mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 07:08:12 +00:00
Adds telemetry objects on composition add
This commit is contained in:
@ -68,14 +68,20 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
|
this.composition.off('add', this.addTelemetry);
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.instantiate = this.openmct.$injector.get('instantiate');
|
this.telemetryObjs = [];
|
||||||
|
this.composition = this.openmct.composition.get(this.domainObject);
|
||||||
|
this.composition.on('add', this.addTelemetry);
|
||||||
this.conditionCollection = this.domainObject.configuration ? this.domainObject.configuration.conditionCollection : [];
|
this.conditionCollection = this.domainObject.configuration ? this.domainObject.configuration.conditionCollection : [];
|
||||||
if (!this.conditionCollection.length) {this.addCondition(true)}
|
if (!this.conditionCollection.length) {this.addCondition(true)}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
addTelemetry(domainObjectAdded) {
|
||||||
|
this.telemetryObjs.push(domainObjectAdded);
|
||||||
|
console.log(this.telemetryObjs);
|
||||||
|
},
|
||||||
addCondition(isDefault) {
|
addCondition(isDefault) {
|
||||||
if (isDefault !== true) {isDefault = false}
|
if (isDefault !== true) {isDefault = false}
|
||||||
let conditionObj = {
|
let conditionObj = {
|
||||||
@ -86,7 +92,7 @@ export default {
|
|||||||
operation: '',
|
operation: '',
|
||||||
input: '',
|
input: '',
|
||||||
metaDataKey: 'sin',
|
metaDataKey: 'sin',
|
||||||
key: '2662a903-2c3c-4e46-b2fa-2b9e35a79c8c'
|
key: isDefault ? '' : this.telemetryObjs.length ? this.openmct.objects.makeKeyString(this.telemetryObjs[0].identifier) : ''
|
||||||
}],
|
}],
|
||||||
output: 'Default test'
|
output: 'Default test'
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user