From 7c58b19c3ec007dd1217697d12d5e77c63674cd4 Mon Sep 17 00:00:00 2001 From: Khalid Adil Date: Fri, 28 Jul 2023 00:04:42 -0500 Subject: [PATCH] Switch staleness provider for SWG to use modeChanged instead of clock (#6845) * Switch staleness provider for SWG to use modeChanged instead of clock --- example/generator/SinewaveStalenessProvider.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/example/generator/SinewaveStalenessProvider.js b/example/generator/SinewaveStalenessProvider.js index 9eda006fe1e..8819ae28caf 100644 --- a/example/generator/SinewaveStalenessProvider.js +++ b/example/generator/SinewaveStalenessProvider.js @@ -62,7 +62,7 @@ export default class SinewaveLimitProvider extends EventEmitter { const id = this.#getObjectKeyString(domainObject); if (this.#isRealTime === undefined) { - this.#updateRealTime(this.#openmct.time.clock()); + this.#updateRealTime(this.#openmct.time.getMode()); } this.#handleClockUpdate(); @@ -92,15 +92,15 @@ export default class SinewaveLimitProvider extends EventEmitter { if (observers && !this.#watchingTheClock) { this.#watchingTheClock = true; - this.#openmct.time.on('clock', this.#updateRealTime, this); + this.#openmct.time.on('modeChanged', this.#updateRealTime, this); } else if (!observers && this.#watchingTheClock) { this.#watchingTheClock = false; - this.#openmct.time.off('clock', this.#updateRealTime, this); + this.#openmct.time.off('modeChanged', this.#updateRealTime, this); } } - #updateRealTime(clock) { - this.#isRealTime = clock !== undefined; + #updateRealTime(mode) { + this.#isRealTime = mode !== 'fixed'; if (!this.#isRealTime) { Object.keys(this.#observingStaleness).forEach((id) => {