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

Implemented first version of mercator projection option.

parent 2b15eecd
No related branches found
No related tags found
No related merge requests found
Showing
with 327 additions and 93 deletions
...@@ -15,7 +15,9 @@ artoaWorkspace.trajectoryOutput.trajectories = {}; ...@@ -15,7 +15,9 @@ artoaWorkspace.trajectoryOutput.trajectories = {};
%% Update table %% Update table
artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks(); artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks();
%% Plot again %% Plot again
artoa.controller.track.trajectoryOutput.plot(); artoa.controller.track.trajectoryOutput.hideTrajectoryAxes();
artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection);
artoa.controller.track.trajectoryOutput.showTrajectoryAxes();
end end
...@@ -27,6 +27,8 @@ artoaWorkspace.trajectoryOutput.trajectories = ... ...@@ -27,6 +27,8 @@ artoaWorkspace.trajectoryOutput.trajectories = ...
%% Update table %% Update table
artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks(); artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks();
%% Plot again %% Plot again
artoa.controller.track.trajectoryOutput.plot(); artoa.controller.track.trajectoryOutput.hideTrajectoryAxes();
artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection);
artoa.controller.track.trajectoryOutput.showTrajectoryAxes();
end end
...@@ -2,12 +2,30 @@ function [] = checkboxEnableMercatorProjection(~, event) ...@@ -2,12 +2,30 @@ function [] = checkboxEnableMercatorProjection(~, event)
%CHECKBOXUPDATETRACKPARAMETERWINDOW Summary of this function goes here %CHECKBOXUPDATETRACKPARAMETERWINDOW Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
global artoaWorkspace; global artoaWorkspace artoaGui;
%% Update state
artoaWorkspace.trajectoryOutput.enableMercatorProjection = logical(event.Source.Value); artoaWorkspace.trajectoryOutput.enableMercatorProjection = logical(event.Source.Value);
%% Save position and height of window
position = artoaGui.figures.trajectoryOutput.Position;
units = artoaGui.figures.trajectoryOutput.Units;
%% Reopen window
artoa.controller.track.trajectoryOutput.close();
artoa.controller.track.trajectoryOutput.open();
%% Restore position of window
artoaGui.figures.trajectoryOutput.Position = position;
artoaGui.figures.trajectoryOutput.Units = units;
%% Setup axes
% artoa.controller.track.trajectoryOutput.setupTrajectoryAxes( ...
% artoaWorkspace.trajectoryOutput.enableMercatorProjection ...
% );
%% Replot %% Replot
artoa.controller.track.trajectoryOutput.plot(); %artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection);
end end
function [] = hideTrajectoryAxes()
%HIDELEFTSIDEBARPLOTS Summary of this function goes here
% Detailed explanation goes here
global artoaGui;
%% Hide trajectory output and show loading hint
artoaGui.trajectoryOutput.axesTrajectoryOutput.Visible = 'off';
artoaGui.trajectoryOutput.loadingTrajectoryHint.Visible = 'on';
%% Restore current axis
artoaGui.figures.trajectoryOutput.CurrentAxes = artoaGui.trajectoryOutput.axesTrajectoryOutput;
end
...@@ -9,7 +9,6 @@ global artoaGui artoaWorkspace; ...@@ -9,7 +9,6 @@ global artoaGui artoaWorkspace;
if isfield(artoaGui.figures, 'trajectoryOutput') if isfield(artoaGui.figures, 'trajectoryOutput')
figure(artoaGui.figures.trajectoryOutput); figure(artoaGui.figures.trajectoryOutput);
artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks(); artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks();
artoa.controller.track.trajectoryOutput.plot();
return return
end end
...@@ -72,7 +71,9 @@ artoaGui.trajectoryOutput.checkboxSynchronizeZoomToaWindow.Value = ... ...@@ -72,7 +71,9 @@ artoaGui.trajectoryOutput.checkboxSynchronizeZoomToaWindow.Value = ...
artoaWorkspace.trajectoryOutput.syncZoomToaWindow; artoaWorkspace.trajectoryOutput.syncZoomToaWindow;
%% Plot everything available %% Plot everything available
artoa.controller.track.trajectoryOutput.plot(); artoa.controller.track.trajectoryOutput.hideTrajectoryAxes();
artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection);
artoa.controller.track.trajectoryOutput.showTrajectoryAxes();
end end
function [] = plot() function [] = plot(pPlotAsMap)
%PLOT Summary of this function goes here %PLOT Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
global artoaGui artoaWorkspace; global artoaGui artoaWorkspace;
%% Set current axes
artoaGui.figures.trajectoryOutput.CurrentAxes = artoaGui.trajectoryOutput.axesTrajectoryOutput;
%% Save zoom state %% Save zoom state
if strcmp(artoaGui.trajectoryOutput.axesTrajectoryOutput.YLimMode, 'manual') if strcmp(artoaGui.trajectoryOutput.axesTrajectoryOutput.YLimMode, 'manual')
ylim = artoaGui.trajectoryOutput.axesTrajectoryOutput.YLim; ylim = artoaGui.trajectoryOutput.axesTrajectoryOutput.YLim;
...@@ -25,7 +28,8 @@ artoa.controller.track.trajectoryOutput.clearTrajectoryPlot(); ...@@ -25,7 +28,8 @@ artoa.controller.track.trajectoryOutput.clearTrajectoryPlot();
artoaGui.trajectoryOutput.textScatterSoundsources ... artoaGui.trajectoryOutput.textScatterSoundsources ...
] = artoa.soundsources.scatterPositions( ... ] = artoa.soundsources.scatterPositions( ...
artoaGui.trajectoryOutput.axesTrajectoryOutput, ... artoaGui.trajectoryOutput.axesTrajectoryOutput, ...
artoaWorkspace.filteredSoundsources ... artoaWorkspace.filteredSoundsources, ...
pPlotAsMap ...
); );
%% Plot float sat data %% Plot float sat data
...@@ -34,7 +38,8 @@ artoa.controller.track.trajectoryOutput.clearTrajectoryPlot(); ...@@ -34,7 +38,8 @@ artoa.controller.track.trajectoryOutput.clearTrajectoryPlot();
artoaGui.trajectoryOutput.textScatterFloatSatData ... artoaGui.trajectoryOutput.textScatterFloatSatData ...
] = artoa.float.scatterSatDataPositions( ... ] = artoa.float.scatterSatDataPositions( ...
artoaGui.trajectoryOutput.axesTrajectoryOutput, ... artoaGui.trajectoryOutput.axesTrajectoryOutput, ...
artoaWorkspace.satData ... artoaWorkspace.satData, ...
pPlotAsMap ...
); );
%% Plot available trajectories %% Plot available trajectories
...@@ -46,7 +51,7 @@ else ...@@ -46,7 +51,7 @@ else
trajectories = {}; trajectories = {};
end end
trajectoryColors = jet(round(length(trajectories) * 1.25)); trajectoryColors = jet(round(length(trajectories) * 1.5));
for i = 1:length(trajectories) for i = 1:length(trajectories)
% initialize handle container % initialize handle container
...@@ -57,11 +62,11 @@ for i = 1:length(trajectories) ...@@ -57,11 +62,11 @@ for i = 1:length(trajectories)
artoaGui.trajectoryOutput.trajectoryHandles{i}.scatterPositions, ... artoaGui.trajectoryOutput.trajectoryHandles{i}.scatterPositions, ...
artoaGui.trajectoryOutput.trajectoryHandles{i}.linePositions, ... artoaGui.trajectoryOutput.trajectoryHandles{i}.linePositions, ...
artoaGui.trajectoryOutput.trajectoryHandles{i}.textPositions ... artoaGui.trajectoryOutput.trajectoryHandles{i}.textPositions ...
] = ... ] = artoa.controller.track.trajectoryOutput.plotTrajectory( ...
artoa.controller.track.trajectoryOutput.plotTrajectory( ...
artoaGui.trajectoryOutput.axesTrajectoryOutput, ... artoaGui.trajectoryOutput.axesTrajectoryOutput, ...
trajectories{i}, ... trajectories{i}, ...
trajectoryColor ... trajectoryColor, ...
pPlotAsMap ...
); );
% plot surface positions thicker than trajectory % plot surface positions thicker than trajectory
[ ... [ ...
...@@ -71,7 +76,8 @@ for i = 1:length(trajectories) ...@@ -71,7 +76,8 @@ for i = 1:length(trajectories)
artoaGui.trajectoryOutput.axesTrajectoryOutput, ... artoaGui.trajectoryOutput.axesTrajectoryOutput, ...
trajectories{i}, ... trajectories{i}, ...
artoaWorkspace.satData, ... artoaWorkspace.satData, ...
trajectoryColor ... trajectoryColor, ...
pPlotAsMap ...
); );
% plot trajectory reference point % plot trajectory reference point
[ ... [ ...
...@@ -80,7 +86,8 @@ for i = 1:length(trajectories) ...@@ -80,7 +86,8 @@ for i = 1:length(trajectories)
] = artoa.trajectory.plotTrajectoryReferencePositions( ... ] = artoa.trajectory.plotTrajectoryReferencePositions( ...
artoaGui.trajectoryOutput.axesTrajectoryOutput, ... artoaGui.trajectoryOutput.axesTrajectoryOutput, ...
trajectories{i}, ... trajectories{i}, ...
trajectoryColor ... trajectoryColor, ...
pPlotAsMap ...
); );
% plot lines between soundsources % plot lines between soundsources
[ ... [ ...
...@@ -89,7 +96,8 @@ for i = 1:length(trajectories) ...@@ -89,7 +96,8 @@ for i = 1:length(trajectories)
artoaGui.trajectoryOutput.axesTrajectoryOutput, ... artoaGui.trajectoryOutput.axesTrajectoryOutput, ...
trajectories{i}, ... trajectories{i}, ...
artoaWorkspace.filteredSoundsources, ... artoaWorkspace.filteredSoundsources, ...
trajectoryColor ... trajectoryColor, ...
pPlotAsMap ...
); );
% hide lines between soundsources % hide lines between soundsources
...@@ -120,6 +128,5 @@ for i = 1:length(trajectories) ...@@ -120,6 +128,5 @@ for i = 1:length(trajectories)
end end
end end
end end
function [lineHandles] = plotSoundsourceLines(pAxesHandle, pTrajectory, pSoundsources, pColor) function [lineHandles] = plotSoundsourceLines(pAxesHandle, pTrajectory, pSoundsources, pColor, pPlotAsMap)
%PLOTSOUNDSOURCELINES Summary of this function goes here %PLOTSOUNDSOURCELINES Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
...@@ -16,6 +16,10 @@ involvedSoundsources = artoa.data.extractSoundsourcesFromStruct( ... ...@@ -16,6 +16,10 @@ involvedSoundsources = artoa.data.extractSoundsourcesFromStruct( ...
); );
%% Plot lines between soundsources %% Plot lines between soundsources
% make handle the current axes
axes(pAxesHandle);
hold(pAxesHandle, 'on'); hold(pAxesHandle, 'on');
lineHandles = {}; lineHandles = {};
...@@ -30,7 +34,11 @@ for o = 1:length(involvedSoundsourceNames) ...@@ -30,7 +34,11 @@ for o = 1:length(involvedSoundsourceNames)
innerSoundsource.position(1), ... innerSoundsource.position(1), ...
innerSoundsource.position(2) ... innerSoundsource.position(2) ...
); );
lineHandles{end + 1} = line(pAxesHandle, lonTrack, latTrack, 'Color', pColor); if pPlotAsMap
lineHandles{end + 1} = linem(latTrack, lonTrack, 'Color', pColor);
else
lineHandles{end + 1} = line(pAxesHandle, lonTrack, latTrack, 'Color', pColor);
end
end end
end end
......
function [scatterHandle, lineHandle, textHandles] = plotTrajectory(pAxesHandle, pTrajectory, pColor) function [scatterHandle, lineHandle, textHandles] = plotTrajectory(pAxesHandle, pTrajectory, pColor, pPlotAsMap)
%PLOTTRAJECTORY Summary of this function goes here %PLOTTRAJECTORY Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
%% Update track gui content %% Update track gui content
% make handle the current axes
axes(pAxesHandle);
hold(pAxesHandle, 'on'); hold(pAxesHandle, 'on');
%% Plot trajectory positions %% Plot trajectory positions
scatterHandle = ... if pPlotAsMap
scatter( ... scatterHandle = ...
scatterm( ...
pTrajectory.latitude, ...
pTrajectory.longitude, ...
10, ...
pColor, ...
'filled' ...
);
else
scatterHandle = ...
scatter( ...
pAxesHandle, ...
pTrajectory.longitude, ...
pTrajectory.latitude, ...
10, ...
pColor, ...
'filled' ...
);
end
%% Plot trajectory line
if pPlotAsMap
lineHandle = linem( ...
pTrajectory.latitude, ...
pTrajectory.longitude, ...
'Color', pColor ...
);
else
lineHandle = line( ...
pAxesHandle, ... pAxesHandle, ...
pTrajectory.longitude, ... pTrajectory.longitude, ...
pTrajectory.latitude, ... pTrajectory.latitude, ...
10, ... 'Color', pColor ...
pColor, ...
'filled' ...
); );
end
%% Plot trajectory line
lineHandle = line( ...
pAxesHandle, ...
pTrajectory.longitude, ...
pTrajectory.latitude, ...
'Color', pColor ...
);
%% Plot text next to trajectory %% Plot text next to trajectory
t = artoa.convert.rd2dmy(pTrajectory.date); t = artoa.convert.rd2dmy(pTrajectory.date);
textHandles = cell(1, length(t)); textHandles = cell(1, length(t));
for i = 1:10:length(t) if pPlotAsMap
textHandles{i} = text( ... for i = 1:10:length(t)
pTrajectory.longitude(i), ... textHandles{i} = textm( ...
pTrajectory.latitude(i), ... pTrajectory.latitude(i), ...
{' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(round(pTrajectory.date(i)))]}, ... pTrajectory.longitude(i), ...
'FontSize', 10, ... {' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(round(pTrajectory.date(i)))]}, ...
'Color', pColor ... 'FontSize', 10, ...
); 'Color', pColor ...
);
end
else
for i = 1:10:length(t)
textHandles{i} = text( ...
pTrajectory.longitude(i), ...
pTrajectory.latitude(i), ...
{' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(round(pTrajectory.date(i)))]}, ...
'FontSize', 10, ...
'Color', pColor ...
);
end
end end
hold(pAxesHandle, 'off'); hold(pAxesHandle, 'off');
......
function [scatterHandle, textHandles] = plotTrajectorySurfacePositions(pAxesHandle, pTrajectory, pSatData, pColor) function [scatterHandle, textHandles] = plotTrajectorySurfacePositions(pAxesHandle, pTrajectory, pSatData, pColor, pPlotAsMap)
%PLOTTRAJECTORYSURFACEPOSITIONS Summary of this function goes here %PLOTTRAJECTORYSURFACEPOSITIONS Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
...@@ -10,28 +10,55 @@ x = pTrajectory.longitude(surfaceDates); ...@@ -10,28 +10,55 @@ x = pTrajectory.longitude(surfaceDates);
y = pTrajectory.latitude(surfaceDates); y = pTrajectory.latitude(surfaceDates);
%% Hold axes %% Hold axes
% make handle the current axes
axes(pAxesHandle);
hold(pAxesHandle, 'on'); hold(pAxesHandle, 'on');
scatterHandle = scatter( ... if pPlotAsMap
pAxesHandle, ... scatterHandle = scatterm( ...
x, ... pAxesHandle, ...
y, ... y, ...
50, ... x, ...
pColor, ... 50, ...
'filled' ... pColor, ...
); 'filled' ...
);
else
scatterHandle = scatter( ...
pAxesHandle, ...
x, ...
y, ...
50, ...
pColor, ...
'filled' ...
);
end
t = artoa.convert.rd2dmy(trajectoryDates(surfaceDates)); t = artoa.convert.rd2dmy(trajectoryDates(surfaceDates));
trd = round(trajectoryDates(surfaceDates)); trd = round(trajectoryDates(surfaceDates));
textHandles = cell(1, length(t)); textHandles = cell(1, length(t));
for i = 1:length(x) if pPlotAsMap
textHandles{i} = text( ... for i = 1:length(x)
x(i), ... textHandles{i} = textm( ...
y(i), ... y(i), ...
{' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(trd(i))]}, ... x(i), ...
'FontSize', 10, ... {' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(trd(i))]}, ...
'Color', pColor ... 'FontSize', 10, ...
); 'Color', pColor ...
);
end
else
for i = 1:length(x)
textHandles{i} = text( ...
x(i), ...
y(i), ...
{' '; [num2str(t(i, 3)) '-' pad(num2str(t(i, 2)), 2, 'left', '0') '-' pad(num2str(t(i, 1)), 2, 'left', '0') ', ' num2str(trd(i))]}, ...
'FontSize', 10, ...
'Color', pColor ...
);
end
end end
%% Resume axes %% Resume axes
......
function [] = setupTrajectoryAxes(pAsMercator)
%SETUPTRAJECTORYAXES Summary of this function goes here
% Detailed explanation goes here
global artoaGui artoaWorkspace;
%% Set standard values
axesTrajectoryWidth = .55;
axesTrajectoryHeight = .85;
axesTrajectoryLeft = .25;
%% Delete axes if required
% if artoa.data.hasMember(artoaGui, {'trajectoryOutput', 'axesTrajectoryOutput'}) ...
% && ishandle(artoaGui.trajectoryOutput.axesTrajectoryOutput)
% delete(artoaGui.trajectoryOutput.axesTrajectoryOutput);
% end
%% Setup mercator axes
if pAsMercator
%set(0, 'currentfigure', artoaGui.figures.trajectoryOutput);
%landareas = shaperead('landareas.shp','UseGeoCoords',true);
lat = cellfun(@(x) x.latitude, artoaWorkspace.trajectoryOutput.trajectories, 'UniformOutput', false);
maxLat = max(cell2mat(lat), [], 'all');
minLat = min(cell2mat(lat), [], 'all');
lon = cellfun(@(x) x.longitude, artoaWorkspace.trajectoryOutput.trajectories, 'UniformOutput', false);
maxLon = max(cell2mat(lon), [], 'all');
minLon = min(cell2mat(lon), [], 'all');
figure(artoaGui.figures.trajectoryOutput); % make the trajectory output window the active one
artoaGui.trajectoryOutput.axesTrajectoryOutput = axesm( ...
'mercator', ...
'Grid', 'on', ...
'MeridianLabel', 'on', ...
'ParallelLabel', 'on', ...
'MLineLocation', 1, ...
'PLineLocation', 1, ...
'MLabelLocation', 1, ...
'PLabelLocation', 1 ...
);
% 'MapLonLimit', [minLon maxLon], ...
% 'MapLatLimit', [minLat maxLat] ...
% );
%geoshow(landareas,'FaceColor',[1 1 .5],'EdgeColor',[.6 .6 .6]);
else
artoaGui.trajectoryOutput.axesTrajectoryOutput = axes(artoaGui.figures.trajectoryOutput);
end
%% Setup standard axes
artoaGui.trajectoryOutput.axesTrajectoryOutput.Position = [axesTrajectoryLeft .1 axesTrajectoryWidth axesTrajectoryHeight];
artoaGui.trajectoryOutput.axesTrajectoryOutput.Color = [1 1 1];
artoaGui.trajectoryOutput.axesTrajectoryOutput.GridColor = [.5 .5 .5];
titleVal = [ ...
'Project: ' artoaWorkspace.float.projectname ...
' - Float ID: ' num2str(artoaWorkspace.float.floatname) ...
' - Cycle: ' num2str(artoaWorkspace.float.cycle(1)) ...
' - Trajectory' ...
];
titleHandle = title(artoaGui.trajectoryOutput.axesTrajectoryOutput, titleVal, 'FontSize', 10);
xlabel('Longitude');
ylabel('Latitude');
grid(artoaGui.trajectoryOutput.axesTrajectoryOutput, 'on');
end
function [] = showTrajectoryAxes()
%HIDELEFTSIDEBARPLOTS Summary of this function goes here
% Detailed explanation goes here
global artoaGui;
%% Hide trajectory output and show loading hint
artoaGui.trajectoryOutput.axesTrajectoryOutput.Visible = 'on';
artoaGui.trajectoryOutput.loadingTrajectoryHint.Visible = 'off';
%% Restore current axis
artoaGui.figures.trajectoryOutput.CurrentAxes = artoaGui.trajectoryOutput.axesTrajectoryOutput;
end
...@@ -119,7 +119,9 @@ artoaWorkspace.trajectoryOutput.trajectories{end + 1} = trajectoryObject; ...@@ -119,7 +119,9 @@ artoaWorkspace.trajectoryOutput.trajectories{end + 1} = trajectoryObject;
artoa.controller.track.trajectoryOutput.open(); artoa.controller.track.trajectoryOutput.open();
%% Plot %% Plot
artoa.controller.track.trajectoryOutput.plot(); artoa.controller.track.trajectoryOutput.hideTrajectoryAxes();
artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection);
artoa.controller.track.trajectoryOutput.showTrajectoryAxes();
end end
function [scatterHandle, textHandles] = scatterSatDataPositions(pAxesHandle, pSatDataPositions) function [scatterHandle, textHandles] = scatterSatDataPositions(pAxesHandle, pSatDataPositions, pPlotAsMap)
%SCATTERSATDATAPOSITIONS Summary of this function goes here %SCATTERSATDATAPOSITIONS Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
...@@ -20,9 +20,18 @@ for i = steps ...@@ -20,9 +20,18 @@ for i = steps
end end
%% Plot %% Plot
% make handle the current axes
axes(pAxesHandle);
hold(pAxesHandle, 'on'); hold(pAxesHandle, 'on');
scatterHandle = scatter(pAxesHandle, x, y, [], [.5 .5 .5]); if pPlotAsMap
textHandles = text(pAxesHandle, x(steps), y(steps), textCell, 'FontSize', 7, 'Color', [.5 .5 .5]); scatterHandle = scatterm(pAxesHandle, y, x, [], [.5 .5 .5]);
textHandles = textm(y(steps), x(steps), textCell, 'FontSize', 7, 'Color', [.5 .5 .5]);
else
scatterHandle = scatter(pAxesHandle, x, y, [], [.5 .5 .5]);
textHandles = text(pAxesHandle, x(steps), y(steps), textCell, 'FontSize', 7, 'Color', [.5 .5 .5]);
end
hold(pAxesHandle, 'off'); hold(pAxesHandle, 'off');
end end
......
...@@ -49,29 +49,26 @@ rightSidebarLeft = .825; ...@@ -49,29 +49,26 @@ rightSidebarLeft = .825;
leftSidebarWidth = .2; leftSidebarWidth = .2;
leftSidebarLeft = .015; leftSidebarLeft = .015;
axesTrajectoryWidth = .55;
axesTrajectoryHeight = .85;
axesTrajectoryLeft = .25;
%% Setup axes %% Setup axes
artoaGui.figures.trajectoryOutput.CurrentAxes = axes(); artoa.controller.track.trajectoryOutput.setupTrajectoryAxes( ...
artoaGui.figures.trajectoryOutput.CurrentAxes.Position = [axesTrajectoryLeft .1 axesTrajectoryWidth axesTrajectoryHeight]; artoaWorkspace.trajectoryOutput.enableMercatorProjection ...
artoaGui.figures.trajectoryOutput.CurrentAxes.Color = [1 1 1]; );
artoaGui.figures.trajectoryOutput.CurrentAxes.GridColor = [.5 .5 .5];
titleVal = [ ...
'Project: ' artoaWorkspace.float.projectname ...
' - Float ID: ' num2str(artoaWorkspace.float.floatname) ...
' - Cycle: ' num2str(artoaWorkspace.float.cycle(1)) ...
' - Trajectory' ...
];
titleHandle = title(artoaGui.figures.trajectoryOutput.CurrentAxes, titleVal, 'FontSize', 10);
xlabel('Longitude');
ylabel('Latitude');
grid(artoaGui.figures.trajectoryOutput.CurrentAxes, 'on');
% save axes handle
artoaGui.trajectoryOutput.axesTrajectoryOutput = artoaGui.figures.trajectoryOutput.CurrentAxes;
% Setup loading trajectory hint
artoaGui.trajectoryOutput.loadingTrajectoryHint = uicontrol( ...
'Parent', artoaGui.figures.trajectoryOutput, ...
'Style', 'text', ...
'String', 'Loading trajectories...', ...
'FontSize', 8, ...
'BackgroundColor', [1 1 1], ...
'Units', 'normalized', ...
'Visible', 'off' ...
);
% integration into the initialization above somehow does not work, so apply
% this afterwards
artoaGui.trajectoryOutput.loadingTrajectoryHint.Position = [.25 .5 .5 .1];
artoaGui.trajectoryOutput.loadingTrajectoryHint.FontSize = 10;
artoaGui.trajectoryOutput.loadingTrajectoryHint.ForegroundColor = [0 0 0];
%% Generate controls %% Generate controls
......
function [scatterHandle, textHandles] = scatterPositions(pAxesHandle, pSoundsources) function [scatterHandle, textHandles] = scatterPositions(pAxesHandle, pSoundsources, pPlotAsMap)
%PLOT Summary of this function goes here %PLOT Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
...@@ -18,9 +18,19 @@ end ...@@ -18,9 +18,19 @@ end
%% Plot positions %% Plot positions
% make handle the current axes
axes(pAxesHandle);
hold(pAxesHandle, 'on'); hold(pAxesHandle, 'on');
scatterHandle = scatter(pAxesHandle, lon, lat, [], [0 0 0]);
textHandles = text(lon, lat, plot_names, 'Color', [0 0 0]); if pPlotAsMap
scatterHandle = scatterm(pAxesHandle, lat, lon, [], [0 0 0]);
%textHandles = text(pAxesHandle, lon, lat, plot_names, 'Color', [0 0 0]);
textHandles = textm(lat, lon, plot_names, 'Color', [0 0 0]);
else
scatterHandle = scatter(pAxesHandle, lon, lat, [], [0 0 0]);
textHandles = text(pAxesHandle, lon, lat, plot_names, 'Color', [0 0 0]);
end
hold(pAxesHandle, 'off'); hold(pAxesHandle, 'off');
end end
......
function [scatterHandles, textHandles] = plotTrajectoryReferencePositions(pAxesHandle, pTrajectory, pColor) function [scatterHandles, textHandles] = plotTrajectoryReferencePositions(pAxesHandle, pTrajectory, pColor, pPlotAsMap)
%PLOTTRAJECTORYREFERENCEPOSITIONS Summary of this function goes here %PLOTTRAJECTORYREFERENCEPOSITIONS Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
...@@ -13,17 +13,33 @@ y = referencePositions(:, 1); ...@@ -13,17 +13,33 @@ y = referencePositions(:, 1);
%% Plot %% Plot
% make handle the current axes
axes(pAxesHandle);
hold(pAxesHandle, 'on'); hold(pAxesHandle, 'on');
scatterHandles = scatter(pAxesHandle, x, y, [], pColor, 'x'); if pPlotAsMap
scatterHandles = scatterm(pAxesHandle, y, x, [], pColor, 'x');
else
scatterHandles = scatter(pAxesHandle, x, y, [], pColor, 'x');
end
% Plot text % Plot text
textHandles = cell(1, length(x)); textHandles = cell(1, length(x));
for i = 1:length(x) if pPlotAsMap
textHandles{i} = text( ... for i = 1:length(x)
pAxesHandle, x(i), y(i), {'', [' ' num2str(pTrajectory.id) '.' num2str(i)]}, ... textHandles{i} = textm( ...
'Color', pColor ... y(i), x(i), {'', [' ' num2str(pTrajectory.id) '.' num2str(i)]}, ...
); 'Color', pColor ...
);
end
else
for i = 1:length(x)
textHandles{i} = text( ...
pAxesHandle, x(i), y(i), {'', [' ' num2str(pTrajectory.id) '.' num2str(i)]}, ...
'Color', pColor ...
);
end
end end
hold(pAxesHandle, 'off'); hold(pAxesHandle, 'off');
......
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