diff --git a/VERSION b/VERSION index c2807f7f3cebe94f4ce652ca42b80dcc5853fe2d..acfba60953b290b6622b2d1f53721968aa77ebf9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -140 \ No newline at end of file +141 \ No newline at end of file diff --git a/lib/+artoa/+controller/+edit/updateAvailablePlots.m b/lib/+artoa/+controller/+edit/updateAvailablePlots.m index 4df49fc23bea94f77690fa5dccd5a8f6d197f01a..8fa204aa275aa32a4603a1eeae4cf707a894a145 100644 --- a/lib/+artoa/+controller/+edit/updateAvailablePlots.m +++ b/lib/+artoa/+controller/+edit/updateAvailablePlots.m @@ -3,14 +3,15 @@ function [] = updateAvailablePlots() global artoaGui; -plotsToUpdate = {'editTemperature', 'editPressure', 'editTimeOfArrival'}; -controllerPackageNames = {'temperature', 'pressure', 'timeOfArrival'}; +plotsToUpdate = {'editTemperature', 'editPressure', 'editTimeOfArrival', 'trajectoryOutput'}; +controllerPackageNames = {'temperature', 'pressure', 'timeOfArrival', 'trajectoryOutput'}; +controllerCategoryNames = {'edit', 'edit', 'edit', 'track'}; for i = 1:length(plotsToUpdate) if ~isfield(artoaGui, plotsToUpdate{i}) continue; end - artoa.controller.edit.(controllerPackageNames{i}).plot(); + artoa.controller.(controllerCategoryNames{i}).(controllerPackageNames{i}).plot(); end end diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteAllTrajectories.m b/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteAllTrajectories.m index 013b8bd6683398e0b722b373587a8ed54ebbf6d1..a350118953b6ad080d9c25b64d80d6b98ef2ddd7 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteAllTrajectories.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteAllTrajectories.m @@ -15,9 +15,7 @@ artoaWorkspace.trajectoryOutput.trajectories = {}; %% Update table artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks(); %% Plot again -artoa.controller.track.trajectoryOutput.hideTrajectoryAxes(); artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection); -artoa.controller.track.trajectoryOutput.showTrajectoryAxes(); end diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteSelectedTrajectory.m b/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteSelectedTrajectory.m index fe67e260d36f0d43330d67746744c692995ddb01..a269ef8098e47a30c91d3eeee2feee62358dce75 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteSelectedTrajectory.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/buttonDeleteSelectedTrajectory.m @@ -27,8 +27,6 @@ artoaWorkspace.trajectoryOutput.trajectories = ... %% Update table artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks(); %% Plot again -artoa.controller.track.trajectoryOutput.hideTrajectoryAxes(); artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection); -artoa.controller.track.trajectoryOutput.showTrajectoryAxes(); end diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/open.m b/lib/+artoa/+controller/+track/+trajectoryOutput/open.m index 8ab156722935d107ec5103cc6cc25c09e32766ea..8352b739ab7c35ddf21a555e0724c530765dd886 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/open.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/open.m @@ -9,9 +9,7 @@ global artoaGui artoaWorkspace; if isfield(artoaGui.figures, 'trajectoryOutput') figure(artoaGui.figures.trajectoryOutput); artoa.controller.track.trajectoryOutput.updateTableGeneratedTracks(); - artoa.controller.track.trajectoryOutput.hideTrajectoryAxes(); artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection); - artoa.controller.track.trajectoryOutput.showTrajectoryAxes(); return end @@ -97,9 +95,7 @@ else end %% Plot everything available -artoa.controller.track.trajectoryOutput.hideTrajectoryAxes(); artoa.controller.track.trajectoryOutput.plot(artoaWorkspace.trajectoryOutput.enableMercatorProjection); -artoa.controller.track.trajectoryOutput.showTrajectoryAxes(); end diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m b/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m index 5e3a516fdb1b2df186b2f15cf6dcffcdbd9da35f..54b6f0e4587dee88bfa4acbeb713522369af40f7 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/plot.m @@ -4,6 +4,11 @@ function [] = plot(pPlotAsMap) global artoaGui artoaWorkspace; +%% Parameter check +if nargin == 0 + pPlotAsMap = false; +end + %% Set current axes artoaGui.figures.trajectoryOutput.CurrentAxes = artoaGui.trajectoryOutput.axesTrajectoryOutput; @@ -29,6 +34,8 @@ artoa.controller.track.trajectoryOutput.clearTrajectoryPlot(); ] = artoa.soundsources.scatterPositions( ... artoaGui.trajectoryOutput.axesTrajectoryOutput, ... artoaWorkspace.filteredSoundsources, ... + artoaWorkspace.soundsourceColorRegister, ... + artoaWorkspace.soundsourceColors, ... pPlotAsMap ... ); diff --git a/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m b/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m index 815efedf4b3a6de198761fd998d6ab89aae589b6..984a2b5335cfadb71fa3f9fbcd1edfb5ba189fa3 100644 --- a/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m +++ b/lib/+artoa/+controller/+track/+trajectoryOutput/updateTableGeneratedTracks.m @@ -8,7 +8,7 @@ global artoaGui artoaWorkspace; if artoa.data.hasMember(artoaWorkspace, {'trajectoryOutput', 'trajectories'}) trajectories = artoaWorkspace.trajectoryOutput.trajectories; else - return; + trajectories = {}; end %% Handle check diff --git a/lib/+artoa/+gui/+edit/offsets.m b/lib/+artoa/+gui/+edit/offsets.m index 66cdb1cbe9a37bbcfccd94fc27f920f312a3cb1b..58c04010d50618166417a9ffdb17d613fc0e72ea 100644 --- a/lib/+artoa/+gui/+edit/offsets.m +++ b/lib/+artoa/+gui/+edit/offsets.m @@ -53,7 +53,6 @@ left = 0.03; fullwidth = 1 - (2 * left); %% Initialize offset table - artoaGui.editOffsets.tableSoundsourceOffsets = uitable( ... artoaGui.figures.editOffsets, ... 'Units', 'normalized', ... diff --git a/lib/+artoa/+soundsources/scatterPositions.m b/lib/+artoa/+soundsources/scatterPositions.m index f22f2f3f76cfa6a61fb0bc8a68f01bbcb9fff073..2931f14f4f60d6082e8d684d4d649f43a934864f 100644 --- a/lib/+artoa/+soundsources/scatterPositions.m +++ b/lib/+artoa/+soundsources/scatterPositions.m @@ -1,4 +1,4 @@ -function [scatterHandle, textHandles] = scatterPositions(pAxesHandle, pSoundsources, pPlotAsMap) +function [scatterHandle, textHandles] = scatterPositions(pAxesHandle, pSoundsources, pSoundsourceColorRegister, pSoundsourceColors, pPlotAsMap) %PLOT Summary of this function goes here % Detailed explanation goes here @@ -9,10 +9,15 @@ plot_names = fnames; lat = NaN(length(fnames), 1); lon = NaN(length(fnames), 1); +color = repmat([0 0 0], length(fnames), 1); for i = 1:length(fnames) lat(i) = pSoundsources.(fnames{i}).position(1); lon(i) = pSoundsources.(fnames{i}).position(2); + index = artoa.soundsources.colorregister.getColorIndex(fnames{i}, pSoundsourceColorRegister); + if index > 0 + color(i, :) = pSoundsourceColors(index, :); + end plot_names{i} = {'', [' ' plot_names{i}]}; end @@ -24,12 +29,15 @@ axes(pAxesHandle); hold(pAxesHandle, 'on'); if pPlotAsMap - scatterHandle = scatterm(pAxesHandle, lat, lon, [], [0 0 0]); + scatterHandle = scatterm(pAxesHandle, lat, lon, [], color); %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]); + scatterHandle = scatter(pAxesHandle, lon, lat, [], color); textHandles = text(pAxesHandle, lon, lat, plot_names, 'Color', [0 0 0]); + for i = 1:length(textHandles) + textHandles(i).Color = color(i, :); + end end hold(pAxesHandle, 'off');