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

Improved track parameter window and added state management.

parent 22b658b8
No related branches found
No related tags found
No related merge requests found
Showing
with 264 additions and 16 deletions
function [] = addSoundsourceCombination(~, ~)
%ADDSOUNDSOURCECOMBINATION Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Get column count
columnCount = size(artoaWorkspace.trackParameter.soundsourceCombinations, 2);
%% Add to the end
artoaWorkspace.trackParameter.soundsourceCombinations(end + 1, :) = cell(1, columnCount);
%% Update gui
artoa.controller.track.parameter.updateGui();
end
function [] = addSoundsourceCombinationAbove(~, ~)
%ADDSOUNDSOURCECOMBINATIONABOVE Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Get column count
columnCount = size(artoaWorkspace.trackParameter.soundsourceCombinations, 2);
%% Get selection
selectedRow = artoaWorkspace.trackParameter.selectedSoundsourceCombinationRow;
%% Get current data
combinationCell = artoaWorkspace.trackParameter.soundsourceCombinations;
%% Add above the selected
combinationCell(selectedRow + 1:end + 1, :) = combinationCell(selectedRow:end, :);
combinationCell(selectedRow, :) = cell(1, columnCount);
artoaWorkspace.trackParameter.soundsourceCombinations = combinationCell;
%% Update gui
artoa.controller.track.parameter.updateGui();
end
function [] = duplicateSoundsourceCombination(~, ~)
%DUPLICATESOUNDSOURCECOMBINATION Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Get column count
columnCount = size(artoaWorkspace.trackParameter.soundsourceCombinations, 2);
%% Get selection
selectedRow = artoaWorkspace.trackParameter.selectedSoundsourceCombinationRow;
%% Get current data
combinationCell = artoaWorkspace.trackParameter.soundsourceCombinations;
%% Add above the selected
combinationCell(selectedRow + 1:end + 1, :) = combinationCell(selectedRow:end, :);
combinationCell(selectedRow, :) = combinationCell(selectedRow + 1, :);
artoaWorkspace.trackParameter.soundsourceCombinations = combinationCell;
%% Update gui
artoa.controller.track.parameter.updateGui();
end
function [newValue] = inputFloatOffsetBegin(~, ~)
%INPUTFLOATOFFSETBEGIN Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = artoaGui.trackParameter.inputFloatOffsetBegin.String;
artoaWorkspace.trackParameter.floatOffsetBegin = str2double(newValue);
end
function [newValue] = inputFloatOffsetEnd(~, ~)
%INPUTFLOATOFFSETBEGIN Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
newValue = artoaGui.trackParameter.inputFloatOffsetEnd.String;
artoaWorkspace.trackParameter.floatOffsetEnd = str2double(newValue);
end
...@@ -6,7 +6,7 @@ global artoaGui artoaWorkspace; ...@@ -6,7 +6,7 @@ global artoaGui artoaWorkspace;
newValue = artoaGui.trackParameter.inputGapSize.String; newValue = artoaGui.trackParameter.inputGapSize.String;
artoaWorkspace.trackParameter.inputGapSize = newValue; artoaWorkspace.trackParameter.gapSize = str2double(newValue);
end end
... ...
......
...@@ -6,7 +6,7 @@ global artoaGui artoaWorkspace; ...@@ -6,7 +6,7 @@ global artoaGui artoaWorkspace;
newValue = artoaGui.trackParameter.inputOutputInterpolationInterval.String; newValue = artoaGui.trackParameter.inputOutputInterpolationInterval.String;
artoaWorkspace.trackParameter.outputInterpolationInterval = newValue; artoaWorkspace.trackParameter.interpolationInterval = str2double(newValue);
end end
... ...
......
...@@ -21,14 +21,18 @@ callbacks.comboboxSoundspeedMethod = @artoa.controller.track.parameter.comboboxS ...@@ -21,14 +21,18 @@ callbacks.comboboxSoundspeedMethod = @artoa.controller.track.parameter.comboboxS
callbacks.checkboxPlotResiduals = @artoa.controller.track.parameter.checkboxPlotResiduals; callbacks.checkboxPlotResiduals = @artoa.controller.track.parameter.checkboxPlotResiduals;
callbacks.inputOutputInterpolationInterval = @artoa.controller.track.parameter.inputOutputInterpolationInterval; callbacks.inputOutputInterpolationInterval = @artoa.controller.track.parameter.inputOutputInterpolationInterval;
callbacks.inputGapSize = @artoa.controller.track.parameter.inputGapSize; callbacks.inputGapSize = @artoa.controller.track.parameter.inputGapSize;
callbacks.tableSoundSourceCombinationsSelection = ''; callbacks.tableSoundSourceCombinationsSelection = @artoa.controller.track.parameter.tableSoundsourceCombinationsSelection;
callbacks.tableSoundSourceCombinationsEdit = ''; callbacks.tableSoundSourceCombinationsEdit = @artoa.controller.track.parameter.tableSoundsourceCombinationsEdit;
callbacks.tableSoundSourceOffsetsEdit = @artoa.controller.track.parameter.tableSoundsourceOffsetsEdit; callbacks.tableSoundSourceOffsetsEdit = @artoa.controller.track.parameter.tableSoundsourceOffsetsEdit;
callbacks.buttonTrack = ''; callbacks.buttonTrack = '';
callbacks.buttonQuickTrack = ''; callbacks.buttonQuickTrack = '';
callbacks.buttonAddCombination = ''; callbacks.buttonAddCombination = @artoa.controller.track.parameter.addSoundsourceCombination;
callbacks.buttonRemoveCombination = ''; callbacks.buttonAddCombinationAbove = @artoa.controller.track.parameter.addSoundsourceCombinationAbove;
callbacks.buttonResetAllCombinations = ''; callbacks.buttonDuplicateCombination = @artoa.controller.track.parameter.duplicateSoundsourceCombination;
callbacks.buttonRemoveCombination = @artoa.controller.track.parameter.removeSoundsourceCombination;
callbacks.buttonResetAllCombinations = @artoa.controller.track.parameter.resetSoundsourceCombinations;
callbacks.inputFloatOffsetBegin = @artoa.controller.track.parameter.inputFloatOffsetBegin;
callbacks.inputFloatOffsetEnd = @artoa.controller.track.parameter.inputFloatOffsetEnd;
%% Open the gui %% Open the gui
artoa.gui.track.parameter( ... artoa.gui.track.parameter( ...
...@@ -56,7 +60,8 @@ if ~isfield(artoaWorkspace, 'trackParameter') ...@@ -56,7 +60,8 @@ if ~isfield(artoaWorkspace, 'trackParameter')
'checkboxPlotResiduals', ... 'checkboxPlotResiduals', ...
'inputOutputInterpolationInterval', ... 'inputOutputInterpolationInterval', ...
'inputGapSize', ... 'inputGapSize', ...
'tableSoundSourceOffsetsEdit' ... 'tableSoundSourceOffsetsEdit', ...
'tableSoundSourceCombinationsEdit' ...
}; };
for i = 1:length(availableCallbacks) for i = 1:length(availableCallbacks)
... ...
......
function [] = removeSoundsourceCombination(~, ~)
%REMOVESOUNDSOURCECOMBINATION Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Get selected row
selectedRow = artoaWorkspace.trackParameter.selectedSoundsourceCombinationRow;
%% Delete from workspace
artoaWorkspace.trackParameter.soundsourceCombinations(selectedRow, :) = [];
%% Update gui
artoa.controller.track.parameter.updateGui();
end
function [] = resetSoundsourceCombinations(~, ~)
%RESETSOUNDSOURCECOMBINATIONS Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Delete from workspace
artoaWorkspace.trackParameter.soundsourceCombinations(:, :) = [];
%% Update gui
artoa.controller.track.parameter.updateGui();
end
function [] = tableSoundsourceCombinationsEdit(~, ~)
%TABLESOUNDSOURCECOMBINATIONSEDIT Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace artoaGui;
artoaWorkspace.trackParameter.soundsourceCombinations = artoaGui.trackParameter.tableSoundSourceCombinations.Data;
end
function [outputArg1,outputArg2] = tableSoundsourceCombinationsSelection(~, event)
%TABLESOUNDSOURCECOMBINATIONSSELECTION Summary of this function goes here
% Detailed explanation goes here
global artoaWorkspace;
%% Update the selected cell
try
artoaWorkspace.trackParameter.selectedSoundsourceCombinationRow = event.Indices(1);
artoaWorkspace.trackParameter.selectedSoundsourceCombinationColumn = event.Indices(2);
catch
artoaWorkspace.trackParameter.selectedSoundsourceCombinationRow = ...
size(artoaWorkspace.trackParameter.soundsourceCombinations, 1);
artoaWorkspace.trackParameter.selectedSoundsourceCombinationColumn = ...
size(artoaWorkspace.trackParameter.soundsourceCombinations, 2);
end
end
...@@ -30,6 +30,12 @@ for i = 1:length(fieldNames) ...@@ -30,6 +30,12 @@ for i = 1:length(fieldNames)
artoaGui.trackParameter.inputGapSize.String = currentValue; artoaGui.trackParameter.inputGapSize.String = currentValue;
case 'soundsourceOffsets' case 'soundsourceOffsets'
artoaGui.trackParameter.tableSoundSourceOffsets.Data = currentValue; artoaGui.trackParameter.tableSoundSourceOffsets.Data = currentValue;
case 'soundsourceCombinations'
artoaGui.trackParameter.tableSoundSourceCombinations.Data = currentValue;
case 'floatOffsetBegin'
artoaGui.trackParameter.inputFloatOffsetBegin.String = currentValue;
case 'floatOffsetEnd'
artoaGui.trackParameter.inputFloatOffsetEnd.String = currentValue;
end end
end end
... ...
......
...@@ -23,8 +23,12 @@ availableCallbacks = { ... ...@@ -23,8 +23,12 @@ availableCallbacks = { ...
'buttonTrack', ... 'buttonTrack', ...
'buttonQuickTrack', ... 'buttonQuickTrack', ...
'buttonAddCombination', ... 'buttonAddCombination', ...
'buttonAddCombinationAbove', ...
'buttonDuplicateCombination', ...
'buttonRemoveCombination', ... 'buttonRemoveCombination', ...
'buttonResetAllCombinations' ... 'buttonResetAllCombinations', ...
'inputFloatOffsetBegin', ...
'inputFloatOffsetEnd' ...
}; };
for i = 1:length(availableCallbacks) % check if a callback is undefined for i = 1:length(availableCallbacks) % check if a callback is undefined
...@@ -206,7 +210,7 @@ columns = { ... ...@@ -206,7 +210,7 @@ columns = { ...
artoaGui.trackParameter.tableSoundSourceOffsets = uitable( ... artoaGui.trackParameter.tableSoundSourceOffsets = uitable( ...
artoaGui.figures.trackParameter, ... artoaGui.figures.trackParameter, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
'Position', [left, 0.1, 0.75*width, 0.27], ... 'Position', [left, 0.1, width, 0.27], ...
'Data', cell(1, length(columns)), ... 'Data', cell(1, length(columns)), ...
'ColumnName', columns, ... 'ColumnName', columns, ...
'ColumnEditable', true, ... 'ColumnEditable', true, ...
...@@ -255,33 +259,103 @@ artoaGui.trackParameter.frameCombinationButtons = uipanel( ... ...@@ -255,33 +259,103 @@ artoaGui.trackParameter.frameCombinationButtons = uipanel( ...
artoaGui.trackParameter.buttonAddCombination = uicontrol( ... artoaGui.trackParameter.buttonAddCombination = uicontrol( ...
'Parent', artoaGui.trackParameter.frameCombinationButtons, ... 'Parent', artoaGui.trackParameter.frameCombinationButtons, ...
'String', 'Add Combination', ... 'String', 'Add', ...
'Style', 'PushButton', ... 'Style', 'PushButton', ...
'FontSize', 8, ... 'FontSize', 8, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
'Position', [left .8 (1-2*left) .5*buttonHeight], ... 'Position', [left .8 (1-2*left) .4*buttonHeight], ...
'CallBack', pCallbacks.buttonAddCombination ... 'CallBack', pCallbacks.buttonAddCombination ...
); );
artoaGui.trackParameter.buttonAddAboveCombination = uicontrol( ...
'Parent', artoaGui.trackParameter.frameCombinationButtons, ...
'String', 'Add above selected', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .65 (1-2*left) .4*buttonHeight], ...
'CallBack', pCallbacks.buttonAddCombinationAbove ...
);
artoaGui.trackParameter.buttonDuplicateCombination = uicontrol( ...
'Parent', artoaGui.trackParameter.frameCombinationButtons, ...
'String', 'Duplicate selected', ...
'Style', 'PushButton', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .5 (1-2*left) .4*buttonHeight], ...
'CallBack', pCallbacks.buttonDuplicateCombination ...
);
artoaGui.trackParameter.buttonRemoveCombination = uicontrol( ... artoaGui.trackParameter.buttonRemoveCombination = uicontrol( ...
'Parent', artoaGui.trackParameter.frameCombinationButtons, ... 'Parent', artoaGui.trackParameter.frameCombinationButtons, ...
'String', 'Remove Combination', ... 'String', 'Remove selected', ...
'Style', 'PushButton', ... 'Style', 'PushButton', ...
'FontSize', 8, ... 'FontSize', 8, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
'Position', [left .6 (1-2*left) .5*buttonHeight], ... 'Position', [left .35 (1-2*left) .4*buttonHeight], ...
'CallBack', pCallbacks.buttonRemoveCombination ... 'CallBack', pCallbacks.buttonRemoveCombination ...
); );
artoaGui.trackParameter.buttonResetAllCombinations = uicontrol( ... artoaGui.trackParameter.buttonResetAllCombinations = uicontrol( ...
'Parent', artoaGui.trackParameter.frameCombinationButtons, ... 'Parent', artoaGui.trackParameter.frameCombinationButtons, ...
'String', 'Reset Combinations', ... 'String', 'Reset All', ...
'Style', 'PushButton', ... 'Style', 'PushButton', ...
'FontSize', 8, ... 'FontSize', 8, ...
'Units', 'normalized', ... 'Units', 'normalized', ...
'Position', [left .1 (1-2*left) .5*buttonHeight], ... 'Position', [left .1 (1-2*left) .4*buttonHeight], ...
'CallBack', pCallbacks.buttonResetAllCombinations ... 'CallBack', pCallbacks.buttonResetAllCombinations ...
); );
%% Float offset frame
artoaGui.trackParameter.frameFloatOffsets = uipanel( ...
'Title', 'Float offsets', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [(2*left + width) .1 width .27] ...
);
artoaGui.trackParameter.textFloatOffsetBegin = uicontrol( ...
'Parent', artoaGui.trackParameter.frameFloatOffsets, ...
'String', 'Begin [s]', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .6 .3 .2], ...
'CallBack', '' ...
);
artoaGui.trackParameter.inputFloatOffsetBegin = uicontrol( ...
'Parent', artoaGui.trackParameter.frameFloatOffsets, ...
'String', '0', ...
'Style', 'edit', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(.5-left) .6 .3 .2], ...
'CallBack', pCallbacks.inputFloatOffsetBegin ...
);
artoaGui.trackParameter.textFloatOffsetEnd = uicontrol( ...
'Parent', artoaGui.trackParameter.frameFloatOffsets, ...
'String', 'End [s]', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [left .2 .3 .2], ...
'CallBack', '' ...
);
artoaGui.trackParameter.inputFloatOffsetEnd = uicontrol( ...
'Parent', artoaGui.trackParameter.frameFloatOffsets, ...
'String', '0', ...
'Style', 'edit', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(.5-left) .2 .3 .2], ...
'CallBack', pCallbacks.inputFloatOffsetEnd ...
);
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment