Skip to content

Commit

Permalink
Set IPS_OK status in checkMotionProgressCallback only after updating …
Browse files Browse the repository at this point in the history
…the position. Fixes #1999
  • Loading branch information
Edoardo Zanoni committed Feb 20, 2024
1 parent 398a891 commit b9b4b5d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/focuser/sestosenso2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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);
}

Expand Down

0 comments on commit b9b4b5d

Please sign in to comment.