Implement customizable dusk and dawn offsets.

Authored by TallFurryMan on Sep 19 2019, 5:03 AM.

Description

Implement customizable dusk and dawn offsets.

Summary:
Customizable dusk and dawn offsets introduce two new Ekos options, located in the Scheduler option pane.
Dusk (resp. dawn) offset will apply a positive or negative hour offset to today's astronomical dusk (resp. dawn) when scheduling observation jobs.
The dawn offset and the pre-dawn offset are cumulative, but the dawn offset allows an earlier or later dawn to be used both while scheduling and executing.

The resulting dusk-to-dawn interval is displayed in the Scheduler UI on the right side of the Twilight checkbox.
If the Twilight restriction is checked, the modified dusk and dawn values will be used to schedule the observation job to night time.
If the Twilight restriction is not checked, the observation job will not depend on night time and the modified dusk and dawn will be ineffective in scheduling that job.

The dusk and dawn offsets can be modified from the Ekos Scheduler options, and the night time interval displayed in the Scheduler UI will be updated when applying the changes in that dialog.

Additionally, if the Scheduler is not running, jobs will be re-evaluated to take the new dusk and dawn values into account.
However, jobs will only effectively update their schedule if the night time constrain them to do so, not if the night time restriction relaxes.

Notes:

  • This differential relocates and resizes some UI gadgets to slightly improve the presentation.
  • UI is rehauled to resize properly, but no further attempt is made to enhance it (well, it's a rehaul though). Especially, tab order is still broken.
  • Night interval is displayed in 24-hour format, it is not straightforward to display locale-compliant hour/minute strings with Qt.

Test Plan:
Checking the night interval UI:

  • Open Ekos, switch to the Scheduler pane.
  • Locate the night interval on the right side of the Twilight Restriction checkbox.
  • Open Ekos options, switch to the Scheduler pane.
  • Locate the dusk and dawn offset editboxes.
  • Update the values, check that applying option changes updates the night interval on the Scheduler UI (use Apply and OK buttons).
  • Update the values, check that dismissing option changes without applying retain the night interval that was set previously.

Checking the job schedule update:

  • Add an ASAP observation job that is schedulable today at dusk, with Twilight Restriction enforced.
  • Check that the job is scheduled inside the night interval displayed in the UI.
  • Restrict the night time to a smaller interval using the dusk offset in the Ekos Scheduler options, and apply changes.
  • Verify that the job is properly re-scheduled inside the night interval.
  • Relax the night time to a larger interval using the dusk offset in the Ekos Scheduler options, and apply changes.
  • Verify that the job is not re-scheduled, and retain its startup time.
  • Manually refresh the job schedule, verify that the job is re-scheduled at the updated dusk.
  • Execute the same steps with the Scheduler running, verify the Scheduler falls asleep waiting for the observation job, and that the schedule is retained.
  • Verify that the job is not rescheduled until it is supposed to start:
  • If the job is restricted to start later, it is effectively re-scheduled to a later date.
  • If the job is relaxed to start earlier, it is effectively starting at the present time, and not re-scheduled to start earlier on a later day.

Reviewers: mutlaqja, wreissenberger, alexcherney

Reviewed By: mutlaqja, wreissenberger, alexcherney

Subscribers: kde-edu

Tags: KDE Edu

Differential Revision: https://phabricator.kde.org/D23869

Details

Committed
mutlaqjaSep 19 2019, 5:03 AM
Reviewer
mutlaqja
Differential Revision
D23869: Implement customizable dusk and dawn offsets.
Parents
R321:cefa36d912dd: Add websocket command to toggle filter wheel
Branches
Unknown
Tags
Unknown