Commit 9ad587c3 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Add new progress bar for current image being captured in the summary

parent 594cd91c
......@@ -97,9 +97,13 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(parent)
mountPI=capturePI=focusPI=guidePI=NULL;
captureProgress->setValue(0);
sequenceProgress->setValue(0);
sequenceProgress->setValue(0);
sequenceProgress->setDecimals(0);
sequenceProgress->setFormat("%v");
imageProgress->setValue(0);
imageProgress->setDecimals(1);
imageProgress->setFormat("%v");
imageProgress->setBarStyle(QRoundProgressBar::StyleLine);
countdownTimer.setInterval(1000);
connect(&countdownTimer, SIGNAL(timeout()), this, SLOT(updateCaptureCountDown()));
......@@ -312,6 +316,7 @@ void EkosManager::reset()
captureProgress->setValue(0);
overallRemainingTime->setText("--:--:--");
sequenceRemainingTime->setText("--:--:--");
imageRemainingTime->setText("--:--:--");
mountStatus->setText(i18n("Idle"));
captureStatus->setText(i18n("Idle"));
focusStatus->setText(i18n("Idle"));
......@@ -1377,9 +1382,11 @@ void EkosManager::initCapture()
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(updateCaptureProgress(QImage*, Ekos::SequenceJob*)));
connect(captureProcess, SIGNAL(newExposureProgress(Ekos::SequenceJob*)), this, SLOT(updateExposureProgress(Ekos::SequenceJob*)));
captureGroup->setEnabled(true);
sequenceProgress->setEnabled(true);
captureProgress->setEnabled(true);
imageProgress->setEnabled(true);
capturePI = new QProgressIndicator(captureProcess);
captureStatusLayout->addWidget(capturePI);
......@@ -1880,6 +1887,7 @@ void EkosManager::updateCaptureStatus(Ekos::CaptureState status)
capturePI->stopAnimation();
countdownTimer.stop();
imageRemainingTime->setText("--:--:--");
overallRemainingTime->setText("--:--:--");
sequenceRemainingTime->setText("--:--:--");
}
......@@ -1895,11 +1903,10 @@ void EkosManager::updateCaptureProgress(QImage *image, Ekos::SequenceJob *job)
previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), previewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
}
if (job->isPreview() == false)
{
// Image is set to NULL only on initial capture start up
int completed = (image == NULL) ? job->getCompleted() : job->getCompleted()+1;
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());
......@@ -1907,8 +1914,21 @@ void EkosManager::updateCaptureProgress(QImage *image, Ekos::SequenceJob *job)
}
}
void EkosManager::updateCaptureCountDown()
void EkosManager::updateExposureProgress(Ekos::SequenceJob *job)
{
imageCountDown.setHMS(0,0,0);
imageCountDown = imageCountDown.addSecs(job->getExposeLeft());
if (imageCountDown.hour() == 23)
imageCountDown.setHMS(0,0,0);
imageProgress->setRange(0, job->getExposure());
imageProgress->setValue(job->getExposeLeft());
imageRemainingTime->setText(imageCountDown.toString("hh:mm:ss"));
}
void EkosManager::updateCaptureCountDown()
{
overallCountDown = overallCountDown.addSecs(-1);
if (overallCountDown.hour() == 23)
overallCountDown.setHMS(0,0,0);
......@@ -1918,7 +1938,7 @@ void EkosManager::updateCaptureCountDown()
sequenceCountDown.setHMS(0,0,0);
overallRemainingTime->setText(overallCountDown.toString("hh:mm:ss"));
sequenceRemainingTime->setText(sequenceCountDown.toString("hh:mm:ss"));
sequenceRemainingTime->setText(sequenceCountDown.toString("hh:mm:ss"));
}
void EkosManager::updateFocusStarPixmap(QPixmap &starPixmap)
......
......@@ -193,6 +193,7 @@ private slots:
// Capture Summary
void updateCaptureStatus(Ekos::CaptureState status);
void updateCaptureProgress(QImage *image, Ekos::SequenceJob *job);
void updateExposureProgress(Ekos::SequenceJob *job);
void updateCaptureCountDown();
// Focus summary
......@@ -272,6 +273,7 @@ private slots:
QProgressIndicator *mountPI;
// Capture Summary
QTime imageCountDown;
QTime overallCountDown;
QTime sequenceCountDown;
QTimer countdownTimer;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>546</width>
<height>636</height>
<width>612</width>
<height>652</height>
</rect>
</property>
<property name="maximumSize">
......@@ -434,22 +434,7 @@
<property name="title">
<string>Capture</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<layout class="QHBoxLayout" name="captureStatusLayout">
<property name="spacing">
......@@ -533,8 +518,91 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<property name="spacing">
<number>1</number>
<number>3</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>1</number>
</property>
<item>
<widget class="QLabel" name="sequenceLabel_2">
<property name="text">
<string>Image</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="spacing">
<number>1</number>
</property>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QRoundProgressBar" name="imageProgress" native="true">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12"/>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="imageRemainingTime">
<property name="text">
<string>--:--:--</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
......
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