From 91efb8e3ccd6f41d9bfce167425983ca5893a3aa Mon Sep 17 00:00:00 2001 From: Georg Zotti Date: Sat, 7 Sep 2024 19:58:16 +0200 Subject: [PATCH] Disable ASCOM on Qt6 (#3887) * Disable ASCOM on Qt6-based builds - due to some incomprehensible error apparently out of our hands. * SUG: Update description of ASCOM support * Docfixes --- guide/plg_atTheTelescope.tex | 9 ++++++--- .../TelescopeControl/src/ASCOM/CMakeLists.txt | 11 +++++++---- plugins/TelescopeControl/src/CMakeLists.txt | 13 +++++++------ .../TelescopeControl/src/TelescopeClient.cpp | 6 ++++-- .../src/common/CMakeLists.txt | 4 ++-- .../TelescopeControl/src/common/Socket.cpp | 6 +++++- .../TelescopeControl/src/common/Socket.hpp | 3 +-- .../TelescopeControl/src/gui/CMakeLists.txt | 4 ++-- .../src/gui/TelescopeConfigurationDialog.cpp | 19 ++++++++++++------- .../src/gui/TelescopeConfigurationDialog.hpp | 6 +++--- 10 files changed, 49 insertions(+), 32 deletions(-) diff --git a/guide/plg_atTheTelescope.tex b/guide/plg_atTheTelescope.tex index fca69c797b8ff..0e5d4c4ad59a7 100644 --- a/guide/plg_atTheTelescope.tex +++ b/guide/plg_atTheTelescope.tex @@ -514,7 +514,7 @@ \subsection{Abilities and limitations} their powerful indoor PCs via RemoteDesktop or similar setups. Keep in mind that Stellarium is a graphics-heavy program that may challenge the outdoor computer's graphics subsystem or network. See framerate intent settings on page~\pageref{sec:gui:configuration:tools:fps} for optimizing your screen refresh rates. -Better, run Stellarium on your indoor system and use INDI or ASCOM protocols. +Better, run Stellarium on your indoor system and use INDI or ASCOM network protocols. \subsection{Using this plug-in} \label{sec:plugins:TelescopeControl:using} @@ -921,7 +921,7 @@ \subsection{INDI} \item IOptron GotoNova Upgrade Kit 8400 \end{itemize} -\subsection{ASCOM (Windows only)} +\subsection{ASCOM (Windows, Qt5-based builds only)} \label{sec:plugins:TelescopeControl:ASCOM} \indexterm{ASCOM} \newFeature{0.19.3}is probably the most widely used @@ -933,7 +933,10 @@ \subsection{ASCOM (Windows only)} and most of the astronomy software and tools can communicate with ASCOM compatible devices. -The ASCOM telescope support has been added to Stellarium's Telescope Control plugin by Gion Kunz in version 0.19.3. +The ASCOM telescope support has been added to Stellarium's Telescope Control plugin by Gion Kunz in version 0.19.3.\footnote{% +Unfortunately traditional ASCOM seems to be incompatible with Qt6. +Starting with version 24.3 ASCOM support is no longer available on Qt6-based builds. +If you depend on ASCOM support, please use a Qt5-based build of the same version.} Note that in order for Stellarium to communicate with your ASCOM compatible mount, you will need to have the ASCOM platform installed diff --git a/plugins/TelescopeControl/src/ASCOM/CMakeLists.txt b/plugins/TelescopeControl/src/ASCOM/CMakeLists.txt index 8b83fa033f5e2..e134d5e93f08f 100644 --- a/plugins/TelescopeControl/src/ASCOM/CMakeLists.txt +++ b/plugins/TelescopeControl/src/ASCOM/CMakeLists.txt @@ -1,4 +1,7 @@ -if(WIN32) +# Due to incomprehensible errors between ASCOM and Qt6OpenGL!QOpenGL2PaintEngineEx::setState(), we must disable ASCOM in QT6-based builds. +# No other code change related to Qt6 has been done so far, only the ASCOM selector has been greyed out. +# Rather sooner than later ASCOM must be replaced by Alpaca. +if(WIN32 AND (${QT_VERSION_MAJOR} EQUAL "5")) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -11,9 +14,9 @@ SET(TelescopeControl_ASCOM_UIS IF (${QT_VERSION_MAJOR} EQUAL "5") QT5_WRAP_UI(TelescopeControl_ASCOM_UIS_H ${TelescopeControl_ASCOM_UIS}) -ELSE() +ELSE(${QT_VERSION_MAJOR} EQUAL "5") QT_WRAP_UI(TelescopeControl_ASCOM_UIS_H ${TelescopeControl_ASCOM_UIS}) -ENDIF() +ENDIF(${QT_VERSION_MAJOR} EQUAL "5") add_library(TelescopeControl_ASCOM STATIC ASCOMDevice.hpp @@ -40,4 +43,4 @@ ENDIF(ENABLE_TESTING) SET_TARGET_PROPERTIES(TelescopeControl_ASCOM PROPERTIES FOLDER "plugins/TelescopeControl") -ENDIF(WIN32) +ENDIF(WIN32 AND (${QT_VERSION_MAJOR} EQUAL "5")) diff --git a/plugins/TelescopeControl/src/CMakeLists.txt b/plugins/TelescopeControl/src/CMakeLists.txt index 96c785eb4c3dd..3b22385fc54cd 100644 --- a/plugins/TelescopeControl/src/CMakeLists.txt +++ b/plugins/TelescopeControl/src/CMakeLists.txt @@ -6,9 +6,9 @@ add_subdirectory(Lx200) add_subdirectory(NexStar) add_subdirectory(Rts2) add_subdirectory(INDI) -if(WIN32) +if(WIN32 AND (${QT_VERSION_MAJOR} EQUAL "5")) add_subdirectory(ASCOM) -endif(WIN32) +endif(WIN32 AND (${QT_VERSION_MAJOR} EQUAL "5")) SET(TelescopeControl_RES ../resources/TelescopeControl.qrc) IF (${QT_VERSION_MAJOR} EQUAL "5") @@ -49,10 +49,11 @@ TARGET_LINK_LIBRARIES(TelescopeControl-static Qt${QT_VERSION_MAJOR}::SerialPort ) -IF(WIN32) -TARGET_LINK_LIBRARIES(TelescopeControl-static - TelescopeControl_ASCOM) -ENDIF(WIN32) +# Due to incomprehensible errors between ASCOM and Qt6OpenGL!QOpenGL2PaintEngineEx::setState(), we must disable in QT6-based builds. +if(WIN32 AND (${QT_VERSION_MAJOR} EQUAL "5")) +#TARGET_LINK_LIBRARIES(TelescopeControl-static +# TelescopeControl_ASCOM) +ENDIF(WIN32 AND (${QT_VERSION_MAJOR} EQUAL "5")) SET_TARGET_PROPERTIES(TelescopeControl-static PROPERTIES COMPILE_FLAGS "-DQT_STATICPLUGIN") ADD_DEPENDENCIES(AllStaticPlugins TelescopeControl-static) diff --git a/plugins/TelescopeControl/src/TelescopeClient.cpp b/plugins/TelescopeControl/src/TelescopeClient.cpp index 1da714a735f64..d0116d4f62fcc 100644 --- a/plugins/TelescopeControl/src/TelescopeClient.cpp +++ b/plugins/TelescopeControl/src/TelescopeClient.cpp @@ -44,8 +44,10 @@ #include #include -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) +#if QT_VERSION // GetSystemTimeAsFileTime() #else #include @@ -103,7 +105,7 @@ TelescopeClient *TelescopeClient::create(const QString &url) { newTelescope = new TelescopeClientINDI(name, params); } - #ifdef Q_OS_WIN + #if defined(Q_OS_WIN) && QT_VERSIONsetupUi(dialog); // ASCOM Telescope client widget needs to be dynamically added in order to make use of preprocessors to exclude for non-windows - #ifdef Q_OS_WIN + #if defined(Q_OS_WIN) && QT_VERSIONscrollAreaWidgetContents); ui->ASCOMLayout->addWidget(ascomWidget); @@ -155,7 +155,12 @@ void TelescopeConfigurationDialog::createDialogContent() connect(ui->radioButtonTelescopeRTS2, SIGNAL(toggled(bool)), this, SLOT(toggleTypeRTS2(bool))); connect(ui->radioButtonTelescopeINDI, SIGNAL(toggled(bool)), this, SLOT(toggleTypeINDI(bool))); #ifdef Q_OS_WIN - connect(ui->radioButtonTelescopeASCOM, SIGNAL(toggled(bool)), this, SLOT(toggleTypeASCOM(bool))); + #if (QT_VERSION>=QT_VERSION_CHECK(6,0,0)) + ui->radioButtonTelescopeASCOM->setToolTip(q_("Disabled due to apparent incompatibility. Please use the Qt5-based build of Stellarium.")); + ui->radioButtonTelescopeASCOM->setDisabled(true); + #else + connect(ui->radioButtonTelescopeASCOM, SIGNAL(toggled(bool)), this, SLOT(toggleTypeASCOM(bool))); + #endif #else ui->radioButtonTelescopeASCOM->hide(); #endif @@ -193,7 +198,7 @@ void TelescopeConfigurationDialog::initConfigurationDialog() ui->groupBoxDeviceSettings->hide(); ui->groupBoxRTS2Settings->hide(); ui->INDIProperties->hide(); - #ifdef Q_OS_WIN + #if defined(Q_OS_WIN) && QT_VERSIONhide(); #endif @@ -347,7 +352,7 @@ void TelescopeConfigurationDialog::initExistingTelescopeConfiguration(int slot) ui->INDIProperties->setPort(portTCP); ui->INDIProperties->setSelectedDevice(deviceModelName); } - #ifdef Q_OS_WIN + #if defined(Q_OS_WIN) && QT_VERSIONradioButtonTelescopeASCOM->setChecked(true); @@ -456,7 +461,7 @@ void TelescopeConfigurationDialog::toggleTypeINDI(bool enabled) ui->INDIProperties->setVisible(enabled); } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && QT_VERSIONsetVisible(enabled); @@ -545,7 +550,7 @@ void TelescopeConfigurationDialog::buttonSavePressed() telescopeManager->addTelescopeAtSlot(configuredSlot, type, name, equinox, ui->INDIProperties->host(), ui->INDIProperties->port(), delay, connectAtStartup, circles, ui->INDIProperties->selectedDevice()); } - #ifdef Q_OS_WIN + #if defined(Q_OS_WIN) && QT_VERSIONradioButtonTelescopeASCOM->isChecked()) { type = TelescopeControl::ConnectionASCOM; diff --git a/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.hpp b/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.hpp index cd0c95c6c622c..5e906c68b6556 100644 --- a/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.hpp +++ b/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.hpp @@ -29,7 +29,7 @@ #include "StelDialog.hpp" #include "TelescopeControl.hpp" -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && QT_VERSION