update output when comp changes

This commit is contained in:
Scott Bell 2024-10-10 10:31:16 +02:00
parent 3b78d4d2bf
commit d5ee430f8b
2 changed files with 15 additions and 1 deletions

View File

@ -345,9 +345,16 @@ export default class CompsManager extends EventEmitter {
this.emit('underlyingTelemetryUpdated', { [keyString]: newTelemetry }); this.emit('underlyingTelemetryUpdated', { [keyString]: newTelemetry });
}; };
reload() {
this.#destroy();
return this.load(this.#telemetryOptions);
}
clearData(telemetryLoadedPromise) { clearData(telemetryLoadedPromise) {
this.#loaded = false; this.#loaded = false;
this.#telemetryLoadedPromises.push(telemetryLoadedPromise); if (telemetryLoadedPromise) {
this.#telemetryLoadedPromises.push(telemetryLoadedPromise);
}
} }
setOutputFormat(outputFormat) { setOutputFormat(outputFormat) {

View File

@ -266,6 +266,7 @@ function updateParameters() {
openmct.objects.mutate(domainObject, `configuration.comps.parameters`, parameters.value); openmct.objects.mutate(domainObject, `configuration.comps.parameters`, parameters.value);
compsManager.setDomainObject(domainObject); compsManager.setDomainObject(domainObject);
applyTestData(); applyTestData();
reload();
} }
function updateAccumulateValues(parameter) { function updateAccumulateValues(parameter) {
@ -297,6 +298,7 @@ function updateExpression() {
openmct.objects.mutate(domainObject, `configuration.comps.expression`, expression.value); openmct.objects.mutate(domainObject, `configuration.comps.expression`, expression.value);
compsManager.setDomainObject(domainObject); compsManager.setDomainObject(domainObject);
applyTestData(); applyTestData();
reload();
} }
function getValueFormatter() { function getValueFormatter() {
@ -354,6 +356,11 @@ function telemetryProcessor(data) {
currentCompOutput.value = formattedOutput; currentCompOutput.value = formattedOutput;
} }
function reload() {
clearData();
outputTelemetryCollection._requestHistoricalTelemetry();
}
function clearData() { function clearData() {
currentCompOutput.value = null; currentCompOutput.value = null;
} }