What is mctLimitState? #5775
Replies: 3 comments 2 replies
-
Hi! What version of Open MCT is the tutorial using when you see this? Also, what branch/step of the tutorial are you on? You can find the Open MCT version by clicking the Open MCT login in the top right. Thanks! |
Beta Was this translation helpful? Give feedback.
-
After further investigation and a little help from @khalidadil (thanks!) I see that this is added here: https://github.com/nasa/openmct/blob/master/src/plugins/plot/configuration/PlotSeries.js#L431 So, it's not coming back from the server, but when viewing the telemetry data in a plot, each datum get's this property. It shouldn't be any issue if it is undefined. It's used by plots to show limit information related to those data. |
Beta Was this translation helpful? Give feedback.
-
@marcelo-earth very sorry for the very long delay, but if you were still wondering and for anyone else interested, if there is a limit provider for the telemetry then a limit state object that contains styling information is returned. From the example in SinewaveLimitProvider.js, we can see the structure: LIMITS = {
rh: {
cssClass: 'is-limit--upr is-limit--red',
low: RED,
high: Number.POSITIVE_INFINITY,
name: 'Red High'
},
rl: {
cssClass: 'is-limit--lwr is-limit--red',
high: -RED,
low: Number.NEGATIVE_INFINITY,
name: 'Red Low'
},
yh: {
cssClass: 'is-limit--upr is-limit--yellow',
low: YELLOW,
high: RED,
name: 'Yellow High'
},
yl: {
cssClass: 'is-limit--lwr is-limit--yellow',
low: -RED,
high: -YELLOW,
name: 'Yellow Low'
}
}; The limitUtils.js provides a utility to extract the cssClass: export function getLimitClass(limit, prefix) {
let cssClass = '';
//If color exists then use it, fall back to the cssClass
if (limit.color) {
cssClass = `${cssClass} ${prefix}${limit.color}`;
} else if (limit.cssClass) {
cssClass = `${cssClass}${limit.cssClass}`;
}
// If we applied the cssClass then skip these classes
if (limit.cssClass === undefined) {
if (limit.isUpper) {
cssClass = `${cssClass} ${prefix}upr`;
} else {
cssClass = `${cssClass} ${prefix}lwr`;
}
if (limit.level) {
cssClass = `${cssClass} ${prefix}${limit.level}`;
}
if (limit.needsHorizontalAdjustment) {
cssClass = `${cssClass} --align-label-right`;
}
if (limit.needsVerticalAdjustment) {
cssClass = `${cssClass} --align-label-below`;
}
}
return cssClass;
} These classes are defined here: _limits.scss These styles can then be applied to plot legends, table cells and I believe table rows based on the values of the telemetry. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi OpenMCT community!
I can't find the definition of
mctLimitState
in the documentation, and I see that it is used in the code. I ask this because opening the object that brings back historical telemetry data, I see that there is a new property calledmctLimitState
.What is it about? Is it okay for it to be
undefined
?From
openmct-tutorial
:Beta Was this translation helpful? Give feedback.
All reactions