Commit 8a8615ca authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Support resume for aborted jobs

parent 303d1f14
...@@ -35,6 +35,7 @@ SequenceJob::SequenceJob() ...@@ -35,6 +35,7 @@ SequenceJob::SequenceJob()
activeChip=NULL; activeChip=NULL;
activeCCD=NULL; activeCCD=NULL;
activeFilter= NULL; activeFilter= NULL;
completed=0;
} }
void SequenceJob::abort() void SequenceJob::abort()
...@@ -249,7 +250,7 @@ void Capture::startSequence() ...@@ -249,7 +250,7 @@ void Capture::startSequence()
foreach(SequenceJob *job, jobs) foreach(SequenceJob *job, jobs)
{ {
if (job->getStatus() == SequenceJob::JOB_IDLE) if (job->getStatus() == SequenceJob::JOB_IDLE || job->getStatus() == SequenceJob::JOB_ABORTED)
{ {
first_job = job; first_job = job;
break; break;
...@@ -520,6 +521,7 @@ void Capture::newFITS(IBLOB *bp) ...@@ -520,6 +521,7 @@ void Capture::newFITS(IBLOB *bp)
} }
seqCurrentCount++; seqCurrentCount++;
activeJob->setCompleted(seqCurrentCount);
imgProgress->setValue(seqCurrentCount); imgProgress->setValue(seqCurrentCount);
appendLogText(i18n("Received image %1 out of %2.", seqCurrentCount, seqTotalCount)); appendLogText(i18n("Received image %1 out of %2.", seqCurrentCount, seqTotalCount));
...@@ -925,7 +927,7 @@ void Capture::executeJob(SequenceJob *job) ...@@ -925,7 +927,7 @@ void Capture::executeJob(SequenceJob *job)
seqDelay = job->getDelay(); seqDelay = job->getDelay();
seqCurrentCount = 0; seqCurrentCount = job->getCompleted();
if (job->isPreview() == false) if (job->isPreview() == false)
{ {
......
...@@ -49,6 +49,7 @@ class SequenceJob ...@@ -49,6 +49,7 @@ class SequenceJob
bool isPreview() { return preview;} bool isPreview() { return preview;}
int getDelay() { return delay;} int getDelay() { return delay;}
int getCount() { return count;} int getCount() { return count;}
unsigned int getCompleted() { return completed; }
const QString & getPrefix() { return prefix;} const QString & getPrefix() { return prefix;}
void setActiveCCD(ISD::CCD *ccd) { activeCCD = ccd; } void setActiveCCD(ISD::CCD *ccd) { activeCCD = ccd; }
...@@ -74,6 +75,7 @@ class SequenceJob ...@@ -74,6 +75,7 @@ class SequenceJob
void setImageType(int type) { imageType = type;} void setImageType(int type) { imageType = type;}
void setExposure(double duration) { exposure = duration;} void setExposure(double duration) { exposure = duration;}
void setStatusCell(QTableWidgetItem *cell) { statusCell = cell; } void setStatusCell(QTableWidgetItem *cell) { statusCell = cell; }
void setCompleted(unsigned int in_completed) { completed = in_completed;}
...@@ -98,6 +100,7 @@ class SequenceJob ...@@ -98,6 +100,7 @@ class SequenceJob
bool isoMode; bool isoMode;
bool preview; bool preview;
bool showFITS; bool showFITS;
unsigned int completed;
FITSScale captureFilter; FITSScale captureFilter;
QTableWidgetItem *statusCell; QTableWidgetItem *statusCell;
......
Markdown is supported
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