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

The soundsource deployment and recover text is now sticky to the YLim property.

parent b446f27f
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,8 @@ artoaGui.editTimeOfArrival.axesToaFromGps = axes(artoaGui.figures.editTimeOfArri
artoaGui.editTimeOfArrival.scatterToaFromGps = struct();
artoaGui.editTimeOfArrival.textToaFromGps = struct();
artoaGui.editTimeOfArrival.textSoundsourceDeployments = struct();
artoaGui.editTimeOfArrival.textSoundsourceRecovers = struct();
hold(artoaGui.editTimeOfArrival.axesToaFromGps, 'on');
......@@ -126,20 +128,18 @@ for o = 1:length(fnames)
toaExtension = 10;
if (soundSourceBegin > toaMin - toaExtension) ...
&& (soundSourceBegin < toaMax + toaExtension)
for textSteps = yMin:tmpSteps:(yMax-tmpSteps)
text( ...
artoaGui.editTimeOfArrival.axesToaFromGps, ...
soundSourceBegin, textSteps + additionalYOffset, ...
['<-- ', fnames{o}], ...
'Color',[1 .4 .4], ...
'HorizontalAlignment', 'center', ...
'VerticalAlignment', 'bottom', ...
'FontName', 'Helvetica', ...
'FontSize', 10, ...
'FontWeight', 'demi', ...
'Rotation', 90 ...
);
end
artoaGui.editTimeOfArrival.textSoundsourceDeployments.(fnames{o}) = text( ...
artoaGui.editTimeOfArrival.axesToaFromGps, ...
soundSourceBegin, yMin, ...
['<-- ', fnames{o}], ...
'Color',[1 .4 .4], ...
'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom', ...
'FontName', 'Helvetica', ...
'FontSize', 10, ...
'FontWeight', 'demi', ...
'Rotation', 90 ...
);
plot( ...
artoaGui.figures.editTimeOfArrival.CurrentAxes, ...
[soundSourceBegin soundSourceBegin], [yMax yMin], ...
......@@ -150,20 +150,18 @@ for o = 1:length(fnames)
% recovering
if (soundSourceEnd > toaMin - toaExtension) ...
&& (soundSourceEnd < toaMax + toaExtension)
for textSteps = yMin:tmpSteps:(yMax-tmpSteps)
text( ...
artoaGui.editTimeOfArrival.axesToaFromGps, ...
soundSourceEnd, textSteps + additionalYOffset, ...
[fnames{o}, ' -->'], ...
'Color',[1 .4 .4], ...
'HorizontalAlignment', 'center', ...
'VerticalAlignment', 'bottom', ...
'FontName', 'Helvetica', ...
'FontSize', 10, ...
'FontWeight', 'demi', ...
'Rotation', 90 ...
);
end
artoaGui.editTimeOfArrival.textSoundsourceRecovers.(fnames{o}) = text( ...
artoaGui.editTimeOfArrival.axesToaFromGps, ...
soundSourceEnd, yMax, ...
[fnames{o}, ' -->'], ...
'Color',[1 .4 .4], ...
'HorizontalAlignment', 'right', ...
'VerticalAlignment', 'bottom', ...
'FontName', 'Helvetica', ...
'FontSize', 10, ...
'FontWeight', 'demi', ...
'Rotation', 90 ...
);
plot( ...
artoaGui.figures.editTimeOfArrival.CurrentAxes, ...
[soundSourceEnd soundSourceEnd], [yMax yMin], ...
......
function [] = updateSoundsourceDeploymentRecoverText(~, pEventObject)
%UPDATESOUNDSOURCEDEPLOYMENTRECOVERTEXT Summary of this function goes here
% Detailed explanation goes here
global artoaGui;
%% Get required variables
yMax = max(pEventObject.AffectedObject.YLim);
yMin = min(pEventObject.AffectedObject.YLim);
%% Update deployment text positions
fnames = fieldnames(artoaGui.editTimeOfArrival.textSoundsourceDeployments);
for o = 1:length(fnames)
artoaGui.editTimeOfArrival.textSoundsourceDeployments.(fnames{o}).Position(2) = yMin;
end
%% Update recover text positions
fnames = fieldnames(artoaGui.editTimeOfArrival.textSoundsourceRecovers);
for o = 1:length(fnames)
artoaGui.editTimeOfArrival.textSoundsourceRecovers.(fnames{o}).Position(2) = yMax;
end
end
......@@ -52,6 +52,15 @@ set(titleHandle, 'Color', 'blue');
xlabel(artoaGui.editTimeOfArrival.axesScatterTimeOfArrival, 'Message Date', 'FontSize', 10);
ylabel(artoaGui.editTimeOfArrival.axesScatterTimeOfArrival, 'Time of arrival rel. to window start time', 'FontSize', 10);
% setup listener to update the deployment and recover text of soundsources
addlistener( ...
artoaGui.editTimeOfArrival.axesScatterTimeOfArrival, ...
'YLim', ...
'PostSet', ...
@artoa.controller.edit.timeOfArrival.updateSoundsourceDeploymentRecoverText ...
);
%% Generate Plot
artoa.controller.edit.timeOfArrival.plot();
......
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