[kstars] kstars/ekos: This patch will disable key buttons while slewing to address a problem I have had many times when using kstars, particularly with the align module.

Jasem Mutlaq null at kde.org
Sat Feb 4 14:14:27 UTC 2017


Git commit 6f4da3394457e1e2c97627a136af8119f2fda275 by Jasem Mutlaq, on behalf of Robert Lancaster.
Committed on 04/02/2017 at 14:13.
Pushed by mutlaqja into branch 'master'.

This patch will disable key buttons while slewing to address a problem I have had many times when using kstars, particularly with the align module.
I often hit the button before it is ready because there is no definitive indication on the screen that it has arrived at the location.  So I wrote some code that will disable the buttons in question while the telescope is slewing and then re-enables them afterward.

CCMAIL:kstars-devel at kde.org

M  +2    -0    kstars/ekos/capture/capture.h
M  +24   -0    kstars/ekos/ekosmanager.cpp

https://commits.kde.org/kstars/6f4da3394457e1e2c97627a136af8119f2fda275

diff --git a/kstars/ekos/capture/capture.h b/kstars/ekos/capture/capture.h
index c6960d248..e6fb4a98d 100644
--- a/kstars/ekos/capture/capture.h
+++ b/kstars/ekos/capture/capture.h
@@ -255,6 +255,8 @@ public:
     /* Capture */
     void updateSequencePrefix( const QString &newPrefix, const QString &dir);
 
+    bool currentCCDHasVideo() {return currentCCD->hasVideoStream();}
+
 public slots:
 
     /** \addtogroup CaptureDBusInterface
diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp
index 89d7e0403..8616c11f4 100644
--- a/kstars/ekos/ekosmanager.cpp
+++ b/kstars/ekos/ekosmanager.cpp
@@ -1897,11 +1897,35 @@ void EkosManager::updateMountStatus(ISD::Telescope::TelescopeStatus status)
         mountPI->setColor(QColor( KStarsData::Instance()->colorScheme()->colorNamed("TargetColor" )));
         if (mountPI->isAnimated() == false)
             mountPI->startAnimation();
+        //This code will disable a bunch of buttons in the Ekos modules while the scope is slewing.
+        //Pressing these buttons while slewing will cause problems in the images that result because either the stars will be streaked or they won't be the right stars.
+        //It might be better to do this in each module, but this is more centralized.
+        alignProcess->solveB->setEnabled(false);
+        alignProcess->loadSlewB->setEnabled(false);
+        captureProcess->previewB->setEnabled(false);
+        captureProcess->liveVideoB->setEnabled(false);
+        captureProcess->startB->setEnabled(false);
+        focusProcess->captureB->setEnabled(false);
+        focusProcess->startFocusB->setEnabled(false);
+        focusProcess->startLoopB->setEnabled(false);
+        guideProcess->captureB->setEnabled(false);
+        guideProcess->calibrateB->setEnabled(false);
         break;
     case ISD::Telescope::MOUNT_TRACKING:
         mountPI->setColor(Qt::darkGreen);
         if (mountPI->isAnimated() == false)
             mountPI->startAnimation();
+        //This will re-enabled the disabled buttons
+        alignProcess->solveB->setEnabled(true);
+        alignProcess->loadSlewB->setEnabled(true);
+        captureProcess->previewB->setEnabled(true);
+        captureProcess->liveVideoB->setEnabled(captureProcess->currentCCDHasVideo());
+        captureProcess->startB->setEnabled(true);
+        focusProcess->captureB->setEnabled(true);
+        focusProcess->startFocusB->setEnabled(true);
+        focusProcess->startLoopB->setEnabled(true);
+        guideProcess->captureB->setEnabled(true);
+        guideProcess->calibrateB->setEnabled(true);
         break;
 
     default:


More information about the Kstars-devel mailing list