-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customize display of "mag.Instrument" class
- Loading branch information
1 parent
26e858e
commit 6dbfcd7
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Customize display of "mag.Instrument" class | ||
- Move PNG export before FIG save | ||
- Fix multiple small issues with HK view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
classdef (Sealed) Instrument < handle & matlab.mixin.Copyable & mag.mixin.SetGet | ||
classdef (Sealed) Instrument < handle & matlab.mixin.Copyable & matlab.mixin.CustomDisplay & mag.mixin.SetGet | ||
% INSTRUMENT Class containing MAG instrument data. | ||
|
||
properties | ||
|
@@ -223,5 +223,38 @@ function downsample(this, targetFrequency) | |
copiedThis.Secondary = copy(this.Secondary); | ||
copiedThis.HK = copy(this.HK); | ||
end | ||
|
||
function header = getHeader(this) | ||
|
||
if isscalar(this) | ||
|
||
if this.HasScience && this.HasMetaData && ... | ||
~isempty(this.Primary.MetaData) && ~ismissing(this.Primary.MetaData.DataFrequency) && ~isequal(this.Primary.MetaData.Mode, "Hybrid") && ... | ||
~isempty(this.Secondary.MetaData) && ~ismissing(this.Secondary.MetaData.DataFrequency) && ~isequal(this.Secondary.MetaData.Mode, "Hybrid") | ||
|
||
tag = char(compose(" in %s (%d, %d)", this.Primary.MetaData.Mode, this.Primary.MetaData.DataFrequency, this.Secondary.MetaData.DataFrequency)); | ||
else | ||
tag = char.empty(); | ||
end | ||
|
||
className = matlab.mixin.CustomDisplay.getClassNameForHeader(this); | ||
header = [' ', className, tag, ' with properties:']; | ||
else | ||
header = [email protected](this); | ||
end | ||
end | ||
|
||
function groups = getPropertyGroups(this) | ||
|
||
if isscalar(this) | ||
|
||
propertyList = ["HasData", "HasMetaData", "HasScience", "HasHK", "TimeRange", ... | ||
"Primary", "Secondary", ... | ||
"MetaData", "Events", "HK"]; | ||
groups = matlab.mixin.util.PropertyGroup(propertyList, ""); | ||
else | ||
groups = [email protected](this); | ||
end | ||
end | ||
end | ||
end |