Bi-monthly release with minor bug fixes and improvements
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
diff --git a/libindi/libs/indibase/inditelescope.cpp b/libindi/libs/indibase/inditelescope.cpp
index 21e67e0..0e57333 100644
--- a/libindi/libs/indibase/inditelescope.cpp
+++ b/libindi/libs/indibase/inditelescope.cpp
@@ -992,14 +992,21 @@ bool INDI::Telescope::ISNewSwitch(const char *dev, const char *name, ISState *st
bool toPark = (ParkS[0].s == ISS_ON);
+ bool incoherentState = (toPark != IsParked);
+
if (toPark == false && TrackState != SCOPE_PARKED)
{
IUResetSwitch(&ParkSP);
ParkS[1].s = ISS_ON;
ParkSP.s = IPS_IDLE;
- DEBUG(INDI::Logger::DBG_SESSION, "Telescope already unparked.");
- IDSetSwitch(&ParkSP, nullptr);
- return true;
+ if(incoherentState)
+ DEBUG(INDI::Logger::DBG_SESSION, "Incoherent state, forcing park.");
+ else
+ {
+ DEBUG(INDI::Logger::DBG_SESSION, "Telescope already unparked.");
+ IDSetSwitch(&ParkSP, nullptr);
+ return true;
+ }
}
if (toPark && TrackState == SCOPE_PARKED)
@@ -1007,9 +1014,14 @@ bool INDI::Telescope::ISNewSwitch(const char *dev, const char *name, ISState *st
IUResetSwitch(&ParkSP);
ParkS[0].s = ISS_ON;
ParkSP.s = IPS_IDLE;
- DEBUG(INDI::Logger::DBG_SESSION, "Telescope already parked.");
- IDSetSwitch(&ParkSP, nullptr);
- return true;
+ if(incoherentState)
+ DEBUG(INDI::Logger::DBG_SESSION, "Incoherent state, forcing unpark.");
+ else
+ {
+ DEBUG(INDI::Logger::DBG_SESSION, "Telescope already parked.");
+ IDSetSwitch(&ParkSP, nullptr);
+ return true;
+ }
}
RememberTrackState = TrackState;
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.