From 72e7dae02d5c168722e44c454c48fd0c222b6602 Mon Sep 17 00:00:00 2001 From: mfacchinelli Date: Mon, 18 Mar 2024 10:36:24 +0000 Subject: [PATCH] Fix issue with plotting last event mode and range in `mag.graphics.view.HK` when data is cropped --- resources/ReleaseNotes.md | 1 + src/visualize/+mag/+graphics/+chart/+custom/Event.m | 2 +- src/visualize/+mag/+graphics/+view/HK.m | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/ReleaseNotes.md b/resources/ReleaseNotes.md index a28ecd7f..25f82806 100644 --- a/resources/ReleaseNotes.md +++ b/resources/ReleaseNotes.md @@ -5,3 +5,4 @@ - Add `mag.process.Separate` to HK processing - Add export of whole science data - Fix issue with processing data ready time in `mag.process.Units` when not enough digits are present +- Fix issue with plotting last event mode and range in `mag.graphics.view.HK` when data is cropped diff --git a/src/visualize/+mag/+graphics/+chart/+custom/Event.m b/src/visualize/+mag/+graphics/+chart/+custom/Event.m index c0da5172..f59d1672 100644 --- a/src/visualize/+mag/+graphics/+chart/+custom/Event.m +++ b/src/visualize/+mag/+graphics/+chart/+custom/Event.m @@ -88,7 +88,7 @@ plotColors = this.getColors(variable); for i = 1:numel(variable) - graph(i) = plot(axes, plotTime(:, i), plotVariable(:, i), Color = plotColors(i, :), LineWidth = 3.5); %#ok + graph(i) = plot(axes, plotTime(:, i), plotVariable(:, i), Color = plotColors(i, :), LineWidth = 3.5); end % Plot vertical lines between mode changes. diff --git a/src/visualize/+mag/+graphics/+view/HK.m b/src/visualize/+mag/+graphics/+view/HK.m index c6dea141..0f4ac4a3 100644 --- a/src/visualize/+mag/+graphics/+view/HK.m +++ b/src/visualize/+mag/+graphics/+view/HK.m @@ -79,10 +79,10 @@ function visualize(this) mag.graphics.style.LeftRight(Title = "1.8 V", LeftLabel = "[V]", RightLabel = "[mA]", LLimits = 1.8 + this.VOffset, Charts = [mag.graphics.chart.Plot(YVariables = "P1V8V"), mag.graphics.chart.Plot(YVariables = "P1V8I")]), ... mag.graphics.style.LeftRight(Title = "3.3 V", LeftLabel = "[V]", RightLabel = "[mA]", LLimits = 3.3 + this.VOffset, Charts = [mag.graphics.chart.Plot(YVariables = "P3V3V"), mag.graphics.chart.Plot(YVariables = "P3V3I")]), ... mag.graphics .style.Default(Title = "2.4 V", YLabel = "[V]", YAxisLocation = "right", Charts = mag.graphics.chart.Plot(YVariables = "P2V4V"))], ... - primary.Events, mag.graphics.style.Default(Title = compose("%s Modes", primarySensor), YLabel = "mode [-]", YLimits = "manual", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "DataFrequency")), ... - secondary.Events, mag.graphics.style.Default(Title = compose("%s Modes", secondarySensor), YLabel = "mode [-]", YLimits = "manual", YAxisLocation = "right", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "DataFrequency")), ... - primary.Events, mag.graphics.style.Default(Title = compose("%s Ranges", primarySensor), YLabel = "range [-]", YLimits = "manual", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "Range", YOffset = 0.1, IgnoreMissing = false)), ... - secondary.Events, mag.graphics.style.Default(Title = compose("%s Ranges", secondarySensor), YLabel = "range [-]", YLimits = "manual", YAxisLocation = "right", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "Range", YOffset = 0.1, IgnoreMissing = false)), ... + primary.Events, mag.graphics.style.Default(Title = compose("%s Modes", primarySensor), YLabel = "mode [-]", YLimits = "manual", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "DataFrequency", EndTime = primary.Time(end))), ... + secondary.Events, mag.graphics.style.Default(Title = compose("%s Modes", secondarySensor), YLabel = "mode [-]", YLimits = "manual", YAxisLocation = "right", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "DataFrequency", EndTime = secondary.Time(end))), ... + primary.Events, mag.graphics.style.Default(Title = compose("%s Ranges", primarySensor), YLabel = "range [-]", YLimits = "manual", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "Range", YOffset = 0.1, IgnoreMissing = false, EndTime = primary.Time(end))), ... + secondary.Events, mag.graphics.style.Default(Title = compose("%s Ranges", secondarySensor), YLabel = "range [-]", YLimits = "manual", YAxisLocation = "right", Charts = mag.graphics.chart.custom.Event(EventOfInterest = "Range", YOffset = 0.1, IgnoreMissing = false, EndTime = secondary.Time(end))), ... Name = "HK & Events", ... Arrangement = [4, 2], ... LinkXAxes = true, ...