From b9b4b5dec218aba46b01056e5fa23572501281c9 Mon Sep 17 00:00:00 2001 From: Edoardo Zanoni Date: Tue, 20 Feb 2024 17:22:03 +0100 Subject: [PATCH] Set IPS_OK status in checkMotionProgressCallback only after updating the position. Fixes #1999 --- drivers/focuser/sestosenso2.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/focuser/sestosenso2.cpp b/drivers/focuser/sestosenso2.cpp index ac3b753ee0..9e24e45c29 100644 --- a/drivers/focuser/sestosenso2.cpp +++ b/drivers/focuser/sestosenso2.cpp @@ -894,13 +894,11 @@ bool SestoSenso2::AbortFocuser() //////////////////////////////////////////////////////////////////////////////////////////////////////// void SestoSenso2::checkMotionProgressCallback() { + IDSetNumber(&FocusAbsPosNP, nullptr); + lastPos = FocusAbsPosN[0].value; if (isMotionComplete()) { - FocusAbsPosNP.s = IPS_OK; - FocusRelPosNP.s = IPS_OK; IDSetNumber(&FocusRelPosNP, nullptr); - IDSetNumber(&FocusAbsPosNP, nullptr); - lastPos = FocusAbsPosN[0].value; if (CalibrationSP.getState() == IPS_BUSY) { @@ -910,14 +908,11 @@ void SestoSenso2::checkMotionProgressCallback() } else LOG_INFO("Focuser reached requested position."); + FocusAbsPosNP.s = IPS_OK; + FocusRelPosNP.s = IPS_OK; return; } - else - { - IDSetNumber(&FocusAbsPosNP, nullptr); - } - lastPos = FocusAbsPosN[0].value; m_MotionProgressTimer.start(500); }