Skip to content
Snippets Groups Projects
Verified Commit 06cd45c2 authored by leprob001's avatar leprob001
Browse files

feat: Added "Apply offsets" button to the TOA window

parent 3be5780c
No related branches found
No related tags found
No related merge requests found
351
\ No newline at end of file
352
\ No newline at end of file
......@@ -8,6 +8,10 @@ newValue = logical(artoaGui.editOffsets.checkboxUseOffsets.Value);
artoaWorkspace.editOffsets.useOffsets = newValue;
%% Update gui
% Needs to be done because the checkbox has also been integrated into the TOA window.
artoa.controller.edit.timeOfArrival.updateControls();
%% Recalculate
artoa.controller.edit.recalculateToaGpsAndPlot();
......
function [newValue] = checkboxUseOffsets(~, ~)
%CHECKBOXDOPPLERCORRECTION Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = logical(artoaGui.editTimeOfArrival.checkboxUseOffsets.Value);
artoaWorkspace.editOffsets.useOffsets = newValue;
%% Update gui
% Needs to be done because the checkbox has also been integrated into the TOA window.
artoa.controller.main.updateControls();
%% Recalculate
artoa.controller.edit.recalculateToaGpsAndPlot();
end
......@@ -12,6 +12,8 @@ end
%% Create workspace variables
artoaWorkspace.editTimeOfArrival = struct();
artoaGui.callbacks.timeOfArrival = struct();
artoaGui.callbacks.timeOfArrival.checkboxUseOffsets = @artoa.controller.edit.timeOfArrival.checkboxUseOffsets;
%% Calculate GPS TOAs
artoa.controller.edit.timeOfArrival.calculateGpsToas();
......
function [] = updateControls()
%UPDATEGUI Updates controls in the timeOfArrival window.
%
global artoaWorkspace artoaGui;
if artoa.data.hasMember(artoaWorkspace, {'editOffsets', 'useOffsets'})
artoaGui.editTimeOfArrival.checkboxUseOffsets.Value = ...
artoaWorkspace.editOffsets.useOffsets;
else
artoaGui.editTimeOfArrival.checkboxUseOffsets.Value = false;
end
end
function [] = updateControls()
%UPDATEGUI Updates controls in the main window.
%
global artoaWorkspace artoaGui;
if artoa.data.hasMember(artoaWorkspace, {'editOffsets', 'useOffsets'})
artoaGui.editOffsets.checkboxUseOffsets.Value = ...
artoaWorkspace.editOffsets.useOffsets;
else
artoaGui.editOffsets.checkboxUseOffsets.Value = false;
end
end
......@@ -156,7 +156,7 @@ artoaGui.editTimeOfArrival.frameControlsSoundSource = uipanel( ...
'Title', 'Soundsource', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [left .35 width .3] ...
'Position', [left .39 width .3] ...
);
artoaGui.editTimeOfArrival.buttonApply = uicontrol( ...
......@@ -216,7 +216,7 @@ artoaGui.editTimeOfArrival.frameControlsShift = uipanel( ...
'Title', 'Shift', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [left .1 width .2] ...
'Position', [left .18 width .2] ...
);
artoaGui.editTimeOfArrival.buttonShiftApply = uicontrol( ...
......@@ -249,6 +249,26 @@ artoaGui.editTimeOfArrival.buttonShiftResetAll = uicontrol( ...
'CallBack', 'artoa.controller.edit.timeOfArrival.resetShiftToa();' ...
);
%% Misc frame
artoaGui.editTimeOfArrival.frameControlsMisc = uipanel( ...
'Parent', artoaGui.figures.editTimeOfArrival, ...
'Title', 'Misc', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [left .1 width .07] ...
);
artoaGui.editTimeOfArrival.checkboxUseOffsets = uicontrol( ...
'Parent', artoaGui.editTimeOfArrival.frameControlsMisc, ...
'String', 'Apply offsets', ...
'Style', 'checkbox', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.156 .6 .69 .3], ...
'CallBack', artoaGui.callbacks.timeOfArrival.checkboxUseOffsets ...
);
%% Duplicate applied TOA table
artoaGui.editTimeOfArrival.frameDuplicateAppliedToa = uipanel( ...
......@@ -365,5 +385,8 @@ artoaGui.editTimeOfArrival.inputLowerBoundary = uicontrol( ...
%% Update histogram
artoa.controller.edit.timeOfArrival.plotToaHistogram();
%% Update GUI controls
artoa.controller.edit.timeOfArrival.updateControls();
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