Skip to content
Snippets Groups Projects
Commit a5cf57cd authored by leprob001's avatar leprob001
Browse files

The reference start position is only added when it is the first row of the combination table.

parent a5bedc26
No related branches found
No related tags found
No related merge requests found
285
\ No newline at end of file
286
\ No newline at end of file
......@@ -9,7 +9,11 @@ global artoaWorkspace;
artoaWorkspace.trajectoryOutput.updateTrackParameterWindow = false;
%% Insert default content
artoaWorkspace.trackParameter.soundsourceCombinations(end + 1, :) = artoa.controller.track.parameter.getDefaultCombinationCell();
if size(artoaWorkspace.trackParameter.soundsourceCombinations, 1) == 1
artoaWorkspace.trackParameter.soundsourceCombinations(end + 1, :) = artoa.controller.track.parameter.getDefaultCombinationCell();
else
artoaWorkspace.trackParameter.soundsourceCombinations(end + 1, :) = artoa.controller.track.parameter.getDefaultCombinationCell(false);
end
try
artoaWorkspace.trackParameter.soundsourceCombinations{end, 'combinationBegin'} = artoaWorkspace.trackParameter.soundsourceCombinations{end - 1, 'combinationEnd'} + 1;
catch
......
......@@ -15,7 +15,11 @@ combinations = artoaWorkspace.trackParameter.soundsourceCombinations;
%% Add above the selected
combinations(selectedRow + 1:end + 1, :) = combinations(selectedRow:end, :);
combinations(selectedRow, :) = artoa.controller.track.parameter.getDefaultCombinationCell();
if selectedRow - 1 == 0
combinations(selectedRow, :) = artoa.controller.track.parameter.getDefaultCombinationCell();
else
combinations(selectedRow, :) = artoa.controller.track.parameter.getDefaultCombinationCell(false);
end
if selectedRow == 1
artoaWorkspace.trackParameter.soundsourceCombinations = combinations;
......
function [emptyCell] = getDefaultCombinationCell()
function [emptyCell] = getDefaultCombinationCell(pAddReferencePosition)
%GETDEFAULTCOMBINATIONVALUES Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
if ~exist('pAddReferencePosition', 'var')
pAddReferencePosition = true;
end
%% Initialize variables
startDate = floor(min(artoaWorkspace.toaData.toaDate(artoaWorkspace.toaData.status ~= 2)));
endDate = floor(max(artoaWorkspace.toaData.toaDate(artoaWorkspace.toaData.status ~= 2)));
......@@ -11,7 +15,11 @@ endDate = floor(max(artoaWorkspace.toaData.toaDate(artoaWorkspace.toaData.status
%% Get last known position
isNotNan = ~isnan(artoaWorkspace.satData.lat_sat) & ~isnan(artoaWorkspace.satData.lon_sat);
knownPositions = [artoaWorkspace.satData.lat_sat(isNotNan), artoaWorkspace.satData.lon_sat(isNotNan)];
referencePosition = [num2str(knownPositions(1, 1)) ' ' num2str(knownPositions(1, 2))];
if pAddReferencePosition
referencePosition = [num2str(knownPositions(1, 1)) ' ' num2str(knownPositions(1, 2))];
else
referencePosition = '';
end
%% Create default cell
emptyCell = { ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment