Summary: Connect Scheduler sleep timer to Simulation Clock scale change.

Authored by TallFurryMan on Sep 25 2019, 8:46 PM.


Summary: Connect Scheduler sleep timer to Simulation Clock scale change.

First, this differential fixes the SimClock scale change so that the change signal is emitted before actual change, providing the new scale as argument.
This enables the slot function to properly estimate the change affecting durations.

Then, it connects the scale change to the Scheduler, so that the sleep timer is recalculated when the SimClock scale updates.
Scheduler sleep duration is then computed based on the SimClock scale, and updated whenever that scale changes.
This allows to debug situations where the Scheduler is set to sleep for a long time in the future.

Warning: pausing or manually advancing the SimClock currently does not impact the sleep timer.
In that case, Scheduler will wake up at an unexpected time.

The change does not impact any other timer than the sleep timer.
The change does not scale the estimation of job duration neither, as it would cause further observations to be scheduled incorrectly far away.
However, the change has all Ekos logs use the current simulation time instead of the system time.

Test Plan:

  • Create a scheduled observation starting in two hours from now.
  • Start the Scheduler, verify it sets to sleep for two hours.
  • Change the simulation clock scale, verify a message is logged indicating the rescaled remaining time.
  • Verify Scheduler wakes up a the proper simulation time.

In that process, verify Ekos logs properly use the current simulation time.

Reviewers: wreissenberger, mutlaqja, alexcherney

Reviewed By: mutlaqja

Subscribers: kde-edu

Tags: KDE Edu

Differential Revision: