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

Added shifting TOA feature.

It is now possible to select TOAs and shift them by a given value.
parent 0d4aa493
No related branches found
No related tags found
No related merge requests found
function [] = shiftToaSelection()
%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'});
if isempty(answer)
return
end
answer = str2num(answer{1});
if isnan(answer)
return;
end
artoaWorkspace.toaData.toa = artoa.data.shiftToa(artoaWorkspace.toaData.toa, answer);
[artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ...
artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival);
artoa.controller.edit.updateAvailablePlots();
end
function [shiftedToa] = shiftToa(pToa, pShiftValue)
%SHIFTTOA Shifts the toa by the given value.
%
shiftedToa = pToa + pShiftValue;
end
......@@ -55,6 +55,16 @@ artoaGui.editTimeOfArrival.buttonPick = uicontrol( ...
'CallBack', 'artoa.controller.edit.timeOfArrival.pickPolygon();' ...
);
artoaGui.editTimeOfArrival.buttonShift = uicontrol( ...
'Parent', artoaGui.editTimeOfArrival.frameControls, ...
'String', 'Shift', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.156 .5 .69 .2], ...
'CallBack', 'artoa.controller.edit.timeOfArrival.shiftToaSelection();' ...
);
artoaGui.editTimeOfArrival.buttonReplot = uicontrol( ...
'Parent', artoaGui.editTimeOfArrival.frameControls, ...
'String', 'Replot', ...
......
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