summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-27 22:26:36 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-27 22:26:36 (GMT)
commitc027f6849a6ed67dc258a2e0078a112314d2b713 (patch)
tree95920efd469fce64c53007ee1d8cff0630f12474
parent51270088d1d51570867cefffd2c34d60c188756b (diff)
Call checkCCD if CCD_TEMPERATURE permission is not RO otherwise no need. Reset frame to zero in case we have invalid limits
-rw-r--r--kstars/ekos/capture/capture.cpp51
-rw-r--r--kstars/ekos/capture/capture.h2
2 files changed, 45 insertions, 8 deletions
diff --git a/kstars/ekos/capture/capture.cpp b/kstars/ekos/capture/capture.cpp
index 8273a93..28f36e0 100644
--- a/kstars/ekos/capture/capture.cpp
+++ b/kstars/ekos/capture/capture.cpp
@@ -521,7 +521,6 @@ void Capture::checkCCD(int ccdNum)
if (currentCCD->hasCooler())
{
-
temperatureCheck->setEnabled(true);
temperatureIN->setEnabled(true);
@@ -538,7 +537,6 @@ void Capture::checkCCD(int ccdNum)
}
else
{
- temperatureOUT->clear();
setTemperatureB->setEnabled(false);
temperatureIN->setReadOnly(true);
temperatureCheck->setEnabled(false);
@@ -557,6 +555,7 @@ void Capture::checkCCD(int ccdNum)
temperatureCheck->setEnabled(false);
temperatureIN->setEnabled(false);
temperatureIN->clear();
+ temperatureOUT->clear();
setTemperatureB->setEnabled(false);
}
@@ -597,6 +596,25 @@ void Capture::checkCCD(int ccdNum)
}
}
+void Capture::resetFrameToZero()
+{
+ frameXIN->setMinimum(0);
+ frameXIN->setMaximum(0);
+ frameXIN->setValue(0);
+
+ frameYIN->setMinimum(0);
+ frameYIN->setMaximum(0);
+ frameYIN->setValue(0);
+
+ frameWIN->setMinimum(0);
+ frameWIN->setMaximum(0);
+ frameWIN->setValue(0);
+
+ frameHIN->setMinimum(0);
+ frameHIN->setMaximum(0);
+ frameHIN->setValue(0);
+}
+
void Capture::updateFrameProperties(int reset)
{
int x,y,w,h;
@@ -626,9 +644,11 @@ void Capture::updateFrameProperties(int reset)
if (currentCCD->getMinMaxStep(frameProp, "WIDTH", &min, &max, &step))
{
-
- if (min == max)
+ if (min >= max)
+ {
+ resetFrameToZero();
return;
+ }
if (step == 0)
xstep = (int) max * 0.05;
@@ -647,8 +667,11 @@ void Capture::updateFrameProperties(int reset)
if (currentCCD->getMinMaxStep(frameProp, "HEIGHT", &min, &max, &step))
{
- if (min == max)
+ if (min >= max)
+ {
+ resetFrameToZero();
return;
+ }
if (step == 0)
ystep = (int) max * 0.05;
@@ -667,8 +690,11 @@ void Capture::updateFrameProperties(int reset)
if (currentCCD->getMinMaxStep(frameProp, "X", &min, &max, &step))
{
- if (min == max)
+ if (min >= max)
+ {
+ resetFrameToZero();
return;
+ }
if (step == 0)
step = xstep;
@@ -685,8 +711,11 @@ void Capture::updateFrameProperties(int reset)
if (currentCCD->getMinMaxStep(frameProp, "Y", &min, &max, &step))
{
- if (min == max)
+ if (min >= max)
+ {
+ resetFrameToZero();
return;
+ }
if (step == 0)
step = ystep;
@@ -1462,10 +1491,16 @@ void Capture::updateCaptureProgress(ISD::CCDChip * tChip, double value, IPState
void Capture::updateCCDTemperature(double value)
{
if (temperatureCheck->isEnabled() == false)
- checkCCD();
+ {
+ if (currentCCD->getBaseDevice()->getPropertyPermission("CCD_TEMPERATURE") != IP_RO)
+ checkCCD();
+ }
temperatureOUT->setText(QString::number(value, 'f', 2));
+ if (temperatureIN->cleanText().isEmpty())
+ temperatureIN->setValue(value);
+
if (activeJob && (activeJob->getStatus() == SequenceJob::JOB_ABORTED || activeJob->getStatus() == SequenceJob::JOB_IDLE))
activeJob->setCurrentTemperature(value);
}
diff --git a/kstars/ekos/capture/capture.h b/kstars/ekos/capture/capture.h
index 736beb6..956e0a0 100644
--- a/kstars/ekos/capture/capture.h
+++ b/kstars/ekos/capture/capture.h
@@ -475,6 +475,8 @@ private:
// Remaining Time in seconds
int getJobRemainingTime(SequenceJob *job);
+ void resetFrameToZero();
+
/* Capture */
double seqExpose;
int seqTotalCount;