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

The two comboboxes for copying are now set to float and soundsources.

parent bd5436f4
No related branches found
No related tags found
No related merge requests found
292
\ No newline at end of file
293
\ No newline at end of file
function [] = buttonCopyFloatOffsets(~, ~)
%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.comboboxFloatOffsetToApplied.Value;
%% Copy selected offset columns to Applied columns
appliedOffsetColumn = 'AppliedOffset';
appliedDriftColumn = 'AppliedDrift';
appliedSoundspeedColumn = 'AppliedSoundspeed';
switch artoaGui.editOffsets.comboboxFloatOffsetToApplied.String{index}
case 'Measured'
offsetColumn = 'OffsetStart';
driftColumn = 'Drift';
soundspeedColumn = 'MeasuredSoundspeed';
case 'Empirical'
offsetColumn = 'EmpiricalOffset';
driftColumn = 'EmpiricalDrift';
soundspeedColumn = 'EmpiricalSoundspeed';
case 'Optimum'
offsetColumn = 'OptimumTotalOffset';
driftColumn = 'OptimumTotalDrift';
soundspeedColumn = 'OptimumSoundspeed';
end
artoaWorkspace.editOffsets.offsets{1, appliedOffsetColumn} = ...
artoaWorkspace.editOffsets.offsets{1, offsetColumn};
artoaWorkspace.editOffsets.offsets{1, appliedDriftColumn} = ...
artoaWorkspace.editOffsets.offsets{1, driftColumn};
artoaWorkspace.editOffsets.offsets{1, appliedSoundspeedColumn} = ...
artoaWorkspace.editOffsets.offsets{1, soundspeedColumn};
%% Update GUI
artoa.controller.edit.offsets.updateGui();
%% Recalculate
artoa.controller.edit.recalculateToaGpsAndPlot();
end
......@@ -8,34 +8,47 @@ global artoaWorkspace artoaGui;
artoa.controller.edit.offsets.saveAppliedState();
%% Get selected index
index = artoaGui.editOffsets.comboboxOffsetToApplied.Value;
index = artoaGui.editOffsets.comboboxSoundsourcesToApplied.Value;
%% Copy selected offset columns to Applied columns
appliedOffsetColumn = 'AppliedOffset';
appliedDriftColumn = 'AppliedDrift';
appliedSoundspeedColumn = 'AppliedSoundspeed';
switch artoaGui.editOffsets.comboboxOffsetToApplied.String{index}
switch artoaGui.editOffsets.comboboxSoundsourcesToApplied.String{index}
case 'Measured'
offsetIndicesToCopy = true(size(artoaWorkspace.editOffsets.offsets{:, appliedOffsetColumn}));
driftIndicesToCopy = true(size(artoaWorkspace.editOffsets.offsets{:, appliedDriftColumn}));
soundspeedIndicesToCopy = true(size(artoaWorkspace.editOffsets.offsets{:, appliedSoundspeedColumn}));
offsetColumn = 'OffsetStart';
driftColumn = 'Drift';
soundspeedColumn = 'MeasuredSoundspeed';
case 'Empirical'
offsetIndicesToCopy = true(size(artoaWorkspace.editOffsets.offsets{:, appliedOffsetColumn}));
driftIndicesToCopy = true(size(artoaWorkspace.editOffsets.offsets{:, appliedDriftColumn}));
soundspeedIndicesToCopy = true(size(artoaWorkspace.editOffsets.offsets{:, appliedSoundspeedColumn}));
offsetColumn = 'EmpiricalOffset';
driftColumn = 'EmpiricalDrift';
soundspeedColumn = 'EmpiricalSoundspeed';
case 'Optimum'
offsetIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, appliedOffsetColumn});
driftIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, appliedDriftColumn});
soundspeedIndicesToCopy = isnan(artoaWorkspace.editOffsets.offsets{:, appliedSoundspeedColumn});
offsetColumn = 'OptimumTotalOffset';
driftColumn = 'OptimumTotalDrift';
soundspeedColumn = 'OptimumSoundspeed';
end
offsetIndicesToCopy(1) = false;
driftIndicesToCopy(1) = false;
soundspeedIndicesToCopy(1) = false;
artoaWorkspace.editOffsets.offsets{offsetIndicesToCopy, appliedOffsetColumn} = ...
artoaWorkspace.editOffsets.offsets{offsetIndicesToCopy, offsetColumn};
artoaWorkspace.editOffsets.offsets{driftIndicesToCopy, appliedDriftColumn} = ...
artoaWorkspace.editOffsets.offsets{driftIndicesToCopy, driftColumn};
artoaWorkspace.editOffsets.offsets{soundspeedIndicesToCopy, appliedSoundspeedColumn} = ...
artoaWorkspace.editOffsets.offsets{soundspeedIndicesToCopy, soundspeedColumn};
%% Update GUI
artoa.controller.edit.offsets.updateGui();
......
function [] = buttonCopySoundspeed(~, ~)
%BUTTONCOPYSOUNDSPEED Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
%% Get selected index
index = artoaGui.editOffsets.comboboxSoundvelocityToApplied.Value;
%% Soundspeed
artoaWorkspace.editOffsets.offsets{:, 'AppliedSoundspeed'} = ...
artoaWorkspace.editOffsets.offsets{ ...
:, ...
[artoaGui.editOffsets.comboboxSoundvelocityToApplied.String{index} 'Soundspeed'] ...
};
%% Update GUI
artoa.controller.edit.offsets.updateGui();
%% Recalculate
artoa.controller.edit.recalculateToaGpsAndPlot();
end
......@@ -59,8 +59,8 @@ callbacks.tableSoundspeedEdit = @artoa.controller.edit.offsets.tableSoundspeedEd
callbacks.buttonCalculateOffsets = @artoa.controller.edit.offsets.buttonCalculateOffsets;
callbacks.checkboxUseOffsets = @artoa.controller.edit.offsets.checkboxUseOffsets;
callbacks.inputSoundspeed = @artoa.controller.edit.offsets.inputSoundspeed;
callbacks.buttonCopyOffsets = @artoa.controller.edit.offsets.buttonCopyOffsets;
callbacks.buttonCopySoundvelocity = @artoa.controller.edit.offsets.buttonCopySoundspeed;
callbacks.buttonCopyFloatOffsets = @artoa.controller.edit.offsets.buttonCopyFloatOffsets;
callbacks.buttonCopySoundsourcesOffsets = @artoa.controller.edit.offsets.buttonCopyOffsets;
callbacks.buttonUndoLastCopy = @artoa.controller.edit.offsets.buttonUndoLastCopy;
callbacks.buttonAppliedToNan = @artoa.controller.edit.offsets.buttonAppliedToNan;
......
......@@ -47,8 +47,8 @@ availableCallbacks = { ...
'tableSoundsourceOffsetsEdit', ...
'buttonCalculateOffsets', ...
'checkboxUseOffsets', ...
'buttonCopyOffsets', ...
'buttonCopySoundvelocity', ...
'buttonCopyFloatOffsets', ...
'buttonCopySoundsourcesOffsets', ...
'buttonAppliedToNan', ...
'buttonUndoLastCopy' ...
};
......@@ -613,16 +613,16 @@ artoaGui.editOffsets.checkboxUseOffsets = uicontrol( ...
'CallBack', pCallbacks.checkboxUseOffsets ...
);
artoaGui.editOffsets.textOffsetToApplied = uicontrol( ...
artoaGui.editOffsets.textFloatOffsetToApplied = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Copy', ...
'String', 'Float', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + 4*fullwidth/8) .725 fullwidth/8 .2] ...
);
artoaGui.editOffsets.comboboxOffsetToApplied = uicontrol( ...
artoaGui.editOffsets.comboboxFloatOffsetToApplied = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', pOffsetsToCopy, ...
'Style', 'popupmenu', ...
......@@ -631,27 +631,27 @@ artoaGui.editOffsets.comboboxOffsetToApplied = uicontrol( ...
'Position', [(1.5*left + 5*fullwidth/8) .725 2*fullwidth/8 .2] ...
);
artoaGui.editOffsets.buttonCopyOffsets = uicontrol( ...
artoaGui.editOffsets.buttonCopyFloatOffsets = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'to Applied', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + 7*fullwidth/8) .725 fullwidth/8 .2], ...
'CallBack', pCallbacks.buttonCopyOffsets ...
'CallBack', pCallbacks.buttonCopyFloatOffsets ...
);
artoaGui.editOffsets.textSoundvelocityToApplied = uicontrol( ...
artoaGui.editOffsets.textSoundsourcesToApplied = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'Soundvelocity', ...
'String', 'Soundsources', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + 4*fullwidth/8) .5 fullwidth/8 .2] ...
);
artoaGui.editOffsets.comboboxSoundvelocityToApplied = uicontrol( ...
artoaGui.editOffsets.comboboxSoundsourcesToApplied = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', pSoundvelocityToCopy, ...
'Style', 'popupmenu', ...
......@@ -660,14 +660,14 @@ artoaGui.editOffsets.comboboxSoundvelocityToApplied = uicontrol( ...
'Position', [(1.5*left + 5*fullwidth/8) .5 2*fullwidth/8 .2] ...
);
artoaGui.editOffsets.buttonCopySoundvelocity = uicontrol( ...
artoaGui.editOffsets.buttonCopySoundsourcesOffsets = uicontrol( ...
'Parent', artoaGui.editOffsets.frameOptimumOffsets, ...
'String', 'to Applied', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(1.5*left + 7*fullwidth/8) .5 fullwidth/8 .2], ...
'CallBack', pCallbacks.buttonCopySoundvelocity ...
'CallBack', pCallbacks.buttonCopySoundsourcesOffsets ...
);
artoaGui.editOffsets.buttonAppliedToNan = uicontrol( ...
......
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