only listen for condition updates in telemetry provider

This commit is contained in:
David Tsay 2020-02-28 15:18:14 -08:00
parent 51c70d02d7
commit dabd0bff29
2 changed files with 3 additions and 9 deletions

View File

@ -110,7 +110,6 @@ export default {
this.composition.off('add', this.addTelemetryObject);
this.composition.off('remove', this.removeTelemetryObject);
if(this.conditionManager) {
this.conditionManager.off('conditionSetResultUpdated', this.handleOutputUpdated);
this.conditionManager.destroy();
}
if (typeof this.stopObservingForChanges === 'function') {
@ -124,7 +123,6 @@ export default {
this.composition.load();
this.conditionCollection = this.domainObject.configuration.conditionCollection;
this.conditionManager = new ConditionManager(this.domainObject, this.openmct);
this.conditionManager.on('conditionSetResultUpdated', this.handleOutputUpdated.bind(this));
this.observeForChanges();
},
methods: {
@ -179,9 +177,6 @@ export default {
dragLeave(e) {
e.target.classList.remove("dragging");
},
handleOutputUpdated(args) {
this.$emit('currentConditionSetOutputUpdated', args);
},
addTelemetryObject(domainObject) {
this.telemetryObjs.push(domainObject);
},

View File

@ -25,9 +25,7 @@
<div class="c-sw-edit__ui holder">
<CurrentOutput :output="currentConditionOutput" />
<TestData :is-editing="isEditing" />
<ConditionCollection :is-editing="isEditing"
@currentConditionSetOutputUpdated="updateCurrentOutput"
/>
<ConditionCollection :is-editing="isEditing" />
</div>
</div>
</template>
@ -66,7 +64,8 @@ export default {
this.currentConditionOutput = currentConditionResult.output;
},
provideTelemetry() {
this.stopProvidingTelemetry = this.openmct.telemetry.subscribe(this.domainObject, output => output);
this.stopProvidingTelemetry = this.openmct.telemetry
.subscribe(this.domainObject, output => { this.updateCurrentOutput(output); });
}
}
};