Commit 042cf321 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Double check ccdNum value

parent 187e93a2
......@@ -289,8 +289,13 @@ void Align::setDefaultCCD(QString ccd)
void Align::checkCCD(int ccdNum)
{
if (ccdNum == -1)
{
ccdNum = CCDCaptureCombo->currentIndex();
if (ccdNum == -1)
return;
}
if (ccdNum <= CCDs.count())
{
currentCCD = CCDs.at(ccdNum);
......
......@@ -410,8 +410,13 @@ bool Capture::setCCD(QString device)
void Capture::checkCCD(int ccdNum)
{
if (ccdNum == -1)
{
ccdNum = CCDCaptureCombo->currentIndex();
if (ccdNum == -1)
return;
}
foreach(ISD::CCD *ccd, CCDs)
{
disconnect(ccd, SIGNAL(numberUpdated(INumberVectorProperty*)), this, SLOT(processCCDNumber(INumberVectorProperty*)));
......
......@@ -308,8 +308,13 @@ void Focus::setDefaultCCD(QString ccd)
void Focus::checkCCD(int ccdNum)
{
if (ccdNum == -1)
{
ccdNum = CCDCaptureCombo->currentIndex();
if (ccdNum == -1)
return;
}
if (ccdNum >=0 && ccdNum <= CCDs.count())
{
currentCCD = CCDs.at(ccdNum);
......
......@@ -191,8 +191,13 @@ bool Guide::setCCD(QString device)
void Guide::checkCCD(int ccdNum)
{
if (ccdNum == -1)
{
ccdNum = guiderCombo->currentIndex();
if (ccdNum == -1)
return;
}
if (ccdNum <= CCDs.count())
{
currentCCD = CCDs.at(ccdNum);
......
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