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 });
};
reload() {
this.#destroy();
return this.load(this.#telemetryOptions);
}
clearData(telemetryLoadedPromise) {
this.#loaded = false;
this.#telemetryLoadedPromises.push(telemetryLoadedPromise);
if (telemetryLoadedPromise) {
this.#telemetryLoadedPromises.push(telemetryLoadedPromise);
}
}
setOutputFormat(outputFormat) {

View File

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