summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-14 00:31:33 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-14 00:31:33 (GMT)
commit3642c4b76efb7620da8b86419092a50c5f1c589f (patch)
tree1702ede15c9ca70401aef4a041c3df01a921dc21
parent898be9d3eead2b90868fb12f55a10b8067423a0c (diff)
Fix setWCS enable/disable notification
-rw-r--r--kstars/ekos/align.cpp47
-rw-r--r--kstars/ekos/align.h4
2 files changed, 23 insertions, 28 deletions
diff --git a/kstars/ekos/align.cpp b/kstars/ekos/align.cpp
index c0c6bbd..0dd69e3 100644
--- a/kstars/ekos/align.cpp
+++ b/kstars/ekos/align.cpp
@@ -386,10 +386,8 @@ void Align::syncCCDInfo()
ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD);
ISwitchVectorProperty *svp = currentCCD->getBaseDevice()->getSwitch("WCS_CONTROL");
- if (svp && Options::solverWCS())
- {
- setWCS(true);
- }
+ if (svp)
+ setWCSEnabled(Options::solverWCS());
targetChip->getFrame(&x,&y,&ccd_width,&ccd_height);
binningCombo->setEnabled(targetChip->canBin());
@@ -1718,41 +1716,38 @@ void Align::processFilterNumber(INumberVectorProperty *nvp)
}
}
-void Align::setWCS(bool enable)
+void Align::setWCSEnabled(bool enable)
{
if (currentCCD == NULL)
return;
- Options::setSolverWCS(enable);
-
ISwitchVectorProperty *wcsControl = currentCCD->getBaseDevice()->getSwitch("WCS_CONTROL");
ISwitch *wcs_enable = IUFindSwitch(wcsControl, "WCS_ENABLE");
ISwitch *wcs_disable = IUFindSwitch(wcsControl, "WCS_DISABLE");
- if (wcs_enable && enable)
- appendLogText(i18n("World Coordinate System (WCS) is enabled. CCD rotation must be set either manually in the CCD driver or by solving an image before proceeding to capture any further images, otherwise the WCS information may be invalid."));
- else if (wcs_disable && !enable)
- appendLogText(i18n("World Coordinate System (WCS) is disabled."));
+ if (!wcs_enable || !wcs_disable)
+ return;
- if (wcs_enable && wcs_disable)
- {
- if ( (enable && wcs_enable->s == ISS_ON) || (!enable && wcs_disable->s == ISS_ON))
- return;
+ if ( (wcs_enable->s == ISS_ON && enable) || (wcs_disable->s == ISS_ON && !enable) )
+ return;
- IUResetSwitch(wcsControl);
- if (enable)
- wcs_enable->s = ISS_ON;
- else
- {
- wcs_disable->s = ISS_ON;
- m_wcsSynced=false;
- }
+ IUResetSwitch(wcsControl);
+ if (enable)
+ {
+ appendLogText(i18n("World Coordinate System (WCS) is enabled. CCD rotation must be set either manually in the CCD driver or by solving an image before proceeding to capture any further images, otherwise the WCS information may be invalid."));
+ wcs_enable->s = ISS_ON;
+ }
+ else
+ {
+ wcs_disable->s = ISS_ON;
+ m_wcsSynced=false;
+ appendLogText(i18n("World Coordinate System (WCS) is disabled."));
+ }
- ClientManager *clientManager = currentCCD->getDriverInfo()->getClientManager();
+ ClientManager *clientManager = currentCCD->getDriverInfo()->getClientManager();
- clientManager->sendNewSwitch(wcsControl);
- }
+ clientManager->sendNewSwitch(wcsControl);
}
void Align::checkCCDExposureProgress(ISD::CCDChip *targetChip, double remaining, IPState state)
diff --git a/kstars/ekos/align.h b/kstars/ekos/align.h
index d788890..9c265d9 100644
--- a/kstars/ekos/align.h
+++ b/kstars/ekos/align.h
@@ -254,10 +254,10 @@ public slots:
void syncTelescopeInfo();
/**
- * @brief setWCS enables/disables World Coordinate System settings in the CCD driver.
+ * @brief setWCSEnabled enables/disables World Coordinate System settings in the CCD driver.
* @param enable true to enable WCS, false to disable.
*/
- void setWCS(bool enable);
+ void setWCSEnabledEnabled(bool enable);
void setLockedFilter(ISD::GDInterface *filter, int lockedPosition);