Commit 842a7102 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Do not run checkCCD if the module is busy as this might end up disconnecting...

parent 102d2563
Pipeline #87762 passed with stage
in 6 minutes and 34 seconds
......@@ -747,6 +747,26 @@ void Align::setDefaultCCD(QString ccd)
void Align::checkCCD(int ccdNum)
{
// Do NOT perform checks if align is in progress as this may result
// in signals/slots getting disconnected.
switch (state)
{
// Idle, camera change is OK.
case ALIGN_IDLE:
case ALIGN_COMPLETE:
case ALIGN_FAILED:
case ALIGN_ABORTED:
break;
// Busy, camera change is not OK.
case ALIGN_PROGRESS:
case ALIGN_SYNCING:
case ALIGN_SLEWING:
case ALIGN_SUSPENDED:
return;
}
if (ccdNum == -1 || ccdNum >= CCDs.count())
{
ccdNum = CCDCaptureCombo->currentIndex();
......
......@@ -222,6 +222,25 @@ QString Focus::camera()
void Focus::checkCCD(int ccdNum)
{
// Do NOT perform checks when the camera is capturing or busy as this may result
// in signals/slots getting disconnected.
switch (state)
{
// Idle, can change camera.
case FOCUS_IDLE:
case FOCUS_COMPLETE:
case FOCUS_FAILED:
case FOCUS_ABORTED:
break;
// Busy, cannot change camera.
case FOCUS_WAITING:
case FOCUS_PROGRESS:
case FOCUS_FRAMING:
case FOCUS_CHANGING_FILTER:
return;
}
if (ccdNum == -1)
{
ccdNum = CCDCaptureCombo->currentIndex();
......
......@@ -443,9 +443,40 @@ QString Guide::camera()
void Guide::checkCCD(int ccdNum)
{
// Do NOT perform checks when the camera is capturing as this may result
// in signals/slots getting disconnected.
if (guiderType != GUIDE_INTERNAL)
return;
switch (state)
{
// Not busy, camera change is OK
case GUIDE_IDLE:
case GUIDE_ABORTED:
case GUIDE_CONNECTED:
case GUIDE_DISCONNECTED:
case GUIDE_CALIBRATION_ERROR:
break;
// Busy, camera change is not OK
case GUIDE_CAPTURE:
case GUIDE_LOOPING:
case GUIDE_DARK:
case GUIDE_SUBFRAME:
case GUIDE_STAR_SELECT:
case GUIDE_CALIBRATING:
case GUIDE_CALIBRATION_SUCESS:
case GUIDE_GUIDING:
case GUIDE_SUSPENDED:
case GUIDE_REACQUIRE:
case GUIDE_DITHERING:
case GUIDE_MANUAL_DITHERING:
case GUIDE_DITHERING_ERROR:
case GUIDE_DITHERING_SUCCESS:
case GUIDE_DITHERING_SETTLE:
return;
}
if (ccdNum == -1)
{
ccdNum = guiderCombo->currentIndex();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment