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

Added soundspeed settings to edit offsets window.

parent bea575eb
No related branches found
No related tags found
No related merge requests found
114
\ No newline at end of file
115
\ No newline at end of file
function [newValue] = checkboxFixedSoundspeed(~, ~)
%CHECKBOXDOPPLERCORRECTION Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = logical(artoaGui.editOffsets.checkboxFixedSoundspeed.Value);
artoaWorkspace.editOffsets.useFixedSoundspeed = newValue;
end
function [newValue] = inputSoundspeed(~, ~)
%COMBOBOXTRACKINGMETHOD Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = artoaGui.editOffsets.inputSoundspeed.String;
artoaWorkspace.editOffsets.fixedSoundspeed = str2double(newValue);
end
......@@ -17,6 +17,8 @@ callbacks = struct();
callbacks.tableSoundsourceOffsetsEdit = @artoa.controller.edit.offsets.tableSoundsourceOffsetsEdit;
callbacks.buttonCalculateOffsets = @artoa.controller.edit.offsets.buttonCalculateOffsets;
callbacks.checkboxUseOffsets = @artoa.controller.edit.offsets.checkboxUseOffsets;
callbacks.checkboxFixedSoundspeed = @artoa.controller.edit.offsets.checkboxFixedSoundspeed;
callbacks.inputSoundspeed = @artoa.controller.edit.offsets.inputSoundspeed;
%% Open the gui
artoa.gui.edit.offsets(callbacks);
......@@ -29,6 +31,8 @@ end
%% Create workspace variables
artoaWorkspace.editOffsets = struct();
artoaWorkspace.editOffsets.useOffsets = false;
artoaWorkspace.editOffsets.useFixedSoundspeed = false;
artoaWorkspace.editOffsets.fixedSoundspeed = 0;
artoa.controller.edit.offsets.updateWorkspaceOffsetsTable();
%% Update gui
......
......@@ -18,6 +18,10 @@ for i = 1:length(fieldNames)
switch fieldNames{i}
case 'useOffsets'
artoaGui.editOffsets.checkboxUseOffsets.Value = currentValue;
case 'useFixedSoundspeed'
artoaGui.editOffsets.checkboxFixedSoundspeed.Value = currentValue;
case 'fixedSoundspeed'
artoaGui.editOffsets.inputSoundspeed.String = num2str(currentValue);
case 'offsets'
artoaGui.editOffsets.tableSoundsourceOffsets.Data = table2cell( ...
currentValue ...
......
......@@ -14,7 +14,9 @@ availableCallbacks = { ...
'tableSoundsourceOffsetsSelect', ...
'tableSoundsourceOffsetsEdit', ...
'buttonCalculateOffsets', ...
'checkboxUseOffsets' ...
'checkboxUseOffsets', ...
'checkboxFixedSoundspeed', ...
'inputSoundspeed' ...
};
for i = 1:length(availableCallbacks) % check if a callback is undefined
......@@ -60,6 +62,7 @@ artoaGui.editOffsets.tableSoundsourceOffsets = uitable( ...
%% Optimum offsets frame
artoaGui.editOffsets.frameOptimumOffsets = uipanel( ...
'Parent', artoaGui.figures.editOffsets, ...
'Title', 'Offset controls', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
......@@ -87,6 +90,66 @@ artoaGui.editOffsets.checkboxUseOffsets = uicontrol( ...
'CallBack', pCallbacks.checkboxUseOffsets ...
);
%% Soundspeed frame
artoaGui.editOffsets.frameSoundspeed = uipanel( ...
'Parent', artoaGui.figures.editOffsets, ...
'Title', 'Soundspeed settings', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [(2*left + fullwidth/2) .05 fullwidth/4 .35] ...
);
artoaGui.editOffsets.checkboxFixedSoundspeed = uicontrol( ...
'Parent', artoaGui.editOffsets.frameSoundspeed, ...
'String', 'Use fixed soundspeed', ...
'Style', 'checkbox', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .05 fullwidth .2], ...
'CallBack', pCallbacks.checkboxFixedSoundspeed ...
);
artoaGui.editOffsets.textSoundspeed = uicontrol( ...
'Parent', artoaGui.editOffsets.frameSoundspeed, ...
'String', 'Fixed soundspeed [m/s]', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .3 (fullwidth/3*2 - 2*left) .2], ...
'CallBack', '' ...
);
artoaGui.editOffsets.inputSoundspeed = uicontrol( ...
'Parent', artoaGui.editOffsets.frameSoundspeed, ...
'String', '0', ...
'Style', 'edit', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(fullwidth/3)*2 .3 fullwidth/3 .2], ...
'CallBack', pCallbacks.inputSoundspeed ...
);
artoaGui.editOffsets.textOptimumSoundspeedLabel = uicontrol( ...
'Parent', artoaGui.editOffsets.frameSoundspeed, ...
'String', 'Optimum soundspeed [m/s]', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .55 (fullwidth/3*2 - 2*left) .2], ...
'CallBack', '' ...
);
artoaGui.editOffsets.textOptimumSoundspeedValue = uicontrol( ...
'Parent', artoaGui.editOffsets.frameSoundspeed, ...
'String', 'NaN', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(fullwidth/3)*2 .55 fullwidth/3 .2], ...
'CallBack', '' ...
);
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