diff --git a/lib/+artoa/+controller/+track/+parameter/addSoundsourceCombination.m b/lib/+artoa/+controller/+track/+parameter/addSoundsourceCombination.m new file mode 100644 index 0000000000000000000000000000000000000000..c40f9f1093cc5953157449b315183d95814f1f32 --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/addSoundsourceCombination.m @@ -0,0 +1,19 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/addSoundsourceCombinationAbove.m b/lib/+artoa/+controller/+track/+parameter/addSoundsourceCombinationAbove.m new file mode 100644 index 0000000000000000000000000000000000000000..d7cbf26674dbdfce18fbaa0c0b4d2276e4534b0a --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/addSoundsourceCombinationAbove.m @@ -0,0 +1,25 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/duplicateSoundsourceCombination.m b/lib/+artoa/+controller/+track/+parameter/duplicateSoundsourceCombination.m new file mode 100644 index 0000000000000000000000000000000000000000..9ca9b2e07329fda314cbc3b57f44047c3bee87c3 --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/duplicateSoundsourceCombination.m @@ -0,0 +1,25 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/inputFloatOffsetBegin.m b/lib/+artoa/+controller/+track/+parameter/inputFloatOffsetBegin.m new file mode 100644 index 0000000000000000000000000000000000000000..a17d6914a637032f4d87d96fc6363e687b96c85f --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/inputFloatOffsetBegin.m @@ -0,0 +1,13 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/inputFloatOffsetEnd.m b/lib/+artoa/+controller/+track/+parameter/inputFloatOffsetEnd.m new file mode 100644 index 0000000000000000000000000000000000000000..029cfa0f7679dab212ff6cc92526eb9f7a1093d7 --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/inputFloatOffsetEnd.m @@ -0,0 +1,13 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/inputGapSize.m b/lib/+artoa/+controller/+track/+parameter/inputGapSize.m index 6da91616eb0f54f87558105d6628a6169ed4f056..091e70f4a9098ec356189cf3a11debb52e5f9868 100644 --- a/lib/+artoa/+controller/+track/+parameter/inputGapSize.m +++ b/lib/+artoa/+controller/+track/+parameter/inputGapSize.m @@ -6,7 +6,7 @@ global artoaGui artoaWorkspace; newValue = artoaGui.trackParameter.inputGapSize.String; -artoaWorkspace.trackParameter.inputGapSize = newValue; +artoaWorkspace.trackParameter.gapSize = str2double(newValue); end diff --git a/lib/+artoa/+controller/+track/+parameter/inputOutputInterpolationInterval.m b/lib/+artoa/+controller/+track/+parameter/inputOutputInterpolationInterval.m index d2a53e98c48b3c48eab284664a546eb107fa20d4..72a4447a6cff7b76bc2a00dc3669382fc266d8f0 100644 --- a/lib/+artoa/+controller/+track/+parameter/inputOutputInterpolationInterval.m +++ b/lib/+artoa/+controller/+track/+parameter/inputOutputInterpolationInterval.m @@ -6,7 +6,7 @@ global artoaGui artoaWorkspace; newValue = artoaGui.trackParameter.inputOutputInterpolationInterval.String; -artoaWorkspace.trackParameter.outputInterpolationInterval = newValue; +artoaWorkspace.trackParameter.interpolationInterval = str2double(newValue); end diff --git a/lib/+artoa/+controller/+track/+parameter/open.m b/lib/+artoa/+controller/+track/+parameter/open.m index 6f818393fb360fefe8fc134a061b5165699f631e..ec617eafcb3dcd299b1cedb6f51980433efb017f 100644 --- a/lib/+artoa/+controller/+track/+parameter/open.m +++ b/lib/+artoa/+controller/+track/+parameter/open.m @@ -21,14 +21,18 @@ callbacks.comboboxSoundspeedMethod = @artoa.controller.track.parameter.comboboxS 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.tableSoundSourceCombinationsSelection = @artoa.controller.track.parameter.tableSoundsourceCombinationsSelection; +callbacks.tableSoundSourceCombinationsEdit = @artoa.controller.track.parameter.tableSoundsourceCombinationsEdit; callbacks.tableSoundSourceOffsetsEdit = @artoa.controller.track.parameter.tableSoundsourceOffsetsEdit; callbacks.buttonTrack = ''; callbacks.buttonQuickTrack = ''; -callbacks.buttonAddCombination = ''; -callbacks.buttonRemoveCombination = ''; -callbacks.buttonResetAllCombinations = ''; +callbacks.buttonAddCombination = @artoa.controller.track.parameter.addSoundsourceCombination; +callbacks.buttonAddCombinationAbove = @artoa.controller.track.parameter.addSoundsourceCombinationAbove; +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 artoa.gui.track.parameter( ... @@ -56,7 +60,8 @@ if ~isfield(artoaWorkspace, 'trackParameter') 'checkboxPlotResiduals', ... 'inputOutputInterpolationInterval', ... 'inputGapSize', ... - 'tableSoundSourceOffsetsEdit' ... + 'tableSoundSourceOffsetsEdit', ... + 'tableSoundSourceCombinationsEdit' ... }; for i = 1:length(availableCallbacks) diff --git a/lib/+artoa/+controller/+track/+parameter/removeSoundsourceCombination.m b/lib/+artoa/+controller/+track/+parameter/removeSoundsourceCombination.m new file mode 100644 index 0000000000000000000000000000000000000000..d27f54f842b2874f3e632655382c80b9f0ad9732 --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/removeSoundsourceCombination.m @@ -0,0 +1,21 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/resetSoundsourceCombinations.m b/lib/+artoa/+controller/+track/+parameter/resetSoundsourceCombinations.m new file mode 100644 index 0000000000000000000000000000000000000000..fa80e2624df96edb5fe403b500dd4248a8921fbf --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/resetSoundsourceCombinations.m @@ -0,0 +1,16 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/tableSoundsourceCombinationsEdit.m b/lib/+artoa/+controller/+track/+parameter/tableSoundsourceCombinationsEdit.m new file mode 100644 index 0000000000000000000000000000000000000000..f3d1bc77430574ad0d51d8694ef65f184c2f13f8 --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/tableSoundsourceCombinationsEdit.m @@ -0,0 +1,11 @@ +function [] = tableSoundsourceCombinationsEdit(~, ~) +%TABLESOUNDSOURCECOMBINATIONSEDIT Summary of this function goes here +% Detailed explanation goes here + + +global artoaWorkspace artoaGui; + +artoaWorkspace.trackParameter.soundsourceCombinations = artoaGui.trackParameter.tableSoundSourceCombinations.Data; + +end + diff --git a/lib/+artoa/+controller/+track/+parameter/tableSoundsourceCombinationsSelection.m b/lib/+artoa/+controller/+track/+parameter/tableSoundsourceCombinationsSelection.m new file mode 100644 index 0000000000000000000000000000000000000000..68e32329424185afc20bb7c16bcb0defabb72ea8 --- /dev/null +++ b/lib/+artoa/+controller/+track/+parameter/tableSoundsourceCombinationsSelection.m @@ -0,0 +1,20 @@ +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 + diff --git a/lib/+artoa/+controller/+track/+parameter/updateGui.m b/lib/+artoa/+controller/+track/+parameter/updateGui.m index 3f86a76efe39e41b5e93d84e94cda284decf21aa..a3babdf7a59234a08de971a1b294b8e4201507e2 100644 --- a/lib/+artoa/+controller/+track/+parameter/updateGui.m +++ b/lib/+artoa/+controller/+track/+parameter/updateGui.m @@ -30,6 +30,12 @@ for i = 1:length(fieldNames) artoaGui.trackParameter.inputGapSize.String = currentValue; case 'soundsourceOffsets' 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 diff --git a/lib/+artoa/+gui/+track/parameter.m b/lib/+artoa/+gui/+track/parameter.m index 4d2a9f362b4aed807a751a9bc5dec9a8cdc1209c..364f27f9cc6df043851e093e3488db45d85101da 100644 --- a/lib/+artoa/+gui/+track/parameter.m +++ b/lib/+artoa/+gui/+track/parameter.m @@ -23,8 +23,12 @@ availableCallbacks = { ... 'buttonTrack', ... 'buttonQuickTrack', ... 'buttonAddCombination', ... + 'buttonAddCombinationAbove', ... + 'buttonDuplicateCombination', ... 'buttonRemoveCombination', ... - 'buttonResetAllCombinations' ... + 'buttonResetAllCombinations', ... + 'inputFloatOffsetBegin', ... + 'inputFloatOffsetEnd' ... }; for i = 1:length(availableCallbacks) % check if a callback is undefined @@ -206,7 +210,7 @@ columns = { ... artoaGui.trackParameter.tableSoundSourceOffsets = uitable( ... artoaGui.figures.trackParameter, ... 'Units', 'normalized', ... - 'Position', [left, 0.1, 0.75*width, 0.27], ... + 'Position', [left, 0.1, width, 0.27], ... 'Data', cell(1, length(columns)), ... 'ColumnName', columns, ... 'ColumnEditable', true, ... @@ -255,33 +259,103 @@ artoaGui.trackParameter.frameCombinationButtons = uipanel( ... artoaGui.trackParameter.buttonAddCombination = uicontrol( ... 'Parent', artoaGui.trackParameter.frameCombinationButtons, ... - 'String', 'Add Combination', ... + 'String', 'Add', ... 'Style', 'PushButton', ... 'FontSize', 8, ... 'Units', 'normalized', ... - 'Position', [left .8 (1-2*left) .5*buttonHeight], ... + 'Position', [left .8 (1-2*left) .4*buttonHeight], ... '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( ... 'Parent', artoaGui.trackParameter.frameCombinationButtons, ... - 'String', 'Remove Combination', ... + 'String', 'Remove selected', ... 'Style', 'PushButton', ... 'FontSize', 8, ... 'Units', 'normalized', ... - 'Position', [left .6 (1-2*left) .5*buttonHeight], ... + 'Position', [left .35 (1-2*left) .4*buttonHeight], ... 'CallBack', pCallbacks.buttonRemoveCombination ... ); artoaGui.trackParameter.buttonResetAllCombinations = uicontrol( ... 'Parent', artoaGui.trackParameter.frameCombinationButtons, ... - 'String', 'Reset Combinations', ... + 'String', 'Reset All', ... 'Style', 'PushButton', ... 'FontSize', 8, ... 'Units', 'normalized', ... - 'Position', [left .1 (1-2*left) .5*buttonHeight], ... + 'Position', [left .1 (1-2*left) .4*buttonHeight], ... '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