issue with MR prevent duplicate focus execution

Hy Murveit murveit at gmail.com
Thu Dec 10 20:15:23 GMT 2020


Eric,

I stumbled on this issue with your recent MR. "prevent duplicate focus
execution"
https://invent.kde.org/education/kstars/-/merge_requests/141

Basically, focus fails (no stars detected for reasons unimportant here),
goes back to its initial position,  and decides to restart,
but when it restarts it says it can't restart because autofocus is already
running!

I guess when it decides to restart itself, it probably needs to deal with
the inAutoFocus variable somehow
Perhaps it's as simple as just setting inAutoFocus to false before the call
to start() on lines 2651, 2688, 2726, 2748,

However, since you've looked at this logic recently, I think you're in a
better position
to make this change (or just tell me that my suggestion looks OK and I can
send in that MR).

Hy

Log:
https://drive.google.com/file/d/1CF89JedlhJ3e5BHkebZHbALDiS_Unm2S/view?usp=sharing

Snippets from the above log:

[2020-12-10T03:31:17.161 PST DEBG ][     org.kde.kstars.ekos.focus] - Focus
newFITS # 1 : Current HFR  -1  Num stars  0
[2020-12-10T03:31:17.288 PST INFO ][     org.kde.kstars.ekos.focus] -
"Failed to detect any stars. Reset frame and try again."
[2020-12-10T03:31:17.289 PST INFO ][     org.kde.kstars.ekos.focus] -
"Focus procedure completed after 8 iterations."
[2020-12-10T03:31:17.289 PST DEBG ][     org.kde.kstars.ekos.focus] -
Stopping Focus

[2020-12-10T03:31:17.289 PST DEBG ][     org.kde.kstars.ekos.focus] -
Stopping Focus
[2020-12-10T03:31:17.318 PST DEBG ][   org.kde.kstars.ekos.capture] -
Guiding state changed from "Suspended" to "Guiding"
[2020-12-10T03:31:17.319 PST INFO ][     org.kde.kstars.ekos.guide] -
"Guiding resumed."
[2020-12-10T03:31:17.319 PST DEBG ][     org.kde.kstars.ekos.guide] -
Capturing frame...
[2020-12-10T03:31:17.319 PST DEBG ][     org.kde.kstars.ekos.focus] -
State: "Aborted"
[2020-12-10T03:31:17.320 PST DEBG ][   org.kde.kstars.ekos.capture] -
setFocusStatus:  3
[2020-12-10T03:31:17.321 PST DEBG ][ org.kde.kstars.ekos.scheduler] - Guide
State "Guiding"
[2020-12-10T03:31:17.323 PST DEBG ][     org.kde.kstars.ekos.focus] -
AutoFocus result: false
[2020-12-10T03:31:17.324 PST INFO ][     org.kde.kstars.ekos.focus] -
"Autofocus failed, moving back to initial focus position 11592."
[2020-12-10T03:31:17.324 PST DEBG ][     org.kde.kstars.ekos.focus] - Frame
is reset. X: 0 Y: 0 W: 4656 H: 3520 binX: 1 binY: 1
[2020-12-10T03:31:17.349 PST DEBG ][     org.kde.kstars.ekos.focus] -
Settled. State: "Failed"
[2020-12-10T03:31:17.350 PST DEBG ][     org.kde.kstars.ekos.focus] - Check
Focus requested with minimum required HFR 0.01
[2020-12-10T03:31:17.350 PST DEBG ][   org.kde.kstars.ekos.capture] -
setFocusStatus:  5

[2020-12-10T03:31:17.669 PST DEBG ][     org.kde.kstars.ekos.focus] - Abs
Focuser position changed to  12327  (state =  2 )
[2020-12-10T03:31:18.213 PST DEBG ][     org.kde.kstars.ekos.focus] - Abs
Focuser position changed to  12199  (state =  2 )
[2020-12-10T03:31:18.759 PST DEBG ][     org.kde.kstars.ekos.focus] - Abs
Focuser position changed to  12071  (state =  2 )
[2020-12-10T03:31:19.317 PST DEBG ][     org.kde.kstars.ekos.focus] - Abs
Focuser position changed to  11940  (state =  2 )
[2020-12-10T03:31:19.865 PST DEBG ][     org.kde.kstars.ekos.focus] - Abs
Focuser position changed to  11812  (state =  2 )
[2020-12-10T03:31:20.405 PST DEBG ][     org.kde.kstars.ekos.focus] - Abs
Focuser position changed to  11684  (state =  2 )
[2020-12-10T03:31:20.948 PST DEBG ][     org.kde.kstars.ekos.focus] - Abs
Focuser position changed to  11592  (state =  2 )
[2020-12-10T03:31:20.981 PST INFO ][     org.kde.kstars.ekos.focus] -
"Restarting autofocus process..."
[2020-12-10T03:31:20.987 PST DEBG ][     org.kde.kstars.ekos.focus] -
Starting focus with box size:  64  Subframe:  no  Autostar:  no  Full
frame:  yes  [ 25 %, 75 %]  Step Size:  25  Threshold:  150  Gaussian
Sigma:  1.5  Gaussian Kernel size:  5  Multi row average:  3  Tolerance:
 10  Frames:  1  Maximum Travel:  10000


[2020-12-10T03:31:25.388 PST DEBG ][     org.kde.kstars.ekos.focus] - Focus
newFITS # 1 : Current HFR  1.70595  Num stars  5
[2020-12-10T03:31:25.508 PST DEBG ][     org.kde.kstars.ekos.focus] -
Current HFR: 1.70595 is above required minimum HFR: 0.01 . Starting
AutoFocus...
[2020-12-10T03:31:25.508 PST INFO ][     org.kde.kstars.ekos.focus] -
"Autofocus is already running, discarding start request."
[2020-12-10T03:31:25.508 PST INFO ][     org.kde.kstars.ekos.focus] -
"Detection complete."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kstars-devel/attachments/20201210/e35476a6/attachment.htm>


More information about the Kstars-devel mailing list