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

Integrated the empiric_offset and empiric_drift parameter of the float,...

Integrated the empiric_offset and empiric_drift parameter of the float, Changed copy offsets layout.
parent e15b37c6
No related branches found
No related tags found
No related merge requests found
242 243
\ No newline at end of file \ No newline at end of file
function [] = buttonCopyFromMeasured(~, ~)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Save Applied state
artoa.controller.edit.offsets.saveAppliedState();
%% Copy from optimum total offset columns to Applied columns
% store float in table
artoaWorkspace.editOffsets.offsets{:, 'AppliedOffset'} = artoaWorkspace.editOffsets.offsets{:, 'OffsetStart'};
artoaWorkspace.editOffsets.offsets{:, 'AppliedDrift'} = artoaWorkspace.editOffsets.offsets{:, 'Drift'};
artoaWorkspace.editOffsets.soundspeed.Applied(1) = artoaWorkspace.editOffsets.soundspeed.Measured(1);
%% Update GUI
artoa.controller.edit.offsets.updateGui();
%% Recalculate
artoa.controller.edit.recalculateToaGpsAndPlot();
end
function [] = buttonCopyOffsets(~, ~)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace artoaGui;
%% Save Applied state
artoa.controller.edit.offsets.saveAppliedState();
%% Get selected index
index = artoaGui.editOffsets.comboboxOffsetToApplied.Value;
%% Copy selected offset columns to Applied columns
% get measured as default
offset = artoaWorkspace.editOffsets.offsets{:, 'OffsetStart'};
drift = artoaWorkspace.editOffsets.offsets{:, 'Drift'};
% store float in table
if strcmp(artoaGui.editOffsets.comboboxOffsetToApplied.String{index}, 'Empirical')
offset = artoaWorkspace.editOffsets.offsets{:, 'EmpiricalOffset'};
drift = artoaWorkspace.editOffsets.offsets{:, 'EmpiricalDrift'};
end
if strcmp(artoaGui.editOffsets.comboboxOffsetToApplied.String{index}, 'Optimum')
offset = artoaWorkspace.editOffsets.offsets{:, 'OptimumTotalOffset'};
drift = artoaWorkspace.editOffsets.offsets{:, 'OptimumTotalDrift'};
end
artoaWorkspace.editOffsets.offsets{:, 'AppliedOffset'} = offset;
artoaWorkspace.editOffsets.offsets{:, 'AppliedDrift'} = drift;
%% Soundspeed
if strcmp(artoaGui.editOffsets.comboboxOffsetToApplied.String{index}, 'Measured')
artoaWorkspace.editOffsets.soundspeed.Applied(1) = artoaWorkspace.editOffsets.soundspeed.Measured(1);
end
if strcmp(artoaGui.editOffsets.comboboxOffsetToApplied.String{index}, 'Optimum')
artoaWorkspace.editOffsets.soundspeed.Applied(1) = artoaWorkspace.editOffsets.soundspeed.Optimum(1);
end
%% Update GUI
artoa.controller.edit.offsets.updateGui();
%% Recalculate
artoa.controller.edit.recalculateToaGpsAndPlot();
end
...@@ -57,8 +57,7 @@ callbacks.tableSoundspeedEdit = @artoa.controller.edit.offsets.tableSoundspeedEd ...@@ -57,8 +57,7 @@ callbacks.tableSoundspeedEdit = @artoa.controller.edit.offsets.tableSoundspeedEd
callbacks.buttonCalculateOffsets = @artoa.controller.edit.offsets.buttonCalculateOffsets; callbacks.buttonCalculateOffsets = @artoa.controller.edit.offsets.buttonCalculateOffsets;
callbacks.checkboxUseOffsets = @artoa.controller.edit.offsets.checkboxUseOffsets; callbacks.checkboxUseOffsets = @artoa.controller.edit.offsets.checkboxUseOffsets;
callbacks.inputSoundspeed = @artoa.controller.edit.offsets.inputSoundspeed; callbacks.inputSoundspeed = @artoa.controller.edit.offsets.inputSoundspeed;
callbacks.buttonCopyFromOptimum = @artoa.controller.edit.offsets.buttonCopyFromOptimum; callbacks.buttonCopyOffsets = @artoa.controller.edit.offsets.buttonCopyOffsets;
callbacks.buttonCopyFromMeasured = @artoa.controller.edit.offsets.buttonCopyFromMeasured;
callbacks.buttonUndoLastCopy = @artoa.controller.edit.offsets.buttonUndoLastCopy; callbacks.buttonUndoLastCopy = @artoa.controller.edit.offsets.buttonUndoLastCopy;
callbacks.buttonAppliedToNan = @artoa.controller.edit.offsets.buttonAppliedToNan; callbacks.buttonAppliedToNan = @artoa.controller.edit.offsets.buttonAppliedToNan;
...@@ -69,7 +68,8 @@ artoa.gui.main( ... ...@@ -69,7 +68,8 @@ artoa.gui.main( ...
callbacks, ... callbacks, ...
artoa.controller.main.collectTrackingMethods(), ... artoa.controller.main.collectTrackingMethods(), ...
artoaConfig.defaults.interpolationMethods, ... artoaConfig.defaults.interpolationMethods, ...
artoaConfig.defaults.soundspeedMethods ... artoaConfig.defaults.soundspeedMethods, ...
artoaConfig.defaults.offsetsToCopy ...
); );
......
...@@ -19,6 +19,11 @@ artoaConfig.defaults.soundspeedMethods = { ... ...@@ -19,6 +19,11 @@ artoaConfig.defaults.soundspeedMethods = { ...
'Soundsource file', ... 'Soundsource file', ...
'Manual' ... 'Manual' ...
}; };
artoaConfig.defaults.offsetsToCopy = { ...
'Measured', ...
'Empirical', ...
'Optimum' ...
};
artoaConfig.defaults.pickPointMarkerSize = 80; artoaConfig.defaults.pickPointMarkerSize = 80;
artoaConfig.defaults.topographicalLines = { ... artoaConfig.defaults.topographicalLines = { ...
-1000; ... -1000; ...
......
...@@ -104,11 +104,11 @@ artoaGui.editOffsets.checkboxUseOffsets = uicontrol( ... ...@@ -104,11 +104,11 @@ artoaGui.editOffsets.checkboxUseOffsets = uicontrol( ...
artoaGui.editOffsets.buttonCopyFromMeasured = uicontrol( ... artoaGui.editOffsets.buttonCopyFromMeasured = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ... 'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Copy Measured to Applied', ... 'String', 'to Applied', ...
'Style', 'PushButton', ... 'Style', 'PushButton', ...
'FontSize', 8, ... 'FontSize', 8, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
'Position', [(1.5*left + fullwidth/2) .725 fullwidth/2 .2], ... 'Position', [(1.5*left + 3*fullwidth/4) .725 fullwidth/4 .2], ...
'CallBack', pCallbacks.buttonCopyFromMeasured ... 'CallBack', pCallbacks.buttonCopyFromMeasured ...
); );
......
function [ ] = main(pCallbacks, pTrackingMethods, pInterpolationMethods, pSoundspeedMethods) function [ ] = main(pCallbacks, pTrackingMethods, pInterpolationMethods, pSoundspeedMethods, pOffsetsToCopy)
%MAIN Contains the definition of main ARTOA4 gui. %MAIN Contains the definition of main ARTOA4 gui.
global artoaGui; global artoaGui;
...@@ -46,8 +46,7 @@ availableCallbacks = { ... ...@@ -46,8 +46,7 @@ availableCallbacks = { ...
'tableSoundspeedEdit', ... 'tableSoundspeedEdit', ...
'buttonCalculateOffsets', ... 'buttonCalculateOffsets', ...
'checkboxUseOffsets', ... 'checkboxUseOffsets', ...
'buttonCopyFromOptimum', ... 'buttonCopyOffsets', ...
'buttonCopyFromMeasured', ...
'buttonAppliedToNan', ... 'buttonAppliedToNan', ...
'buttonUndoLastCopy' ... 'buttonUndoLastCopy' ...
}; };
...@@ -596,24 +595,34 @@ artoaGui.editOffsets.checkboxUseOffsets = uicontrol( ... ...@@ -596,24 +595,34 @@ artoaGui.editOffsets.checkboxUseOffsets = uicontrol( ...
'CallBack', pCallbacks.checkboxUseOffsets ... 'CallBack', pCallbacks.checkboxUseOffsets ...
); );
artoaGui.editOffsets.buttonCopyFromMeasured = uicontrol( ... artoaGui.editOffsets.textOffsetToApplied = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ... 'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Copy Measured to Applied', ... 'String', 'Copy', ...
'Style', 'PushButton', ... 'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + 4*fullwidth/8) .725 fullwidth/8 .2], ...
'CallBack', '' ...
);
artoaGui.editOffsets.comboboxOffsetToApplied = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', pOffsetsToCopy, ...
'Style', 'popupmenu', ...
'FontSize', 8, ... 'FontSize', 8, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
'Position', [(1.5*left + fullwidth/2) .725 fullwidth/2 .2], ... 'Position', [(1.5*left + 5*fullwidth/8) .725 2*fullwidth/8 .2], ...
'CallBack', pCallbacks.buttonCopyFromMeasured ... 'CallBack', pCallbacks.comboboxInterpolationMethod ...
); );
artoaGui.editOffsets.buttonCopyFromOptimum = uicontrol( ... artoaGui.editOffsets.buttonCopyOffsets = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ... 'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Copy Optimum to Applied', ... 'String', 'to Applied', ...
'Style', 'PushButton', ... 'Style', 'PushButton', ...
'FontSize', 8, ... 'FontSize', 8, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
'Position', [(1.5*left + fullwidth/2) .5 fullwidth/2 .2], ... 'Position', [(1.5*left + 7*fullwidth/8) .725 fullwidth/8 .2], ...
'CallBack', pCallbacks.buttonCopyFromOptimum ... 'CallBack', pCallbacks.buttonCopyOffsets ...
); );
artoaGui.editOffsets.buttonAppliedToNan = uicontrol( ... artoaGui.editOffsets.buttonAppliedToNan = uicontrol( ...
......
...@@ -21,6 +21,8 @@ endDate = NaN; ...@@ -21,6 +21,8 @@ endDate = NaN;
startOffset = NaN; startOffset = NaN;
endOffset = NaN; endOffset = NaN;
drift = NaN; drift = NaN;
floatEmpiricOffset = artoa.data.getMember(pFloatDetails, {'empiric_offset'}, NaN);
floatEmpiricDrift = artoa.data.getMember(pFloatDetails, {'empiric_drift'}, NaN);
if ~islogical(floatOffsets) if ~islogical(floatOffsets)
sizeOffsets = size(floatOffsets); sizeOffsets = size(floatOffsets);
if sizeOffsets(1) >= 1 && sizeOffsets(2) >= 3 % start date can be calculated if sizeOffsets(1) >= 1 && sizeOffsets(2) >= 3 % start date can be calculated
...@@ -53,7 +55,9 @@ offsetTable{1, variableNames{2}} = startOffset; ...@@ -53,7 +55,9 @@ offsetTable{1, variableNames{2}} = startOffset;
offsetTable{1, variableNames{3}} = endDate; offsetTable{1, variableNames{3}} = endDate;
offsetTable{1, variableNames{4}} = endOffset; offsetTable{1, variableNames{4}} = endOffset;
offsetTable{1, variableNames{5}} = drift; offsetTable{1, variableNames{5}} = drift;
clear startDate startOffset endDate endOffset drift; offsetTable{1, variableNames{6}} = floatEmpiricOffset;
offsetTable{1, variableNames{7}} = floatEmpiricDrift;
clear startDate startOffset endDate endOffset drift floatEmpiricOffset floatEmpiricDrift;
if nargin == 1 if nargin == 1
return; return;
......
%% Add defaults for offsets to copy if required
if ~artoa.data.hasMember(artoaConfig, 'defaults', 'offsetsToCopy')
artoaConfig.defaults.offsetsToCopy = { ...
'Measured', ...
'Empirical', ...
'Optimum' ...
};
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