mirror of
https://github.com/nasa/openmct.git
synced 2025-02-13 14:16:29 +00:00
refactor: move to created
hook, remove initialize function
This commit is contained in:
parent
0d5041d289
commit
417ff41331
@ -199,7 +199,53 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
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.status = this.openmct.status.get(this.series.domainObject.identifier);
|
||||||
this.removeStatusListener = this.openmct.status.observe(
|
this.removeStatusListener = this.openmct.status.observe(
|
||||||
@ -213,55 +259,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
dynamicPathForKey(key) {
|
||||||
return function (object, model) {
|
return function (object, model) {
|
||||||
const modelIdentifier = model.get('identifier');
|
const modelIdentifier = model.get('identifier');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user