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

The empirical shift that is available from edit TOA window is now in a separate variable.

parent b38fbf61
No related branches found
No related tags found
No related merge requests found
...@@ -2,19 +2,21 @@ function [] = resetShiftToa() ...@@ -2,19 +2,21 @@ function [] = resetShiftToa()
%SHIFTTOA Summary of this function goes here %SHIFTTOA Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
global artoaGui artoaWorkspace artoaDataInput; global artoaGui artoaWorkspace;
%% Ask for reset %% Ask for reset
if strcmp(questdlg('Reset all shifted values?', 'Confirmation', 'Yes', 'Cancel', 'Cancel'), 'Cancel') if strcmp(questdlg('Reset all shifted values?', 'Confirmation', 'Yes', 'Cancel', 'Cancel'), 'Cancel')
return; return;
end end
%% Subtract empirical shift
artoaWorkspace.toaData.toa = artoaDataInput.toaData.toa; artoaWorkspace.toaData.toa = artoaWorkspace.toaData.toa - artoaWorkspace.toaData.empiricalShift;
%% Reset empirical shift array
artoaWorkspace.toaData.empiricalShift(:) = 0;
%% Clear selection
[artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ... [artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ...
artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival); artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival);
%% Update plots
artoa.controller.edit.updateAvailablePlots(); artoa.controller.edit.updateAvailablePlots();
......
...@@ -2,7 +2,7 @@ function [] = resetShiftToaSelection() ...@@ -2,7 +2,7 @@ function [] = resetShiftToaSelection()
%SHIFTTOA Summary of this function goes here %SHIFTTOA Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
global artoaGui artoaWorkspace artoaDataInput; global artoaGui artoaWorkspace;
%% Select polygon %% Select polygon
...@@ -17,12 +17,16 @@ if strcmp(questdlg('Remove shift from selection?', 'Confirmation', 'Yes', 'Cance ...@@ -17,12 +17,16 @@ if strcmp(questdlg('Remove shift from selection?', 'Confirmation', 'Yes', 'Cance
return; return;
end end
%% Subtract empirical shift
artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) = artoaDataInput.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection); artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) = ...
artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) ...
- artoaWorkspace.toaData.empiricalShift(artoaWorkspace.editTimeOfArrival.userSelection);
%% Reset empirical shift
artoaWorkspace.toaData.empiricalShift(artoaWorkspace.editTimeOfArrival.userSelection) = 0;
%% Clear selection
[artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ... [artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival] = ...
artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival); artoa.controller.edit.clearSelection(artoaGui.editTimeOfArrival, artoaWorkspace.editTimeOfArrival);
%% Update plots
artoa.controller.edit.updateAvailablePlots(); artoa.controller.edit.updateAvailablePlots();
......
...@@ -25,6 +25,12 @@ if isnan(answer) ...@@ -25,6 +25,12 @@ if isnan(answer)
return; return;
end end
% track empirical shift to be able to reset it
artoaWorkspace.toaData.empiricalShift(artoaWorkspace.editTimeOfArrival.userSelection) = ...
artoaWorkspace.toaData.empiricalShift(artoaWorkspace.editTimeOfArrival.userSelection) ...
+ answer;
% add shift to toa
artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) = ... artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) = ...
artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) + answer; artoaWorkspace.toaData.toa(artoaWorkspace.editTimeOfArrival.userSelection) + answer;
......
...@@ -57,6 +57,8 @@ artoaWorkspace.toaData.soundSource = cell( ... ...@@ -57,6 +57,8 @@ artoaWorkspace.toaData.soundSource = cell( ...
1 ... 1 ...
); );
artoaWorkspace.toaData.empiricalShift = zeros(size(artoaWorkspace.toaData.toa));
% Copy the original toaData object to the input, so that it easily can be % Copy the original toaData object to the input, so that it easily can be
% restored later on % restored later on
artoaDataInput.toaData = artoaWorkspace.toaData; artoaDataInput.toaData = artoaWorkspace.toaData;
......
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