Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DustCover open/close #2152

Merged
merged 3 commits into from
Dec 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions drivers/focuser/alluna_tcs2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ void AllunaTCS2::TimerHit()
receiveDone();
ParkCapSP.setState(IPS_OK);
ParkCapSP.apply();
getDustCover();
break;
default: // unexpected output
LOGF_INFO("TimerHit: unexpected response (%s)", res);
Expand Down Expand Up @@ -844,33 +845,43 @@ bool AllunaTCS2::getDustCover()
ParkCapSP[CAP_UNPARK].setState((value == 1) ? ISS_ON : ISS_OFF);
ParkCapSP[CAP_PARK ].setState((value != 1) ? ISS_ON : ISS_OFF);
ParkCapSP.setState(IPS_OK);
ParkCapSP.apply();

return true;
}

IPState AllunaTCS2::ParkCap()
{
if (ParkCapSP[CAP_PARK].getState() == ISS_OFF)
if (ParkCapSP[CAP_PARK].getState() == ISS_ON)
{
if (setDustCover()) // toggle state of dust cover
LOG_INFO("Toggle");
peter-englmaier marked this conversation as resolved.
Show resolved Hide resolved
if (setDustCover()) { // toggle state of dust cover
isCoverMoving = true;
return IPS_BUSY;
}
else
return IPS_ALERT;
}
getDustCover();

// Cover already parked, nothing to do
return IPS_OK;
}

IPState AllunaTCS2::UnParkCap()
{
if (ParkCapSP[CAP_UNPARK].getState() == ISS_OFF)
LOGF_INFO("UnParkCap called, state is %d %d", ParkCapSP[CAP_PARK].getState(), ParkCapSP[CAP_UNPARK].getState());
peter-englmaier marked this conversation as resolved.
Show resolved Hide resolved
if (ParkCapSP[CAP_UNPARK].getState() == ISS_ON)
{
if (setDustCover()) // toggle state of dust cover
LOG_INFO("Toggle");
if (setDustCover()) { // toggle state of dust cover
isCoverMoving = true;
return IPS_BUSY;
}
else
return IPS_ALERT;
}
getDustCover();

// Cover already unparked, nothing to do
return IPS_OK;
Expand Down
Loading