[Imagery Freshness] Update Telemetry for Imagery Freshness (#3723)

* added new spacecraftPosition keys and changed old spacecraft keys to spacecraftOriention keys, updated how freshness is determined

* due to tests, added some checks for missing related telemetry before acting on it

* lint fixes

* pr comments, change simple if to Boolean
This commit is contained in:
Jamie V
2021-03-02 16:55:27 -08:00
committed by GitHub
parent 22d32eed1d
commit 221d10d3e6
2 changed files with 35 additions and 18 deletions

View File

@@ -68,12 +68,14 @@ export default class RelatedTelemetry {
await Promise.all(
this.keys.map(async (key) => {
if (this[key].historical) {
await this._initializeHistorical(key);
}
if (this[key]) {
if (this[key].historical) {
await this._initializeHistorical(key);
}
if (this[key].realtime && this[key].realtime.telemetryObjectId) {
await this._intializeRealtime(key);
if (this[key].realtime && this[key].realtime.telemetryObjectId) {
await this._intializeRealtime(key);
}
}
})
);
@@ -153,7 +155,7 @@ export default class RelatedTelemetry {
destroy() {
this._openmct.time.off('timeSystem', this._timeSystemChange);
for (let key of this.keys) {
if (this[key].unsubscribe) {
if (this[key] && this[key].unsubscribe) {
this[key].unsubscribe();
}
}