[kstars] kstars/ekos: This is the summary screen patch. It should display HFR for focus, sigmas for RA and Dec in guiding, and more uniform colors for the Progress Indicators. I used Mount indicator as a guide. If they are doing their primary task, they are green and if they are doing another task

Jasem Mutlaq null at kde.org
Sat Feb 4 07:57:04 UTC 2017


Git commit 6481dcec7ade05b1f7d3c44c48550f3286913d70 by Jasem Mutlaq, on behalf of Robert Lancaste.
Committed on 04/02/2017 at 06:48.
Pushed by mutlaqja into branch 'master'.

This is the summary screen patch.  It should display HFR for focus, sigmas for RA and Dec in guiding, and more uniform colors for the Progress Indicators.  I used Mount indicator as a guide.  If they are doing their primary task, they are green and if they are doing another task
 to prepare they are the target color. I also updated it so that if you have the autofocus/focus monitor option enabled during capture you will not only get a new star image, but also a new profile and a new hfr.
In addition during the capture process because the focus is being monitored, it appears with a green indicator.  If autofocus is happening it is a red indicator and if there is nothing going on it is blank.

CCMAIL:kstars-devel at kde.org

M  +1    -1    kstars/ekos/ekos.h
M  +60   -8    kstars/ekos/ekosmanager.cpp
M  +2    -0    kstars/ekos/ekosmanager.h
M  +101  -2    kstars/ekos/ekosmanager.ui
M  +8    -9    kstars/ekos/focus/focus.cpp
M  +0    -2    kstars/ekos/focus/focus.h
M  +1    -0    kstars/ekos/guide/guide.cpp
M  +1    -0    kstars/ekos/guide/guide.h

https://commits.kde.org/kstars/6481dcec7ade05b1f7d3c44c48550f3286913d70

