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

Added button to restore empirical values to the state before copying.

parent ff5a1012
No related branches found
No related tags found
No related merge requests found
117
\ No newline at end of file
118
\ No newline at end of file
......@@ -4,6 +4,9 @@ function [] = buttonCopyFromMeasured(~, ~)
global artoaWorkspace;
%% Save empirical state
artoa.controller.edit.offsets.saveEmpiricalState();
%% Copy from optimum total offset columns to empirical columns
% store float in table
artoaWorkspace.editOffsets.offsets{:, 'EmpiricalOffset'} = artoaWorkspace.editOffsets.offsets{:, 'OffsetStart'};
......
......@@ -4,6 +4,9 @@ function [] = buttonCopyFromOptimum(~, ~)
global artoaWorkspace;
%% Save empirical state
artoa.controller.edit.offsets.saveEmpiricalState();
%% Copy from optimum total offset columns to empirical columns
offsetIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, 'EmpiricalOffset'});
......
function [] = buttonUndoLastCopy(~, ~)
%BUTTONUNDOLASTCOPY Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
lastValues = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'undoCopyValues'}, false);
if islogical(lastValues)
return;
end
artoaWorkspace.editOffsets.offsets.EmpiricalOffset = lastValues.EmpiricalOffset;
artoaWorkspace.editOffsets.offsets.EmpiricalDrift = lastValues.EmpiricalDrift;
artoa.controller.edit.offsets.updateGui();
end
......@@ -21,6 +21,7 @@ callbacks.checkboxFixedSoundspeed = @artoa.controller.edit.offsets.checkboxFixed
callbacks.inputSoundspeed = @artoa.controller.edit.offsets.inputSoundspeed;
callbacks.buttonCopyFromOptimum = @artoa.controller.edit.offsets.buttonCopyFromOptimum;
callbacks.buttonCopyFromMeasured = @artoa.controller.edit.offsets.buttonCopyFromMeasured;
callbacks.buttonUndoLastCopy = @artoa.controller.edit.offsets.buttonUndoLastCopy;
%% Open the gui
......
function [] = saveEmpiricalState()
%SAVEEMPIRICALSTATE Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
artoaWorkspace.editOffsets.undoCopyValues = ...
artoaWorkspace.editOffsets.offsets(:, {'EmpiricalOffset', 'EmpiricalDrift'});
end
......@@ -18,7 +18,8 @@ availableCallbacks = { ...
'checkboxFixedSoundspeed', ...
'inputSoundspeed', ...
'buttonCopyFromOptimum', ...
'buttonCopyFromMeasured' ...
'buttonCopyFromMeasured', ...
'buttonUndoLastCopy' ...
};
for i = 1:length(availableCallbacks) % check if a callback is undefined
......@@ -108,10 +109,21 @@ artoaGui.editOffsets.buttonCopyFromOptimum = uicontrol( ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .25 fullwidth/2 .2], ...
'Position', [left .275 fullwidth/2 .2], ...
'CallBack', pCallbacks.buttonCopyFromOptimum ...
);
artoaGui.editOffsets.buttonUndoLastCopy = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Undo last copy', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .05 fullwidth/2 .2], ...
'CallBack', pCallbacks.buttonUndoLastCopy ...
);
%% Soundspeed frame
artoaGui.editOffsets.frameSoundspeed = uipanel( ...
'Parent', artoaGui.figures.editOffsets, ...
......
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