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

Values are now updated if available when the track parameter window is opened.

parent cbb59f2d
No related branches found
No related tags found
No related merge requests found
Showing
with 180 additions and 20 deletions
function [newValue] = checkboxDopplerCorrection(~, ~)
%CHECKBOXDOPPLERCORRECTION Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = logical(artoaGui.trackParameter.checkboxDopplerCorrection.Value);
artoaWorkspace.trackParameter.dopplerCorrection = newValue;
end
function [newValue] = checkboxPlotResiduals(~, ~)
%CHECKBOXPLOTRESIDUALS Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = logical(artoaGui.trackParameter.checkboxPlotResiduals.Value);
artoaWorkspace.trackParameter.plotResiduals = newValue;
end
function [newValue] = comboboxInterpolationMethod(~, ~)
%COMBOBOXTRACKINGMETHOD Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
selectedIndex = artoaGui.trackParameter.comboboxInterpolationMethod.Value;
newValue = artoaGui.trackParameter.comboboxInterpolationMethod.String{selectedIndex};
artoaWorkspace.trackParameter.interpolationMethodValue = selectedIndex;
artoaWorkspace.trackParameter.interpolationMethodString = newValue;
end
function [newValue] = comboboxSoundspeedMethod(~, ~)
%COMBOBOXTRACKINGMETHOD Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
selectedIndex = artoaGui.trackParameter.comboboxSoundspeedMethod.Value;
newValue = artoaGui.trackParameter.comboboxSoundspeedMethod.String{selectedIndex};
artoaWorkspace.trackParameter.soundspeedMethodValue = selectedIndex;
artoaWorkspace.trackParameter.soundspeedMethodString = newValue;
end
function [newValue] = comboboxTrackingMethod(~, ~)
%COMBOBOXTRACKINGMETHOD Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
selectedIndex = artoaGui.trackParameter.comboboxTrackingMethod.Value;
newValue = artoaGui.trackParameter.comboboxTrackingMethod.String{selectedIndex};
artoaWorkspace.trackParameter.trackingMethodValue = selectedIndex;
artoaWorkspace.trackParameter.trackingMethodString = newValue;
end
function [newValue] = inputGapSize(~, ~)
%COMBOBOXTRACKINGMETHOD Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = artoaGui.trackParameter.inputGapSize.String;
artoaWorkspace.trackParameter.inputGapSize = newValue;
end
function [newValue] = inputOutputInterpolationInterval(~, ~)
%COMBOBOXTRACKINGMETHOD Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = artoaGui.trackParameter.inputOutputInterpolationInterval.String;
artoaWorkspace.trackParameter.outputInterpolationInterval = newValue;
end
......@@ -13,14 +13,14 @@ end
%% Setup callbacks
callbacks = struct();
callbacks.CloseRequestFcn = 'artoa.controller.track.parameter.close();';
callbacks.comboboxTrackingMethod = '';
callbacks.checkboxDopplerCorrection = '';
callbacks.comboboxInterpolationMethod = '';
callbacks.comboboxSoundspeedMethod = '';
callbacks.checkboxPlotResiduals = '';
callbacks.inputOutputInterpolationInterval = '';
callbacks.inputGapSize = '';
callbacks.CloseRequestFcn = @artoa.controller.track.parameter.close;
callbacks.comboboxTrackingMethod = @artoa.controller.track.parameter.comboboxTrackingMethod;
callbacks.checkboxDopplerCorrection = @artoa.controller.track.parameter.checkboxDopplerCorrection;
callbacks.comboboxInterpolationMethod = @artoa.controller.track.parameter.comboboxInterpolationMethod;
callbacks.comboboxSoundspeedMethod = @artoa.controller.track.parameter.comboboxSoundspeedMethod;
callbacks.checkboxPlotResiduals = @artoa.controller.track.parameter.checkboxPlotResiduals;
callbacks.inputOutputInterpolationInterval = @artoa.controller.track.parameter.inputOutputInterpolationInterval;
callbacks.inputGapSize = @artoa.controller.track.parameter.inputGapSize;
callbacks.tableSoundSourceCombinationsSelection = '';
callbacks.tableSoundSourceCombinationsEdit = '';
callbacks.buttonTrack = '';
......@@ -30,10 +30,20 @@ callbacks.buttonRemoveCombination = '';
callbacks.buttonResetAllCombinations = '';
%% Open the gui
artoa.gui.track.parameter(callbacks);
artoa.gui.track.parameter( ...
callbacks, ...
artoaWorkspace.defaults.trackingMethods, ...
artoaWorkspace.defaults.interpolationMethods, ...
artoaWorkspace.defaults.soundspeedMethods ...
);
%% Create workspace variables
artoaWorkspace.trackParameter = struct();
if ~isfield(artoaWorkspace, 'trackParameter')
artoaWorkspace.trackParameter = struct();
end
%% Update the values if required
artoa.controller.track.parameter.updateGui();
end
function [] = updateGui()
%UPDATEGUI Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
if ~isfield(artoaWorkspace, 'trackParameter')
return;
end
fields = artoaWorkspace.trackParameter;
fieldNames = fieldnames(fields);
for i = 1:length(fieldNames)
currentValue = fields.(fieldNames{i});
switch fieldNames{i}
case 'dopplerCorrection'
artoaGui.trackParameter.checkboxDopplerCorrection.Value = currentValue;
case 'plotResiduals'
artoaGui.trackParameter.checkboxPlotResiduals.Value = currentValue;
case 'trackingMethodValue'
artoaGui.trackParameter.comboboxTrackingMethod.Value = currentValue;
case 'interpolationMethodValue'
artoaGui.trackParameter.comboboxInterpolationMethod.Value = currentValue;
case 'soundspeedMethodValue'
artoaGui.trackParameter.comboboxSoundspeedMethod.Value = currentValue;
case 'outputInterpolationInterval'
artoaGui.trackParameter.inputOutputInterpolationInterval.String = currentValue;
case 'gapSize'
artoaGui.trackParameter.inputGapSize.String = currentValue;
end
end
end
......@@ -15,6 +15,26 @@ artoaDataInput = struct();
artoaDataOutput = struct();
artoaWorkspace = struct();
artoaWorkspace.showAllDataPoints = false;
artoaWorkspace.defaults = struct();
artoaWorkspace.defaults.trackingMethods = { ...
'Least Square', ...
'Exclusive Least Square', ...
'Circular', ...
'Hyperbolic' ...
};
artoaWorkspace.defaults.interpolationMethods = { ...
'None', ...
'Linear', ...
'Spline', ...
'Cubic' ...
};
artoaWorkspace.defaults.soundspeedMethods = { ...
'Del Grosso', ...
'Linear', ...
'Soundsource file', ...
'Levitus', ...
'Manual' ...
};
artoaGui = struct();
artoaGui.figures = struct();
artoaGui.main = struct();
......
function [] = parameter(pCallbacks)
function [] = parameter(pCallbacks, pTrackingMethods, pInterpolationMethods, pSoundspeedMethods)
%PARAMETER Defines the ARTOA4 tracking parameter window.
global artoaGui artoaWorkspace;
......@@ -27,7 +27,7 @@ availableCallbacks = { ...
for i = 1:length(availableCallbacks) % check if a callback is undefined
if ~isfield(pCallbacks, availableCallbacks{i})
pCallbacks.(availableCallbacks{i}) = '';
pCallbacks.(availableCallbacks{i}) = @(~, ~) false;
end
end
......@@ -65,17 +65,15 @@ artoaGui.trackParameter.frameTrackingMethod = uipanel( ...
'Position', [left .75 width .20] ...
);
methods = {'Least Square', 'Exclusive Least Square', 'Circular', 'Hyperbolic'};
artoaGui.trackParameter.comboboxTrackingMethod = uicontrol( ...
'Parent', artoaGui.trackParameter.frameTrackingMethod, ...
'String', methods, ...
'String', pTrackingMethods, ...
'Style', 'popupmenu', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .5 .9 .4], ...
'CallBack', pCallbacks.comboboxTrackingMethod ...
);
clear methods;
artoaGui.trackParameter.checkboxDopplerCorrection = uicontrol( ...
'Parent', artoaGui.trackParameter.frameTrackingMethod, ...
......@@ -95,10 +93,9 @@ artoaGui.trackParameter.frameInterpolationMethod = uipanel( ...
'Position', [(2*left + width) .75 width .20] ...
);
methods = {'None', 'Linear', 'Spline', 'Cubic'};
artoaGui.trackParameter.comboboxInterpolationMethod = uicontrol( ...
'Parent', artoaGui.trackParameter.frameInterpolationMethod, ...
'String', methods, ...
'String', pInterpolationMethods, ...
'Style', 'popupmenu', ...
'FontSize', 8, ...
'Units', 'normalized', ...
......@@ -136,17 +133,15 @@ artoaGui.trackParameter.frameSoundspeedMethod = uipanel( ...
'Position', [(3*left + 2*width) .75 width .20] ...
);
methods = {'Del Grosso', 'Linear', 'Soundsource file', 'Levitus', 'Manual'};
artoaGui.trackParameter.comboboxSoundspeedMethod = uicontrol( ...
'Parent', artoaGui.trackParameter.frameSoundspeedMethod, ...
'String', methods, ...
'String', pSoundspeedMethods, ...
'Style', 'popupmenu', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .5 .9 .4], ...
'CallBack', pCallbacks.comboboxSoundspeedMethod ...
);
clear methods;
artoaGui.trackParameter.checkboxPlotResiduals = uicontrol( ...
'Parent', artoaGui.trackParameter.frameSoundspeedMethod, ...
......
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