Implement customizable dusk and dawn offsets.
Changes PlannedPublic

Authored by TallFurryMan on Wed, Sep 11, 9:05 AM.

Details

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.
  • However, no further attempt is made to enhance the UI. 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.
  • The way the option update event is propagated to Scheduler may not be ideal regarding possible future architectures.
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.

Diff Detail

Repository
R321 KStars
Branch
improve__dawn_dusk_offset (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 16370
Build 16388: arc lint + arc unit
TallFurryMan created this revision.Wed, Sep 11, 9:05 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptWed, Sep 11, 9:05 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
TallFurryMan requested review of this revision.Wed, Sep 11, 9:05 AM
wreissenberger accepted this revision.Wed, Sep 11, 1:31 PM

Very nice idea, Eric - well done!

This revision is now accepted and ready to land.Wed, Sep 11, 1:31 PM
alexcherney accepted this revision.Wed, Sep 11, 2:41 PM

great idea indeed. I look forward to using it

mutlaqja requested changes to this revision.Thu, Sep 12, 6:38 AM

why is applyConfig() needed?

kstars/ekos/scheduler/scheduler.ui
9

Must be less than 800 pixels.

This revision now requires changes to proceed.Thu, Sep 12, 6:38 AM

We need applyConfig to trigger updates in modules following a change of settings. For instance, altering lead time in the options requires a re-evaluation of the schedule. Granted, there are not so many cases for now because most procedures use options when they execute, without preview. Scheduler prepares execution and present it to the end-user for verification as a job list. Thus while the evaluation would be done again when starting the observation, and options taken into account at that moment, scheduler needs to update its presentation when options are applied to retain coherence.

kstars/ekos/scheduler/scheduler.ui
9

See my comment on D23892 on why we don't care actually.

Regarding the 800 pixels, it actually affects it and by default now we end up with more width that cannot be reduced.

For the applyConfig, maybe use this in scheduler?

m_ConfigDialog = KConfigDialog::exists("settings");
connect(m_ConfigDialog, &KConfigDialog::settingsChange, this, &Scheduler::applyConfig) ; ?

Ah you mean there is a missing restriction in the manager? I'll double check ok. Thanks for the connection example, I'll try to use that!

TallFurryMan planned changes to this revision.Thu, Sep 12, 12:33 PM