summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-22 10:51:39 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-22 10:51:39 (GMT)
commit270a2b74cda3ac1384cbdb4a00a4f9f9cc88bab6 (patch)
tree01f451139dc5740389b864149bad2dfa124854e0
parent1a460219cdcd179dc8a90185de82cc8baf320da3 (diff)
Get rid of unnecessary signals since it is all being tracked now by the state
-rw-r--r--kstars/ekos/guide.cpp21
-rw-r--r--kstars/ekos/guide.h8
-rw-r--r--kstars/ekos/guide/guider.cpp15
-rw-r--r--kstars/ekos/guide/guider.h6
-rw-r--r--kstars/ekos/mount.cpp2
-rw-r--r--kstars/ekos/phd2.cpp11
-rw-r--r--kstars/ekos/phd2.h8
7 files changed, 36 insertions, 35 deletions
diff --git a/kstars/ekos/guide.cpp b/kstars/ekos/guide.cpp
index f8c42d5..918d9aa 100644
--- a/kstars/ekos/guide.cpp
+++ b/kstars/ekos/guide.cpp
@@ -86,8 +86,8 @@ Guide::Guide() : QWidget()
guider = new internalGuider(pmath, this);
connect(guider, SIGNAL(ditherToggled(bool)), this, SIGNAL(ditherToggled(bool)));
- connect(guider, SIGNAL(autoGuidingToggled(bool)), this, SIGNAL(autoGuidingToggled(bool)));
- connect(guider, SIGNAL(ditherComplete()), this, SIGNAL(ditherComplete()));
+ //connect(guider, SIGNAL(autoGuidingToggled(bool)), this, SIGNAL(autoGuidingToggled(bool)));
+ //connect(guider, SIGNAL(ditherComplete()), this, SIGNAL(ditherComplete()));
connect(guider, SIGNAL(newStatus(Ekos::GuideState)), this, SLOT(setStatus(Ekos::GuideState)));
connect(guider, SIGNAL(newProfilePixmap(QPixmap &)), this, SIGNAL(newProfilePixmap(QPixmap &)));
connect(guider, SIGNAL(newStarPosition(QVector3D,bool)), this, SLOT(setStarPosition(QVector3D,bool)));
@@ -114,12 +114,13 @@ Guide::Guide() : QWidget()
connect(phd2, SIGNAL(newLog(QString)), this, SLOT(appendLogText(QString)));
connect(phd2, SIGNAL(newStatus(Ekos::GuideState)), this, SLOT(setStatus(Ekos::GuideState)));
+ connect(phd2, SIGNAL(newStatus(Ekos::GuideState)), guider, SLOT(toggleExternalGuideStateGUI(Ekos::GuideState)));
connect(phd2, SIGNAL(newAxisDelta(double,double)), this, SIGNAL(newAxisDelta(double,double)));
- connect(phd2, SIGNAL(guideReady()), this, SIGNAL(guideReady()));
- connect(phd2, SIGNAL(autoGuidingToggled(bool)), this, SIGNAL(autoGuidingToggled(bool)));
- connect(phd2, SIGNAL(autoGuidingToggled(bool)), guider, SLOT(setGuideState(bool)));
- connect(phd2, SIGNAL(ditherComplete()), this, SIGNAL(ditherComplete()));
+ //connect(phd2, SIGNAL(guideReady()), this, SIGNAL(guideReady()));
+ //connect(phd2, SIGNAL(autoGuidingToggled(bool)), this, SIGNAL(autoGuidingToggled(bool)));
+ //connect(phd2, SIGNAL(autoGuidingToggled(bool)), guider, SLOT(setGuideState(bool)));
+ //connect(phd2, SIGNAL(ditherComplete()), this, SIGNAL(ditherComplete()));
if (Options::usePHD2Guider())
phd2->connectPHD2();
@@ -576,8 +577,9 @@ void Guide::setCaptureComplete()
if (guider->dither() == false)
{
appendLogText(i18n("Dithering failed. Autoguiding aborted."));
+ emit newStatus(GUIDE_DITHERING_ERROR);
guider->abort();
- emit ditherFailed();
+ //emit ditherFailed();
}
}
else if (guider->isGuiding())
@@ -597,7 +599,7 @@ void Guide::setCaptureComplete()
{
guider->setReady(true);
tabWidget->setTabEnabled(1, true);
- emit guideReady();
+ //emit guideReady();
}
}
@@ -713,8 +715,9 @@ void Guide::processRapidStarData(ISD::CCDChip *targetChip, double dx, double dy,
if (guider->dither() == false)
{
appendLogText(i18n("Dithering failed. Autoguiding aborted."));
+ emit newStatus(GUIDE_DITHERING_ERROR);
guider->abort();
- emit ditherFailed();
+ //emit ditherFailed();
}
}
else
diff --git a/kstars/ekos/guide.h b/kstars/ekos/guide.h
index 0642ddf..73a8f8a 100644
--- a/kstars/ekos/guide.h
+++ b/kstars/ekos/guide.h
@@ -302,11 +302,11 @@ signals:
void newStarPixmap(QPixmap &);
void newProfilePixmap(QPixmap &);
- void guideReady();
+ //void guideReady();
void newAxisDelta(double delta_ra, double delta_dec);
- void autoGuidingToggled(bool);
- void ditherComplete();
- void ditherFailed();
+ //void autoGuidingToggled(bool);
+ //void ditherComplete();
+ //void ditherFailed();
void ditherToggled(bool);
void guideChipUpdated(ISD::CCDChip*);
diff --git a/kstars/ekos/guide/guider.cpp b/kstars/ekos/guide/guider.cpp
index bfc63ce..9ebd7ef 100644
--- a/kstars/ekos/guide/guider.cpp
+++ b/kstars/ekos/guide/guider.cpp
@@ -413,8 +413,6 @@ bool internalGuider::start()
if (m_useRapidGuide)
guideModule->startRapidGuide();
- emit autoGuidingToggled(true);
- // FIXME use only one signal, remove the previous one
emit newStatus(Ekos::GUIDE_GUIDING);
guideModule->setSuspended(false);
@@ -436,7 +434,7 @@ bool internalGuider::stop()
if (phd2)
{
ui.pushButton_StartStop->setText( i18n("Start Autoguide") );
- emit autoGuidingToggled(false);
+ //emit autoGuidingToggled(false);
m_isDithering = false;
m_isStarted = false;
@@ -458,8 +456,6 @@ bool internalGuider::stop()
if (m_useRapidGuide)
guideModule->stopRapidGuide();
- emit autoGuidingToggled(false);
- // FIXME use only one signal, remove the previous one
emit newStatus(Ekos::GUIDE_IDLE);
m_isDithering = false;
@@ -468,13 +464,13 @@ bool internalGuider::stop()
return true;
}
-void internalGuider::setGuideState(bool guiding)
+void internalGuider::toggleExternalGuideStateGUI(Ekos::GuideState state)
{
if (phd2 == NULL)
return;
// If not started already
- if (m_isStarted == false && guiding)
+ if (m_isStarted == false && state == Ekos::GUIDE_GUIDING)
{
m_isStarted = true;
m_useRapidGuide = ui.rapidGuideCheck->isChecked();
@@ -483,7 +479,7 @@ void internalGuider::setGuideState(bool guiding)
guideModule->appendLogText(i18n("Autoguiding started."));
}
// if already started
- else if (m_isStarted && guiding == false)
+ else if (m_isStarted && state == Ekos::GUIDE_IDLE)
{
ui.pushButton_StartStop->setText( i18n("Start Autoguide") );
}
@@ -787,7 +783,8 @@ bool internalGuider::dither()
if (Options::guideLogging())
qDebug() << "Guide: Dither complete.";
- emit ditherComplete();
+ //emit ditherComplete();
+ emit newStatus(Ekos::GUIDE_DITHERING_SUCCESS);
}
else
{
diff --git a/kstars/ekos/guide/guider.h b/kstars/ekos/guide/guider.h
index 32797db..5e1edc2 100644
--- a/kstars/ekos/guide/guider.h
+++ b/kstars/ekos/guide/guider.h
@@ -67,7 +67,7 @@ public slots:
void setPHD2Connected();
void setPHD2Disconnected();
// Only called by PHD2
- void setGuideState(bool guiding);
+ void toggleExternalGuideStateGUI(Ekos::GuideState state);
protected slots:
void onXscaleChanged( int i );
@@ -84,9 +84,9 @@ protected slots:
void onSetDECSwap(bool enable);
signals:
- void ditherComplete();
+ //void ditherComplete();
void ditherToggled(bool);
- void autoGuidingToggled(bool);
+ //void autoGuidingToggled(bool);
void newStatus(Ekos::GuideState);
void newProfilePixmap(QPixmap &);
void newStarPosition(QVector3D, bool);
diff --git a/kstars/ekos/mount.cpp b/kstars/ekos/mount.cpp
index 6d2537b..4235b75 100644
--- a/kstars/ekos/mount.cpp
+++ b/kstars/ekos/mount.cpp
@@ -262,7 +262,7 @@ void Mount::updateTelescopeCoords()
newCoords(raOUT->text(), decOUT->text(), azOUT->text(), altOUT->text());
- newStatus(currentTelescope->getStatus());
+ emit newStatus(currentTelescope->getStatus());
if (currentTelescope->isConnected() == false)
updateTimer.stop();
diff --git a/kstars/ekos/phd2.cpp b/kstars/ekos/phd2.cpp
index 3fc8f92..b64db81 100644
--- a/kstars/ekos/phd2.cpp
+++ b/kstars/ekos/phd2.cpp
@@ -252,7 +252,7 @@ void PHD2::processPHD2Event(const QJsonObject &jsonEvent)
// It goes immediately to guiding until PHD implements a calibration-only method
state = GUIDING;
emit newLog(i18n("PHD2: Calibration Complete."));
- emit guideReady();
+ //emit guideReady();
emit newStatus(Ekos::GUIDE_CALIBRATION_SUCESS);
break;
@@ -264,7 +264,7 @@ void PHD2::processPHD2Event(const QJsonObject &jsonEvent)
emit connected();
}
emit newLog(i18n("PHD2: Guiding Started."));
- emit autoGuidingToggled(true);
+ //emit autoGuidingToggled(true);
emit newStatus(Ekos::GUIDE_GUIDING);
break;
@@ -325,12 +325,13 @@ void PHD2::processPHD2Event(const QJsonObject &jsonEvent)
if (error)
{
state = DITHER_FAILED;
- emit ditherFailed();
+ //emit ditherFailed();
+ emit newStatus(GUIDE_DITHERING_ERROR);
}
else
{
state = DITHER_SUCCESSFUL;
- emit ditherComplete();
+ emit newStatus(Ekos::GUIDE_DITHERING_SUCCESS);
}
}
}
@@ -347,7 +348,7 @@ void PHD2::processPHD2Event(const QJsonObject &jsonEvent)
case GuidingStopped:
emit newLog(i18n("PHD2: Guiding Stopped."));
- emit autoGuidingToggled(false);
+ //emit autoGuidingToggled(false);
emit newStatus(Ekos::GUIDE_IDLE);
break;
diff --git a/kstars/ekos/phd2.h b/kstars/ekos/phd2.h
index c01d3b5..23fb523 100644
--- a/kstars/ekos/phd2.h
+++ b/kstars/ekos/phd2.h
@@ -71,11 +71,11 @@ signals:
void newLog(const QString &);
void connected();
void disconnected();
- void ditherComplete();
- void ditherFailed();
+ //void ditherComplete();
+ //void ditherFailed();
void newAxisDelta(double delta_ra, double delta_dec);
- void autoGuidingToggled(bool);
- void guideReady();
+ //void autoGuidingToggled(bool);
+ //void guideReady();
void newStatus(Ekos::GuideState);
private: