Skip to content

Commit b1870db

Browse files
authored
Merge pull request #159 from ImperialCollegeLondon/task/app-improvements
task: App and graphics improvements
2 parents 74e7886 + 6de377a commit b1870db

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

app/DataVisualization.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@
6868
end
6969

7070
% Create figure and other UI components.
71-
app.UIFigure = uifigure();
72-
app.UIFigure.Position = [100, 100, 800, 495];
73-
app.UIFigure.Name = app.getAppName();
74-
app.UIFigure.Resize = "off";
71+
app.UIFigure = uifigure(Name = app.getAppName(), Position = [100, 100, 800, 495], Resize = "off");
7572

7673
pathToAppIcons = fullfile(fileparts(mfilename("fullpath")), "icons");
7774
app.ToolbarManager = mag.app.manage.ToolbarManager(app, pathToAppIcons);

app/mission/imap/+mag/+app/+imap/+control/CPT.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function instantiate(this, parent)
3737
primaryModeLabel.Layout.Column = 1;
3838

3939
this.PrimaryModePatternField = uieditfield(this.Layout, Value = this.encodeForEditField(this.PrimaryModePattern), ...
40-
ValueChangingFcn = @(~, value) this.validatePattern(value));
40+
ValueChangedFcn = @(~, value) this.validatePattern(value));
4141
this.PrimaryModePatternField.Layout.Row = 2;
4242
this.PrimaryModePatternField.Layout.Column = [2, 3];
4343

@@ -48,7 +48,7 @@ function instantiate(this, parent)
4848
secondryModeLabel.Layout.Column = 1;
4949

5050
this.SecondaryModePatternField = uieditfield(this.Layout, Value = this.encodeForEditField(this.SecondaryModePattern), ...
51-
ValueChangingFcn = @(~, value) this.validatePattern(value));
51+
ValueChangedFcn = @(~, value) this.validatePattern(value));
5252
this.SecondaryModePatternField.Layout.Row = 3;
5353
this.SecondaryModePatternField.Layout.Column = [2, 3];
5454

@@ -59,7 +59,7 @@ function instantiate(this, parent)
5959
rangeLabel.Layout.Column = 1;
6060

6161
this.RangePatternField = uieditfield(this.Layout, Value = this.encodeForEditField(this.RangePattern), ...
62-
ValueChangingFcn = @(~, value) this.validatePattern(value));
62+
ValueChangedFcn = @(~, value) this.validatePattern(value));
6363
this.RangePatternField.Layout.Row = 4;
6464
this.RangePatternField.Layout.Column = [2, 3];
6565
end
@@ -99,7 +99,7 @@ function validatePattern(~, changingData)
9999
pattern = asManyOfPattern(digitsPattern() + optionalPattern(characterListPattern(",") + whitespacePattern()));
100100

101101
if ~matches(value, pattern)
102-
error("Value must match the pattern '1, 2, 3'.");
102+
error("mag:app:invalidPattern", "Value must match the pattern ""1, 2, 3"".");
103103
end
104104
end
105105
end

resources/release-notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
## App
2+
3+
- (IMAP) CPT view settings must match pattern only once finished typing (not while typing)
4+
15
## Software
26

7+
- (All) Force figures to appear in the figures container in MATLAB R2025a and above
38
- (IMAP) Events recorded before the start of a test are discarded
49

510
## Project

src/visualize/+mag/+graphics/+factory/DefaultFactory.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,19 @@
2828
% Force MATLAB to finish opening any previous figure.
2929
drawnow();
3030

31+
% In MATLAB R2025a and above, force figures in the figures
32+
% container.
33+
if matlabRelease().Release >= "R2025a"
34+
windowStyle = "docked";
35+
else
36+
windowStyle = "normal";
37+
end
38+
3139
% Create and populate figure.
3240
% Make sure figure is hidden while being populated, and only
3341
% shown, if requested, at the end.
34-
f = figure(Name = options.Name, NumberTitle = "off", WindowState = options.WindowState, Visible = "off");
35-
setVisibility = onCleanup(@() set(f, Visible = matlab.lang.OnOffSwitchState(options.Visible)));
42+
f = figure(Name = options.Name, NumberTitle = "off", WindowState = options.WindowState, WindowStyle = windowStyle, Visible = "off");
43+
resetVisibility = onCleanup(@() set(f, Visible = matlab.lang.OnOffSwitchState(options.Visible)));
3644

3745
if mag.internal.isThemeable(f)
3846
f.Theme = options.Theme;

0 commit comments

Comments
 (0)