From b8b1cb30735179abb609f0dc0338519544a42c6e Mon Sep 17 00:00:00 2001 From: mfacchinelli Date: Thu, 22 Feb 2024 10:30:05 +0000 Subject: [PATCH] Do not show figure until it is fully populated --- resources/ReleaseNotes.md | 1 + src/visualize/+mag/+graphics/visualize.m | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/ReleaseNotes.md b/resources/ReleaseNotes.md index 66653751..1c4fddc4 100644 --- a/resources/ReleaseNotes.md +++ b/resources/ReleaseNotes.md @@ -5,6 +5,7 @@ - Add `Compression` property to supported events for plotting - Add `YAxisLocation` for `mag.graphics.style.Default` and `mag.graphics.style.Stackedplot` - Shift `YAxisLocation` to "right" for plots on right-hand side of some views: `mag.graphics.view.Field`, `mag.graphics.view.Frequency`, `mag.graphics.view.HK`, `mag.graphics.view.IALiRT`, and `mag.graphics.view.RampMode` +- Do not show figure until it is fully populated in `mag.graphics.visualize` - Create `mag.meta.Mode` enumeration to capture sensor science mode - Move definition of time constants to shared utility file `mag.time.Constant` - Make `mag.process.Range` and `mag.process.SignedInteger` more flexible to custom variable names diff --git a/src/visualize/+mag/+graphics/visualize.m b/src/visualize/+mag/+graphics/visualize.m index 11f34772..f2daa5ec 100644 --- a/src/visualize/+mag/+graphics/visualize.m +++ b/src/visualize/+mag/+graphics/visualize.m @@ -27,7 +27,10 @@ drawnow(); % Create and populate figure. - f = figure(Name = options.Name, NumberTitle = "off", WindowState = options.WindowState, Visible = matlab.lang.OnOffSwitchState(options.Visible)); + % Make sure figure is hidden while being populated, and only shown, if + % requested, at the end. + f = figure(Name = options.Name, NumberTitle = "off", WindowState = options.WindowState, Visible = "off"); + setVisibility = onCleanup(@() set(f, Visible = matlab.lang.OnOffSwitchState(options.Visible))); if isequal(options.Arrangement, zeros(1, 2)) arrangement = {"flow"};