<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">When running EKOS autofocus with a FocusLynx focuser, the warning "Capture called while already in progress“ appears in the log file. Here is a sample.<div class=""><br class=""></div><div class=""><div class="">[2020-05-06T22:06:56.629 CEST DEBG ][     org.kde.kstars.ekos.focus] - "Abs Focuser position changed to 17200"</div><div class="">[2020-05-06T22:06:56.674 CEST DEBG ][   org.kde.kstars.ekos.capture] - setFocusStatus:  5</div><div class="">[2020-05-06T22:06:56.675 CEST INFO ][     org.kde.kstars.ekos.focus] - "Capturing image..."</div><div class="">[2020-05-06T22:06:56.676 CEST WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.</div><div class="">[2020-05-06T22:06:56.726 CEST DEBG ][           org.kde.kstars.indi] - MI CCD G2-8300 : "[DEBUG] The Final image area is (0, 0), (3358, 2536) "</div><div class="">[2020-05-06T22:06:57.624 CEST DEBG ][           org.kde.kstars.indi] - MI CCD G2-8300 : "[DEBUG] Taking a 5.000 seconds frame... "</div><div class="">[2020-05-06T22:06:57.624 CEST DEBG ][           org.kde.kstars.indi] - MI CCD G2-8300 : "[DEBUG] Exposure in progress: Time left 5.00s "</div><div class="">[2020-05-06T22:06:57.663 CEST DEBG ][     org.kde.kstars.ekos.focus] - "processFocusNumber FOCUS_TEMPERATURE ERROR"</div><div class="">[2020-05-06T22:06:57.665 CEST DEBG ][     org.kde.kstars.ekos.focus] - "processFocusNumber ABS_FOCUS_POSITION OK"</div><div class="">[2020-05-06T22:06:57.665 CEST DEBG ][     org.kde.kstars.ekos.focus] - "Abs Focuser position changed to 17200"</div><div class="">[2020-05-06T22:06:57.673 CEST WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.</div><div class="">[2020-05-06T22:06:58.626 CEST DEBG ][           org.kde.kstars.indi] - MI CCD G2-8300 : "[DEBUG] Exposure in progress: Time left 4.00s "</div><div class="">[2020-05-06T22:06:58.673 CEST WARN ][     org.kde.kstars.ekos.focus] - Capture called while already in progress. Capture is ignored.</div><div class="">[2020-05-06T22:06:58.700 CEST DEBG ][     org.kde.kstars.ekos.focus] - "processFocusNumber FOCUS_TEMPERATURE ERROR"</div><div class="">[2020-05-06T22:06:58.702 CEST DEBG ][     org.kde.kstars.ekos.focus] - "processFocusNumber ABS_FOCUS_POSITION OK"</div><div class="">[2020-05-06T22:06:58.702 CEST DEBG ][     org.kde.kstars.ekos.focus] - "Abs Focuser position changed to 17200"</div></div><div class=""><br class=""></div><div class="">The problem seems to be that FocusLynx reports <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">ABS_FOCUS_POSITION with every refresh, i.e. typically once a second, even if the position did not change. See </span></div><div class=""><span style="color: rgb(128, 128, 0);" class="">void</span><span style="color: rgb(192, 192, 192);" class=""> </span><span style="color: rgb(128, 0, 128);" class="">FocusLynxBase</span>::<span style="font-weight: 600; font-style: italic; color: rgb(0, 103, 124);" class="">TimerHit</span>()</div>
<div class=""><br class=""></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">On the other side, the EKOS focus module tries to issue a capture() at any time it receives </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">ABS_FOCUS_POSITION with status OK:</span></div><div class="">
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><!--StartFragment--><span style=" color:#808000;" class="">void</span><span style=" color:#c0c0c0;" class=""> </span><span style=" color:#800080;" class="">Focus</span>::<span style=" font-weight:600; color:#00677c;" class="">processFocusNumber</span>(<span style=" color:#800080;" class="">INumberVectorProperty</span><span style=" color:#c0c0c0;" class=""> </span>*<span style=" color:#092e64;" class="">nvp</span>)</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class="">{</pre>
<pre style="margin-top: 0px; margin-bottom: 0px;" class="">…</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">    </span><span style=" color:#808000;" class="">if</span><span style=" color:#c0c0c0;" class=""> </span>(!<span style=" color:#00677c;" class="">strcmp</span>(<span style=" color:#092e64;" class="">nvp</span>-><span style=" color:#800000;" class="">name</span>,<span style=" color:#c0c0c0;" class=""> </span><span style=" color:#008000;" class="">"ABS_FOCUS_POSITION"</span>))</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">    </span>{</pre>…</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">        </span><span style=" color:#808000;" class="">if</span><span style=" color:#c0c0c0;" class=""> </span>(<span style=" color:#800000;" class="">canAbsMove</span><span style=" color:#c0c0c0;" class=""> </span>&&<span style=" color:#c0c0c0;" class=""> </span><span style=" color:#800000;" class="">inAutoFocus</span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">        </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">            </span><span style=" color:#00677c;" class="">autoFocusProcessPositionChange</span>(<span style=" color:#092e64;" class="">nvp</span>-><span style=" color:#800000;" class="">s</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style=" color:#c0c0c0;" class="">        </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""><!--EndFragment--></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class="">where <span style="color: rgb(0, 103, 124);" class="">autoFocusProcessPositionChange() </span>triggers</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="color: rgb(192, 192, 192);" class="">            </span><span style="color: rgb(128, 0, 128);" class="">QTimer</span>::<span style="color: rgb(0, 103, 124);" class="">singleShot</span>(<span style="color: rgb(128, 0, 0);" class="">FocusSettleTime</span>-><span style="color: rgb(0, 103, 124);" class="">value</span>()<span style="color: rgb(192, 192, 192);" class=""> </span>*<span style="color: rgb(192, 192, 192);" class=""> </span><span style="color: rgb(0, 0, 128);" class="">1000</span>,<span style="color: rgb(192, 192, 192);" class=""> </span><span style="color: rgb(128, 128, 0);" class="">this</span>,<span style="color: rgb(192, 192, 192);" class=""> </span>&<span style="color: rgb(128, 0, 128);" class="">Ekos</span>::<span style="color: rgb(128, 0, 128);" class="">Focus</span>::<span style="color: rgb(0, 103, 124);" class="">capture</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><font face="Arial" class="">My question here is where we should fix it. From my perspective, the behavior of FocusLynx is OK and we should capture this situation within EKOS focus.cpp</font></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><font face="Arial" class=""><br class=""></font></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><font face="Arial" class="">Any opinions?</font></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><font face="Arial" class=""><br class=""></font></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><font face="Arial" class="">Wolfgang</font></pre><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><pre style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""><!--EndFragment--></pre><div class=""><br class=""></div></pre><div class=""><br class=""></div>
<pre style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""><!--EndFragment--></pre><div class=""><br class=""></div></pre></div></body></html>