mirror of
https://github.com/nasa/openmct.git
synced 2025-04-08 11:54:25 +00:00
Remove telemetry data cache if a telemetry endpoint is removed (#2916)
This commit is contained in:
parent
1842d3923c
commit
7dd81beb03
@ -57,7 +57,6 @@ export default class ConditionManager extends EventEmitter {
|
||||
endpoint,
|
||||
this.telemetryReceived.bind(this, id)
|
||||
);
|
||||
// TODO check if this is needed
|
||||
this.updateConditionTelemetry();
|
||||
}
|
||||
|
||||
@ -71,6 +70,7 @@ export default class ConditionManager extends EventEmitter {
|
||||
this.subscriptions[id]();
|
||||
delete this.subscriptions[id];
|
||||
delete this.telemetryObjects[id];
|
||||
this.updateConditionTelemetry();
|
||||
}
|
||||
|
||||
initialize() {
|
||||
|
@ -47,6 +47,21 @@ export default class AllTelemetryCriterion extends TelemetryCriterion {
|
||||
|
||||
updateTelemetry(telemetryObjects) {
|
||||
this.telemetryObjects = { ...telemetryObjects };
|
||||
this.removeTelemetryDataCache();
|
||||
}
|
||||
|
||||
removeTelemetryDataCache() {
|
||||
const telemetryCacheIds = Object.keys(this.telemetryDataCache);
|
||||
Object.values(this.telemetryObjects).forEach(telemetryObject => {
|
||||
const id = this.openmct.objects.makeKeyString(telemetryObject.identifier);
|
||||
const foundIndex = telemetryCacheIds.indexOf(id);
|
||||
if (foundIndex > -1) {
|
||||
telemetryCacheIds.splice(foundIndex, 1);
|
||||
}
|
||||
});
|
||||
telemetryCacheIds.forEach(id => {
|
||||
delete (this.telemetryDataCache[id]);
|
||||
});
|
||||
}
|
||||
|
||||
formatData(data, telemetryObjects) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user