summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-07-20 00:28:57 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-07-20 00:28:57 (GMT)
commit031907ff7d737d7a7cfcae4520900cad04ddc6f3 (patch)
tree57da3dad789c43c8e567c91df1376f0fbaf2f0fe
parentfe83ee8524d355b46ca29e79679cf63834daead7 (diff)
Handle bin regardless of which valid ccd and mount values we currently have
-rw-r--r--kstars/ekos/guide.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/kstars/ekos/guide.cpp b/kstars/ekos/guide.cpp
index 495cc82..9bfb64d 100644
--- a/kstars/ekos/guide.cpp
+++ b/kstars/ekos/guide.cpp
@@ -311,42 +311,42 @@ void Guide::syncTelescopeInfo()
void Guide::updateGuideParams()
{
- if (ccd_hor_pixel != -1 && ccd_ver_pixel != -1 && focal_length != -1 && aperture != -1)
- {
- pmath->set_guider_params(ccd_hor_pixel, ccd_ver_pixel, aperture, focal_length);
- phd2->setCCDMountParams(ccd_hor_pixel, ccd_ver_pixel, focal_length);
+ if (currentCCD->hasGuideHead() == false)
+ useGuideHead = false;
- int x,y,w,h;
+ ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD);
- if (currentCCD->hasGuideHead() == false)
- useGuideHead = false;
+ if (targetChip == NULL)
+ {
+ appendLogText(i18n("Connection to the guide CCD is lost."));
+ return;
+ }
- ISD::CCDChip *targetChip = currentCCD->getChip(useGuideHead ? ISD::CCDChip::GUIDE_CCD : ISD::CCDChip::PRIMARY_CCD);
+ binningCombo->setEnabled(targetChip->canBin());
+ if (targetChip->canBin())
+ {
+ int binX,binY, maxBinX, maxBinY;
+ targetChip->getBinning(&binX, &binY);
+ targetChip->getMaxBin(&maxBinX, &maxBinY);
- if (targetChip == NULL)
- {
- appendLogText(i18n("Connection to the guide CCD is lost."));
- return;
- }
+ binningCombo->disconnect();
- binningCombo->setEnabled(targetChip->canBin());
- if (targetChip->canBin())
- {
- int binX,binY, maxBinX, maxBinY;
- targetChip->getBinning(&binX, &binY);
- targetChip->getMaxBin(&maxBinX, &maxBinY);
+ binningCombo->clear();
- binningCombo->disconnect();
+ for (int i=1; i <= maxBinX; i++)
+ binningCombo->addItem(QString("%1x%2").arg(i).arg(i));
- binningCombo->clear();
+ binningCombo->setCurrentIndex(binX-1);
- for (int i=1; i <= maxBinX; i++)
- binningCombo->addItem(QString("%1x%2").arg(i).arg(i));
+ connect(binningCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCCDBin(int)));
+ }
- binningCombo->setCurrentIndex(binX-1);
+ if (ccd_hor_pixel != -1 && ccd_ver_pixel != -1 && focal_length != -1 && aperture != -1)
+ {
+ pmath->set_guider_params(ccd_hor_pixel, ccd_ver_pixel, aperture, focal_length);
+ phd2->setCCDMountParams(ccd_hor_pixel, ccd_ver_pixel, focal_length);
- connect(binningCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCCDBin(int)));
- }
+ int x,y,w,h;
emit guideChipUpdated(targetChip);