mirror of
https://github.com/nasa/openmct.git
synced 2025-06-05 09:00:49 +00:00
[Time] Tick when clock set
Update time API to tick immediately after setting a clock using the currentValue of the clock. This ensures that bounds will be set when the clock is set, instead of waiting for the next tick to occur. fixes https://github.com/nasa/openmct/issues/1582
This commit is contained in:
parent
eb7f78799d
commit
344a325cb5
@ -366,11 +366,6 @@ define(['EventEmitter'], function (EventEmitter) {
|
|||||||
|
|
||||||
this.activeClock = clock;
|
this.activeClock = clock;
|
||||||
|
|
||||||
if (this.activeClock !== undefined) {
|
|
||||||
this.offsets = offsets;
|
|
||||||
this.activeClock.on("tick", this.tick);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The active clock has changed. Clock can be unset by calling {@link stopClock}
|
* The active clock has changed. Clock can be unset by calling {@link stopClock}
|
||||||
* @event clock
|
* @event clock
|
||||||
@ -380,6 +375,11 @@ define(['EventEmitter'], function (EventEmitter) {
|
|||||||
*/
|
*/
|
||||||
this.emit("clock", this.activeClock);
|
this.emit("clock", this.activeClock);
|
||||||
|
|
||||||
|
if (this.activeClock !== undefined) {
|
||||||
|
this.clockOffsets(offsets);
|
||||||
|
this.activeClock.on("tick", this.tick);
|
||||||
|
}
|
||||||
|
|
||||||
} else if (arguments.length === 1) {
|
} else if (arguments.length === 1) {
|
||||||
throw "When setting the clock, clock offsets must also be provided";
|
throw "When setting the clock, clock offsets must also be provided";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user