Commit 88b83f61 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Only emit prepareComplete() if we need to

parent 43b04244
......@@ -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();
}
......
......@@ -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;
......
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