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

Refactoring, moved defaults from artoaWorkspace to artoaConfig.

parent 1459fa61
No related branches found
No related tags found
No related merge requests found
193
\ No newline at end of file
194
\ No newline at end of file
......@@ -2,9 +2,11 @@ function [] = initialize()
%INITIALIZE Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
global artoaGui;
callbacks = artoaWorkspace.defaults.mainCallbacks;
%% Initialize
callbacks = artoaGui.callbacks.main;
availableCallbacks = { ...
'tableSoundsourceOffsetsSelect', ...
......
......
......@@ -2,7 +2,7 @@ function [] = pickPoint()
%PICKPOINT Lets the user pick a point in the plot.
% Selection can be aborted by using the right mouse button.
global artoaGui artoaWorkspace;
global artoaGui artoaWorkspace artoaConfig;
%% Check if polygon is already selected
......@@ -24,7 +24,7 @@ if button ~= 1
end
hold on;
artoaGui.editPressure.userSelection = scatter(x_closest, y_closest, artoaWorkspace.defaults.pickPointMarkerSize, [1 1 1]);
artoaGui.editPressure.userSelection = scatter(x_closest, y_closest, artoaConfig.defaults.pickPointMarkerSize, [1 1 1]);
hold off;
artoaWorkspace.editPressure.userSelection = index;
......
......
......@@ -2,7 +2,7 @@ function [] = pickPoint()
%PICKPOINT Lets the user pick a point in the plot.
% Selection can be aborted by using the right mouse button.
global artoaGui artoaWorkspace;
global artoaGui artoaWorkspace artoaConfig;
%% Check if polygon is already selected
......@@ -24,7 +24,7 @@ if button ~= 1
end
hold on;
artoaGui.editTemperature.userSelection = scatter(x_closest, y_closest, artoaWorkspace.defaults.pickPointMarkerSize, [1 1 1]);
artoaGui.editTemperature.userSelection = scatter(x_closest, y_closest, artoaConfig.defaults.pickPointMarkerSize, [1 1 1]);
hold off;
artoaWorkspace.editTemperature.userSelection = index;
......
......
......@@ -2,7 +2,7 @@ function [] = pickPoint()
%PICKPOINT Lets the user pick a point in the plot.
% Selection can be aborted by using the right mouse button.
global artoaGui artoaWorkspace;
global artoaGui artoaWorkspace artoaConfig;
%% Check if polygon is already selected
......@@ -20,7 +20,7 @@ while button == 1
[x_closest, y_closest, index] = findClosestMatch(dx, dy);
hold on;
artoaGui.editTimeOfArrival.userSelection{end + 1} = scatter(x_closest, y_closest, artoaWorkspace.defaults.pickPointMarkerSize, [0 0 0]);
artoaGui.editTimeOfArrival.userSelection{end + 1} = scatter(x_closest, y_closest, artoaConfig.defaults.pickPointMarkerSize, [0 0 0]);
hold off;
artoaWorkspace.editTimeOfArrival.userSelection = [ ...
artoaWorkspace.editTimeOfArrival.userSelection, ...
......
......
......@@ -2,10 +2,10 @@ function [trackingMethods] = collectTrackingMethods()
%INITIALIZE Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
global artoaWorkspace artoaConfig;
%% Get default tracking methods
trackingMethods = artoaWorkspace.defaults.trackingMethods;
trackingMethods = artoaConfig.defaults.trackingMethods;
%% Get plugin methods
if (artoa.data.hasMember(artoaWorkspace, {'plugins', 'tracking', 'functionHandles'}))
......
......
......@@ -2,7 +2,7 @@ function [] = open(~, ~)
%OPEN Initializes the main gui.
% Detailed explanation goes here
global artoaGui artoaWorkspace;
global artoaGui artoaConfig;
%% Check if the gui is already opened
......@@ -59,14 +59,14 @@ callbacks.buttonCopyFromMeasured = @artoa.controller.edit.offsets.buttonCopyFrom
callbacks.buttonUndoLastCopy = @artoa.controller.edit.offsets.buttonUndoLastCopy;
callbacks.buttonEmpiricalToNan = @artoa.controller.edit.offsets.buttonEmpiricalToNan;
artoaWorkspace.defaults.mainCallbacks = callbacks;
artoaGui.callbacks.main = callbacks;
%% Start artoa4
artoa.gui.main( ...
callbacks, ...
artoa.controller.main.collectTrackingMethods(), ...
artoaWorkspace.defaults.interpolationMethods, ...
artoaWorkspace.defaults.soundspeedMethods ...
artoaConfig.defaults.interpolationMethods, ...
artoaConfig.defaults.soundspeedMethods ...
);
......
......
......@@ -4,7 +4,7 @@ function [] = initialize()
global artoaWorkspace artoaGui;
callbacks = artoaWorkspace.defaults.mainCallbacks;
callbacks = artoaGui.callbacks.main;
%% Create workspace variables
if ~isfield(artoaWorkspace, 'trackParameter')
......
......
......@@ -2,7 +2,7 @@ function [] = initializeArtoa4()
%INITIALIZEARTOA4 Initializes variables required for artoa4 and creates the main window if required.
%
global artoaDataInput artoaWorkspace artoaGui;
global artoaDataInput artoaWorkspace artoaGui artoaConfig;
%% When the gui exists, focus it
if isfield(artoaGui, 'figures') && isfield(artoaGui.figures, 'main')
......@@ -14,40 +14,42 @@ end
artoaDataInput = struct();
artoaWorkspace = struct();
artoaWorkspace.hideDeletedDataPoints = false;
artoaWorkspace.defaults = struct();
artoaWorkspace.defaults.trackingMethods = { ...
artoaWorkspace.artoaVersion = ['4' artoa.versioning.getVersionString(true)];
artoaWorkspace.plugins = struct();
artoaWorkspace.plugins.tracking = struct();
artoaGui = struct();
artoaGui.figures = struct();
artoaGui.main = struct();
artoaGui.trackParameter = struct();
artoaGui.callbacks = struct();
artoaWorkspace.editOffsets = struct();
artoaWorkspace.editOffsets.useOffsets = false;
%% Configure artoa defaults
artoaConfig.defaults = struct();
artoaConfig.defaults.trackingMethods = { ...
'Least Square', ...
'Exclusive Least Square', ...
'Circular', ...
'Hyperbolic' ...
};
artoaWorkspace.defaults.interpolationMethods = { ...
artoaConfig.defaults.interpolationMethods = { ...
'None', ...
'Linear', ...
'Spline', ...
'Cubic' ...
};
artoaWorkspace.defaults.soundspeedMethods = { ...
artoaConfig.defaults.soundspeedMethods = { ...
'Del Grosso', ...
'Linear', ...
'Soundsource file', ...
'Levitus', ...
'Manual' ...
};
artoaWorkspace.defaults.pickPointMarkerSize = 80;
artoaWorkspace.artoaVersion = ['4' artoa.versioning.getVersionString(true)];
artoaWorkspace.plugins = struct();
artoaWorkspace.plugins.tracking = struct();
artoaGui = struct();
artoaGui.figures = struct();
artoaGui.main = struct();
artoaGui.trackParameter = struct();
artoaWorkspace.editOffsets = struct();
artoaWorkspace.editOffsets.useOffsets = false;
artoaConfig.defaults.pickPointMarkerSize = 80;
%% Read ini file if existent and copy required variables to workspace
artoa.controller.file.loadArtoaIni();
......
......
......@@ -24,7 +24,7 @@ try
catch
end
clearvars -global artoaGui artoaDataInput artoaWorkspace;
clearvars -global artoaGui artoaDataInput artoaWorkspace artoaConfig;
end
%% artoaWorkspace.defaults moved to artoaConfig.defaults
% remove the old defaults
if artoa.data.hasMember(artoaWorkspace, 'defaults')
artoaWorkspace = rmfield(artoaWorkspace, 'defaults');
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment