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

Added empirical to NaN button.

parent fcaeeeb1
No related branches found
No related tags found
No related merge requests found
158
\ No newline at end of file
159
\ No newline at end of file
function [] = buttonEmpiricalToNan(~, ~)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Save empirical state
artoa.controller.edit.offsets.saveEmpiricalState();
%% Reset all empirical offsets and drift
artoaWorkspace.editOffsets.offsets{:, 'EmpiricalOffset'} = NaN;
artoaWorkspace.editOffsets.offsets{:, 'EmpiricalDrift'} = NaN;
artoaWorkspace.editOffsets.soundspeed.Empirical(1) = NaN;
%% Update GUI
artoa.controller.edit.offsets.updateGui();
end
......@@ -4,6 +4,8 @@ function [] = buttonUndoLastCopy(~, ~)
global artoaWorkspace;
%% Restore offset table values
lastValues = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'undoCopyValues'}, false);
if islogical(lastValues)
......@@ -13,6 +15,15 @@ end
artoaWorkspace.editOffsets.offsets.EmpiricalOffset = lastValues.EmpiricalOffset;
artoaWorkspace.editOffsets.offsets.EmpiricalDrift = lastValues.EmpiricalDrift;
%% Restore soundspeed
lastSoundspeed = artoa.data.getMember(artoaWorkspace, {'editOffsets', 'undoCopySoundspeed'}, false);
if islogical(lastSoundspeed)
return;
end
artoaWorkspace.editOffsets.soundspeed.Empirical(1) = lastSoundspeed(1);
artoa.controller.edit.offsets.updateGui();
end
......
......@@ -22,6 +22,8 @@ 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;
callbacks.buttonEmpiricalToNan = @artoa.controller.edit.offsets.buttonEmpiricalToNan;
%% Open the gui
......
......@@ -7,5 +7,8 @@ global artoaWorkspace;
artoaWorkspace.editOffsets.undoCopyValues = ...
artoaWorkspace.editOffsets.offsets(:, {'EmpiricalOffset', 'EmpiricalDrift'});
artoaWorkspace.editOffsets.undoCopySoundspeed = ...
artoaWorkspace.editOffsets.soundspeed.Empirical(1);
end
......@@ -18,6 +18,7 @@ availableCallbacks = { ...
'checkboxUseOffsets', ...
'buttonCopyFromOptimum', ...
'buttonCopyFromMeasured', ...
'buttonEmpiricalToNan', ...
'buttonUndoLastCopy' ...
};
......@@ -107,7 +108,7 @@ artoaGui.editOffsets.buttonCopyFromMeasured = uicontrol( ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + fullwidth/2) .75 fullwidth/2 .2], ...
'Position', [(1.5*left + fullwidth/2) .725 fullwidth/2 .2], ...
'CallBack', pCallbacks.buttonCopyFromMeasured ...
);
......@@ -121,6 +122,15 @@ artoaGui.editOffsets.buttonCopyFromOptimum = uicontrol( ...
'CallBack', pCallbacks.buttonCopyFromOptimum ...
);
artoaGui.editOffsets.buttonEmpiricalToNan = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Empirical to NaN', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + fullwidth/2) .275 fullwidth/2 .2], ...
'CallBack', pCallbacks.buttonEmpiricalToNan ...
);
artoaGui.editOffsets.buttonUndoLastCopy = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
......@@ -128,7 +138,7 @@ artoaGui.editOffsets.buttonUndoLastCopy = uicontrol( ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + fullwidth/2) .25 fullwidth/2 .2], ...
'Position', [(1.5*left + fullwidth/2) .05 fullwidth/2 .2], ...
'CallBack', pCallbacks.buttonUndoLastCopy ...
);
......
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