summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-09 20:45:58 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-11-09 20:45:58 (GMT)
commit9ad587c34f38bfb30f5d9626a1f8599e7d3c97db (patch)
treecc42af448ecb4ba06c5155051ad480dc18953a29
parent594cd91c274e52f623ef5e2689357c6f833eff6f (diff)
Add new progress bar for current image being captured in the summary
-rw-r--r--kstars/ekos/ekosmanager.cpp30
-rw-r--r--kstars/ekos/ekosmanager.h2
-rw-r--r--kstars/ekos/ekosmanager.ui106
3 files changed, 114 insertions, 24 deletions
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index e45d3f3..7742242 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -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)
diff --git a/kstars/ekos/ekosmanager.h b/kstars/ekos/ekosmanager.h
index a220123..4fe2149 100644
--- a/kstars/ekos/ekosmanager.h
+++ b/kstars/ekos/ekosmanager.h
@@ -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;
diff --git a/kstars/ekos/ekosmanager.ui b/kstars/ekos/ekosmanager.ui
index 7cd26fe..4d0b208 100644
--- a/kstars/ekos/ekosmanager.ui
+++ b/kstars/ekos/ekosmanager.ui
@@ -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,9 +518,92 @@
<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">
<number>1</number>