When calibrating, Capture does not wait for Mount to slew
When the Capture module requires the Mount module to slew the mount to a wall position as part of a calibration procedure, it checks for the end of the slew by looking at the status returned by Mount. However, if end-user approval is required (see #148, #149 (closed)), the status does not change fast enough and Capture considers the mount is done slewing before it even started moving.
case SOURCE_WALL:
if (currentTelescope)
{
if (calibrationStage < CAL_SLEWING)
{
wallCoord = activeJob->getWallCoord();
wallCoord.HorizontalToEquatorial(KStarsData::Instance()->lst(),
KStarsData::Instance()->geo()->lat());
currentTelescope->Slew(&wallCoord);
appendLogText(i18n("Mount slewing to wall position..."));
calibrationStage = CAL_SLEWING;
return IPS_BUSY;
}
// Check if slewing is complete
if (calibrationStage == CAL_SLEWING)
{
if (currentTelescope->isSlewing() == false)
{
// Disable mount tracking if supported by the driver.
currentTelescope->setTrackEnabled(false);
calibrationStage = CAL_SLEWING_COMPLETE;
appendLogText(i18n("Slew to wall position complete."));
}
else
return IPS_BUSY;
}
Because there are two pop-ups requiring end-user approval before slewing in case the wall position is under the horizon limits, the calibration procedure sees the mount is not slewing, immediately considers the procedure is complete and starts capturing.
The calibration procedure should check the coordinates of the mount before considering it completed its movement, and eventually hit a timeout if there is no movement at all.