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

The TOA plot and the sound source panel on the left is now updated on reloading artoa.ini.

parent dfe3c36d
No related branches found
No related tags found
No related merge requests found
function [] = createSoundsourceColorsPanel()
%CREATESOUNDSOURCECOLORSPANEL Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
width = .14;
artoaGui.editTimeOfArrival.frameControlsSoundSourceColors = uipanel( ...
'Parent', artoaGui.figures.editTimeOfArrival, ...
'Title', 'Soundsource colors', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [.01 .3 width .6] ...
);
% add label and color for every sound source that is available
spaceTopAndBottom = .05;
leftItemOffset = 0;
rightItemOffset = 0;
artoaGui.editTimeOfArrival.labelSoundsourcesColors = struct();
soundsources = artoaWorkspace.filteredSoundsources;
fnames = fieldnames(soundsources);
isLeftItem = true;
for i = 1:length(fnames)
if isLeftItem
offset = leftItemOffset;
marginLeft = 0;
leftItemOffset = leftItemOffset + 0.04;
isLeftItem = false;
else
offset = rightItemOffset;
marginLeft = .5;
rightItemOffset = rightItemOffset + 0.04;
isLeftItem = true;
end
artoaGui.editTimeOfArrival.labelSoundsourcesColors.(fnames{i}) = uicontrol( ...
'Parent', artoaGui.editTimeOfArrival.frameControlsSoundSourceColors, ...
'String', '', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(marginLeft + .1) (1 - spaceTopAndBottom - offset) .1 .03], ...
'Background', artoaWorkspace.soundsourceColors(i, :) ...
);
artoaGui.editTimeOfArrival.labelSoundsourcesColors.([fnames{i} 'c']) = uicontrol( ...
'Parent', artoaGui.editTimeOfArrival.frameControlsSoundSourceColors, ...
'String', fnames{i}, ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [(marginLeft + .25) (1 - spaceTopAndBottom - offset) .3 .03], ...
'Background', [1 1 1], ...
'HorizontalAlignment', 'left' ...
);
end
end
......@@ -34,7 +34,9 @@ if isfield(artoaGui.editTimeOfArrival, 'scatterTimeOfArrival') ...
artoaGui.editTimeOfArrival.scatterTimeOfArrival.CData = c;
% update applied sound sources
artoa.controller.edit.timeOfArrival.plotAppliedSoundsources();
artoa.controller.edit.timeOfArrival.plotSoundsourceToaFromGps(artoaWorkspace.filteredSoundsources);
artoa.controller.edit.timeOfArrival.applyToaAxesToGpsAndSoundsources();
artoa.controller.edit.timeOfArrival.createSoundsourceColorsPanel();
return
end
......
......@@ -16,6 +16,7 @@ hold(artoaGui.editTimeOfArrival.axesToaFromGps, 'on');
yMax = max(artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.YLim);
yMin = min(artoaGui.editTimeOfArrival.axesScatterTimeOfArrival.YLim);
%% Create plot
fnames = fieldnames(pSoundsources);
for o = 1:length(fnames)
......
......@@ -15,6 +15,8 @@ if isempty(artoaDataInput.ini)
error([mfilename ': artoa.ini has been found but is empty. Please use a valid artoa.ini!']);
end
artoa.controller.edit.timeOfArrival.plot();
end
......@@ -151,44 +151,7 @@ artoaGui.editTimeOfArrival.buttonWithdrawAllVisible = uicontrol( ...
%% Sound source color legend frame
artoaGui.editTimeOfArrival.frameControlsSoundSourceColors = uipanel( ...
'Title', 'Soundsource colors', ...
'Units', 'normalized', ...
'BackgroundColor', 'white', ...
'Position', [.01 .2 width .7] ...
);
% add label and color for every sound source that is available
usedHeight = .8;
spaceTopAndBottom = .05;
offset = 0;
artoaGui.editTimeOfArrival.labelSoundsourcesColors = struct();
soundsources = artoaWorkspace.filteredSoundsources;
fnames = fieldnames(soundsources);
for i = 1:length(fnames)
artoaGui.editTimeOfArrival.labelSoundsourcesColors.(fnames{i}) = uicontrol( ...
'Parent', artoaGui.editTimeOfArrival.frameControlsSoundSourceColors, ...
'String', '', ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.1 (1 - spaceTopAndBottom - offset) .1 .03], ...
'Background', artoaWorkspace.soundsourceColors(i, :) ...
);
artoaGui.editTimeOfArrival.labelSoundsourcesColors.([fnames{i} 'c']) = uicontrol( ...
'Parent', artoaGui.editTimeOfArrival.frameControlsSoundSourceColors, ...
'String', fnames{i}, ...
'Style', 'text', ...
'FontSize', 8, ...
'Units', 'normalized', ...
'Position', [.25 (1 - spaceTopAndBottom - offset) .5 .03], ...
'Background', [1 1 1], ...
'HorizontalAlignment', 'left' ...
);
offset = offset + 0.04;
end
artoa.controller.edit.timeOfArrival.createSoundsourceColorsPanel();
%% Colormap slider
......
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