diff --git a/kstars/ekos/ekos.h b/kstars/ekos/ekos.h
index f54814625..3cb39823f 100644
--- a/kstars/ekos/ekos.h
+++ b/kstars/ekos/ekos.h
@@ -17,7 +17,7 @@ namespace Ekos
 
     // Guide States
     static const QStringList guideStates = { I18N_NOOP("Idle"), I18N_NOOP("Aborted"), I18N_NOOP("Connected"), I18N_NOOP("Disconnected"), I18N_NOOP("Capturing"), I18N_NOOP("Subtracting"), I18N_NOOP("Subframing"),
-                                             I18N_NOOP("Selecting star"), I18N_NOOP("Calibrating"), I18N_NOOP("Calibration error"), I18N_NOOP("Calibration successful"), I18N_NOOP("Guiding"),
+                                             I18N_NOOP("Selecting star"), I18N_NOOP("Calibrating"), I18N_NOOP("Calibration error"), I18N_NOOP("Calibrated"), I18N_NOOP("Guiding"),
                                              I18N_NOOP("Suspended"), I18N_NOOP("Dithering"), I18N_NOOP("Dithering error"), I18N_NOOP("Dithering successful")};
 
     typedef enum { GUIDE_IDLE, GUIDE_ABORTED, GUIDE_CONNECTED, GUIDE_DISCONNECTED, GUIDE_CAPTURE, GUIDE_DARK, GUIDE_SUBFRAME, GUIDE_STAR_SELECT, GUIDE_CALIBRATING, GUIDE_CALIBRATION_ERROR,
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index b2d0f4b3e..8549526e7 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -1419,8 +1419,10 @@ void EkosManager::initCapture()
     captureProgress->setEnabled(true);
     imageProgress->setEnabled(true);
 
-    capturePI = new QProgressIndicator(captureProcess);
-    captureStatusLayout->addWidget(capturePI);
+    if(!capturePI){
+        capturePI = new QProgressIndicator(captureProcess);
+        captureStatusLayout->insertWidget(0,capturePI);
+    }
 
     foreach(ISD::GDInterface *device, findDevices(KSTARS_AUXILIARY))
     {
@@ -1509,11 +1511,14 @@ void EkosManager::initFocus()
     connect(focusProcess, SIGNAL(newStatus(Ekos::FocusState)), this, SLOT(setFocusStatus(Ekos::FocusState)));
     connect(focusProcess, SIGNAL(newStarPixmap(QPixmap&)), this, SLOT(updateFocusStarPixmap(QPixmap&)));
     connect(focusProcess, SIGNAL(newProfilePixmap(QPixmap&)), this, SLOT(updateFocusProfilePixmap(QPixmap&)));
+    connect(focusProcess, SIGNAL(newHFR(double)), this, SLOT(updateCurrentHFR(double)));
 
     focusGroup->setEnabled(true);
 
-    focusPI = new QProgressIndicator(focusProcess);
-    focusStatusLayout->addWidget(focusPI);
+    if(!focusPI){
+        focusPI = new QProgressIndicator(focusProcess);
+        focusStatusLayout->insertWidget(0,focusPI);
+    }
 
     if (captureProcess)
     {
@@ -1546,6 +1551,15 @@ void EkosManager::initFocus()
 
 }
 
+void EkosManager::updateCurrentHFR(double newHFR){
+    currentHFR->setText(QString("%1").arg(newHFR, 0,'f', 2)+" px");
+}
+
+void EkosManager::updateSigmas(double ra, double de){
+    errRA->setText(QString::number(ra, 'f', 2)+"\"");
+    errDEC->setText(QString::number(de, 'f', 2)+"\"");
+}
+
 void EkosManager::initMount()
 {
     if (mountProcess)
@@ -1560,10 +1574,14 @@ void EkosManager::initMount()
     connect(mountProcess, SIGNAL(newStatus(ISD::Telescope::TelescopeStatus)), this, SLOT(updateMountStatus(ISD::Telescope::TelescopeStatus)));
     connect(mountProcess, SIGNAL(newTarget(QString)), mountTarget, SLOT(setText(QString)));
 
-    mountPI = new QProgressIndicator(mountProcess);
-    mountStatusLayout->addWidget(mountPI);
+    if(!mountPI){
+        mountPI = new QProgressIndicator(mountProcess);
+        mountStatusLayout->insertWidget(0,mountPI);
+    }
+
     mountGroup->setEnabled(true);
 
+
     if (captureProcess)
     {
         // Meridian Flip
@@ -1596,12 +1614,15 @@ void EkosManager::initGuide()
         connect(guideProcess, SIGNAL(newLog()), this, SLOT(updateLog()));
         guideGroup->setEnabled(true);
 
-        guidePI = new QProgressIndicator(guideProcess);
-        guideStatusLayout->addWidget(guidePI);
+        if(!guidePI){
+            guidePI = new QProgressIndicator(guideProcess);
+            guideStatusLayout->insertWidget(0,guidePI);
+        }
 
         connect(guideProcess, SIGNAL(newStatus(Ekos::GuideState)), this, SLOT(updateGuideStatus(Ekos::GuideState)));
         connect(guideProcess, SIGNAL(newStarPixmap(QPixmap&)), this, SLOT(updateGuideStarPixmap(QPixmap&)));
         connect(guideProcess, SIGNAL(newProfilePixmap(QPixmap&)), this, SLOT(updateGuideProfilePixmap(QPixmap&)));
+        connect(guideProcess, SIGNAL(sigmasUpdated(double,double)), this, SLOT(updateSigmas(double,double)));
     }
 
     if (captureProcess)
@@ -1913,6 +1934,10 @@ void EkosManager::updateCaptureStatus(Ekos::CaptureState status)
 
     if (status != Ekos::CAPTURE_ABORTED && status != Ekos::CAPTURE_COMPLETE)
     {
+        if (status==Ekos::CAPTURE_CAPTURING)
+            capturePI->setColor(Qt::darkGreen);
+        else
+            capturePI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
         if (capturePI->isAnimated() == false)
         {
             capturePI->startAnimation();
@@ -1926,6 +1951,11 @@ void EkosManager::updateCaptureStatus(Ekos::CaptureState status)
             capturePI->stopAnimation();
             countdownTimer.stop();
 
+            if(focusStatus->text()=="Complete"){
+                if (focusPI->isAnimated())
+                    focusPI->stopAnimation();
+            }
+
             imageProgress->setValue(0);
             imageRemainingTime->setText("--:--:--");
             overallRemainingTime->setText("--:--:--");
@@ -2006,9 +2036,16 @@ void EkosManager::setFocusStatus(Ekos::FocusState status)
 
     if (status >= Ekos::FOCUS_PROGRESS)
     {
+        focusPI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
         if (focusPI->isAnimated() == false)
             focusPI->startAnimation();
     }
+    else if(status == Ekos::FOCUS_COMPLETE&&Options::enforceAutofocus()&&captureProcess->getActiveJobID()!=-1)
+    {
+         focusPI->setColor(Qt::darkGreen);
+         if (focusPI->isAnimated() == false)
+             focusPI->startAnimation();
+    }
     else
     {
         if (focusPI->isAnimated())
@@ -2033,14 +2070,29 @@ void EkosManager::updateGuideStatus(Ekos::GuideState status)
         break;
 
     case Ekos::GUIDE_CALIBRATING:
+        guidePI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
+        if (guidePI->isAnimated() == false)
+            guidePI->startAnimation();
+        break;
     case Ekos::GUIDE_GUIDING:
+        guidePI->setColor(Qt::darkGreen);
+        if (guidePI->isAnimated() == false)
+            guidePI->startAnimation();
+        break;
     case Ekos::GUIDE_DITHERING:
+        guidePI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
+        if (guidePI->isAnimated() == false)
+            guidePI->startAnimation();
+        break;
     case Ekos::GUIDE_DITHERING_SUCCESS:
+        guidePI->setColor(Qt::darkGreen);
         if (guidePI->isAnimated() == false)
             guidePI->startAnimation();
         break;
 
     default:
+        if (guidePI->isAnimated())
+            guidePI->stopAnimation();
         break;
     }
 }
diff --git a/kstars/ekos/ekosmanager.h b/kstars/ekos/ekosmanager.h
index 37963175c..d8af917ac 100644
--- a/kstars/ekos/ekosmanager.h
+++ b/kstars/ekos/ekosmanager.h
@@ -205,11 +205,13 @@ private slots:
     void setFocusStatus(Ekos::FocusState status);
     void updateFocusStarPixmap(QPixmap &starPixmap);
     void updateFocusProfilePixmap(QPixmap &profilePixmap);
+    void updateCurrentHFR(double newHFR);
 
     // Guide Summary
     void updateGuideStatus(Ekos::GuideState status);
     void updateGuideStarPixmap(QPixmap &starPix);
     void updateGuideProfilePixmap(QPixmap &profilePix);
+    void updateSigmas(double ra, double de);
 
  private:
 
diff --git a/kstars/ekos/ekosmanager.ui b/kstars/ekos/ekosmanager.ui
index e150b537d..3340a7b8c 100644
--- a/kstars/ekos/ekosmanager.ui
+++ b/kstars/ekos/ekosmanager.ui
@@ -862,7 +862,7 @@
                    <property name="minimumSize">
                     <size>
                      <width>50</width>
-                     <height>0</height>
+                     <height>20</height>
                     </size>
                    </property>
                    <property name="text">
@@ -1037,6 +1037,38 @@
                    </property>
                   </spacer>
                  </item>
+                 <item>
+                  <widget class="QLabel" name="label_9">
+                   <property name="text">
+                    <string>HFR:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="currentHFR">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="minimumSize">
+                    <size>
+                     <width>20</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                   <property name="maximumSize">
+                    <size>
+                     <width>16777215</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string/>
+                   </property>
+                  </widget>
+                 </item>
                 </layout>
                </item>
                <item>
@@ -1698,14 +1730,81 @@
                    <property name="orientation">
                     <enum>Qt::Horizontal</enum>
                    </property>
+                   <property name="sizeType">
+                    <enum>QSizePolicy::Minimum</enum>
+                   </property>
                    <property name="sizeHint" stdset="0">
                     <size>
-                     <width>40</width>
+                     <width>1</width>
                      <height>20</height>
                     </size>
                    </property>
                   </spacer>
                  </item>
+                 <item>
+                  <widget class="QLabel" name="label_11">
+                   <property name="text">
+                    <string> σRA:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="errRA">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="minimumSize">
+                    <size>
+                     <width>30</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                   <property name="maximumSize">
+                    <size>
+                     <width>25</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string/>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="label_14">
+                   <property name="text">
+                    <string>σDEC:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="errDEC">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                   <property name="minimumSize">
+                    <size>
+                     <width>30</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                   <property name="maximumSize">
+                    <size>
+                     <width>25</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                   <property name="text">
+                    <string/>
+                   </property>
+                  </widget>
+                 </item>
                 </layout>
                </item>
                <item>
diff --git a/kstars/ekos/focus/focus.cpp b/kstars/ekos/focus/focus.cpp
index c56d7d076..63dfbec4c 100644
--- a/kstars/ekos/focus/focus.cpp
+++ b/kstars/ekos/focus/focus.cpp
@@ -93,7 +93,7 @@ Focus::Focus()
     currentFilterIndex=-1;
     minPos=1e6;
     maxPos=0;
-    frameNum=0;
+    HFRFrames.clear();
 
     showFITSViewerB->setIcon(QIcon::fromTheme("kstars_fitsviewer", QIcon(":/icons/breeze/default/kstars_fitsviewer.svg")));
     showFITSViewerB->setAttribute(Qt::WA_LayoutUsesWidgetRect);
@@ -713,7 +713,7 @@ void Focus::start()
     }
 
     inAutoFocus = true;    
-    frameNum=0;
+    HFRFrames.clear();
 
     resetButtons();
 
@@ -804,7 +804,7 @@ void Focus::stop(bool aborted)
     starSelected= false;
     minimumRequiredHFR    = -1;
     noStarCount = 0;
-    frameNum=0;
+    HFRFrames.clear();
     //maxHFR=1;
 
     disconnect(currentCCD, SIGNAL(BLOBUpdated(IBLOB*)), this, SLOT(newFITS(IBLOB*)));
@@ -1115,15 +1115,14 @@ void Focus::setCaptureComplete()
         }
 
         if (Options::focusLogging())
-            qDebug() << "Focus newFITS #" << frameNum+1 << ": Current HFR " << currentHFR;
+            qDebug() << "Focus newFITS #" << HFRFrames.count()+1 << ": Current HFR " << currentHFR;
 
 
-        frameNum++;
         if (currentHFR != -1)
             HFRFrames.append(currentHFR);
 
         // Check if we need to average more than a single frame
-        if (frameNum >= focusFramesSpin->value())
+        if (HFRFrames.count() >= focusFramesSpin->value())
         {
             currentHFR=0;
             // Sort all HFRs
@@ -1136,9 +1135,8 @@ void Focus::setCaptureComplete()
             for (int i=cutOff; i < HFRFrames.count()-cutOff; i++)
                 currentHFR+= HFRFrames[i];
 
-                currentHFR /= (HFRFrames.count() - (2 * cutOff));
+            currentHFR /= (HFRFrames.count() - (2 * cutOff));
 
-            frameNum =0;
             HFRFrames.clear();
         }
         else
@@ -1395,6 +1393,7 @@ void Focus::setCaptureComplete()
         else
         {
             setAutoFocusResult(true);
+            drawProfilePlot();
         }
 
         minimumRequiredHFR = -1;
@@ -2109,7 +2108,7 @@ void Focus::startFraming()
     waitStarSelectTimer.stop();
 
     inFocusLoop = true;
-    frameNum=0;
+    HFRFrames.clear();
 
     clearDataPoints();
 
diff --git a/kstars/ekos/focus/focus.h b/kstars/ekos/focus/focus.h
index ddbc52683..ddeff4660 100644
--- a/kstars/ekos/focus/focus.h
+++ b/kstars/ekos/focus/focus.h
@@ -391,8 +391,6 @@ private:
     int HFRInc;
     // If HFR decreasing? Well, good job. Once HFR start decreasing, we can start calculating HFR slope and estimating our next move.
     int HFRDec;
-    // How many frames have we captured thus far? Do we need to average them?
-    uint8_t frameNum;
 
     /****************************
     * Absolute position focusers
diff --git a/kstars/ekos/guide/guide.cpp b/kstars/ekos/guide/guide.cpp
index ea7ed3e06..9ca80f400 100644
--- a/kstars/ekos/guide/guide.cpp
+++ b/kstars/ekos/guide/guide.cpp
@@ -1835,6 +1835,7 @@ void Guide::setAxisSigma(double ra, double de)
 {
     l_ErrRA->setText(QString::number(ra, 'f', 2));
     l_ErrDEC->setText(QString::number(de, 'f', 2));
+    emit sigmasUpdated(ra,de);
 }
 
 void Guide::setAxisPulse(double ra, double de)
diff --git a/kstars/ekos/guide/guide.h b/kstars/ekos/guide/guide.h
index 16e4e5789..b5b24b94b 100644
--- a/kstars/ekos/guide/guide.h
+++ b/kstars/ekos/guide/guide.h
@@ -385,6 +385,7 @@ signals:
     void newProfilePixmap(QPixmap &);
 
     void newAxisDelta(double delta_ra, double delta_dec);
+    void sigmasUpdated(double ra, double dec);
     void guideChipUpdated(ISD::CCDChip*);
 
 private:



More information about the Kstars-devel mailing list