<html><head><style id="outgoing-font-settings">#response_container_BBPPID{font-family: initial; font-size:initial; color: initial;}</style></head><body style="background-color: rgb(255, 255, 255); background-image: initial; line-height: initial;"><div id="response_container_BBPPID" style="outline:none;" dir="auto" contenteditable="false"> <div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width:100%;"> Thanks for noticing that Hy! </div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width:100%;"><br></div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width:100%;">I was under the impression that this case was covered by the tests I added in test_ekos_focus. I do verify that an autofocus that fails does not prevent a subsequent autofocus from succeeding. </div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width:100%;"><br></div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width:100%;">Ah you are looking at the preliminary MR. Since then, we merged MR144 that fixed that situation. It is very unfortunate that v3.5.0 got out in-between. </div> <div id="blackberry_signature_BBPPID" name="BB10" dir="auto">     <div id="_signaturePlaceholder_BBPPID" name="BB10" dir="auto"><p dir="ltr">eric.dejouhanet@gmail.com - https://astronomy.dejouha.net</p></div> </div></div><div id="_original_msg_header_BBPPID" dir="auto">                                                                                                                                             <table width="100%" style="border-spacing: 0px; display: table; outline: none;" contenteditable="false"><tbody><tr><td colspan="2" style="padding: initial; font-size: initial; text-align: initial;">                           <div style="border-right: none; border-bottom: none; border-left: none; border-image: initial; border-top: 1pt solid rgb(181, 196, 223); padding: 3pt 0in 0in; font-family: Tahoma, "BB Alpha Sans", "Slate Pro"; font-size: 10pt;">  <div id="from"><b>De:</b> murveit@gmail.com</div><div id="sent"><b>Envoyé:</b> 10 décembre 2020 21:15</div><div id="to"><b>À:</b> eric.dejouhanet@gmail.com; kstars-devel@kde.org</div><div id="reply_to"><b>Répondre à:</b> hy@murveit.com</div><div id="subject"><b>Objet:</b> issue with MR prevent duplicate focus execution</div></div></td></tr></tbody></table> <br> </div><!--start of _originalContent --><div name="BB10" dir="auto" style="background-image: initial; line-height: initial; outline: none;" contenteditable="false"><div dir="ltr">Eric,<div><br></div><div>I stumbled on this issue with your recent MR. "prevent duplicate focus execution"</div><div><a href="https://invent.kde.org/education/kstars/-/merge_requests/141">https://invent.kde.org/education/kstars/-/merge_requests/141</a><br></div><div><br></div><div>Basically, focus fails (no stars detected for reasons unimportant here), goes back to its initial position,  and decides to restart, </div><div>but when it restarts it says it can't restart because autofocus is already running!</div><div><br></div><div>I guess when it decides to restart itself, it probably needs to deal with the inAutoFocus variable somehow</div><div>Perhaps it's as simple as just setting inAutoFocus to false before the call to start() on lines 2651, 2688, 2726, 2748, </div><div><br></div><div>However, since you've looked at this logic recently, I think you're in a better position</div><div>to make this change (or just tell me that my suggestion looks OK and I can send in that MR).</div><div><br></div><div>Hy</div><div><br></div><div>Log:  <a href="https://drive.google.com/file/d/1CF89JedlhJ3e5BHkebZHbALDiS_Unm2S/view?usp=sharing">https://drive.google.com/file/d/1CF89JedlhJ3e5BHkebZHbALDiS_Unm2S/view?usp=sharing</a><br></div><div><br></div><div>Snippets from the above log:</div><div><br></div><div>[2020-12-10T03:31:17.161 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Focus newFITS # 1 : Current HFR  -1  Num stars  0<br>[2020-12-10T03:31:17.288 PST INFO ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - "Failed to detect any stars. Reset frame and try again."<br>[2020-12-10T03:31:17.289 PST INFO ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - "Focus procedure completed after 8 iterations."<br>[2020-12-10T03:31:17.289 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Stopping Focus<br><br>[2020-12-10T03:31:17.289 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Stopping Focus<br>[2020-12-10T03:31:17.318 PST DEBG ][   <wbr><a href="http://org.kde.kstars.ekos.capture">org.kde.kstars.ekos.capture</a><wbr>] - Guiding state changed from "Suspended" to "Guiding"<br>[2020-12-10T03:31:17.319 PST INFO ][     <wbr><a href="http://org.kde.kstars.ekos.guide">org.kde.kstars.ekos.guide</a><wbr>] - "Guiding resumed."<br>[2020-12-10T03:31:17.319 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.guide">org.kde.kstars.ekos.guide</a><wbr>] - Capturing frame...<br>[2020-12-10T03:31:17.319 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - State: "Aborted"<br>[2020-12-10T03:31:17.320 PST DEBG ][   <wbr><a href="http://org.kde.kstars.ekos.capture">org.kde.kstars.ekos.capture</a><wbr>] - setFocusStatus:  3<br>[2020-12-10T03:31:17.321 PST DEBG ][ <wbr><a href="http://org.kde.kstars.ekos.scheduler">org.kde.kstars.ekos.scheduler</a><wbr>] - Guide State "Guiding"<br>[2020-12-10T03:31:17.323 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - AutoFocus result: false<br><span style="background-color:rgb( 255 , 255 , 0 )">[2020-12-10T03:31:17.324 PST INFO ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - "Autofocus failed, moving back to initial focus position 11592."</span><br>[2020-12-10T03:31:17.324 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Frame is reset. X: 0 Y: 0 W: 4656 H: 3520 binX: 1 binY: 1<br>[2020-12-10T03:31:17.349 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Settled. State: "Failed"<br>[2020-12-10T03:31:17.350 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Check Focus requested with minimum required HFR 0.01<br>[2020-12-10T03:31:17.350 PST DEBG ][   <wbr><a href="http://org.kde.kstars.ekos.capture">org.kde.kstars.ekos.capture</a><wbr>] - setFocusStatus:  5<br><br>[2020-12-10T03:31:17.669 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Abs Focuser position changed to  12327  (state =  2 )<br>[2020-12-10T03:31:18.213 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Abs Focuser position changed to  12199  (state =  2 )<br>[2020-12-10T03:31:18.759 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Abs Focuser position changed to  12071  (state =  2 )<br>[2020-12-10T03:31:19.317 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Abs Focuser position changed to  11940  (state =  2 )<br>[2020-12-10T03:31:19.865 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Abs Focuser position changed to  11812  (state =  2 )<br>[2020-12-10T03:31:20.405 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Abs Focuser position changed to  11684  (state =  2 )<br>[2020-12-10T03:31:20.948 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Abs Focuser position changed to  11592  (state =  2 )<br><span style="background-color:rgb( 255 , 255 , 0 )">[2020-12-10T03:31:20.981 PST INFO ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - "Restarting autofocus process..."</span><br>[2020-12-10T03:31:20.987 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - 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<br><br><br>[2020-12-10T03:31:25.388 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Focus newFITS # 1 : Current HFR  1.70595  Num stars  5<br>[2020-12-10T03:31:25.508 PST DEBG ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - Current HFR: 1.70595 is above required minimum HFR: 0.01 . Starting AutoFocus...<br><span style="background-color:rgb( 255 , 255 , 0 )">[2020-12-10T03:31:25.508 PST INFO ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - "Autofocus is already running, discarding start request."</span><br>[2020-12-10T03:31:25.508 PST INFO ][     <wbr><a href="http://org.kde.kstars.ekos.focus">org.kde.kstars.ekos.focus</a><wbr>] - "Detection complete."<br></div><div><br></div><div><br></div></div>
<!--end of _originalContent --></div></body></html>