summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-11 22:18:08 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-11 22:18:08 (GMT)
commit88b83f61f88af2f011a5568340112e5f8429afcb (patch)
tree0f3f99757be4e54d4cb8bc327186018fd61a1e39
parent43b042440b382c73ffc0c634a990040e1f979727 (diff)
Only emit prepareComplete() if we need to
-rw-r--r--kstars/ekos/sequencejob.cpp25
-rw-r--r--kstars/ekos/sequencejob.h2
2 files changed, 20 insertions, 7 deletions
diff --git a/kstars/ekos/sequencejob.cpp b/kstars/ekos/sequencejob.cpp
index d02840e..bb85393 100644
--- a/kstars/ekos/sequencejob.cpp
+++ b/kstars/ekos/sequencejob.cpp
@@ -38,7 +38,7 @@ SequenceJob::SequenceJob()
currentTemperature=targetTemperature=INVALID_TEMPERATURE;
captureFilter=FITS_NONE;
preview=false;
- filterReady=temperatureReady=filterPostFocusReady=true;
+ filterReady=temperatureReady=filterPostFocusReady=prepareReady=true;
enforceTemperature=false;
activeChip=NULL;
activeCCD=NULL;
@@ -96,6 +96,8 @@ void SequenceJob::done()
void SequenceJob::prepareCapture()
{
+ prepareReady=false;
+
activeChip->setBatchMode(!preview);
activeCCD->setFITSDir(fitsDir);
@@ -116,7 +118,6 @@ void SequenceJob::prepareCapture()
if (targetFilter != -1 && activeFilter != NULL)
{
if (targetFilter == currentFilter)
- //emit prepareComplete();
filterReady = true;
else
{
@@ -136,8 +137,11 @@ void SequenceJob::prepareCapture()
activeCCD->setTemperature(targetTemperature);
}
- if (temperatureReady && filterReady)
+ if (prepareReady == false && temperatureReady && filterReady)
+ {
+ prepareReady = true;
emit prepareComplete();
+ }
}
@@ -264,8 +268,11 @@ void SequenceJob::setCurrentTemperature(double value)
if (enforceTemperature == false || fabs(targetTemperature - currentTemperature) <= Options::maxTemperatureDiff())
temperatureReady = true;
- if (filterReady && temperatureReady && filterPostFocusReady && (status == JOB_IDLE || status == JOB_ABORTED))
+ if (prepareReady == false && filterReady && temperatureReady && filterPostFocusReady && (status == JOB_IDLE || status == JOB_ABORTED))
+ {
+ prepareReady = true;
emit prepareComplete();
+ }
}
double SequenceJob::getTargetTemperature() const
@@ -376,8 +383,11 @@ void SequenceJob::setFilterPostFocusReady(bool value)
{
filterPostFocusReady = value;
- if (filterPostFocusReady && filterReady && temperatureReady && (status == JOB_IDLE || status == JOB_ABORTED))
+ if (prepareReady == false && filterPostFocusReady && filterReady && temperatureReady && (status == JOB_IDLE || status == JOB_ABORTED))
+ {
+ prepareReady = true;
emit prepareComplete();
+ }
}
int SequenceJob::getISOIndex() const
@@ -402,8 +412,11 @@ void SequenceJob::setCurrentFilter(int value)
if (currentFilter == targetFilter)
filterReady = true;
- if (filterReady && temperatureReady && filterPostFocusReady && (status == JOB_IDLE || status == JOB_ABORTED))
+ if (prepareReady == false && filterReady && temperatureReady && filterPostFocusReady && (status == JOB_IDLE || status == JOB_ABORTED))
+ {
+ prepareReady = true;
emit prepareComplete();
+ }
else if (filterReady && filterPostFocusReady == false)
emit checkFocus();
}
diff --git a/kstars/ekos/sequencejob.h b/kstars/ekos/sequencejob.h
index d5d0f0c..5ccd787 100644
--- a/kstars/ekos/sequencejob.h
+++ b/kstars/ekos/sequencejob.h
@@ -163,7 +163,7 @@ private:
int count;
int delay;
bool preview;
- bool filterReady, temperatureReady, filterPostFocusReady;
+ bool filterReady, temperatureReady, filterPostFocusReady, prepareReady;
bool enforceTemperature;
int isoIndex;
int captureRetires;