Commit f4d8c796 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Fix capture progress report on initial startup

parent 120139a2
......@@ -1561,6 +1561,9 @@ void Capture::prepareJob(SequenceJob *job)
{
activeJob = job;
// Just notification of active job stating up
emit newImage(NULL, activeJob);
connect(job, SIGNAL(checkFocus()), this, SLOT(startPostFilterAutoFocus()));
// Reset calibration stage
......@@ -1664,13 +1667,16 @@ void Capture::executeJob()
activeJob->setCompleted(seqCurrentCount);
currentImgCountOUT->setText( QString::number(seqCurrentCount));
imgProgress->setValue(seqCurrentCount);
// Emit progress update
emit newImage(NULL, activeJob);
}
}
// Update button status
setBusy(true);
useGuideHead = (activeJob->getActiveChip()->getType() == ISD::CCDChip::PRIMARY_CCD) ? false : true;
useGuideHead = (activeJob->getActiveChip()->getType() == ISD::CCDChip::PRIMARY_CCD) ? false : true;
// Check flat field frame requirements
if (activeJob->getFrameType() != FRAME_LIGHT && activeJob->isPreview() == false)
......@@ -1711,14 +1717,14 @@ void Capture::setGuideDeviation(double delta_ra, double delta_dec)
double deviation_rms = sqrt(delta_ra*delta_ra + delta_dec*delta_dec);
if (deviation_rms < guideDeviation->value())
{
initialHA = getCurrentHA();
initialHA = getCurrentHA();
appendLogText(i18n("Post meridian flip calibration completed successfully."));
resumeSequence();
// N.B. Set meridian flip stage AFTER resumeSequence() always
meridianFlipStage = MF_NONE;
return;
}
}
}
// We don't enforce limit on previews
if (activeJob->isPreview() || activeJob->getExposeLeft() == 0)
......@@ -1770,7 +1776,7 @@ void Capture::setGuideDither(bool enable)
}
void Capture::setAutoguiding(bool enable)
{
{
// If Autoguiding was started before and now stopped, let's abort (unless we're doing a meridian flip)
if (enable == false && isAutoGuiding && meridianFlipStage == MF_NONE && activeJob && activeJob->getStatus() == SequenceJob::JOB_BUSY)
{
......@@ -3227,7 +3233,7 @@ IPState Capture::processPreCaptureCalibrationStage()
}
break;
// Park cap, if not parked and not flat frame
// Unpark cap, if flat frame
// Turn on Light
......
......@@ -1325,7 +1325,7 @@ void EkosManager::initCapture()
toolsWidget->tabBar()->setTabToolTip(index, i18nc("Charge-Coupled Device", "CCD"));
connect(captureProcess, SIGNAL(newLog()), this, SLOT(updateLog()));
connect(captureProcess, SIGNAL(newStatus(Ekos::CaptureState)), this, SLOT(updateCaptureStatus(Ekos::CaptureState)));
connect(captureProcess, SIGNAL(newImage(QImage*, Ekos::SequenceJob*)), this, SLOT(updateCaptureImage(QImage*, Ekos::SequenceJob*)));
connect(captureProcess, SIGNAL(newImage(QImage*, Ekos::SequenceJob*)), this, SLOT(updateCaptureProgress(QImage*, Ekos::SequenceJob*)));
captureGroup->setEnabled(true);
sequenceProgress->setEnabled(true);
captureProgress->setEnabled(true);
......@@ -1820,18 +1820,24 @@ void EkosManager::updateCaptureStatus(Ekos::CaptureState status)
}
}
void EkosManager::updateCaptureImage(QImage *image, Ekos::SequenceJob *job)
void EkosManager::updateCaptureProgress(QImage *image, Ekos::SequenceJob *job)
{
delete (previewPixmap);
previewPixmap = new QPixmap(QPixmap::fromImage(*image));
previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
if (image)
{
delete (previewPixmap);
previewPixmap = new QPixmap(QPixmap::fromImage(*image));
previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
if (job->isPreview() == false)
{
sequenceLabel->setText(QString("Job # %1/%2 %3 (%4/%5)").arg(captureProcess->getActiveJobID()+1).arg(captureProcess->getJobCount()).arg(job->getPrefix())
.arg(job->getCompleted()+1).arg(job->getCount()));
// Image is set to NULL only on initial capture start up
int completed = (image == NULL) ? job->getCompleted() : job->getCompleted()+1;
sequenceLabel->setText(QString("Job # %1/%2 %3 (%4/%5)").arg(captureProcess->getActiveJobID()+1).arg(captureProcess->getJobCount()).arg(job->getPrefix()).arg(completed).arg(job->getCount()));
sequenceProgress->setRange(0, job->getCount());
sequenceProgress->setValue(static_cast<int>(job->getCompleted()+1));
sequenceProgress->setValue(completed);
}
}
......
......@@ -189,7 +189,7 @@ private slots:
// Capture Summary
void updateCaptureStatus(Ekos::CaptureState status);
void updateCaptureImage(QImage *image, Ekos::SequenceJob *job);
void updateCaptureProgress(QImage *image, Ekos::SequenceJob *job);
void updateCaptureCountDown();
// Focus summary
......
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