From 6a9809b85f752015e9ac42c9db6dc68612e72802 Mon Sep 17 00:00:00 2001 From: Georg Zotti Date: Fri, 6 Sep 2024 00:57:47 +0200 Subject: [PATCH] Make it clear in GUI whether abortSlew is supported. --- plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.hpp | 1 + .../TelescopeControl/src/Lx200/TelescopeClientDirectLx200.hpp | 1 + .../src/NexStar/TelescopeClientDirectNexStar.hpp | 1 + plugins/TelescopeControl/src/TelescopeClient.hpp | 3 +++ plugins/TelescopeControl/src/gui/SlewDialog.cpp | 1 + 5 files changed, 7 insertions(+) diff --git a/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.hpp b/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.hpp index 75c6eea5fb9c7..445071555dff6 100644 --- a/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.hpp +++ b/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.hpp @@ -37,6 +37,7 @@ class TelescopeClientASCOM : public TelescopeClient void telescopeSync(const Vec3d& j2000Pos, StelObjectP selectObject) override; bool isTelescopeSyncSupported() const override {return true;} void telescopeAbortSlew() override; + bool isAbortSlewSupported() const override {return true;} bool isConnected() const override; bool hasKnownPosition() const override; static bool useJNow(ASCOMDevice::ASCOMEquatorialCoordinateType coordinateType, bool ascomUseDeviceEqCoordType, TelescopeControl::Equinox equinox); diff --git a/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.hpp b/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.hpp index 4ebc942bfcdb6..41ad6aea645b7 100644 --- a/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.hpp +++ b/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.hpp @@ -73,6 +73,7 @@ class TelescopeClientDirectLx200 : public TelescopeClient, public Server void telescopeSync(const Vec3d &j2000Pos, StelObjectP selectObject) override; bool isTelescopeSyncSupported() const override {return true;} void telescopeAbortSlew() override; + bool isAbortSlewSupported() const override {return true;} bool isInitialized(void) const override; //====================================================================== diff --git a/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.hpp b/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.hpp index daf5b528081cf..823a6f5bff0b4 100644 --- a/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.hpp +++ b/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.hpp @@ -72,6 +72,7 @@ class TelescopeClientDirectNexStar : public TelescopeClient, public Server void telescopeSync(const Vec3d &j2000Pos, StelObjectP selectObject) override; bool isTelescopeSyncSupported() const override {return true;} void telescopeAbortSlew() override; + bool isAbortSlewSupported() const override {return true;} bool isInitialized(void) const override; //====================================================================== diff --git a/plugins/TelescopeControl/src/TelescopeClient.hpp b/plugins/TelescopeControl/src/TelescopeClient.hpp index dabb1ebd6b04e..9992ef61b056b 100644 --- a/plugins/TelescopeControl/src/TelescopeClient.hpp +++ b/plugins/TelescopeControl/src/TelescopeClient.hpp @@ -95,6 +95,9 @@ class TelescopeClient : public QObject, public StelObject //! Send command to abort slew. Not all telescopes support this, base implementation only gives a warning. //! After abort, the current position should be retrieved and displayed. virtual void telescopeAbortSlew(); + //! report whether this client can abort a running slew. + //! Can be used for GUI tweaks + virtual bool isAbortSlewSupported() const {return false;} //! //! \brief move diff --git a/plugins/TelescopeControl/src/gui/SlewDialog.cpp b/plugins/TelescopeControl/src/gui/SlewDialog.cpp index 81508852a1364..ea16fc6f99bb8 100644 --- a/plugins/TelescopeControl/src/gui/SlewDialog.cpp +++ b/plugins/TelescopeControl/src/gui/SlewDialog.cpp @@ -367,6 +367,7 @@ void SlewDialog::onCurrentTelescopeChanged() return; ui->pushButtonSync->setEnabled(telescope->isTelescopeSyncSupported()); + ui->pushButtonAbort->setEnabled(telescope->isAbortSlewSupported()); auto controlWidget = telescope->createControlWidget(telescope); if (!controlWidget) return;