Commit 6d23b0c9 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

FIx issues when switching guiders and connecting to guider with existing guide state

parent 144b2f3f
......@@ -140,6 +140,22 @@ void LinGuider::processResponse(LinGuiderCommand command, const QString &reply)
emit newLog(i18n("Only LinGuider v4.1.0 or higher is supported. Please upgrade LinGuider and try again."));
Disconnect();
}
sendCommand(GET_GUIDER_STATE);
break;
case GET_GUIDER_STATE:
if (reply == "GUIDING")
{
state = GUIDING;
emit newStatus(GUIDE_GUIDING);
deviationTimer.start();
}
else
{
state = IDLE;
deviationTimer.stop();
}
break;
case FIND_STAR:
......@@ -212,6 +228,12 @@ void LinGuider::processResponse(LinGuiderCommand command, const QString &reply)
case GET_RA_DEC_DRIFT:
{
if (state != GUIDING)
{
state = GUIDING;
emit newStatus(GUIDE_GUIDING);
}
QStringList pos = reply.split(' ');
if (pos.count() == 2)
{
......
......@@ -949,14 +949,6 @@ bool Guide::guide()
bool rc = guider->guide();
if (rc)
{
driftGraph->graph(0)->data().clear();
driftGraph->graph(1)->data().clear();
guideTimer = QTime::currentTime();
refreshColorScheme();
}
return rc;
}
......@@ -1120,6 +1112,11 @@ void Guide::setStatus(Ekos::GuideState newState)
{
appendLogText(i18n("Autoguiding started."));
setBusy(true);
driftGraph->graph(0)->data().clear();
driftGraph->graph(1)->data().clear();
guideTimer = QTime::currentTime();
refreshColorScheme();
}
break;
......@@ -1289,7 +1286,8 @@ bool Guide::setGuiderType(int type)
currentCCD->getDriverInfo()->getClientManager()->setBLOBMode(B_ALSO, currentCCD->getDeviceName(), useGuideHead ? "CCD2" : "CCD1");
}
calibrateB->setEnabled(true);
calibrateB->setEnabled(true);
guideB->setEnabled(false);
captureB->setEnabled(true);
darkFrameCheck->setEnabled(true);
subFrameCheck->setEnabled(true);
......@@ -1298,6 +1296,8 @@ bool Guide::setGuiderType(int type)
externalDisconnectB->setEnabled(false);
controlGroup->setEnabled(true);
updateGuideParams();
}
break;
......@@ -1859,7 +1859,12 @@ bool Guide::executeOperationStack()
setBusy(true);
}
else
{
emit newStatus(GUIDE_CALIBRATION_ERROR);
state = GUIDE_IDLE;
appendLogText(i18n("Calibration failed to start!"));
setBusy(false);
}
break;
default:
......
......@@ -248,7 +248,7 @@ bool InternalGuider::calibrate()
if (ccdInfo == false || scopeInfo == false)
{
KMessageBox::error(NULL, i18n("Missing Information"), i18n("%1 info are missing. Please set the values in INDI Control Panel.", errMsg));
KMessageBox::error(NULL, i18n("%1 info are missing. Please set the values in INDI Control Panel.", errMsg), i18n("Missing Information"));
return false;
}
......
Supports Markdown
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