summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-23 09:11:22 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-23 09:11:22 (GMT)
commitf4d8c79642557897e4cc4e4d97699aa6399dc8a8 (patch)
treee98e39819402377a2d5bb4fc1062a4ff3e316030
parent120139a2f418628aac9b4a2635d5f9d4cd9bfc90 (diff)
Fix capture progress report on initial startup
-rw-r--r--kstars/ekos/capture.cpp16
-rw-r--r--kstars/ekos/ekosmanager.cpp22
-rw-r--r--kstars/ekos/ekosmanager.h2
3 files changed, 26 insertions, 14 deletions
diff --git a/kstars/ekos/capture.cpp b/kstars/ekos/capture.cpp
index dd945bf..a1915d2 100644
--- a/kstars/ekos/capture.cpp
+++ b/kstars/ekos/capture.cpp
@@ -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
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index 540040d..203b71d 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -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);
}
}
diff --git a/kstars/ekos/ekosmanager.h b/kstars/ekos/ekosmanager.h
index 9265727..2b5299d 100644
--- a/kstars/ekos/ekosmanager.h
+++ b/kstars/ekos/ekosmanager.h
@@ -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