diff --git a/VERSION b/VERSION index cd004727f2441a8c967a228d81b0bee1895a2597..80945bc4363d59056a852d30423fbd3517241b17 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -182 \ No newline at end of file +183 \ No newline at end of file diff --git a/lib/+artoa/+controller/+main/open.m b/lib/+artoa/+controller/+main/open.m index a68584f059512ffb357a267148d5b8ab13f2547a..3410aa51e97d0d7bc6bef6bd914fba32a3f86afd 100644 --- a/lib/+artoa/+controller/+main/open.m +++ b/lib/+artoa/+controller/+main/open.m @@ -32,7 +32,6 @@ callbacks.openTrackTrajectoryOutput = @artoa.controller.track.trajectoryOutput.o callbacks.switchHideDeletedDataPoints = @artoa.controller.switchHideDeletedPoints; %% Prepare callbacks for track parameter -callbacks.comboboxTrackingMethod = @artoa.controller.track.parameter.comboboxTrackingMethod; callbacks.checkboxDopplerCorrection = @artoa.controller.track.parameter.checkboxDopplerCorrection; callbacks.comboboxInterpolationMethod = @artoa.controller.track.parameter.comboboxInterpolationMethod; callbacks.comboboxSoundspeedMethod = @artoa.controller.track.parameter.comboboxSoundspeedMethod; diff --git a/lib/+artoa/+controller/+track/+parameter/comboboxTrackingMethod.m b/lib/+artoa/+controller/+track/+parameter/comboboxTrackingMethod.m deleted file mode 100644 index bbbd9e6813981316550a44f984e40e7b3d1acda7..0000000000000000000000000000000000000000 --- a/lib/+artoa/+controller/+track/+parameter/comboboxTrackingMethod.m +++ /dev/null @@ -1,16 +0,0 @@ -function [newValue] = comboboxTrackingMethod(~, ~) -%COMBOBOXTRACKINGMETHOD Summary of this function goes here -% Detailed explanation goes here - -global artoaGui artoaWorkspace; - -selectedIndex = artoaGui.trackParameter.comboboxTrackingMethod.Value; - -newValue = artoaGui.trackParameter.comboboxTrackingMethod.String{selectedIndex}; - -artoaWorkspace.trackParameter.trackingMethodValue = selectedIndex; -artoaWorkspace.trackParameter.trackingMethodString = newValue; - - -end - diff --git a/lib/+artoa/+controller/+track/+parameter/createCombinationsTable.m b/lib/+artoa/+controller/+track/+parameter/createCombinationsTable.m index 14f1d8b905c4ec9ecf00b243561a8f27de2fc403..3b86f9a6985d903ed8a06cada310b42fac8feb73 100644 --- a/lib/+artoa/+controller/+track/+parameter/createCombinationsTable.m +++ b/lib/+artoa/+controller/+track/+parameter/createCombinationsTable.m @@ -10,7 +10,8 @@ variableNames = { ... 'referencePosition', ... 'soundspeed1', ... 'soundspeed2', ... - 'soundspeed3' ... + 'soundspeed3', ... + 'trackingMethod' ... }; %% Create struct for workspace diff --git a/lib/+artoa/+controller/+track/+parameter/getDefaultCombinationCell.m b/lib/+artoa/+controller/+track/+parameter/getDefaultCombinationCell.m index 4032dce8e0bc24470caed50f39f2e2e53a79e860..a271b5550d33b77eb873255c55e086d02f85abca 100644 --- a/lib/+artoa/+controller/+track/+parameter/getDefaultCombinationCell.m +++ b/lib/+artoa/+controller/+track/+parameter/getDefaultCombinationCell.m @@ -11,7 +11,8 @@ emptyCell = { ... '', ... 1464, ... 1464, ... - 1464 ... + 1464, ... + '' ... }; end diff --git a/lib/+artoa/+controller/+track/+parameter/validateCombinationsInput.m b/lib/+artoa/+controller/+track/+parameter/validateCombinationsInput.m index 738434be9e3bcdabd8ad97df45bf7cc82caa3802..5d0ddf2b28b4a97fdb5cbda5ae2692f901905a50 100644 --- a/lib/+artoa/+controller/+track/+parameter/validateCombinationsInput.m +++ b/lib/+artoa/+controller/+track/+parameter/validateCombinationsInput.m @@ -28,6 +28,12 @@ if any(isnan(pCombinationsTable.soundspeed1)) ... return; end +if any(isempty(pCombinationsTable.trackingMethod)) ... + || any(strcmp(pCombinationsTable.trackingMethod, '')) + message = 'You must select a tracking method for all combinations!'; + return; +end + success = true; end diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m b/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m index 984a2b5335cfadb71fa3f9fbcd1edfb5ba189fa3..7564388128a0f0a6639ad3c6515522f28427488a 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m @@ -28,7 +28,7 @@ for i = 1:length(trajectories) generatedTracks{i, 1} = ''; end generatedTracks{i, 2} = trajectories{i}.id; - generatedTracks{i, 3} = trajectories{i}.trackParameter.trackingMethodString; + generatedTracks{i, 3} = strjoin(trajectories{i}.trackParameter.soundsourceCombinations.trackingMethod, ', '); end tableHandle.Data = generatedTracks; diff --git a/lib/+artoa/+gui/main.m b/lib/+artoa/+gui/main.m index 248b10a1a9366dd54bc9300ed0361bfc296f4f75..2a3c4d9f3555ba7b4f6ec5780eb6bf17a1000ff8 100644 --- a/lib/+artoa/+gui/main.m +++ b/lib/+artoa/+gui/main.m @@ -23,8 +23,7 @@ availableCallbacks = { ... 'openTrackParameter', ... 'openTrackTrajectoryOutput', ... 'switchHideDeletedDataPoints', ... - 'comboboxTrackingMethod', ... % FIRST ITEM TRACK PARAMETER CALLBACKS - 'checkboxDopplerCorrection', ... + 'checkboxDopplerCorrection', ... % FIRST ITEM TRACK PARAMETER CALLBACKS 'comboboxInterpolationMethod', ... 'comboboxSoundspeedMethod', ... 'checkboxPlotResiduals', ... @@ -268,31 +267,21 @@ buttonHeight = .3; % Tracking method frame -artoaGui.trackParameter.frameTrackingMethod = uipanel( ... +artoaGui.trackParameter.frameCorrections = uipanel( ... 'Parent', artoaGui.trackParameter.frameTrackingParameter, ... - 'Title', 'Tracking Method', ... + 'Title', 'Corrections', ... 'Units', 'normalized', ... 'BackgroundColor', 'white', ... 'Position', [left .75 width .20] ... ); -artoaGui.trackParameter.comboboxTrackingMethod = uicontrol( ... - 'Parent', artoaGui.trackParameter.frameTrackingMethod, ... - 'String', pTrackingMethods, ... - 'Style', 'popupmenu', ... - 'FontSize', 8, ... - 'Units', 'normalized', ... - 'Position', [left .5 .9 .4], ... - 'CallBack', pCallbacks.comboboxTrackingMethod ... -); - artoaGui.trackParameter.checkboxDopplerCorrection = uicontrol( ... - 'Parent', artoaGui.trackParameter.frameTrackingMethod, ... + 'Parent', artoaGui.trackParameter.frameCorrections, ... 'String', 'Apply Doppler Correction', ... 'Style', 'checkbox', ... 'FontSize', 8, ... 'Units', 'normalized', ... - 'Position', [left .1 .9 .3], ... + 'Position', [left .5 .9 .3], ... 'Value', 1, ... 'CallBack', pCallbacks.checkboxDopplerCorrection ... ); @@ -396,8 +385,11 @@ columns = { ... 'End', ... 'Sound Sources', ... 'Reference Position', ... - 'Sound Speed', 'Sound Speed', 'Sound Speed' ... + 'Sound Speed', 'Sound Speed', 'Sound Speed', ... + 'Tracking Method' ... }; +columnFormat = cell(1, length(columns)); +columnFormat{end} = pTrackingMethods; artoaGui.trackParameter.tableSoundSourceCombinations = uitable( ... artoaGui.trackParameter.frameTrackingParameter, ... 'Units', 'normalized', ... @@ -405,10 +397,11 @@ artoaGui.trackParameter.tableSoundSourceCombinations = uitable( ... 'Data', cell(1, length(columns)), ... 'ColumnName', columns, ... 'ColumnEditable', true, ... + 'ColumnFormat', (columnFormat), ... 'CellSelectionCallback', pCallbacks.tableSoundSourceCombinationsSelection,... %@(app,event) disp(num2str(event.Indices)) ... 'CellEditCallback', pCallbacks.tableSoundSourceCombinationsEdit ... ); -clear columns; +clear columns columnFormat; % Track buttons frame diff --git a/lib/+artoa/+trajectory/calculate.m b/lib/+artoa/+trajectory/calculate.m index bc7d9213273b38cb4c784bf9c6af3a3675e30740..7f0ec784f1903f9ce69d3d8e56b8e080d19a54f4 100644 --- a/lib/+artoa/+trajectory/calculate.m +++ b/lib/+artoa/+trajectory/calculate.m @@ -236,8 +236,7 @@ for oCombination = 1:size(soundsourceCombinations, 1) preparedData, ... currentCombination, ...%trajectory(end, :), ... floatReferenceTime, ... - pSoundVelocity(oCombination, :), ... - pTrackingParameter.trackingMethodString ... + pSoundVelocity(oCombination, :) ... ); % remove NaNs from segment diff --git a/lib/+artoa/+trajectory/calculateCombinationSegment.m b/lib/+artoa/+trajectory/calculateCombinationSegment.m index 105bd21c27c366420aa1f25a6aa0f94ee946876a..ec0413bfb56bd8c8762eb5b47c4798c7b13000ca 100644 --- a/lib/+artoa/+trajectory/calculateCombinationSegment.m +++ b/lib/+artoa/+trajectory/calculateCombinationSegment.m @@ -1,4 +1,4 @@ -function [segmentPositions, segmentDates, segmentClockError, segmentResiduals] = calculateCombinationSegment(pCorrectedData, pCombinationDetails, pFloatReferenceTime, pSoundVelocity, pTrackingMethod) +function [segmentPositions, segmentDates, segmentClockError, segmentResiduals] = calculateCombinationSegment(pCorrectedData, pCombinationDetails, pFloatReferenceTime, pSoundVelocity) %CALCULATECOMBINATIONSEGMENT Combination segment calculation. % Using the input data, the function calculates the segment positions, % its corresponding dates as well as the clock error (in case of hyperbolic calculation) @@ -20,14 +20,6 @@ function [segmentPositions, segmentDates, segmentClockError, segmentResiduals] = % used. % For all other methods, only one value needs to be set. % Unit: [m/s] -% pTrackingMethod (string/char): -% Contains the tracking algorithm that should be used. -% Available methods: -% least square -% exclusive least square -% circular -% hyperbolic -% % % Returns: % segmentPositions (double): @@ -50,7 +42,7 @@ segmentVelocities = struct(); soundsourceNames = unique(strsplit(strtrim(pCombinationDetails.soundsources{1}), ' ')); %% Get tracking method -trackingMethod = lower(pTrackingMethod); +trackingMethod = lower(pCombinationDetails.trackingMethod{:}); %% Get start and end point segmentStart = pCombinationDetails{1, 1}; @@ -151,7 +143,7 @@ end switch trackingMethod case {'least square', 'exclusive least square'} for oDates = 1:length(intersectedToaDates) - if strcmp(pTrackingMethod, 'exclusive least square') ... + if strcmp(trackingMethod, 'exclusive least square') ... && (sum(~isnan(distanceToSoundsources{oDates})) ~= length(soundsourcePositions)) segmentPositions = [segmentPositions; [NaN, NaN]]; segmentClockError = [segmentClockError; NaN(1, 3)]; @@ -194,7 +186,7 @@ switch trackingMethod otherwise % prepare soundsource infos [segmentPositions, segmentClockError] = artoa.plugins.tracking.callTrackingMethod( ... - pTrackingMethod, ... + trackingMethod, ... pluginTables, ... pluginSoundsourcePositions, ... pCombinationDetails ... diff --git a/lib/+artoa/+versioning/+migrations/versions/v4183.m b/lib/+artoa/+versioning/+migrations/versions/v4183.m new file mode 100644 index 0000000000000000000000000000000000000000..8d2c4e8731566644fcf626d4256202bc1bea35ff --- /dev/null +++ b/lib/+artoa/+versioning/+migrations/versions/v4183.m @@ -0,0 +1,10 @@ +if ~artoa.data.hasMember(artoaWorkspace, 'trackParameter', 'soundsourceCombinations', 'trackingMethod') + artoaWorkspace.trackParameter.soundsourceCombinations.trackingMethod(:) = {''}; +end + +if artoa.data.hasMember(artoaWorkspace, 'trackParameter', 'trackingMethodString') + rmfield(artoaWorkspace.trackParameter, 'trackingMethodString'); +end +if artoa.data.hasMember(artoaWorkspace, 'trackParameter', 'trackingMethodValue') + rmfield(artoaWorkspace.trackParameter, 'trackingMethodValue'); +end \ No newline at end of file