mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 17:57:04 +00:00
Switch staleness provider for SWG to use modeChanged instead of clock (#6845)
* Switch staleness provider for SWG to use modeChanged instead of clock
This commit is contained in:
parent
16e1ac2529
commit
7c58b19c3e
@ -62,7 +62,7 @@ export default class SinewaveLimitProvider extends EventEmitter {
|
|||||||
const id = this.#getObjectKeyString(domainObject);
|
const id = this.#getObjectKeyString(domainObject);
|
||||||
|
|
||||||
if (this.#isRealTime === undefined) {
|
if (this.#isRealTime === undefined) {
|
||||||
this.#updateRealTime(this.#openmct.time.clock());
|
this.#updateRealTime(this.#openmct.time.getMode());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#handleClockUpdate();
|
this.#handleClockUpdate();
|
||||||
@ -92,15 +92,15 @@ export default class SinewaveLimitProvider extends EventEmitter {
|
|||||||
|
|
||||||
if (observers && !this.#watchingTheClock) {
|
if (observers && !this.#watchingTheClock) {
|
||||||
this.#watchingTheClock = true;
|
this.#watchingTheClock = true;
|
||||||
this.#openmct.time.on('clock', this.#updateRealTime, this);
|
this.#openmct.time.on('modeChanged', this.#updateRealTime, this);
|
||||||
} else if (!observers && this.#watchingTheClock) {
|
} else if (!observers && this.#watchingTheClock) {
|
||||||
this.#watchingTheClock = false;
|
this.#watchingTheClock = false;
|
||||||
this.#openmct.time.off('clock', this.#updateRealTime, this);
|
this.#openmct.time.off('modeChanged', this.#updateRealTime, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#updateRealTime(clock) {
|
#updateRealTime(mode) {
|
||||||
this.#isRealTime = clock !== undefined;
|
this.#isRealTime = mode !== 'fixed';
|
||||||
|
|
||||||
if (!this.#isRealTime) {
|
if (!this.#isRealTime) {
|
||||||
Object.keys(this.#observingStaleness).forEach((id) => {
|
Object.keys(this.#observingStaleness).forEach((id) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user