Restarting looping schedule continues capturing
ClosedPublic

Authored by wreissenberger on Aug 19 2018, 12:32 PM.

Details

Summary

When a schedule is started that is looping AND there are already existing images in the target directory,
the capture module refuses to continue and signals that there exist already sufficent images - which
should be never the case for looping schedules.

Test Plan

Take any schedule where the sequence is repeated infinitely often. Start it and let it run for at least
one cycle. Then abort it and restart it. Switch to the capture tab and see, that no more images will be
taken.

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added a project: KDE Edu. · View Herald TranscriptAug 19 2018, 12:32 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
wreissenberger requested review of this revision.Aug 19 2018, 12:32 PM
TallFurryMan requested changes to this revision.Aug 19 2018, 1:15 PM

I don't understand the relation between ignoreJobProgress and the loop configuration of the scheduler job. If the Scheduler is causing the Capture module to consider all captures are complete, the the problem is in capturedFramesMap, not in that flag.

Besides, I strongly believe that this flag should NOT be used anymore in the Capture module. It should be moved from the Capture settings to the Scheduler settings. The rule that I think must be enforced is : unconditionally capture when the user uses the Capture module directly, honor the flag when the Scheduler uses the Capture module.

This revision now requires changes to proceed.Aug 19 2018, 1:15 PM

OK, makes sense. My thought was that ignoreJobProgress was set via ignoreSequenceHistory() from Scheduler for infinite looping jobs, but never used in Capture.
I'll revert the change and shift this as proposed to Scheduler.

Scheduler does not set captured frames map for SchedulerJob::FINISH_LOOP jobs.

Instead of changing Capture to ignore the captured frames map, the map is not set for
those scheduler jobs that loop until termination.

Hm, it seems like my code changes did not find their way to this differential. Here is what I did:

wolfgang@debianlive:~/sterne-jaeger/git/kstars-master$ arc diff --update D14928
You have uncommitted changes in this working copy.

  Working copy: /home/wolfgang/sterne-jaeger/git/kstars-master/

  Unstaged changes in working copy:
    kstars/ekos/scheduler/scheduler.cpp

    Do you want to amend this change to the current commit? [y/N] y

Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
 SKIP STAGING  Unable to determine repository for this change.
Updated an existing Differential revision:
        Revision URI: https://phabricator.kde.org/D14928

Included changes:
  M       kstars/ekos/capture/capture.cpp
  M       kstars/ekos/scheduler/scheduler.cpp
wolfgang@debianlive:~/sterne-jaeger/git/kstars-master$

Any hints?

First, make sure you create a development branch, and that this branch tracks the master branch, either local or remote. "arc diff" will push commits up to the fork point. Or you can use "arc diff <fork point>", such as "arc diff master" if you checked out "kde/master" locally.

So FINISH_LOOP does not fill a capture map? Well that makes sense, I wasn't sure I had done something there. But in that case, what happens in the Capture module? I would expect it to act as if all items were set to zero!

Aaaa, it seems like my changes now made it into the Phabricator.
I simply leave the captured frames map empty for SchedulerJob::FINISH_LOOP. The Capture module remains untouched. The behavior in the capture module is quite simple: since it does not find the signature in the captured frames map, it assumes that there are no frames - i.e. it simply executes the entire set - as desired. Quite simple...

TallFurryMan requested changes to this revision.Aug 19 2018, 8:40 PM
TallFurryMan added inline comments.
kstars/ekos/scheduler/scheduler.cpp
4454–4455

I propose you use a switch case so that we don't forget the special situation of FINISH_LOOP. I think we should also do the same for FINISH_AT, as there are no requirements on captures there neither.

This revision now requires changes to proceed.Aug 19 2018, 8:40 PM

Captured frames map not handed over for FINISH_LOOP and FINISH_AT
Additionally, switch statement used instead of a simple if clause.

Excellent, let me test that tonight :)

Took the liberty to pick that differential up to squash changes and rebase onto master.
Tested OK for both FINISH_LOOP and FINISH_AT, good to go.

TallFurryMan accepted this revision.Sep 4 2018, 12:25 PM
This revision is now accepted and ready to land.Sep 4 2018, 12:25 PM
TallFurryMan commandeered this revision.Sep 4 2018, 12:25 PM
TallFurryMan edited reviewers, added: wreissenberger; removed: TallFurryMan.
This revision now requires review to proceed.Sep 4 2018, 12:25 PM
TallFurryMan planned changes to this revision.Sep 4 2018, 12:27 PM

Missed the connection management loss, repushing.

Fixed incorrect conflict resolution on connection loss management.

@wreissenberger Please commandeer this differential to get ownership back, so that your name appears in the commit (ah, phabricator...).

wreissenberger commandeered this revision.Sep 4 2018, 3:29 PM
wreissenberger edited reviewers, added: TallFurryMan; removed: wreissenberger.

Thanks for your rebasing, Eric!

TallFurryMan accepted this revision.Sep 7 2018, 6:49 AM
This revision is now accepted and ready to land.Sep 7 2018, 6:49 AM
mutlaqja accepted this revision.Sep 7 2018, 8:38 AM
This revision was automatically updated to reflect the committed changes.