Compare commits

...

6 Commits

Author SHA1 Message Date
Jesse Mazzella
f8c41f2fd2 fix: get limits really actually correctly this time (phew) 2024-03-18 17:21:55 -07:00
Jesse Mazzella
e881336d07 fix: call .limits() correctly 2024-03-18 17:13:27 -07:00
Jesse Mazzella
c198b4bf94 fix: pass in domainObject 2024-03-18 15:33:29 -07:00
Jesse Mazzella
417ff41331 refactor: move to created hook, remove initialize function 2024-03-18 11:10:18 -07:00
Jesse Mazzella
0d5041d289 fix: de-reactify plot series config among others 2024-03-18 11:09:50 -07:00
Jesse Mazzella
cccf3c65cc fix: don't show plot configuration for missing objects 2024-03-18 11:08:53 -07:00
5 changed files with 91 additions and 82 deletions

View File

@@ -268,7 +268,6 @@ export default {
annotatedPointsBySeries: {},
highlights: [],
annotationSelectionsBySeries: {},
annotationsEverLoaded: false,
lockHighlightPoint: false,
yKeyOptions: [],
yAxisLabel: '',
@@ -276,17 +275,14 @@ export default {
plotHistory: [],
selectedXKeyOption: {},
xKeyOptions: [],
pending: 0,
isRealTime: this.openmct.time.isRealTime(),
loaded: false,
isTimeOutOfSync: false,
isFrozenOnMouseDown: false,
cursorGuide: this.initCursorGuide,
gridLines: this.initGridLines,
yAxes: [],
hiddenYAxisIds: [],
yAxisListWithRange: [],
config: {}
yAxisListWithRange: []
};
},
computed: {
@@ -362,21 +358,19 @@ export default {
},
created() {
this.abortController = new AbortController();
},
mounted() {
this.annotationsEverLoaded = false;
this.isFrozenOnMouseDown = false;
this.pending = 0;
this.seriesModels = [];
this.config = {};
this.yAxisIdVisibility = {};
this.offsetWidth = 0;
document.addEventListener('keydown', this.handleKeyDown);
document.addEventListener('keyup', this.handleKeyUp);
eventHelpers.extend(this);
this.config = this.getConfig() || {};
this.updateMode = this.updateMode.bind(this);
this.updateDisplayBounds = this.updateDisplayBounds.bind(this);
this.setTimeContext = this.setTimeContext.bind(this);
this.config = this.getConfig();
this.yAxisIdVisibility = {};
this.offsetWidth = 0;
document.addEventListener('keydown', this.handleKeyDown);
document.addEventListener('keyup', this.handleKeyUp);
eventHelpers.extend(this);
this.yAxes = [
{
id: this.config.yAxis.id,
@@ -417,11 +411,10 @@ export default {
this.EventBus.$on('loading-complete', this.loadAnnotationsIfAllowed);
this.openmct.selection.on('change', this.updateSelection);
this.yAxisListWithRange = [this.config.yAxis, ...this.config.additionalYAxes];
this.$nextTick(() => {
this.setTimeContext();
this.loaded = true;
});
},
mounted() {
this.setTimeContext();
this.loaded = true;
},
beforeUnmount() {
this.abortController.abort();

View File

@@ -158,18 +158,23 @@ export default class PlotSeries extends Model {
}
/**
* Set defaults for telemetry series.
* @override
* @param {import('./Model').ModelOptions<PlotSeriesModelType, PlotSeriesModelOptions>} options
* Initializes the telemetry series with default settings.
* This method sets up the necessary properties and subscriptions for telemetry data handling.
*
* @param {Object} options - The options for initializing the telemetry series.
* @param {import('openmct.js').OpenMCT} options.openmct - The Open MCT instance.
* @param {import('../../../api/objects/ObjectAPI.js').DomainObject} options.domainObject - The domain object for which telemetry data is being observed.
* @param {import('./SeriesCollection.js').default} options.collection - The collection of series data.
* @param {import('./PlotConfigurationModel.js').default} options.collection.plot - The plot object associated with the series collection.
*/
initialize(options) {
this.openmct = options.openmct;
this.domainObject = options.domainObject;
initialize({ openmct, domainObject, collection: seriesCollection }) {
this.openmct = openmct;
this.domainObject = domainObject;
this.keyString = this.openmct.objects.makeKeyString(this.domainObject.identifier);
this.dataStoreId = `data-${options.collection.plot.id}-${this.keyString}`;
this.dataStoreId = `data-${seriesCollection.plot.id}-${this.keyString}`;
this.updateSeriesData([]);
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(options.domainObject);
this.limitDefinition = this.openmct.telemetry.limitDefinition(options.domainObject);
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(this.domainObject);
this.limitDefinition = this.openmct.telemetry.limitDefinition(this.domainObject);
this.limits = [];
this.openmct.time.on('bounds', this.updateLimits);
this.removeMutationListener = this.openmct.objects.observe(

View File

@@ -23,7 +23,11 @@
<div v-if="loaded" class="js-plot-options-browse">
<ul v-if="!isStackedPlotObject" class="c-tree" aria-label="Plot Series Properties">
<h2 class="--first" title="Plot series display properties in this object">Plot Series</h2>
<PlotOptionsItem v-for="series in plotSeries" :key="series.keyString" :series="series" />
<PlotOptionsItem
v-for="series in nonMissingPlotSeries"
:key="series.keyString"
:series="series"
/>
</ul>
<div v-if="plotSeries.length && !isStackedPlotObject" class="grid-properties">
<ul
@@ -154,6 +158,11 @@ export default {
};
},
computed: {
nonMissingPlotSeries() {
return this.plotSeries.filter(
(series) => !this.openmct.objects.isMissing(series.domainObject)
);
},
isNestedWithinAStackedPlot() {
return this.path.find(
(pathObject, pathObjIndex) =>

View File

@@ -23,7 +23,7 @@
<div v-if="loaded" class="js-plot-options-edit">
<ul v-if="!isStackedPlotObject" class="c-tree" aria-label="Plot Series Properties">
<h2 class="--first" title="Display properties for this object">Plot Series</h2>
<li v-for="series in plotSeries" :key="series.keyString">
<li v-for="series in nonMissingPlotSeries" :key="series.keyString">
<series-form :series="series" @series-updated="updateSeriesConfigForObject" />
</li>
</ul>
@@ -70,6 +70,11 @@ export default {
};
},
computed: {
nonMissingPlotSeries() {
return this.plotSeries.filter(
(series) => !this.openmct.objects.isMissing(series.domainObject)
);
},
isStackedPlotNestedObject() {
return this.path.find(
(pathObject, pathObjIndex) =>

View File

@@ -199,7 +199,53 @@ export default {
}
},
created() {
this.initialize();
this.fields = [
{
modelProp: 'yKey',
objectPath: this.dynamicPathForKey('yKey')
},
{
modelProp: 'interpolate',
objectPath: this.dynamicPathForKey('interpolate')
},
{
modelProp: 'markers',
objectPath: this.dynamicPathForKey('markers')
},
{
modelProp: 'markerShape',
objectPath: this.dynamicPathForKey('markerShape')
},
{
modelProp: 'markerSize',
coerce: Number,
objectPath: this.dynamicPathForKey('markerSize')
},
{
modelProp: 'alarmMarkers',
coerce: Boolean,
objectPath: this.dynamicPathForKey('alarmMarkers')
},
{
modelProp: 'limitLines',
coerce: Boolean,
objectPath: this.dynamicPathForKey('limitLines')
}
];
const metadata = this.series.metadata;
this.yKeyOptions = metadata.valuesForHints(['range']).map(function (o) {
return {
name: o.key,
value: o.key
};
});
this.markerShapeOptions = Object.entries(MARKER_SHAPES).map(([key, obj]) => {
return {
name: obj.label,
value: key
};
});
this.status = this.openmct.status.get(this.series.domainObject.identifier);
this.removeStatusListener = this.openmct.status.observe(
@@ -213,55 +259,6 @@ export default {
}
},
methods: {
initialize() {
this.fields = [
{
modelProp: 'yKey',
objectPath: this.dynamicPathForKey('yKey')
},
{
modelProp: 'interpolate',
objectPath: this.dynamicPathForKey('interpolate')
},
{
modelProp: 'markers',
objectPath: this.dynamicPathForKey('markers')
},
{
modelProp: 'markerShape',
objectPath: this.dynamicPathForKey('markerShape')
},
{
modelProp: 'markerSize',
coerce: Number,
objectPath: this.dynamicPathForKey('markerSize')
},
{
modelProp: 'alarmMarkers',
coerce: Boolean,
objectPath: this.dynamicPathForKey('alarmMarkers')
},
{
modelProp: 'limitLines',
coerce: Boolean,
objectPath: this.dynamicPathForKey('limitLines')
}
];
const metadata = this.series.metadata;
this.yKeyOptions = metadata.valuesForHints(['range']).map(function (o) {
return {
name: o.key,
value: o.key
};
});
this.markerShapeOptions = Object.entries(MARKER_SHAPES).map(([key, obj]) => {
return {
name: obj.label,
value: key
};
});
},
dynamicPathForKey(key) {
return function (object, model) {
const modelIdentifier = model.get('identifier');