summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-09 18:34:34 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-09 18:34:34 (GMT)
commit6d23b0c93639ef2f9244a5bf6c8f9f07a2748e57 (patch)
treedd0344fd639bd446dd7640109872e7cd07f4664d
parent144b2f3f8ce6064e39858a1b86c20fbff5a52ffc (diff)
FIx issues when switching guiders and connecting to guider with existing guide state
-rw-r--r--kstars/ekos/guide/externalguide/linguider.cpp22
-rw-r--r--kstars/ekos/guide/guide.cpp23
-rw-r--r--kstars/ekos/guide/internalguide/internalguider.cpp2
3 files changed, 37 insertions, 10 deletions
diff --git a/kstars/ekos/guide/externalguide/linguider.cpp b/kstars/ekos/guide/externalguide/linguider.cpp
index 9ae83df..23be233 100644
--- a/kstars/ekos/guide/externalguide/linguider.cpp
+++ b/kstars/ekos/guide/externalguide/linguider.cpp
@@ -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)
{
diff --git a/kstars/ekos/guide/guide.cpp b/kstars/ekos/guide/guide.cpp
index 2333f75..f7473e5 100644
--- a/kstars/ekos/guide/guide.cpp
+++ b/kstars/ekos/guide/guide.cpp
@@ -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:
diff --git a/kstars/ekos/guide/internalguide/internalguider.cpp b/kstars/ekos/guide/internalguide/internalguider.cpp
index 2db5283..4ebbedc 100644
--- a/kstars/ekos/guide/internalguide/internalguider.cpp
+++ b/kstars/ekos/guide/internalguide/internalguider.cpp
@@ -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;
}