diff --git a/lib/+artoa/+controller/+edit/+timeOfArrival/applySoundSourceToSelectedPoints.m b/lib/+artoa/+controller/+edit/+timeOfArrival/applySoundSourceToSelectedPoints.m index 1d1bbc960a25300962fee4c322a711afe7b21170..f3d9d71858f1276faede75c6be1bdbee7126c317 100644 --- a/lib/+artoa/+controller/+edit/+timeOfArrival/applySoundSourceToSelectedPoints.m +++ b/lib/+artoa/+controller/+edit/+timeOfArrival/applySoundSourceToSelectedPoints.m @@ -38,7 +38,7 @@ artoaWorkspace.toaData.soundSource( ... ) = soundsources(index); -% Update status to selected +%% Update status to selected artoa.controller.edit.timeOfArrival.applyStatusToSelectedPoints(1); %% Update duplicate toa table diff --git a/lib/+artoa/+controller/+track/+parameter/open.m b/lib/+artoa/+controller/+track/+parameter/open.m index d5a2e2630665bf448ce66ec39056fc1a8e6cf243..aab05a93a2620a82ca161b0b46d10ef470aeb2f0 100644 --- a/lib/+artoa/+controller/+track/+parameter/open.m +++ b/lib/+artoa/+controller/+track/+parameter/open.m @@ -42,25 +42,13 @@ artoa.gui.track.parameter( ... artoaWorkspace.defaults.soundspeedMethods ... ); -%% Get involved -soundsourceNames = fieldnames(artoaWorkspace.filteredSoundsources); -appliedSoundsources = {}; -involvedSoundsources = struct(); -for i = 1:length(soundsourceNames) - if artoa.soundsources.hasAppliedToa(soundsourceNames{i}, artoaWorkspace.toaData.soundSource) - extracted = artoa.data.extractSoundsourcesFromStruct( ... - soundsourceNames{i}, ... - artoaWorkspace.filteredSoundsources ... - ); - involvedSoundsources.(soundsourceNames{i}) = extracted; - clear extracted; - end -end +%% Get sources with applied toa +soundsourcesWithAppliedToa = artoa.controller.getSoundsourcesWithAppliedToa(); %% Setup sound source offsets table % initialize sound source offsets artoaGui.trackParameter.tableSoundSourceOffsets.RowName = fieldnames( ... - involvedSoundsources ... + soundsourcesWithAppliedToa ... ); diff --git a/lib/+artoa/+controller/+track/+parameter/updateGui.m b/lib/+artoa/+controller/+track/+parameter/updateGui.m index 501be77e806f7d8fe92706f5858f913f3b9c4849..cf03a6b6c10c5ba661710431ccc6b16f1fc03681 100644 --- a/lib/+artoa/+controller/+track/+parameter/updateGui.m +++ b/lib/+artoa/+controller/+track/+parameter/updateGui.m @@ -38,9 +38,9 @@ for i = 1:length(fieldNames) case 'soundsourceOffsets' artoaGui.trackParameter.tableSoundSourceOffsets.Data = ... artoa.soundsources.createOffsetsCell( ... - currentValue, ... - artoaGui.trackParameter.tableSoundSourceOffsets.RowName ... - ); + currentValue, ... + artoaGui.trackParameter.tableSoundSourceOffsets.RowName ... + ); case 'soundsourceCombinations' artoaGui.trackParameter.tableSoundSourceCombinations.Data = artoa.soundsources.createCombinationsCell(currentValue); case 'floatOffsetBegin' diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m b/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m index ab7404cdde32c0f5094c6ba022e761175652e776..94a4b9ef6abbfe8cd472827391894b675f5bc7f7 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m @@ -119,6 +119,9 @@ for i = 1:length(trajectories) ~trajectories{i}.hidden ... ); if ~trajectories{i}.hidden + if ~artoa.data.hasMember(artoaWorkspace, {'trajectoryOutput', 'showPositionDates'}) + artoaWorkspace.trajectoryOutput.showPositionDates = true; + end artoa.controller.setPlotHandleVisibility( ... { ... artoaGui.trajectoryOutput.trajectoryHandles{i}.textPositions ... diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/tableGeneratedTracksSelect.m b/lib/+artoa/+controller/+track/+trajectoryOutput/tableGeneratedTracksSelect.m index 6e0717ca4fb4ccf9c538949cde79a1bc6ea47e81..92d4ed836f286c8d82200d31ca863e921013cb5a 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/tableGeneratedTracksSelect.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/tableGeneratedTracksSelect.m @@ -80,6 +80,9 @@ artoa.controller.track.trajectoryOutput.showLeftSidebarPlots(); ); %% Replace track parameter +if ~artoa.data.hasMember(artoaWorkspace, {'trajectoryOutput', 'updateTrackParameterWindow'}) + artoaWorkspace.trajectoryOutput.updateTrackParameterWindow = false; +end if artoaWorkspace.trajectoryOutput.updateTrackParameterWindow artoaWorkspace.trackParameter = ... artoaWorkspace.trajectoryOutput.trajectories{selectedRow}.trackParameter; diff --git a/lib/+artoa/+controller/+track/getInvolvedSoundsources.m b/lib/+artoa/+controller/+track/getInvolvedSoundsources.m index 60eabc0f0f7ba8703b7ea065e40d0a132484c23d..316a53942aa178b59f62784048ebae030f21aa4d 100644 --- a/lib/+artoa/+controller/+track/getInvolvedSoundsources.m +++ b/lib/+artoa/+controller/+track/getInvolvedSoundsources.m @@ -4,18 +4,16 @@ function [involvedSoundsources, involvedSoundsourceNames] = getInvolvedSoundsour global artoaWorkspace; -involvedSoundsourceNames = fieldnames(artoaWorkspace.filteredSoundsources); -involvedSoundsources = struct(); -for i = 1:length(involvedSoundsourceNames) - if artoa.soundsources.hasAppliedToa(involvedSoundsourceNames{i}, artoaWorkspace.toaData.soundSource) - extracted = artoa.data.extractSoundsourcesFromStruct( ... - involvedSoundsourceNames{i}, ... - artoaWorkspace.filteredSoundsources ... - ); - involvedSoundsources.(involvedSoundsourceNames{i}) = extracted; - clear extracted; - end -end +involvedSoundsourceNames = ... + unique(flatten( ... + cellfun( ... + @strsplit, strtrim(artoaWorkspace.trackParameter.soundsourceCombinations.soundsources), 'UniformOutput', false ... + ) ... + )); +involvedSoundsources = artoa.data.extractSoundsourcesFromStruct( ... + involvedSoundsourceNames, ... + artoaWorkspace.filteredSoundsources ... +); end diff --git a/lib/+artoa/+controller/getSoundsourcesWithAppliedToa.m b/lib/+artoa/+controller/getSoundsourcesWithAppliedToa.m new file mode 100644 index 0000000000000000000000000000000000000000..c7811e2ae98542e87af6a054ee90b45ea591245f --- /dev/null +++ b/lib/+artoa/+controller/getSoundsourcesWithAppliedToa.m @@ -0,0 +1,21 @@ +function [involvedSoundsources] = getSoundsourcesWithAppliedToa() +%GETINVOLVEDSOUNDSOURCES Summary of this function goes here +% Detailed explanation goes here + +global artoaWorkspace; + +involvedSoundsourceNames = fieldnames(artoaWorkspace.filteredSoundsources); +involvedSoundsources = struct(); +for i = 1:length(involvedSoundsourceNames) + if artoa.soundsources.hasAppliedToa(involvedSoundsourceNames{i}, artoaWorkspace.toaData.soundSource) + extracted = artoa.data.extractSoundsourcesFromStruct( ... + involvedSoundsourceNames{i}, ... + artoaWorkspace.filteredSoundsources ... + ); + involvedSoundsources.(involvedSoundsourceNames{i}) = extracted; + clear extracted; + end +end + +end + diff --git a/lib/+artoa/+gui/+track/trajectoryOutput.m b/lib/+artoa/+gui/+track/trajectoryOutput.m index d03a72b42ea7d7aee07828b0cbed66660e50e45c..e41ec19372d7e88179e8caaefbcaa5497a776628 100644 --- a/lib/+artoa/+gui/+track/trajectoryOutput.m +++ b/lib/+artoa/+gui/+track/trajectoryOutput.m @@ -50,6 +50,9 @@ leftSidebarWidth = .2; leftSidebarLeft = .015; %% Setup axes +if ~artoa.data.hasMember(artoaWorkspace, {'trajectoryOutput', 'enableMercatorProjection'}) + artoaWorkspace.trajectoryOutput.enableMercatorProjection = false; +end artoa.controller.track.trajectoryOutput.setupTrajectoryAxes( ... artoaWorkspace.trajectoryOutput.enableMercatorProjection ... ); diff --git a/lib/+artoa/+trajectory/plotTimeDivergenceToGps.m b/lib/+artoa/+trajectory/plotTimeDivergenceToGps.m index 9813f6cc759a723f66f46daa9e4accaccde8927c..16ed8ef36389cae4b7b2ba76812d16743f3843ff 100644 --- a/lib/+artoa/+trajectory/plotTimeDivergenceToGps.m +++ b/lib/+artoa/+trajectory/plotTimeDivergenceToGps.m @@ -16,6 +16,9 @@ cla(pAxesHandle); hold(pAxesHandle, 'on'); for i = 1:length(fnames) current = pTrajectory.timeDivergenceToGps.(fnames{i}); + if isempty(current) + continue; + end x = current(:, 1); y = current(:, 2); handleTimeDivergenceToGps.(fnames{i}) = plot(pAxesHandle, x, y, '.-');