summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-31 20:06:33 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-31 20:06:33 (GMT)
commitd53f6ffbc527479c3b9971a64f83a5f489e455d3 (patch)
treec1c34dcdf3dd60e7c6595ecdd53e25d66f4200fa
parent4b23f1ed87c5bee786e1324eb5036e272b0fc933 (diff)
Reject invalid frame requests
-rw-r--r--kstars/ekos/capture.cpp48
-rw-r--r--kstars/ekos/capture.h2
2 files changed, 31 insertions, 19 deletions
diff --git a/kstars/ekos/capture.cpp b/kstars/ekos/capture.cpp
index 540fd81..2ec6846 100644
--- a/kstars/ekos/capture.cpp
+++ b/kstars/ekos/capture.cpp
@@ -515,7 +515,7 @@ void Capture::checkCCD(int ccdNum)
}
}
-void Capture::updateFrameProperties(bool reload)
+void Capture::updateFrameProperties(bool reset)
{
int x,y,w,h;
int binx=1,biny=1;
@@ -544,6 +544,10 @@ void Capture::updateFrameProperties(bool reload)
if (currentCCD->getMinMaxStep(frameProp, "WIDTH", &min, &max, &step))
{
+
+ if (min == max)
+ return;
+
if (step == 0)
xstep = (int) max * 0.05;
else
@@ -556,9 +560,14 @@ void Capture::updateFrameProperties(bool reload)
frameWIN->setSingleStep(xstep);
}
}
+ else
+ return;
if (currentCCD->getMinMaxStep(frameProp, "HEIGHT", &min, &max, &step))
{
+ if (min == max)
+ return;
+
if (step == 0)
ystep = (int) max * 0.05;
else
@@ -571,9 +580,14 @@ void Capture::updateFrameProperties(bool reload)
frameHIN->setSingleStep(ystep);
}
}
+ else
+ return;
if (currentCCD->getMinMaxStep(frameProp, "X", &min, &max, &step))
{
+ if (min == max)
+ return;
+
if (step == 0)
step = xstep;
@@ -584,9 +598,14 @@ void Capture::updateFrameProperties(bool reload)
frameXIN->setSingleStep(step);
}
}
+ else
+ return;
if (currentCCD->getMinMaxStep(frameProp, "Y", &min, &max, &step))
{
+ if (min == max)
+ return;
+
if (step == 0)
step = ystep;
@@ -597,28 +616,21 @@ void Capture::updateFrameProperties(bool reload)
frameYIN->setSingleStep(step);
}
}
+ else
+ return;
- if ( reload || frameSettings.contains(targetChip) == false)
+ if (reset || frameSettings.contains(targetChip) == false)
{
QVariantMap settings;
- bool haveFrame=false, haveBinning=false;
- if ( (haveFrame = targetChip->getFrame(&x,&y,&w,&h)) )
- {
- settings["x"] = x;
- settings["y"] = y;
- settings["w"] = w;
- settings["h"] = h;
- }
-
- if ( (haveBinning = targetChip->getBinning(&binx, &biny)) )
- {
- settings["binx"] = binx;
- settings["biny"] = biny;
- }
+ settings["x"] = 0;
+ settings["y"] = 0;
+ settings["w"] = frameWIN->maximum();
+ settings["h"] = frameHIN->maximum();
+ settings["binx"] = 1;
+ settings["biny"] = 1;
- if (haveFrame && haveBinning)
- frameSettings[targetChip] = settings;
+ frameSettings[targetChip] = settings;
}
if (frameSettings.contains(targetChip))
diff --git a/kstars/ekos/capture.h b/kstars/ekos/capture.h
index c0bed20..79e0d1d 100644
--- a/kstars/ekos/capture.h
+++ b/kstars/ekos/capture.h
@@ -445,7 +445,7 @@ private:
void setBusy(bool enable);
bool resumeSequence();
void startNextExposure();
- void updateFrameProperties(bool reload=false);
+ void updateFrameProperties(bool reset=false);
void prepareJob(SequenceJob *job);
void syncGUIToJob(SequenceJob *job);
bool processJobInfo(XMLEle *root);