Commit 8c481c8f authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Cannot use UniqueConnection with labdas so going back to regular signals/slots

parent 31240e60
......@@ -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;
}
}
}
......@@ -279,6 +279,9 @@ public slots:
// Capture
void setCaptureComplete();
// Update Capture Module status
void setCaptureStatus(Ekos::CaptureState newState);
private slots:
/* Solver Options */
void checkLineEdits();
......
......@@ -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)
......
......@@ -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());
......
......@@ -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);
......
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