<table><tr><td style="">TallFurryMan created this revision.<br />TallFurryMan added a reviewer: mutlaqja.<br />Restricted Application added a project: KDE Edu.<br />Restricted Application added a subscriber: kde-edu.<br />TallFurryMan requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D12779">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Evaluation proceeds in three isolated steps:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Scheduling jobs from altitude, moon separation and dark sky score.</li>
<li class="remarkup-list-item">Adjusting pre-scheduled jobs startup times so that they will start sequentially.</li>
<li class="remarkup-list-item">Selecting and executing the first scheduled jobs, eventually advancing its startup time.</li>
</ul>
<p>There is no need now to remove jobs which are more than 12 hours away, because those are necessarily configured by the user, not the scheduler.</p>
<p>Added original startup time to SchedulerJob. This fixes the issue where jobs were stored with their scheduled startup time instead of their original startup time in the .esl.<br />
Added a predicate in SchedulerJob to sort based on startup time. Sorting by startup time is useful after readjusting the schedule of jobs starting at the same time.<br />
Added a few automatic resets on startup time, because the possibility to control condition and time independently should be disallowed in the future.<br />
Also displayed completion time and estimated duration in the job table, either from specified time or imaging duration.<br />
User-specified startup/completion times are now marked with a chronometer icon for clarification.</p>
<p>Fixed message about jobs that passed their schedule, which was logging a weird value resulting from 1 day minus the passed delay.<br />
Also forced those past jobs to reevaluate automatically, if possible. This could be better handled with a periodic evaluation when the scheduler is not running.</p>
<p>Added a predicate in SchedulerJob to determine whether a job is a duplicate of another: same name, same sequence file because for now it only depends on capture storage.<br />
Properly made all duplicate jobs complete at the same time while the scheduler is running. This instability in the evaluation was counter-intuitive for the scheduler.<br />
Also checked for duplicate schedule jobs, warning the user that proper priority should be set, as well as repeat count now that sequence jobs properly check their storage folder.<br />
Alternately, user can disable option 'Remember Job Progress' in order to completely disregard captures when executing jobs.<br />
Added a few verifications when adding a job, warning the user when a fixed startup time is in the past or doesn't result in a positive score at that moment.</p>
<p>Made sure that dawn and dusk values are properly refreshed, before evaluation, and during the execution of the scheduler, in the case local time updates.</p>
<p>Prevented score calculation from continuing when negative. The current implementation is still incorrect, as in fact any intermediate negative score is a no-go.<br />
Check on presence of light/calibration frames is now done inside the score calculation, so that it's not forgotten.</p>
<p>Fixed widget connections in the UI, which were messing up with job data when editing an existing job.</p>
<p>Fixed processing of duplicated track-only jobs. This is an edge case, and is probably not properly fixed yet.<br />
Also fixed save of repeat count not located in the right completion case. Probably a regression?</p>
<p>Fixed regression on scheduler engaging while it is only requested to evaluate jobs.<br />
Fixed regression on capture count, observed with duplicated sequence jobs and duplicated scheduler jobs.<br />
Fixed regression on duration estimation of single sequence jobs, not properly taking scheduler job repeats into account.</p>
<p>Added eye-candy with tooltips local to job rows. There is room for improvement here.<br />
Fixed a few DBUS error messages with wrong arg number.</p>
<p>Added test vectors for the scheduler. There is room for improvement and documentation here:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">'1x1s_Lum' is a sequence with 1 luminance 1-second capture, no prefix.</li>
<li class="remarkup-list-item">'1x1s_RGBLRGB' is a sequence with red, green, blue, luminance, red, green and blue 1-second captures, in that order, prefixed with filter name, duration and timestamp. There is an issue on folders when not prefixing with filter names emphasized by this test vector.</li>
<li class="remarkup-list-item">'simple_test' targets the first stars of the KStars catalog. Objective of the test is to check how the Scheduler behaves when some targets are not achievable, and how it orders them.</li>
<li class="remarkup-list-item">'simple_test_no_twilight' is essentially the same test as 'simple_test', except that the restriction on twilight is removed. This allows the scheduler to run immediately.</li>
<li class="remarkup-list-item">'culmination_no_twilight' verifies the behavior of the Scheduler when all targets are configured to start when culminating.</li>
<li class="remarkup-list-item">'duplicated_scheduler_job_no_twilight' verifies the behavior of the Scheduler when targets are duplicated. Some of the jobs will complete simultaneously, while others will be processed according to their priority and repeat count.</li>
<li class="remarkup-list-item">'start_at_finish_at_no_twilight' verifies the behavior of the Scheduler when some jobs have user-specified startup and completion times. At the time of writing, there are several issues emphasized by this test vector</li>
</ul></div></div><br /><div><strong>TEST PLAN</strong><div><p>Use the test vectors provided in 'kstars/Tests/scheduler' to verify the behavior of the Scheduler.<br />
Sequence files are to be copied in '/tmp/kstars_tests' for those to work properly.<br />
There is still room for improvement, for sure.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R321 KStars</div></div></div><br /><div><strong>BRANCH</strong><div><div>feature__scheduled_asap_jobs (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D12779">https://phabricator.kde.org/D12779</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>Tests/scheduler/1x1s_Lum.esq<br />
Tests/scheduler/1x1s_RGBLumRGB.esq<br />
Tests/scheduler/culmination_no_twilight.esl<br />
Tests/scheduler/duplicated_scheduler_jobs_duplicated_sequence_jobs_no_twilight.esl<br />
Tests/scheduler/duplicated_scheduler_jobs_no_twilight.esl<br />
Tests/scheduler/readme.txt<br />
Tests/scheduler/simple_test.esl<br />
Tests/scheduler/simple_test_no_twilight.esl<br />
Tests/scheduler/start_at_finish_at_test.esl<br />
kstars/ekos/scheduler/scheduler.cpp<br />
kstars/ekos/scheduler/schedulerjob.cpp<br />
kstars/ekos/scheduler/schedulerjob.h</div></div></div><br /><div><strong>To: </strong>TallFurryMan, mutlaqja<br /><strong>Cc: </strong>kde-edu, narvaez, apol<br /></div>