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

The shift TOA feature now requires a user selection.

parent f1d4c785
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ function [] = resetShiftToa()
global artoaGui artoaWorkspace artoaDataInput;
%% Ask for reset
if strcmp(questdlg('Reset shift?', 'Confirmation', 'Yes', 'Cancel', 'Cancel'), 'Cancel')
if strcmp(questdlg('Reset all shifted values?', 'Confirmation', 'Yes', 'Cancel', 'Cancel'), 'Cancel')
return;
end
......
function [] = resetShiftToaSelection()
%SHIFTTOA Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace artoaDataInput;
%% Select polygon
if ~artoa.controller.edit.dataPointsSelected(artoaWorkspace.editTimeOfArrival)
warndlg('You need to select data by using the "Pick" button first!', 'No data selected');
return;
end
%% Ask for reset
if strcmp(questdlg('Remove shift from selection?', 'Confirmation', 'Yes', 'Cancel', 'Cancel'), 'Cancel')
return;
end
artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) = artoaDataInput.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection);
[artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ...
artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival);
artoa.controller.edit.updateAvailablePlots();
end
......@@ -2,8 +2,16 @@ function [] = shiftToa()
%SHIFTTOA Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
%% Select polygon
if ~artoa.controller.edit.dataPointsSelected(artoaWorkspace.editTimeOfArrival)
warndlg('You need to select data by using the "Pick" button first!', 'No data selected');
return;
end
%% Ask for shift value
answer = inputdlg({'Enter shift value:'}, 'Shift TOAs', [1 35], {'0'});
......@@ -11,19 +19,19 @@ if isempty(answer)
return
end
answer = str2num(answer{1});
answer = str2double(answer{1});
if isnan(answer)
return;
end
artoaWorkspace.toaData.toa = artoa.data.shiftToa(artoaWorkspace.toaData.toa, answer);
artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) = ...
artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) + answer;
[artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ...
artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival);
artoa.controller.edit.updateAvailablePlots();
end
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