summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-01 07:44:02 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-01 07:44:02 (GMT)
commit8c481c8f39662204e48f1f2838fba8a9e3c6b84e (patch)
treec7afd6b6d690af8166fac53968ab077e01d24919
parent31240e60138af9890001b38b330ff7bcc4a10498 (diff)
Cannot use UniqueConnection with labdas so going back to regular signals/slots
-rw-r--r--kstars/ekos/align/align.cpp13
-rw-r--r--kstars/ekos/align/align.h3
-rw-r--r--kstars/ekos/ekosmanager.cpp42
-rw-r--r--kstars/ekos/guide/guide.cpp33
-rw-r--r--kstars/ekos/guide/guide.h7
5 files changed, 62 insertions, 36 deletions
diff --git a/kstars/ekos/align/align.cpp b/kstars/ekos/align/align.cpp
index 4518dfe..913d3d1 100644
--- a/kstars/ekos/align/align.cpp
+++ b/kstars/ekos/align/align.cpp
@@ -1895,6 +1895,19 @@ void Align::saveSettleTime()
Options::setSettlingTime(delaySpin->value());
}
+void Align::setCaptureStatus(CaptureState newState)
+{
+ switch (newState)
+ {
+ case CAPTURE_ALIGNING:
+ QTimer::singleShot(Options::settlingTime(), this, SLOT(captureAndSolve()));
+ break;
+
+ default:
+ break;
+ }
+}
+
}
diff --git a/kstars/ekos/align/align.h b/kstars/ekos/align/align.h
index 8ec4e3c..082a85e 100644
--- a/kstars/ekos/align/align.h
+++ b/kstars/ekos/align/align.h
@@ -279,6 +279,9 @@ public slots:
// Capture
void setCaptureComplete();
+ // Update Capture Module status
+ void setCaptureStatus(Ekos::CaptureState newState);
+
private slots:
/* Solver Options */
void checkLineEdits();
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index 8a8d46a..e846f1a 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -1403,16 +1403,11 @@ void EkosManager::initCapture()
if (alignProcess)
{
- // Alignment flag
- //connect(alignProcess, SIGNAL(solverComplete(bool)), captureProcess, SLOT(enableAlignmentFlag()), Qt::UniqueConnection);
- //connect(alignProcess, SIGNAL(solverSlewComplete()), captureProcess, SLOT(checkAlignmentSlewComplete()), Qt::UniqueConnection);
-
+ // Alignment flag
connect(alignProcess, SIGNAL(newStatus(Ekos::AlignState)), captureProcess, SLOT(setAlignStatus(Ekos::AlignState)), Qt::UniqueConnection);
- // Meridian Flip
- //connect(captureProcess, SIGNAL(meridialFlipTracked()), alignProcess, SLOT(captureAndSolve()), Qt::UniqueConnection);
- connect(captureProcess, &Ekos::Capture::newStatus, this, [&](Ekos::CaptureState state){if (state == Ekos::CAPTURE_ALIGNING)
- {QTimer::singleShot(Options::settlingTime(), alignProcess, SLOT(captureAndSolve()));}}, Qt::UniqueConnection);
+ // Capture Status
+ connect(captureProcess, SIGNAL(newStatus(Ekos::CaptureState)), alignProcess, SLOT(setCaptureStatus(Ekos::CaptureState)), Qt::UniqueConnection);
}
@@ -1443,17 +1438,10 @@ void EkosManager::initAlign()
if (captureProcess)
{
- // Alignment flag
- //connect(alignProcess, SIGNAL(solverComplete(bool)), captureProcess, SLOT(enableAlignmentFlag()), Qt::UniqueConnection);
- //connect(alignProcess, SIGNAL(solverSlewComplete()), captureProcess, SLOT(checkAlignmentSlewComplete()), Qt::UniqueConnection);
-
- // Meridian Flip
- //connect(captureProcess, SIGNAL(meridialFlipTracked()), alignProcess, SLOT(captureAndSolve()), Qt::UniqueConnection);
-
+ // Align Status
connect(alignProcess, SIGNAL(newStatus(Ekos::AlignState)), captureProcess, SLOT(setAlignStatus(Ekos::AlignState)), Qt::UniqueConnection);
-
- connect(captureProcess, &Ekos::Capture::newStatus, this, [&](Ekos::CaptureState state){if (state == Ekos::CAPTURE_ALIGNING)
- {QTimer::singleShot(Options::settlingTime(), alignProcess, SLOT(captureAndSolve()));}}, Qt::UniqueConnection);
+ // Capture Status
+ connect(captureProcess, SIGNAL(newStatus(Ekos::CaptureState)), alignProcess, SLOT(setCaptureStatus(Ekos::CaptureState)), Qt::UniqueConnection);
}
if (focusProcess)
@@ -1537,8 +1525,7 @@ void EkosManager::initMount()
if (guideProcess)
{
- connect(mountProcess, &Ekos::Mount::newStatus, this, [&](ISD::Telescope::TelescopeStatus state){if (state == ISD::Telescope::MOUNT_PARKING)
- guideProcess->abort();}, Qt::UniqueConnection);
+ connect(mountProcess, SIGNAL(newStatus(ISD::Telescope::TelescopeStatus)), guideProcess, SLOT(setMountStatus(ISD::Telescope::TelescopeStatus)), Qt::UniqueConnection);
}
}
@@ -1580,15 +1567,7 @@ void EkosManager::initGuide()
connect(guideProcess, SIGNAL(newAxisDelta(double,double)), captureProcess, SLOT(setGuideDeviation(double,double)));
// Dithering
- //connect(guideProcess, SIGNAL(autoGuidingToggled(bool)), captureProcess, SLOT(setAutoguiding(bool)));
- //connect(guideProcess, SIGNAL(ditherComplete()), captureProcess, SLOT(resumeCapture()));
- //connect(guideProcess, SIGNAL(ditherFailed()), captureProcess, SLOT(abort()));
- //connect(guideProcess, SIGNAL(ditherToggled(bool)), captureProcess, SLOT(setGuideDither(bool)));
- //connect(captureProcess, SIGNAL(exposureComplete()), guideProcess, SLOT(dither()));
- //connect(captureProcess, SIGNAL(exposureComplete()), guideProcess, SLOT(dither()));
-
- connect(captureProcess, &Ekos::Capture::newStatus, this, [&](Ekos::CaptureState state){if (state == Ekos::CAPTURE_DITHERING)
- {guideProcess->dither();}}, Qt::UniqueConnection);
+ connect(captureProcess, SIGNAL(newStatus(Ekos::CaptureState)), guideProcess, SLOT(setCaptureStatus(Ekos::CaptureState)), Qt::UniqueConnection);
// Guide Head
@@ -1604,10 +1583,7 @@ void EkosManager::initGuide()
if (mountProcess)
{
// Parking
- //connect(captureProcess, SIGNAL(mountParking()), guideProcess, SLOT(stopGuiding()));
- connect(mountProcess, &Ekos::Mount::newStatus, this, [&](ISD::Telescope::TelescopeStatus state){if (state == ISD::Telescope::MOUNT_PARKING)
- guideProcess->abort();}, Qt::UniqueConnection);
-
+ connect(mountProcess, SIGNAL(newStatus(ISD::Telescope::TelescopeStatus)), guideProcess, SLOT(setMountStatus(ISD::Telescope::TelescopeStatus)), Qt::UniqueConnection);
}
if (focusProcess)
diff --git a/kstars/ekos/guide/guide.cpp b/kstars/ekos/guide/guide.cpp
index 2d9e966..bbd9765 100644
--- a/kstars/ekos/guide/guide.cpp
+++ b/kstars/ekos/guide/guide.cpp
@@ -992,6 +992,9 @@ bool Guide::guide()
bool Guide::dither()
{
+ if (state == GUIDE_DITHERING)
+ return true;
+
if (guiderType == GUIDE_INTERNAL)
{
if (state != GUIDE_GUIDING)
@@ -1025,6 +1028,32 @@ bool Guide::resume()
return false;
}
+void Guide::setCaptureStatus(CaptureState newState)
+{
+ switch (newState)
+ {
+ case CAPTURE_DITHERING:
+ dither();
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Guide::setMountStatus(ISD::Telescope::TelescopeStatus newState)
+{
+ switch (newState)
+ {
+ case ISD::Telescope::MOUNT_PARKING:
+ abort();
+ break;
+
+ default:
+ break;
+ }
+}
+
void Guide::setExposure(double value)
{
exposureIN->setValue(value);
@@ -1242,11 +1271,11 @@ void Guide::processCCDNumber(INumberVectorProperty *nvp)
}
}
-void Guide::checkExposureValue(ISD::CCDChip *targetChip, double exposure, IPState state)
+void Guide::checkExposureValue(ISD::CCDChip *targetChip, double exposure, IPState expState)
{
INDI_UNUSED(exposure);
- if (state == IPS_ALERT && (state == GUIDE_GUIDING) || (state == GUIDE_DITHERING) || (state == GUIDE_CALIBRATING))
+ if (expState == IPS_ALERT && ( (state == GUIDE_GUIDING) || (state == GUIDE_DITHERING) || (state == GUIDE_CALIBRATING)) )
{
appendLogText(i18n("Exposure failed. Restarting exposure..."));
targetChip->capture(exposureIN->value());
diff --git a/kstars/ekos/guide/guide.h b/kstars/ekos/guide/guide.h
index 98220be..cbfe329 100644
--- a/kstars/ekos/guide/guide.h
+++ b/kstars/ekos/guide/guide.h
@@ -283,7 +283,7 @@ public slots:
* @param exposure numbers of seconds left in the exposure
* @param state State of the exposure property
*/
- void checkExposureValue(ISD::CCDChip *targetChip, double exposure, IPState state);
+ void checkExposureValue(ISD::CCDChip *targetChip, double exposure, IPState expState);
/**
* @brief newFITS is called by the INDI framework whenever there is a new BLOB arriving
@@ -311,6 +311,11 @@ public slots:
// Update Guide module status
void setStatus(Ekos::GuideState newState);
+ // Update Capture Module status
+ void setCaptureStatus(Ekos::CaptureState newState);
+ // Update Mount module status
+ void setMountStatus(ISD::Telescope::TelescopeStatus newState);
+
// Star Position
void setStarPosition(const QVector3D &newCenter, bool updateNow);