diff --git a/.appveyor.yml b/.appveyor.yml
index 16d4b6bf5d0e0..6370acab84cff 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -26,11 +26,12 @@ environment:
tidyURL: https://github.com/htacg/tidy-html5/releases/download/5.8.0/tidy-5.8.0-win64.zip
tidyBaseName: tidy-5.8.0-win64
matrix:
- - BUILD_NAME: Win64 Qt6.8
+# While testing, deactivate 2 builds that we know to be OK.
+ - BUILD_NAME: Win64 Qt6.9
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
VSPATH: C:\Program Files\Microsoft Visual Studio\2022\Community\SDK\ScopeCppSDK\vc15\VC\bin
QT_VERSION_MAJOR: 6
- QT_BASEDIR: C:\Qt\6.8\msvc2022_64
+ QT_BASEDIR: C:\Qt\6.9\msvc2022_64
CMAKE_GENERATOR: Visual Studio 17 2022
CMAKE_ARGS: -A x64 -DSCM_SHOULD_ENABLE_CONVERTER=ON
exiv2url: https://github.com/Exiv2/exiv2/releases/download/v0.28.0/exiv2-0.28.0-2019msvc64.zip
@@ -46,6 +47,7 @@ environment:
exiv2url: https://github.com/10110111/exiv2/releases/download/ver0.28.0-final/exiv2-0.28.0-2017msvc64.zip
exiv2baseName: exiv2-0.28.0-2017msvc64
scConverterEnabled: false
+ # The Qt5.15 CI has issues around memory use in translation tools.
# - BUILD_NAME: Win64 Qt5.15
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
# VSPATH: C:\Program Files\Microsoft Visual Studio\2022\Community\SDK\ScopeCppSDK\vc15\VC\bin
@@ -56,15 +58,27 @@ environment:
# exiv2url: https://github.com/Exiv2/exiv2/releases/download/v0.28.0/exiv2-0.28.0-2019msvc64.zip
# exiv2baseName: exiv2-0.28.0-2019msvc64
# scConverterEnabled: false
- - BUILD_NAME: Arm64 Qt6.8
+ # TODO: This is not yet properly supported, or some config switch is missing. We postpone Qt6.9-based AppVeyor builds for Win/Arm64 to post-26.1.
+# - BUILD_NAME: Arm64 Qt6.9
+# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
+# VSPATH: C:\Program Files\Microsoft Visual Studio\2022\Community\SDK\ScopeCppSDK\vc15\VC\bin
+# QT_VERSION_MAJOR: 6
+# QT_BASEDIR: C:\Qt\6.9\msvc2022_arm64
+# CMAKE_GENERATOR: Visual Studio 17 2022
+# # While tesing appveyor, disable all plugins and extras to minimize build time..
+# CMAKE_ARGS: -A ARM64 -DSTELLARIUM_BUILD_ARM64=ON -DQT_HOST_PATH=C:/Qt/6.9/msvc2022_64 -DQt6LinguistTools_DIR=C:/Qt/6.9/msvc2022_64/lib/cmake/Qt6LinguistTools -DENABLE_QTWEBENGINE=OFF -DQT_ENABLE_VERBOSE_DEPLOYMENT=ON -DQMAKESPEC=C:/Qt/6.9/msvc2022_arm64/mkspecs -DUSE_PLUGIN_ANGLEMEASURE=OFF -DUSE_PLUGIN_ARCHAEOLINES=OFF -DUSE_PLUGIN_EQUATIONOFTIME=OFF -DUSE_PLUGIN_CALENDARS=OFF -DUSE_PLUGIN_EXOPLANETS=OFF -DUSE_PLUGIN_METEORSHOWERS=OFF -DUSE_PLUGIN_MOSAICCAMERA=OFF -DUSE_PLUGIN_NAVSTARS=OFF -DUSE_PLUGIN_NOVAE=OFF -DUSE_PLUGIN_NEBULATEXTURES=OFF -DUSE_PLUGIN_LENSDISTORTIONESTIMATOR=OFF -DUSE_PLUGIN_SOLARSYSTEMEDITOR=OFF -DUSE_PLUGIN_OBSERVABILITY=OFF -DUSE_PLUGIN_OCULARS=OFF -DUSE_PLUGIN_ONLINEQUERIES=OFF -DUSE_PLUGIN_POINTERCOORDINATES=OFF -DUSE_PLUGIN_PULSARS=OFF -DUSE_PLUGIN_QUASARS=OFF -DUSE_PLUGIN_REMOTECONTROL=OFF -DUSE_PLUGIN_REMOTESYNC=OFF -DUSE_PLUGIN_SATELLITES=OFF -DUSE_PLUGIN_SCENERY3D=OFF -DUSE_PLUGIN_SKYCULTUREMAKER=OFF -DUSE_PLUGIN_SUPERNOVAE=OFF -DUSE_PLUGIN_TELESCOPECONTROL=OFF -DUSE_PLUGIN_TEXTUSERINTERFACE=OFF -DENABLE_SHOWMYSKY=OFF -DENABLE_SPEECH=OFF -DENABLE_TESTING=OFF -DENABLE_SCRIPT_CONSOLE=OFF -DENABLE_SPOUT=OFF -DENABLE_XLSX=OFF -DENABLE_NLS=OFF
+# scConverterEnabled: false
+ # Qt6.5 for Win/Arm64 is missing QtWebEngine. (Introduced in Qt6.10 only).
+ - BUILD_NAME: Arm64 Qt6.5
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- VSPATH: C:\Program Files\Microsoft Visual Studio\2022\Community\SDK\ScopeCppSDK\vc15\VC\bin
QT_VERSION_MAJOR: 6
- QT_BASEDIR: C:\Qt\6.8\msvc2022_arm64
+ QT_BASEDIR: C:\Qt\6.5\msvc2019_arm64
CMAKE_GENERATOR: Visual Studio 17 2022
- CMAKE_ARGS: -A ARM64 -DSTELLARIUM_BUILD_ARM64=ON -DQT_HOST_PATH=C:\Qt\6.8\msvc2022_64 -DQt6LinguistTools_DIR=C:\Qt\6.8\msvc2022_64\lib\cmake\Qt6LinguistTools -DENABLE_QTWEBENGINE=OFF
+ CMAKE_ARGS: -A ARM64 -DSTELLARIUM_BUILD_ARM64=ON -DQT_HOST_PATH=C:/Qt/6.5/msvc2019_64 -DQt6LinguistTools_DIR=C:/Qt/6.5/msvc2019_64/lib/cmake/Qt6LinguistTools -DENABLE_QTWEBENGINE=OFF
scConverterEnabled: false
+
before_build:
+ # push a few Artifacts created by windeploy to the AppVeyor result page for inspection (log, err files)?
- set DEBUG_WINDEPLOYQT=false
- set PUBLISH_BINARY=false
- set USE_MESA=false
@@ -74,11 +88,13 @@ before_build:
- set INSTALL_CONVERTER=false
- set INSTALL_CONVERTER_DEPS=false
- set INNSPATH=C:\Program Files (x86)\Inno Setup 5;C:\Program Files (x86)\Inno Setup 6
- - set PATH=%VSPATH%;%QT_BASEDIR%\bin;c:\%exiv2baseName%\bin;%INNSPATH%;c:\%gettextBaseName%\bin;c:\%tidyBaseName%\bin;c:\skyculture-converter;%PATH%
+ - set PATH=%VSPATH%;%QT_BASEDIR%;%QT_BASEDIR%\bin;c:\%exiv2baseName%\bin;%INNSPATH%;c:\%gettextBaseName%\bin;c:\%tidyBaseName%\bin;c:\skyculture-converter;%PATH%
- - ps: if($env:QT_BASEDIR.contains('_64') -or $env:QT_BASEDIR.contains('arm64')) { $env:BITS=64 } else { $env:BITS=32 }
- - ps: if($env:QT_BASEDIR.contains('_64')) { $env:PKGARCH="x64" } else { $env:PKGARCH="x86" }
- - ps: if($env:QT_BASEDIR.contains('arm64')) { $env:PKGARCH="arm64" }
+## We no longer build 32bit stuff
+# - ps: if($env:QT_BASEDIR.contains('_64') -or $env:QT_BASEDIR.contains('arm64')) { $env:BITS=64 } else { $env:BITS=32 }
+# - ps: if($env:QT_BASEDIR.contains('_64')) { $env:PKGARCH="x64" } else { $env:PKGARCH="x86" }
+ - ps: $env:BITS=64
+ - ps: if($env:QT_BASEDIR.contains('arm64')) { $env:PKGARCH="arm64" } else { $env:PKGARCH="x64" }
- ps: if($env:QT_VERSION_MAJOR -eq "6") { $env:SSL="OpenSSL-" } else { $env:SSL="OpenSSL-1-" }
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-next") { $env:PUBLISH_BINARY = 'true' }
- ps: if($env:APPVEYOR_REPO_BRANCH -eq "stellarium-stable") { $env:PUBLISH_BINARY = 'true' }
@@ -133,9 +149,36 @@ test_script:
- ps: if($env:PUBLISH_BINARY -eq "false" -and $env:BUILD_NAME.contains("Win")) { ctest --output-on-failure }
after_test:
+ ## A few comments and diagnostics useful for upgrading win/Arm64 build to Qt6.8 or higher.
+ # Where are we?
+ #- echo %cd%
+ # save current working dir before changing elsewhere
+ #- set after_test_dir=%cd%
+ # windeployqt complains about path element missing. Unable to read \mkspecs\qconfig.pri: The system cannot find the path specified.
+ #- path
+ # Unsure: set path for host or target arch?
+ #- set PATH=C:\Qt\6.9\msvc2022_64\bin;%PATH%
+ #- set PATH=C:\Qt\6.9\msvc2022_arm64\bin;%PATH%
+ # CAVEAT: problem in next line? TODO: Change the following line so that windeployqt actually copies the arm dlls!
- if [%PUBLISH_BINARY%]==[true] cmake --build c:\stellarium\build\ --config %configuration% --target install
+ # Where are we after cmake build?
+ #- echo %cd%
- if [%DEBUG_WINDEPLOYQT%]==[true] cd c:\stellarium\build\
- - if [%DEBUG_WINDEPLOYQT%]==[true] for %%i in (windeployqt.*) do appveyor PushArtifact %%i
+ # what is pushed?
+ #- if [%DEBUG_WINDEPLOYQT%]==[true] dir /s windeployqt.*
+ # Make a few diagnostic files available when debugging
+ - if [%DEBUG_WINDEPLOYQT%]==[true] for %%i in (windeployqt.*) do appveyor PushArtifact %%i
+ # Alternative while investigating the Arm64 cross-compile issue
+ #- if [%DEBUG_WINDEPLOYQT%]==[true] for %%i in (windeployqt.* c:\stellarium\build\Stellarium.sln) do appveyor PushArtifact %%i
+ #- echo %cd%
+ #- cd %after_test_dir%
+ #- echo %cd%
+ #- echo " we should be back"
+ #- echo "Checking that qconfig.pri exists in the expected places"
+ #- dir C:\Qt\6.9\msvc2022_64\mkspecs\qconfig.pri
+ #- type C:\Qt\6.9\msvc2022_64\mkspecs\qconfig.pri
+ #- dir C:\Qt\6.9\msvc2022_arm64\mkspecs\qconfig.pri
+ #- type C:\Qt\6.9\msvc2022_arm64\mkspecs\qconfig.pri
- if [%INSTALL_CONVERTER%]==[true] appveyor DownloadFile https://github.com/Stellarium/stellarium-skyculture-converter/releases/download/v0.0.1/stellarium-skyculture-converter-0.0.1-win64.zip -FileName c:\sc-converter.zip
- if [%INSTALL_CONVERTER%]==[true] 7z e c:\sc-converter.zip -aoa -oc:\sc-converter
- if [%INSTALL_CONVERTER%]==[true] copy c:\sc-converter\lib*.dll c:\stellarium-package\bin\
@@ -155,6 +198,20 @@ after_test:
# - if [%PUBLISH_BINARY%]==[true] appveyor DownloadFile https://github.com/Stellarium/stellarium-data/releases/download/translations/translations.zip -FileName c:\translations.zip
# - if [%PUBLISH_BINARY%]==[true] 7z e c:\translations.zip -spf -oc:\stellarium-package\share\stellarium\
- if [%PUBLISH_BINARY%]==[true] if NOT [%exiv2url%] == [] copy c:\%exiv2baseName%\bin\exiv2.dll c:\stellarium-package\bin\
+ # DEBUG: find if there is anything in qtstuff...
+ # It appears that for Arm64 there is no directory qtstuff. This may cause issues later. Let's create it. But being empty, it still causes an error. Add a dummy file.
+ #- if not exist c:\stellarium-package\qtstuff mkdir c:\stellarium-package\qtstuff
+ #- echo "This is just to make Inno work." > c:\stellarium-package\qtstuff\dummy.txt
+ # Check the following output: Is there a compiled program to find? Feed it to windeployqt below...
+ #- echo %cd%
+ #- dir /s
+ #- echo "======== ANOTHER DIR LISTING"
+ #- dir /s c:\stellarium-package\qtstuff\
+ # In case the first windeployqt from cmake has now worked, we don't need the second run which again failed because of path errors.
+ # Manually run windeployqt again for ARM builds? TBD: give location of Arm libraries?
+ # - ps: if($env:QT_BASEDIR.contains('arm64')) { C:\Qt\6.9\msvc2022_64\bin\windeployqt.exe --no-translations --compiler-runtime --verbose 2 --qtpaths C:\Qt\6.9\msvc2022_arm64\bin\qtpaths.bat --dir c:\stellarium-package\qtstuff\ c:\stellarium-package\bin\stellarium.exe}
+ #- echo "The qtstuff directory should include Qt6 dll libraries, not just the dummy file "
+ #- dir /s c:\stellarium-package\qtstuff\
- if [%PUBLISH_BINARY%]==[true] cmake --build c:\stellarium\build\ --config %configuration% --target stellarium-installer
- if [%USE_EXTRA_EXE%]==[true] cmake --build c:\stellarium\build\ --config %configuration% --target stellarium-patch-installer
- if [%PUBLISH_BINARY%]==[true] cd c:\stellarium\installers
@@ -176,4 +233,3 @@ notifications:
on_build_success: false
on_build_failure: true
on_build_status_changed: true
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 647907032663d..96b91e3982f61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,7 +116,7 @@ ELSE()
SET(ISS_MIN_WIN_VERSION "6.1")
ENDIF()
# Define required version for MSVC
-# Details: https://docs.microsoft.com/ru-ru/windows/win32/winprog/using-the-windows-headers
+# Details: https://docs.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers
IF(Qt6_FOUND)
SET(MIN_WIN_VERSION "0x0A00")
ELSE()
@@ -221,7 +221,7 @@ ENDIF()
# Add ASan (AddressSanitizer) build options if necessary
# Details: https://github.com/google/sanitizers/wiki/AddressSanitizer
-# https://docs.microsoft.com/ru-ru/cpp/build/reference/fsanitize?view=msvc-150
+# https://docs.microsoft.com/en-us/cpp/build/reference/fsanitize?view=msvc-150
IF(${CMAKE_BUILD_TYPE} MATCHES "ASan")
IF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=address")
@@ -241,7 +241,7 @@ ENDIF()
# Add Fuzzer (Fuzzer Sanitizer) build options if necessary
# Details: https://llvm.org/docs/LibFuzzer.html
-# https://docs.microsoft.com/ru-ru/cpp/build/reference/fsanitize?view=msvc-150
+# https://docs.microsoft.com/en-us/cpp/build/reference/fsanitize?view=msvc-150
IF(${CMAKE_BUILD_TYPE} MATCHES "Fuzzer")
IF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fsanitize=fuzzer")
@@ -451,7 +451,7 @@ ENDIF()
IF(WIN32)
# On AMD64 systems it should be enough to just not set this variable.
# To cross-compile, call with cmake -DSTELLARIUM_BUILD_ARM64
- IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "ARM64") # for Surface etc.
+ IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") # for Surface etc.
SET(STELLARIUM_BUILD_ARM64 1 CACHE BOOL "Build for Windows on ARM")
ENDIF()
@@ -882,6 +882,11 @@ IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS(-DINSTALL_LOCALEDIR_FOR_DEBUG="${CMAKE_SOURCE_DIR}")
ENDIF()
+# Keep this for testing until AppVeyor plays nice (Qt6.10) with arm64.
+#IF(STELLARIUM_BUILD_ARM64) # 64bit ARM build?
+# MESSAGE(STATUS "This is an ARM64 build message outside a WIN32 clause.")
+#ENDIF()
+
IF(WIN32)
#######################################################
### Generate icon file name
@@ -923,6 +928,7 @@ IF(WIN32)
#######################################################
IF(STELLARIUM_BUILD_ARM64) # 64bit ARM build?
+ #MESSAGE(STATUS "This is an ARM64 build message inside a WIN32 clause.")
SET(ISS_ARCHITECTURE_SPECIFIC ";Make the installer run only on arm64:\nArchitecturesAllowed=arm64\n;Switch to 64-bit install mode:\nArchitecturesInstallIn64BitMode=arm64")
SET(ISS_PACKAGE_PLATFORM "qt${QT_VERSION_MAJOR}-arm64")
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
@@ -930,6 +936,9 @@ IF(WIN32)
SET(ISS_PACKAGE_PLATFORM "qt${QT_VERSION_MAJOR}-win32")
ELSEIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
SET(ISS_ARCHITECTURE_SPECIFIC ";Make the installer run only on win64:\nArchitecturesAllowed=x64\n;Switch to 64-bit install mode:\nArchitecturesInstallIn64BitMode=x64")
+ # Prepare for InnoSetup 6.3+: Set to x64compatible, which allows to install to arm64 in emulation mode even though we have our own arm64 build.
+ # Currently AppVeyor has InnoSetup 6.2 only. Keep for later.
+ #SET(ISS_ARCHITECTURE_SPECIFIC ";Make the installer run only on win64:\nArchitecturesAllowed=x64compatible\n;Switch to 64-bit install mode:\nArchitecturesInstallIn64BitMode=x64compatible")
SET(ISS_PACKAGE_PLATFORM "qt${QT_VERSION_MAJOR}-win64")
ENDIF()
SET(ISS_AUTOGENERATED_WARNING "Do not edit this file! It has been automatically generated by CMake. Your changes will be lost the next time CMake is run.")
diff --git a/cmake/stellarium.iss.cmake b/cmake/stellarium.iss.cmake
index 30a86133f5833..c40253e576474 100644
--- a/cmake/stellarium.iss.cmake
+++ b/cmake/stellarium.iss.cmake
@@ -38,6 +38,7 @@ Source: "@CMAKE_INSTALL_PREFIX@\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversi
Source: "@CMAKE_SOURCE_DIR@\data\stellarium.url"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\data\stellarium-devdocs.url"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\data\qt.conf"; DestDir: "{app}"; Flags: ignoreversion
+Source: "@CMAKE_SOURCE_DIR@\data\stellarium.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\COPYING"; DestDir: "{app}"; Flags: ignoreversion; DestName: "GPL.txt"
Source: "@CMAKE_SOURCE_DIR@\ChangeLog"; DestDir: "{app}"; Flags: ignoreversion; DestName: "ChangeLog.txt"
diff --git a/cmake/stellarium.iss6.cmake b/cmake/stellarium.iss6.cmake
index 9063d85b600af..31795aa11dfdc 100644
--- a/cmake/stellarium.iss6.cmake
+++ b/cmake/stellarium.iss6.cmake
@@ -39,6 +39,7 @@ Source: "@CMAKE_INSTALL_PREFIX@\bin\*.dll"; DestDir: "{app}"; Flags: ignoreversi
Source: "@CMAKE_SOURCE_DIR@\data\stellarium.url"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\data\stellarium-devdocs.url"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\data\qt.conf"; DestDir: "{app}"; Flags: ignoreversion
+Source: "@CMAKE_SOURCE_DIR@\data\stellarium.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "@CMAKE_SOURCE_DIR@\COPYING"; DestDir: "{app}"; Flags: ignoreversion; DestName: "GPL.txt"
Source: "@CMAKE_SOURCE_DIR@\ChangeLog"; DestDir: "{app}"; Flags: ignoreversion; DestName: "ChangeLog.txt"
diff --git a/data/stellarium.exe.config b/data/stellarium.exe.config
new file mode 100644
index 0000000000000..9b74e95937be0
--- /dev/null
+++ b/data/stellarium.exe.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/guide/plg_atTheTelescope.tex b/guide/plg_atTheTelescope.tex
index afd7b06bc6b0e..4f5683e0e26c2 100644
--- a/guide/plg_atTheTelescope.tex
+++ b/guide/plg_atTheTelescope.tex
@@ -947,7 +947,8 @@ \subsection{ASCOM~7 (Windows only)}
Note that in order for Stellarium to communicate with your ASCOM
compatible mount, you will need to have the ASCOM platform installed
on your Windows machine (version 7 or
-higher\footnote{\url{https://ascom-standards.org/Downloads/Index.htm}}). Also,
+higher\footnote{\url{https://ascom-standards.org/Downloads/Index.htm}};
+On Windows 11 for ARM64, ASCOM platform 7.1.2 or later is required.). Also,
the ASCOM driver of your telescope mount needs to be installed before
you can start using the telescope in Stellarium.
diff --git a/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.cpp b/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.cpp
index 621cce3f8a551..fb91c075ae413 100644
--- a/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.cpp
+++ b/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.cpp
@@ -17,6 +17,7 @@
*/
#include "ASCOMDevice.hpp"
+#include "TelescopeControl.hpp"
#include
ASCOMDevice::ASCOMDevice(QObject* parent, QString ascomDeviceId) : QObject(parent),
@@ -32,7 +33,7 @@ bool ASCOMDevice::connect()
if (!initResult || FAILED(hResult))
{
- qDebug() << "Initialization failed for device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Initialization failed for device: " << mAscomDeviceId;
return false;
}
@@ -42,10 +43,25 @@ bool ASCOMDevice::connect()
if (FAILED(hResult))
{
- qDebug() << "Could not connect to device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Could not connect to device: " << mAscomDeviceId;
return false;
}
-
+
+ // With ASCOM 7.1 there is a problem reaching the Properties panel of the simulators.
+ // Before sending a slew, telescopes must be set to tracking.
+ qCDebug(Telescopes) << "This device is tracking:" << isTracking();
+ if (!isTracking())
+ {
+ VARIANT vT = OleBoolToVariant(TRUE);
+
+ hResult = OlePropertyPut(pTelescopeDispatch, nullptr, const_cast(LTracking), 1, vT);
+
+ if (FAILED(hResult))
+ {
+ qCWarning(Telescopes) << "Could not enable Tracking on device: " << mAscomDeviceId;
+ return false;
+ }
+ }
mConnected = true;
return true;
}
@@ -59,7 +75,7 @@ bool ASCOMDevice::disconnect()
if (FAILED(hResult))
{
- qDebug() << "Could not disconnect device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Could not disconnect device: " << mAscomDeviceId;
return false;
}
@@ -82,10 +98,13 @@ void ASCOMDevice::slewToCoordinates(ASCOMDevice::ASCOMCoordinates coords)
VARIANT v1 = OleDoubleToVariant(coords.RA);
VARIANT v2 = OleDoubleToVariant(coords.DEC);
+ qCDebug(Telescopes) << "Slewing to coordinates" << variantToQstring(v1) << " dec " << variantToQstring(v2);
+ qCDebug(Telescopes) << "Slewing to coordinates" << QString::number(variantToDouble(v1)) << " dec " << QString::number(variantToDouble(v2));
+
HRESULT hResult = OleMethodCall(pTelescopeDispatch, nullptr, const_cast(LSlewToCoordinatesAsync), 2, v1, v2);
if (FAILED(hResult))
{
- qDebug() << "Slew failed for device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Slew failed for device: " << mAscomDeviceId;
}
}
@@ -96,10 +115,11 @@ void ASCOMDevice::syncToCoordinates(ASCOMCoordinates coords)
VARIANT v1 = OleDoubleToVariant(coords.RA);
VARIANT v2 = OleDoubleToVariant(coords.DEC);
+ qCDebug(Telescopes) << "Syncing to coordinates" << variantToQstring(v1) << " dec " << variantToQstring(v2);
HRESULT hResult = OleMethodCall(pTelescopeDispatch, nullptr, const_cast(LSyncToCoordinates), 2, v1, v2);
if (FAILED(hResult))
{
- qDebug() << "Could not sync to coordinates for device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Could not sync to coordinates for device: " << mAscomDeviceId;
}
}
@@ -110,7 +130,7 @@ void ASCOMDevice::abortSlew()
HRESULT hResult = OleMethodCall(pTelescopeDispatch, nullptr, const_cast(LAbortSlew));
if (FAILED(hResult))
{
- qCritical() << "Could not abort slew for device: " << mAscomDeviceId;
+ qCCritical(Telescopes) << "Could not abort slew for device: " << mAscomDeviceId;
}
}
@@ -120,10 +140,12 @@ bool ASCOMDevice::isDeviceConnected() const
VARIANT v1;
HRESULT hResult = OlePropertyGet(pTelescopeDispatch, &v1, const_cast(LConnected));
+ // TODO: if possible, change this. It fires once per frame in draw()!
+ //qCDebug(Telescopes) << "ASCOMDevice::isDeviceConnected reports" << variantToQstring(v1);
if (FAILED(hResult))
{
- qDebug() << "Could not get connected state for device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Could not get connected state for device: " << mAscomDeviceId;
return false;
}
@@ -136,16 +158,33 @@ bool ASCOMDevice::isParked() const
VARIANT v1;
HRESULT hResult = OlePropertyGet(pTelescopeDispatch, &v1, const_cast(LAtPark));
+ qCDebug(Telescopes) << "ASCOMDevice::isParked reports" << variantToQstring(v1);
if (FAILED(hResult))
{
- qDebug() << "Could not get AtPark state for device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Could not get AtPark state for device: " << mAscomDeviceId;
return false;
}
return v1.boolVal == -1;
}
+bool ASCOMDevice::isTracking() const
+{
+ if (!mConnected) return true;
+
+ VARIANT v1;
+ HRESULT hResult = OlePropertyGet(pTelescopeDispatch, &v1, const_cast(LTracking));
+ qCDebug(Telescopes) << "ASCOMDevice::isTracking reports" << variantToQstring(v1);
+
+ if (FAILED(hResult))
+ {
+ qCWarning(Telescopes) << "Could not get Tracking state for device: " << mAscomDeviceId;
+ return false;
+ }
+
+ return v1.boolVal == -1;
+}
ASCOMDevice::ASCOMEquatorialCoordinateType ASCOMDevice::getEquatorialCoordinateType()
{
@@ -153,10 +192,11 @@ ASCOMDevice::ASCOMEquatorialCoordinateType ASCOMDevice::getEquatorialCoordinateT
VARIANT v1;
HRESULT hResult = OlePropertyGet(pTelescopeDispatch, &v1, const_cast(LEquatorialSystem));
+ qCDebug(Telescopes) << "ASCOMDevice::getEquatorialCoordinateType reports" << variantToQstring(v1);
if (FAILED(hResult))
{
- qDebug() << "Could not get EquatorialCoordinateType for device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Could not get EquatorialCoordinateType for device: " << mAscomDeviceId;
return ASCOMDevice::ASCOMEquatorialCoordinateType::Other;
}
@@ -169,10 +209,11 @@ bool ASCOMDevice::doesRefraction()
VARIANT v1;
HRESULT hResult = OlePropertyGet(pTelescopeDispatch, &v1, const_cast(LDoesRefraction));
+ qCDebug(Telescopes) << "ASCOMDevice::doesRefraction reports" << variantToQstring(v1);
if (FAILED(hResult))
{
- qDebug() << "Could not get DoesRefraction for device: " << mAscomDeviceId;
+ qCWarning(Telescopes) << "Could not get DoesRefraction for device: " << mAscomDeviceId;
return false;
}
@@ -190,13 +231,14 @@ ASCOMDevice::ASCOMCoordinates ASCOMDevice::getCoordinates()
HRESULT hResult;
hResult = OlePropertyGet(pTelescopeDispatch, &v1, const_cast(LRightAscension));
- if (FAILED(hResult)) qDebug() << "Could not get RightAscension for device: " << mAscomDeviceId;
+ if (FAILED(hResult)) qCWarning(Telescopes) << "Could not get RightAscension for device: " << mAscomDeviceId;
hResult = OlePropertyGet(pTelescopeDispatch, &v2, const_cast(LDeclination));
- if (FAILED(hResult)) qDebug() << "Could not get Declination for device: " << mAscomDeviceId;
+ if (FAILED(hResult)) qCWarning(Telescopes) << "Could not get Declination for device: " << mAscomDeviceId;
coords.RA = v1.dblVal;
coords.DEC = v2.dblVal;
+ qCDebug(Telescopes) << "ASCOMDevice::getCoordinates(): RA/Dec:" << QString::number(coords.RA) << "/" << QString::number(coords.DEC);
return coords;
}
@@ -236,3 +278,4 @@ const wchar_t* ASCOMDevice::LDoesRefraction = L"DoesRefraction";
const wchar_t* ASCOMDevice::LRightAscension = L"RightAscension";
const wchar_t* ASCOMDevice::LDeclination = L"Declination";
const wchar_t* ASCOMDevice::LChoose = L"Choose";
+const wchar_t* ASCOMDevice::LTracking = L"Tracking";
diff --git a/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.hpp b/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.hpp
index 8edd54a0fec9c..b1f22a17a626e 100644
--- a/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.hpp
+++ b/plugins/TelescopeControl/src/ASCOM/ASCOMDevice.hpp
@@ -45,6 +45,7 @@ class ASCOMDevice final : public QObject
bool isDeviceConnected() const;
bool isParked() const;
+ bool isTracking() const;
bool connect();
bool disconnect();
ASCOMCoordinates position() const;
@@ -74,6 +75,7 @@ class ASCOMDevice final : public QObject
static const wchar_t* LRightAscension;
static const wchar_t* LDeclination;
static const wchar_t* LChoose;
+ static const wchar_t* LTracking;
};
#endif // ASCOMDEVICE_HPP
diff --git a/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.cpp b/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.cpp
index c8612867fb2b7..575aa09b0511b 100644
--- a/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.cpp
+++ b/plugins/TelescopeControl/src/ASCOM/TelescopeClientASCOM.cpp
@@ -43,7 +43,7 @@ TelescopeClientASCOM::TelescopeClientASCOM(const QString& name, const QString& p
mAscomUseDeviceEqCoordType = paramMatch.captured(2).trimmed() == "true";
}
- qDebug() << "TelescopeClientASCOM::TelescopeClientASCOM with telescope name " << name << " and ascomDeviceId " << mAscomDeviceId;
+ qCInfo(Telescopes) << "TelescopeClientASCOM::TelescopeClientASCOM with telescope name " << name << " and ascomDeviceId " << mAscomDeviceId;
mAscomDevice = new ASCOMDevice(this, mAscomDeviceId);
mAscomDevice->connect();
@@ -167,6 +167,7 @@ void TelescopeClientASCOM::telescopeAbortSlew()
bool TelescopeClientASCOM::isConnected() const
{
+ // TODO: This is called once per frame in draw(). Find a solution like for LX200, test stale handle.
return mAscomDevice->isDeviceConnected();
}
diff --git a/plugins/TelescopeControl/src/INDI/INDIConnection.cpp b/plugins/TelescopeControl/src/INDI/INDIConnection.cpp
index 224d5f4525813..b464cfff2e9f3 100644
--- a/plugins/TelescopeControl/src/INDI/INDIConnection.cpp
+++ b/plugins/TelescopeControl/src/INDI/INDIConnection.cpp
@@ -29,6 +29,8 @@
#include
#include
+#include "TelescopeControl.hpp"
+
const int INDIConnection::SLEW_STOP = INDI::Telescope::SLEW_GUIDE - 1;
INDIConnection::INDIConnection(QObject *parent) : QObject(parent)
@@ -58,7 +60,7 @@ void INDIConnection::setPosition(INDIConnection::Coordinates coords)
if (!mTelescope.isConnected())
{
- qDebug() << "Error: Telescope not connected";
+ qCWarning(Telescopes) << "Error: Telescope not connected";
return;
}
@@ -66,7 +68,7 @@ void INDIConnection::setPosition(INDIConnection::Coordinates coords)
auto switchVector = mTelescope.getSwitch("ON_COORD_SET");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or ON_COORD_SET switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or ON_COORD_SET switch...";
return;
}
// Note that confusingly there is a SLEW switch member as well that will move but not track.
@@ -81,7 +83,7 @@ void INDIConnection::setPosition(INDIConnection::Coordinates coords)
auto property = mTelescope.getNumber("EQUATORIAL_EOD_COORD");
if (!property.isValid())
{
- qDebug() << "Error: unable to find Telescope or EQUATORIAL_EOD_COORD property...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or EQUATORIAL_EOD_COORD property...";
return;
}
@@ -98,7 +100,7 @@ void INDIConnection::syncPosition(INDIConnection::Coordinates coords)
if (!mTelescope.isConnected())
{
- qDebug() << "Error: Telescope not connected";
+ qCWarning(Telescopes) << "Error: Telescope not connected";
return;
}
@@ -106,7 +108,7 @@ void INDIConnection::syncPosition(INDIConnection::Coordinates coords)
auto switchVector = mTelescope.getSwitch("ON_COORD_SET");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or ON_COORD_SET switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or ON_COORD_SET switch...";
return;
}
@@ -121,7 +123,7 @@ void INDIConnection::syncPosition(INDIConnection::Coordinates coords)
auto property = mTelescope.getNumber("EQUATORIAL_EOD_COORD");
if (!property.isValid())
{
- qDebug() << "Error: unable to find Telescope or EQUATORIAL_EOD_COORD property...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or EQUATORIAL_EOD_COORD property...";
return;
}
@@ -160,7 +162,7 @@ void INDIConnection::unParkTelescope()
auto switchVector = mTelescope.getSwitch("TELESCOPE_PARK");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or TELESCOPE_PARK switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or TELESCOPE_PARK switch...";
return;
}
@@ -192,7 +194,7 @@ void INDIConnection::parkTelescope()
auto switchVector = mTelescope.getSwitch("TELESCOPE_PARK");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or TELESCOPE_PARK switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or TELESCOPE_PARK switch...";
return;
}
@@ -221,7 +223,7 @@ void INDIConnection::moveNorth(int speed)
auto switchVector = mTelescope.getSwitch("TELESCOPE_MOTION_NS");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or TELESCOPE_MOTION_NS switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or TELESCOPE_MOTION_NS switch...";
return;
}
@@ -247,7 +249,7 @@ void INDIConnection::moveEast(int speed)
auto switchVector = mTelescope.getSwitch("TELESCOPE_MOTION_WE");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or TELESCOPE_MOTION_WE switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or TELESCOPE_MOTION_WE switch...";
return;
}
@@ -273,7 +275,7 @@ void INDIConnection::moveSouth(int speed)
auto switchVector = mTelescope.getSwitch("TELESCOPE_MOTION_NS");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or TELESCOPE_MOTION_NS switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or TELESCOPE_MOTION_NS switch...";
return;
}
@@ -299,7 +301,7 @@ void INDIConnection::moveWest(int speed)
auto switchVector = mTelescope.getSwitch("TELESCOPE_MOTION_WE");
if (!switchVector.isValid())
{
- qDebug() << "Error: unable to find Telescope or TELESCOPE_MOTION_WE switch...";
+ qCWarning(Telescopes) << "Error: unable to find Telescope or TELESCOPE_MOTION_WE switch...";
return;
}
@@ -337,7 +339,7 @@ void INDIConnection::newDevice(INDI::BaseDevice dp)
QString name(dp.getDeviceName());
- qDebug().noquote() << "INDIConnection::newDevice| New Device... " << name;
+ qCDebug(Telescopes).noquote() << "INDIConnection::newDevice| New Device... " << name;
mDevices.append(name);
mTelescope = dp;
@@ -371,13 +373,13 @@ void INDIConnection::newProperty(INDI::Property property)
QString name(property.getName());
- qDebug().noquote() << "INDIConnection::newProperty| " << name;
+ qCDebug(Telescopes).noquote() << "INDIConnection::newProperty| " << name;
if (!mTelescope.isConnected())
{
connectDevice(mTelescope.getDeviceName());
if (mTelescope.isConnected())
- qDebug() << "connected\n";
+ qCDebug(Telescopes) << "connected\n";
}
}
diff --git a/plugins/TelescopeControl/src/INDI/TelescopeClientINDI.cpp b/plugins/TelescopeControl/src/INDI/TelescopeClientINDI.cpp
index 97e3721c0c3d6..197401a3a1d39 100644
--- a/plugins/TelescopeControl/src/INDI/TelescopeClientINDI.cpp
+++ b/plugins/TelescopeControl/src/INDI/TelescopeClientINDI.cpp
@@ -25,13 +25,14 @@
#include "StelCore.hpp"
#include "StelUtils.hpp"
+#include "TelescopeControl.hpp"
#include
#include "INDIControlWidget.hpp"
TelescopeClientINDI::TelescopeClientINDI(const QString &name, const QString ¶ms):
TelescopeClient(name)
{
- qDebug() << "TelescopeClientINDI::TelescopeClientINDI";
+ qCDebug(Telescopes) << "TelescopeClientINDI::TelescopeClientINDI";
static const QRegularExpression paramRx("^([^:]*):(\\d+):([^:]*)$");
QRegularExpressionMatch paramMatch=paramRx.match(params);
@@ -144,13 +145,13 @@ void TelescopeClientINDI::move(double angle, double speed)
{
if (angle < 0.0 || angle >= 360.0)
{
- qWarning() << "TelescopeClientINDI::move angle " << angle << " out of range [0,360)";
+ qCWarning(Telescopes) << "TelescopeClientINDI::move angle " << angle << " out of range [0,360)";
return;
}
if (speed < 0.0 || speed > 1.0)
{
- qWarning() << "TelescopeClientINDI::move speed " << speed << "out of range [0,1]";
+ qCWarning(Telescopes) << "TelescopeClientINDI::move speed " << speed << "out of range [0,1]";
return;
}
diff --git a/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.cpp b/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.cpp
index e9c267a0de426..d0f03035cc011 100644
--- a/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.cpp
+++ b/plugins/TelescopeControl/src/Lx200/TelescopeClientDirectLx200.cpp
@@ -64,16 +64,16 @@ TelescopeClientDirectLx200::TelescopeClientDirectLx200 (const QString &name, con
}
else
{
- qWarning() << "ERROR creating TelescopeClientDirectLx200: invalid parameters.";
+ qCWarning(Telescopes) << "ERROR creating TelescopeClientDirectLx200: invalid parameters.";
return;
}
- qDebug() << "TelescopeClientDirectLx200 parameters: port, time_delay:" << serialDeviceName << time_delay;
+ qCDebug(Telescopes) << "TelescopeClientDirectLx200 parameters: port, time_delay:" << serialDeviceName << time_delay;
//Validation: Time delay
if (time_delay <= 0 || time_delay > 10000000)
{
- qWarning() << "ERROR creating TelescopeClientDirectLx200: time_delay not valid (should be less than 10000000)";
+ qCWarning(Telescopes) << "ERROR creating TelescopeClientDirectLx200: time_delay not valid (should be less than 10000000)";
return;
}
@@ -88,7 +88,7 @@ TelescopeClientDirectLx200::TelescopeClientDirectLx200 (const QString &name, con
lx200 = new Lx200Connection(*this, qPrintable(serialDeviceName));
if (lx200->isClosed())
{
- qWarning() << "ERROR creating TelescopeClientDirectLx200: cannot open serial device" << serialDeviceName;
+ qCWarning(Telescopes) << "ERROR creating TelescopeClientDirectLx200: cannot open serial device" << serialDeviceName;
return;
}
diff --git a/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.cpp b/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.cpp
index 1fa6c6a1c3a78..a09dcf1bc96ac 100644
--- a/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.cpp
+++ b/plugins/TelescopeControl/src/NexStar/TelescopeClientDirectNexStar.cpp
@@ -61,16 +61,16 @@ TelescopeClientDirectNexStar::TelescopeClientDirectNexStar(const QString &name,
}
else
{
- qWarning() << "ERROR creating TelescopeClientDirectNexStar: invalid parameters.";
+ qCWarning(Telescopes) << "ERROR creating TelescopeClientDirectNexStar: invalid parameters.";
return;
}
- qDebug() << "TelescopeClientDirectNexStar parameters: port, time_delay:" << serialDeviceName << time_delay;
+ qCDebug(Telescopes) << "TelescopeClientDirectNexStar parameters: port, time_delay:" << serialDeviceName << time_delay;
//Validation: Time delay
if (time_delay <= 0 || time_delay > 10000000)
{
- qWarning() << "ERROR creating TelescopeClientDirectNexStar: time_delay not valid (should be less than 10000000)";
+ qCWarning(Telescopes) << "ERROR creating TelescopeClientDirectNexStar: time_delay not valid (should be less than 10000000)";
return;
}
@@ -85,7 +85,7 @@ TelescopeClientDirectNexStar::TelescopeClientDirectNexStar(const QString &name,
nexstar = new NexStarConnection(*this, qPrintable(serialDeviceName));
if (nexstar->isClosed())
{
- qWarning() << "ERROR creating TelescopeClientDirectNexStar: cannot open serial device" << serialDeviceName;
+ qCWarning(Telescopes) << "ERROR creating TelescopeClientDirectNexStar: cannot open serial device" << serialDeviceName;
return;
}
diff --git a/plugins/TelescopeControl/src/Rts2/TelescopeClientJsonRts2.cpp b/plugins/TelescopeControl/src/Rts2/TelescopeClientJsonRts2.cpp
index d1ef2638dc295..79dcd0d508d33 100644
--- a/plugins/TelescopeControl/src/Rts2/TelescopeClientJsonRts2.cpp
+++ b/plugins/TelescopeControl/src/Rts2/TelescopeClientJsonRts2.cpp
@@ -65,16 +65,16 @@ TelescopeClientJsonRts2::TelescopeClientJsonRts2(const QString &name, const QStr
}
else
{
- qWarning() << "ERROR creating TelescopeClientJsonRts2: invalid parameters.";
+ qCWarning(Telescopes) << "ERROR creating TelescopeClientJsonRts2: invalid parameters.";
return;
}
- qDebug() << "TelescopeRTS2(" << name << ") URL, refresh timeout: " << url << "," << refresh_delay;
+ qCInfo(Telescopes) << "TelescopeRTS2(" << name << ") URL, refresh timeout: " << url << "," << refresh_delay;
baseurl.setUrl(url);
if (!baseurl.isValid())
{
- qWarning() << "TelescopeRTS2(" << name << ") invalid URL: " << url;
+ qCWarning(Telescopes) << "TelescopeRTS2(" << name << ") invalid URL: " << url;
return;
}
@@ -88,7 +88,7 @@ TelescopeClientJsonRts2::TelescopeClientJsonRts2(const QString &name, const QStr
cfgRequest.setUrl(rurl);
- qDebug() << "TelescopeRTS2(" << name << ")::TelescopeRTS2: request url:" << rurl.toString();
+ qCInfo(Telescopes) << "TelescopeRTS2(" << name << ")::TelescopeRTS2: request url:" << rurl.toString();
connect(&networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
@@ -114,7 +114,7 @@ void TelescopeClientJsonRts2::replyFinished(QNetworkReply *reply)
setReadOnly(true);
return;
}
- qDebug() << "TelescopeRTS2(" << name << ")::replyFinished: error " << reply->error() << " url: " << reply->url().toString();
+ qCWarning(Telescopes) << "TelescopeRTS2(" << name << ")::replyFinished: error " << reply->error() << " url: " << reply->url().toString();
telName = "";
if (reconnectTimer < 0)
reconnectTimer = startTimer(15000);
@@ -129,7 +129,7 @@ void TelescopeClientJsonRts2::replyFinished(QNetworkReply *reply)
}
QByteArray data = reply->readAll();
- //qDebug() << "TelescopeRTS2(" << name << ")::replyFinished: data " << (QString) data;
+ //qCDebug(Telescopes) << "TelescopeRTS2(" << name << ")::replyFinished: data " << (QString) data;
QJsonDocument doc;
QJsonParseError jsonError;
@@ -157,7 +157,7 @@ void TelescopeClientJsonRts2::replyFinished(QNetworkReply *reply)
request.setUrl(rurl);
- qDebug() << "TelescopeRTS2(" << name << ")::replyFinished: request url:" << rurl.toString();
+ qCDebug(Telescopes) << "TelescopeRTS2(" << name << ")::replyFinished: request url:" << rurl.toString();
refreshTimer();
}
@@ -176,7 +176,7 @@ void TelescopeClientJsonRts2::replyFinished(QNetworkReply *reply)
const double dec = telObject["dec"].toDouble() * M_PI / 180.0;
const double cdec = cos(dec);
- qDebug() << "TelescopeRTS2(" << name << ")::replyFinished: RADEC" << ra << dec;
+ qCDebug(Telescopes) << "TelescopeRTS2(" << name << ")::replyFinished: RADEC" << ra << dec;
lastPos.set(cos(ra)*cdec, sin(ra)*cdec, sin(dec));
interpolatedPosition.add(lastPos, getNow(), server_micros, 0);
@@ -187,7 +187,7 @@ void TelescopeClientJsonRts2::replyFinished(QNetworkReply *reply)
{
QJsonObject docObject = doc.object();
int cmdRet = docObject["ret"].toInt();
- qDebug() << "Move command finished: " << cmdRet;
+ qCDebug(Telescopes) << "Move command finished: " << cmdRet;
if (cmdRet == 0)
getReadOnly();
else
@@ -195,7 +195,7 @@ void TelescopeClientJsonRts2::replyFinished(QNetworkReply *reply)
}
else
{
- qWarning() << "TelescopeRTS2(" << name << ")::replyFinished: unhandled reply: " << reply->url().toString();
+ qCWarning(Telescopes) << "TelescopeRTS2(" << name << ")::replyFinished: unhandled reply: " << reply->url().toString();
}
reply->deleteLater();
}
@@ -247,7 +247,7 @@ void TelescopeClientJsonRts2::telescopeGoto(const Vec3d &j2000Pos, StelObjectP s
QNetworkRequest setR;
setR.setUrl(set);
- qDebug() << "TelescopeRTS2(" << name << ")::telescopeGoto: request: " << set.toString();
+ qCDebug(Telescopes) << "TelescopeRTS2(" << name << ")::telescopeGoto: request: " << set.toString();
networkManager.get(setR);
}
@@ -271,7 +271,7 @@ void TelescopeClientJsonRts2::timerEvent(QTimerEvent *event)
{
if (event->timerId() == reconnectTimer)
{
- qDebug() << "Telescope reconnect";
+ qCDebug(Telescopes) << "Telescope reconnect";
networkManager.get(cfgRequest);
}
}
@@ -307,7 +307,7 @@ void TelescopeClientJsonRts2::getReadOnly()
request.setUrl(diurl);
- qDebug() << "TelescopeRTS2(" << name << ")::replyFinished: request url:" << diurl.toString();
+ qCDebug(Telescopes) << "TelescopeRTS2(" << name << ")::replyFinished: request url:" << diurl.toString();
networkManager.get(request);
}
diff --git a/plugins/TelescopeControl/src/TelescopeClient.cpp b/plugins/TelescopeControl/src/TelescopeClient.cpp
index b8e34cf387632..506a5c4b1a1fd 100644
--- a/plugins/TelescopeControl/src/TelescopeClient.cpp
+++ b/plugins/TelescopeControl/src/TelescopeClient.cpp
@@ -74,7 +74,7 @@ TelescopeClient *TelescopeClient::create(const QString &url)
}
else
{
- qWarning() << "Telescope definition" << url << "not recognised";
+ qCWarning(Telescopes) << "Telescope definition" << url << "not recognised";
return nullptr;
}
@@ -118,12 +118,12 @@ TelescopeClient *TelescopeClient::create(const QString &url)
#endif
else
{
- qWarning() << "Unknown telescope type" << type << "- not creating a telescope object for url" << url;
+ qCWarning(Telescopes) << "Unknown telescope type" << type << "- not creating a telescope object for url" << url;
}
if (newTelescope && !newTelescope->isInitialized())
{
- qDebug() << "TelescopeClient::create(): Unable to create a telescope client.";
+ qCWarning(Telescopes) << "TelescopeClient::create(): Unable to create a telescope client.";
delete newTelescope;
newTelescope = nullptr;
}
@@ -153,7 +153,7 @@ QString TelescopeClient::getInfoString(const StelCore* core, const InfoStringGro
void TelescopeClient::telescopeAbortSlew()
{
- qWarning() << "Telescope" << getID() << "does not support AbortSlew()!";
+ qCWarning(Telescopes) << "Telescope" << getID() << "does not support AbortSlew()!";
QMessageBox::critical(&StelMainView::getInstance(), q_("QUICK!"), q_("This Telescope does not support Abort command!"));
}
@@ -161,7 +161,7 @@ void TelescopeClient::move(double angle, double speed)
{
Q_UNUSED(angle)
Q_UNUSED(speed)
- qDebug() << "TelescopeClient::move not implemented";
+ qCInfo(Telescopes) << "TelescopeClient::move not implemented";
}
qint64 TelescopeClient::getNow(void)
@@ -211,7 +211,7 @@ TelescopeTCP::TelescopeTCP(const QString &name, const QString ¶ms, Telescope
}
else
{
- qWarning() << "Incorrect TelescopeTCP parameters";
+ qCWarning(Telescopes) << "Incorrect TelescopeTCP parameters";
return;
}
@@ -219,7 +219,7 @@ TelescopeTCP::TelescopeTCP(const QString &name, const QString ¶ms, Telescope
if (time_delay <= 0 || time_delay > 10000000)
{
- qWarning() << "ERROR creating TelescopeTCP - time_delay not valid (should be less than 10000000)";
+ qCWarning(Telescopes) << "ERROR creating TelescopeTCP - time_delay not valid (should be less than 10000000)";
return;
}
@@ -227,11 +227,11 @@ TelescopeTCP::TelescopeTCP(const QString &name, const QString ¶ms, Telescope
QHostInfo info = QHostInfo::fromName(host);
if (info.error())
{
- qWarning() << "ERROR creating TelescopeTCP: error looking up host " << host << ":" << info.errorString();
+ qCWarning(Telescopes) << "ERROR creating TelescopeTCP: error looking up host " << host << ":" << info.errorString();
return;
}
//BM: is info.addresses().isEmpty() if there's no error?
- //qDebug() << "TelescopeClient::create(): Host addresses:" << info.addresses();
+ //qCInfo(Telescopes) << "TelescopeClient::create(): Host addresses:" << info.addresses();
for (const auto& resolvedAddress : info.addresses())
{
//For now, Stellarium's telescope servers support only IPv4
@@ -243,7 +243,7 @@ TelescopeTCP::TelescopeTCP(const QString &name, const QString ¶ms, Telescope
}
if(address.isNull())
{
- qWarning() << "ERROR creating TelescopeTCP: cannot find IPv4 address. Addresses found at " << host << ":" << info.addresses();
+ qCWarning(Telescopes) << "ERROR creating TelescopeTCP: cannot find IPv4 address. Addresses found at " << host << ":" << info.addresses();
return;
}
@@ -340,7 +340,7 @@ void TelescopeTCP::telescopeGoto(const Vec3d &j2000Pos, StelObjectP selectObject
}
else
{
- qDebug() << "TelescopeTCP(" << name << ")::telescopeGoto: "<< "communication is too slow, I will ignore this command";
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::telescopeGoto: "<< "communication is too slow, I will ignore this command";
}
}
@@ -351,7 +351,7 @@ void TelescopeTCP::performWriting(void)
if (rc < 0)
{
//TODO: Better error message. See the Qt documentation.
- qDebug() << "TelescopeTCP(" << name << ")::performWriting: "
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::performWriting: "
<< "write failed: " << tcpSocket->errorString();
hangup();
}
@@ -379,12 +379,12 @@ void TelescopeTCP::performReading(void)
if (rc < 0)
{
//TODO: Better error warning. See the Qt documentation.
- qDebug() << "TelescopeTCP(" << name << ")::performReading: " << "read failed: " << tcpSocket->errorString();
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::performReading: " << "read failed: " << tcpSocket->errorString();
hangup();
}
else if (rc == 0)
{
- qDebug() << "TelescopeTCP(" << name << ")::performReading: " << "server has closed the connection";
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::performReading: " << "server has closed the connection";
hangup();
}
else
@@ -397,7 +397,7 @@ void TelescopeTCP::performReading(void)
const int size = static_cast((static_cast(p[0])) | ((static_cast(static_cast(p[1]))) << 8));
if (size > static_cast(sizeof(readBuffer)) || size < 4)
{
- qDebug() << "TelescopeTCP(" << name << ")::performReading: " << "bad packet size: " << size;
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::performReading: " << "bad packet size: " << size;
hangup();
return;
}
@@ -417,7 +417,7 @@ void TelescopeTCP::performReading(void)
// "Stellarium telescope control protocol"
if (size < 24)
{
- qDebug() << "TelescopeTCP(" << name << ")::performReading: " << "type 0: bad packet size: " << size;
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::performReading: " << "type 0: bad packet size: " << size;
hangup();
return;
}
@@ -460,7 +460,7 @@ void TelescopeTCP::performReading(void)
}
break;
default:
- qDebug() << "TelescopeTCP(" << name << ")::performReading: " << "ignoring unknown packet, type: " << type;
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::performReading: " << "ignoring unknown packet, type: " << type;
break;
}
p += size;
@@ -496,7 +496,7 @@ bool TelescopeTCP::prepareCommunication()
if(wait_for_connection_establishment)
{
wait_for_connection_establishment = false;
- qDebug() << "TelescopeTCP(" << name << ")::prepareCommunication: Connection established";
+ qCDebug(Telescopes) << "TelescopeTCP(" << name << ")::prepareCommunication: Connection established";
}
return true;
}
@@ -506,7 +506,7 @@ bool TelescopeTCP::prepareCommunication()
if (now > end_of_timeout)
{
end_of_timeout = now + 1000000;
- qDebug() << "TelescopeTCP(" << name << ")::prepareCommunication: Connection attempt timed out";
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << ")::prepareCommunication: Connection attempt timed out";
hangup();
}
}
@@ -518,7 +518,7 @@ bool TelescopeTCP::prepareCommunication()
end_of_timeout = now + 5000000;
tcpSocket->connectToHost(address, port);
wait_for_connection_establishment = true;
- qDebug() << "TelescopeTCP(" << name << ")::prepareCommunication: Attempting to connect to host" << address.toString() << "at port" << port;
+ qCDebug(Telescopes) << "TelescopeTCP(" << name << ")::prepareCommunication: Attempting to connect to host" << address.toString() << "at port" << port;
}
return false;
}
@@ -540,12 +540,12 @@ void TelescopeTCP::performCommunication()
void TelescopeTCP::socketConnected(void)
{
- qDebug() << "TelescopeTCP(" << name <<"): turning off Nagle algorithm.";
+ qCDebug(Telescopes) << "TelescopeTCP(" << name <<"): turning off Nagle algorithm.";
tcpSocket->setSocketOption(QAbstractSocket::LowDelayOption, 1);
}
//TODO: More informative error messages?
void TelescopeTCP::socketFailed(QAbstractSocket::SocketError)
{
- qDebug() << "TelescopeTCP(" << name << "): TCP socket error:\n" << tcpSocket->errorString();
+ qCWarning(Telescopes) << "TelescopeTCP(" << name << "): TCP socket error:\n" << tcpSocket->errorString();
}
diff --git a/plugins/TelescopeControl/src/TelescopeClient.hpp b/plugins/TelescopeControl/src/TelescopeClient.hpp
index 855a55dc4a8d7..a93fe54801779 100644
--- a/plugins/TelescopeControl/src/TelescopeClient.hpp
+++ b/plugins/TelescopeControl/src/TelescopeClient.hpp
@@ -182,7 +182,7 @@ class TelescopeClientDummy : public TelescopeClient
void telescopeAbortSlew() override
{
desired_pos=XYZ;
- qDebug() << "Telescope" << getID() << "Slew aborted";
+ qCInfo(Telescopes) << "Telescope" << getID() << "Slew aborted";
}
bool isAbortSlewSupported() const override {return true;}
bool hasKnownPosition(void) const override
diff --git a/plugins/TelescopeControl/src/TelescopeControl.cpp b/plugins/TelescopeControl/src/TelescopeControl.cpp
index d900f66775859..f912c2c8418bb 100644
--- a/plugins/TelescopeControl/src/TelescopeControl.cpp
+++ b/plugins/TelescopeControl/src/TelescopeControl.cpp
@@ -63,6 +63,8 @@
#define DEFAULT_RTS2_REFRESH 500000
+Q_LOGGING_CATEGORY(Telescopes,"stel.Telescopes", QtInfoMsg)
+
////////////////////////////////////////////////////////////////////////////////
//
StelModule* TelescopeControlStelPluginInterface::getStelModule() const
@@ -141,7 +143,7 @@ void TelescopeControl::init()
loadDeviceModels();
if(deviceModels.isEmpty())
{
- qWarning() << "[TelescopeControl] No device model descriptions have been loaded. Stellarium will not be able to control a telescope on its own, but it is still possible to do it through an external application or to connect to a remote host.";
+ qCWarning(Telescopes) << "[TelescopeControl] No device model descriptions have been loaded. Stellarium will not be able to control a telescope on its own, but it is still possible to do it through an external application or to connect to a remote host.";
}
//Unload Stellarium's internal telescope control module
@@ -222,7 +224,7 @@ void TelescopeControl::init()
}
catch (std::runtime_error &e)
{
- qWarning() << "[TelescopeControl] init() error: " << e.what();
+ qCWarning(Telescopes) << "[TelescopeControl] init() error: " << e.what();
return;
}
@@ -276,7 +278,7 @@ void TelescopeControl::deinit()
#endif
telescopeServerProcess[slotNumber]->waitForFinished();
delete telescopeServerProcess[slotNumber];
- qDebug() << "[TelescopeControl] deinit(): Server process at slot" << slotNumber << "terminated successfully.";
+ qCDebug(Telescopes) << "[TelescopeControl] deinit(): Server process at slot" << slotNumber << "terminated successfully.";
}
//Save the configuration on exit
@@ -582,7 +584,7 @@ void TelescopeControl::loadTelescopeServerExecutables(void)
QDir serverDirectory(serverExecutablesDirectoryPath);
if(!serverDirectory.exists())
{
- qWarning() << "[TelescopeControl] No telescope server directory has been found.";
+ qCWarning(Telescopes) << "[TelescopeControl] No telescope server directory has been found.";
return;
}
QList telescopeServerExecutables = serverDirectory.entryInfoList(QStringList("TelescopeServer*"), (QDir::Files|QDir::Executable|QDir::CaseSensitive), QDir::Name);
@@ -593,7 +595,7 @@ void TelescopeControl::loadTelescopeServerExecutables(void)
}
else
{
- qWarning() << "[TelescopeControl] No telescope server executables found in" << serverExecutablesDirectoryPath;
+ qCWarning(Telescopes) << "[TelescopeControl] No telescope server executables found in" << serverExecutablesDirectoryPath;
}
}
@@ -636,7 +638,7 @@ void TelescopeControl::loadConfiguration()
QString serverDirectoryPath = StelFileMgr::findFile("servers", StelFileMgr::Directory);
if (serverDirectoryPath.isEmpty())
{
- //qDebug() << "TelescopeControl: No telescope servers directory detected.";
+ //qCDebug(Telescopes) << "TelescopeControl: No telescope servers directory detected.";
useServerExecutables = false;
serverDirectoryPath = StelFileMgr::getUserDir() + "/servers";
}
@@ -702,13 +704,13 @@ void TelescopeControl::saveTelescopes()
QString telescopesJsonPath = StelFileMgr::findFile("modules/TelescopeControl", static_cast(StelFileMgr::Directory|StelFileMgr::Writable)) + "/telescopes.json";
if (telescopesJsonPath.isEmpty())
{
- qWarning() << "[TelescopeControl] Error saving telescopes";
+ qCWarning(Telescopes) << "[TelescopeControl] Error saving telescopes";
return;
}
QFile telescopesJsonFile(telescopesJsonPath);
if(!telescopesJsonFile.open(QFile::WriteOnly|QFile::Text))
{
- qWarning() << "[TelescopeControl] Telescopes can not be saved. A file can not be open for writing:" << QDir::toNativeSeparators(telescopesJsonPath);
+ qCWarning(Telescopes) << "[TelescopeControl] Telescopes can not be saved. A file can not be open for writing:" << QDir::toNativeSeparators(telescopesJsonPath);
return;
}
@@ -728,12 +730,12 @@ void TelescopeControl::loadTelescopes()
QString telescopesJsonPath = StelFileMgr::findFile("modules/TelescopeControl", static_cast(StelFileMgr::Directory|StelFileMgr::Writable)) + "/telescopes.json";
if (telescopesJsonPath.isEmpty())
{
- qWarning() << "[TelescopeControl] Error loading telescopes";
+ qCWarning(Telescopes) << "[TelescopeControl] Error loading telescopes";
return;
}
if(!QFileInfo::exists(telescopesJsonPath))
{
- qWarning().noquote() << "[TelescopeControl] loadTelescopes(): No telescopes loaded. File is missing:" << QDir::toNativeSeparators(telescopesJsonPath);
+ qCWarning(Telescopes).noquote() << "[TelescopeControl] loadTelescopes(): No telescopes loaded. File is missing:" << QDir::toNativeSeparators(telescopesJsonPath);
telescopeDescriptions = result;
return;
}
@@ -744,7 +746,7 @@ void TelescopeControl::loadTelescopes()
if(!telescopesJsonFile.open(QFile::ReadOnly))
{
- qWarning().noquote() << "[TelescopeControl] No telescopes loaded. Can't open for reading" << QDir::toNativeSeparators(telescopesJsonPath);
+ qCWarning(Telescopes).noquote() << "[TelescopeControl] No telescopes loaded. Can't open for reading" << QDir::toNativeSeparators(telescopesJsonPath);
telescopeDescriptions = result;
return;
}
@@ -767,11 +769,11 @@ void TelescopeControl::loadTelescopes()
QString newName = telescopesJsonPath + ".backup." + QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss");
if(telescopesJsonFile.rename(newName))
{
- qWarning() << "[TelescopeControl] The existing version of telescopes.json is obsolete. Backing it up as" << QDir::toNativeSeparators(newName);
- qWarning() << "[TelescopeControl] A blank telescopes.json file will have to be created.";
+ qCWarning(Telescopes) << "[TelescopeControl] The existing version of telescopes.json is obsolete. Backing it up as" << QDir::toNativeSeparators(newName);
+ qCWarning(Telescopes) << "[TelescopeControl] A blank telescopes.json file will have to be created.";
}
else
- qWarning() << "[TelescopeControl] The existing version of telescopes.json is obsolete. Unable to rename.";
+ qCWarning(Telescopes) << "[TelescopeControl] The existing version of telescopes.json is obsolete. Unable to rename.";
telescopeDescriptions = result;
QMessageBox::warning(&StelMainView::getInstance(), q_("Attention!"), q_("The existing version of the configuration data for telescopes in the Telescope Control plugin is obsolete."), QMessageBox::Ok);
@@ -797,7 +799,7 @@ void TelescopeControl::loadTelescopes()
int slot = key.toInt(&ok);
if(!ok || !isValidSlotNumber(slot))
{
- qDebug() << "[TelescopeControl] loadTelescopes(): Deleted node unrecogised as slot:" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] loadTelescopes(): Deleted node unrecogised as slot:" << key;
map.remove(key);
continue;
}
@@ -809,7 +811,7 @@ void TelescopeControl::loadTelescopes()
QString name = telescope.value("name").toString();
if(name.isEmpty())
{
- qDebug() << "[TelescopeControl] Unable to load telescope: No name specified at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope: No name specified at slot" << key;
map.remove(key);
continue;
}
@@ -818,7 +820,7 @@ void TelescopeControl::loadTelescopes()
QString connection = telescope.value("connection").toString();
if(connection.isEmpty() || !connectionTypeNames.values().contains(connection))
{
- qDebug() << "[TelescopeControl] Unable to load telescope: No valid connection type at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope: No valid connection type at slot" << key;
map.remove(key);
continue;
}
@@ -827,7 +829,7 @@ void TelescopeControl::loadTelescopes()
QString equinox = telescope.value("equinox", "J2000").toString();
if (equinox != "J2000" && equinox != "JNow")
{
- qDebug() << "[TelescopeControl] Unable to load telescope: Invalid equinox value at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope: Invalid equinox value at slot" << key;
map.remove(key);
continue;
}
@@ -852,7 +854,7 @@ void TelescopeControl::loadTelescopes()
if(deviceModelName.isEmpty())
{
- qDebug() << "[TelescopeControl] Unable to load telescope: No device model specified at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope: No device model specified at slot" << key;
map.remove(key);
continue;
}
@@ -860,15 +862,15 @@ void TelescopeControl::loadTelescopes()
//Do we have this server?
if(!deviceModels.contains(deviceModelName))
{
- qWarning() << "[TelescopeControl] Unable to load telescope at slot" << slot
- << "because the specified device model is missing:" << deviceModelName;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope at slot" << slot
+ << "because the specified device model is missing:" << deviceModelName;
map.remove(key);
continue;
}
if(portSerial.isEmpty())
{
- qDebug() << "[TelescopeControl] Unable to load telescope: No valid serial port specified at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope: No valid serial port specified at slot" << key;
map.remove(key);
continue;
}
@@ -880,7 +882,7 @@ void TelescopeControl::loadTelescopes()
hostName = telescope.value("host_name").toString();
if(hostName.isEmpty())
{
- qDebug() << "[TelescopeControl] loadTelescopes(): No host name at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] loadTelescopes(): No host name at slot" << key;
map.remove(key);
continue;
}
@@ -905,7 +907,7 @@ void TelescopeControl::loadTelescopes()
rts2Url = telescope.value("url").toString();
if(rts2Url.isEmpty())
{
- qDebug() << "[TelescopeControl] loadTelescopes(): No URL at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] loadTelescopes(): No URL at slot" << key;
map.remove(key);
continue;
}
@@ -922,7 +924,7 @@ void TelescopeControl::loadTelescopes()
portTCP = telescope.value("tcp_port").toInt();
if(!telescope.contains("tcp_port") || !isValidPort(portTCP))
{
- qDebug() << "[TelescopeControl] Unable to load telescope: No valid TCP port at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope: No valid TCP port at slot" << key;
map.remove(key);
continue;
}
@@ -932,7 +934,7 @@ void TelescopeControl::loadTelescopes()
delay = telescope.value("delay", 0).toInt();
if(!isValidDelay(delay))
{
- qDebug() << "[TelescopeControl] Unable to load telescope: No valid delay at slot" << key;
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to load telescope: No valid delay at slot" << key;
map.remove(key);
continue;
}
@@ -980,12 +982,12 @@ void TelescopeControl::loadTelescopes()
if(!startServerAtSlot(slot, deviceModelName, portTCP, portSerial))
{
stopClientAtSlot(slot);
- qDebug() << "[TelescopeControl] Unable to launch a telescope server at slot" << slot;
+ qCDebug(Telescopes) << "[TelescopeControl] Unable to launch a telescope server at slot" << slot;
}
}
else
{
- qDebug() << "[TelescopeControl] Unable to create a telescope client at slot" << slot;
+ qCDebug(Telescopes) << "[TelescopeControl] Unable to create a telescope client at slot" << slot;
//Unnecessary due to if-else construction;
//also, causes bug #608533
//continue;
@@ -997,7 +999,7 @@ void TelescopeControl::loadTelescopes()
logAtSlot(slot);
if(!startClientAtSlot(slot, connectionType, name, equinox, QString(), 0, delay, internalCircles, deviceModelName, portSerial))
{
- qDebug() << "[TelescopeControl] Unable to create a telescope client at slot" << slot;
+ qCDebug(Telescopes) << "[TelescopeControl] Unable to create a telescope client at slot" << slot;
//Unnecessary due to if-else construction;
//also, causes bug #608533
//continue;
@@ -1008,7 +1010,7 @@ void TelescopeControl::loadTelescopes()
{
if(!startClientAtSlot(slot, connectionType, name, equinox, hostName, portTCP, delay, internalCircles, deviceModelName, portSerial, rts2Url, rts2Username, rts2Password, rts2Refresh, ascomDeviceId, ascomUseDeviceEqCoordType))
{
- qDebug() << "[TelescopeControl] Unable to create a telescope client at slot" << slot;
+ qCDebug(Telescopes) << "[TelescopeControl] Unable to create a telescope client at slot" << slot;
//Unnecessary due to if-else construction;
//also, causes bug #608533
//continue;
@@ -1023,7 +1025,7 @@ void TelescopeControl::loadTelescopes()
if(telescopesCount > 0)
{
result = map;
- qDebug() << "[TelescopeControl] Loaded successfully" << telescopesCount
+ qCDebug(Telescopes) << "[TelescopeControl] Loaded successfully" << telescopesCount
<< "telescopes.";
}
@@ -1324,7 +1326,7 @@ bool TelescopeControl::startServerAtSlot(int slotNumber, QString deviceModelName
QString serverExecutablePath = StelFileMgr::findFile(serverExecutablesDirectoryPath + TELESCOPE_SERVER_PATH.arg(serverName), StelFileMgr::File);
if (serverExecutablePath.isEmpty())
{
- qDebug() << "[TelescopeControl] Error starting telescope server: Can't find executable:" << QDir::toNativeSeparators(serverExecutablePath);
+ qCDebug(Telescopes) << "[TelescopeControl] Error starting telescope server: Can't find executable:" << QDir::toNativeSeparators(serverExecutablePath);
return false;
}
@@ -1338,7 +1340,7 @@ bool TelescopeControl::startServerAtSlot(int slotNumber, QString deviceModelName
if(useTelescopeServerLogs)
serverArguments << QString(StelFileMgr::getUserDir() + "/log_TelescopeServer" + slotName + ".txt");
- qDebug() << "[TelescopeControl] Starting tellescope server at slot" << slotName
+ qCDebug(Telescopes) << "[TelescopeControl] Starting tellescope server at slot" << slotName
<< "with path" << QDir::toNativeSeparators(serverExecutablePath)
<< "and arguments" << serverArguments.join(" ");
@@ -1352,7 +1354,7 @@ bool TelescopeControl::startServerAtSlot(int slotNumber, QString deviceModelName
return true;
}
else
- qDebug() << "[TelescopeControl] Error starting telescope server: No such server found:" << serverName;
+ qCDebug(Telescopes) << "[TelescopeControl] Error starting telescope server: No such server found:" << serverName;
return false;
}
@@ -1427,7 +1429,7 @@ bool TelescopeControl::startClientAtSlot(int slotNumber, ConnectionType connecti
initString = QString("%1:TCP:%2:%3:%4:%5").arg(name, equinox, host, QString::number(portTCP), QString::number(delay));
}
- qDebug() << "connectionType:" << connectionType << " initString:" << initString;
+ qCDebug(Telescopes) << "connectionType:" << connectionType << " initString:" << initString;
TelescopeClient* newTelescope = TelescopeClient::create(initString);
if (newTelescope)
@@ -1473,7 +1475,7 @@ bool TelescopeControl::stopClientAtSlot(int slotNumber)
void TelescopeControl::loadDeviceModels()
{
- //qDebug() << "TelescopeControl: Loading device model descriptions...";
+ //qCDebug(Telescopes) << "TelescopeControl: Loading device model descriptions...";
//Make sure that the device models file exists
bool useDefaultList = false;
@@ -1482,7 +1484,7 @@ void TelescopeControl::loadDeviceModels()
{
if(!restoreDeviceModelsListTo(deviceModelsJsonPath))
{
- qWarning() << "[TelescopeControl] Unable to find " << QDir::toNativeSeparators(deviceModelsJsonPath);
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to find " << QDir::toNativeSeparators(deviceModelsJsonPath);
useDefaultList = true;
}
}
@@ -1491,7 +1493,7 @@ void TelescopeControl::loadDeviceModels()
QFile deviceModelsJsonFile(deviceModelsJsonPath);
if(!deviceModelsJsonFile.open(QFile::ReadOnly))
{
- qWarning() << "[TelescopeControl] Can't open for reading " << QDir::toNativeSeparators(deviceModelsJsonPath);
+ qCWarning(Telescopes) << "[TelescopeControl] Can't open for reading " << QDir::toNativeSeparators(deviceModelsJsonPath);
useDefaultList = true;
}
else
@@ -1506,7 +1508,7 @@ void TelescopeControl::loadDeviceModels()
QString newName = deviceModelsJsonPath + ".backup." + QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss");
if(deviceModelsJsonFile.rename(newName))
{
- qWarning() << "[TelescopeControl] The existing version of device_models.json is obsolete. Backing it up as " << QDir::toNativeSeparators(newName);
+ qCInfo(Telescopes) << "[TelescopeControl] The existing version of device_models.json is obsolete. Backing it up as " << QDir::toNativeSeparators(newName);
if(!restoreDeviceModelsListTo(deviceModelsJsonPath))
{
useDefaultList = true;
@@ -1514,7 +1516,7 @@ void TelescopeControl::loadDeviceModels()
}
else
{
- qWarning() << "[TelescopeControl] The existing version of device_models.json is obsolete. Unable to rename.";
+ qCWarning(Telescopes) << "[TelescopeControl] The existing version of device_models.json is obsolete. Unable to rename.";
useDefaultList = true;
}
}
@@ -1525,7 +1527,7 @@ void TelescopeControl::loadDeviceModels()
if (useDefaultList)
{
- qWarning() << "[TelescopeControl] Using embedded device models list.";
+ qCInfo(Telescopes) << "[TelescopeControl] Using embedded device models list.";
deviceModelsJsonPath = ":/telescopeControl/device_models.json";
}
@@ -1548,7 +1550,7 @@ void TelescopeControl::loadDeviceModels()
{
//deviceModels = QHash();
//return;
- qWarning() << "[TelescopeControl] Only embedded telescope servers are available.";
+ qCWarning(Telescopes) << "[TelescopeControl] Only embedded telescope servers are available.";
}
//Clear the list of device models - it may not be empty.
@@ -1571,7 +1573,7 @@ void TelescopeControl::loadDeviceModels()
if(deviceModels.contains(name))
{
- qWarning() << "[TelescopeControl] Skipping device model: Duplicate name:" << name;
+ qCWarning(Telescopes) << "[TelescopeControl] Skipping device model: Duplicate name:" << name;
continue;
}
@@ -1581,26 +1583,26 @@ void TelescopeControl::loadDeviceModels()
bool useExecutable = false;
if(server.isEmpty())
{
- qWarning() << "[TelescopeControl] Skipping device model: No server specified for" << name;
+ qCWarning(Telescopes) << "[TelescopeControl] Skipping device model: No server specified for" << name;
continue;
}
if(useServerExecutables)
{
if(telescopeServers.contains(server))
{
- qDebug() << "[TelescopeControl] Using telescope server executable for" << name;
+ qCDebug(Telescopes) << "[TelescopeControl] Using telescope server executable for" << name;
useExecutable = true;
}
else if(EMBEDDED_TELESCOPE_SERVERS.contains(server))
{
- qWarning() << "[TelescopeControl] No external telescope server executable found for" << name;
- qWarning() << "[TelescopeControl] Using embedded telescope server" << server
+ qCWarning(Telescopes) << "[TelescopeControl] No external telescope server executable found for" << name;
+ qCWarning(Telescopes) << "[TelescopeControl] Using embedded telescope server" << server
<< "for" << name;
useExecutable = false;
}
else
{
- qWarning() << "[TelescopeControl] Skipping device model: No server" << server
+ qCWarning(Telescopes) << "[TelescopeControl] Skipping device model: No server" << server
<< "found for" << name;
continue;
}
@@ -1609,7 +1611,7 @@ void TelescopeControl::loadDeviceModels()
{
if(!EMBEDDED_TELESCOPE_SERVERS.contains(server))
{
- qWarning() << "[TelescopeControl] Skipping device model: No server" << server
+ qCWarning(Telescopes) << "[TelescopeControl] Skipping device model: No server" << server
<< "found for" << name;
continue;
}
@@ -1623,7 +1625,7 @@ void TelescopeControl::loadDeviceModels()
//Add this to the main list
DeviceModel newDeviceModel = {name, description, server, delay, useExecutable};
deviceModels.insert(name, newDeviceModel);
- qDebug() << "[TelescopeControl] Adding device model:" << name << description << server << delay;
+ qCDebug(Telescopes) << "[TelescopeControl] Adding device model:" << name << description << server << delay;
}
}
@@ -1654,13 +1656,13 @@ bool TelescopeControl::restoreDeviceModelsListTo(QString deviceModelsListPath)
QFile defaultFile(":/telescopeControl/device_models.json");
if (!defaultFile.copy(deviceModelsListPath))
{
- qWarning() << "[TelescopeControl] Unable to copy the default device models list to" << QDir::toNativeSeparators(deviceModelsListPath);
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to copy the default device models list to" << QDir::toNativeSeparators(deviceModelsListPath);
return false;
}
QFile newCopy(deviceModelsListPath);
newCopy.setPermissions(newCopy.permissions() | QFile::WriteOwner);
- qDebug() << "[TelescopeControl] The default device models list has been copied to" << QDir::toNativeSeparators(deviceModelsListPath);
+ qCDebug(Telescopes) << "[TelescopeControl] The default device models list has been copied to" << QDir::toNativeSeparators(deviceModelsListPath);
return true;
}
@@ -1675,13 +1677,13 @@ bool TelescopeControl::setServerExecutablesDirectoryPath(const QString& newPath)
QDir newServerDirectory(newPath);
if(!newServerDirectory.exists())
{
- qWarning() << "[TelescopeControl] Can't find such a directory: " << QDir::toNativeSeparators(newPath);
+ qCWarning(Telescopes) << "[TelescopeControl] Can't find such a directory: " << QDir::toNativeSeparators(newPath);
return false;
}
QList telescopeServerExecutables = newServerDirectory.entryInfoList(QStringList("TelescopeServer*"), (QDir::Files|QDir::Executable|QDir::CaseSensitive), QDir::Name);
if(telescopeServerExecutables.isEmpty())
{
- qWarning() << "[TelescopeControl] No telescope server executables found in"
+ qCWarning(Telescopes) << "[TelescopeControl] No telescope server executables found in"
<< QDir::toNativeSeparators(serverExecutablesDirectoryPath);
return false;
}
@@ -1725,7 +1727,7 @@ void TelescopeControl::addLogAtSlot(int slot)
QFile* logFile = new QFile(filePath);
if (!logFile->open(QFile::WriteOnly|QFile::Text|QFile::Truncate|QFile::Unbuffered))
{
- qWarning() << "[TelescopeControl] Unable to create a log file for slot" << slot
+ qCWarning(Telescopes) << "[TelescopeControl] Unable to create a log file for slot" << slot
<< ":" << QDir::toNativeSeparators(filePath);
telescopeServerLogFiles.insert(slot, logFile);
telescopeServerLogStreams.insert(slot, new QTextStream(new QFile()));
diff --git a/plugins/TelescopeControl/src/TelescopeControl.hpp b/plugins/TelescopeControl/src/TelescopeControl.hpp
index 7257bc8d90c75..22db9f71dd29b 100644
--- a/plugins/TelescopeControl/src/TelescopeControl.hpp
+++ b/plugins/TelescopeControl/src/TelescopeControl.hpp
@@ -35,6 +35,7 @@
#include "StelTextureTypes.hpp"
#include "VecMath.hpp"
+#include
#include
#include
#include
@@ -74,6 +75,14 @@ setting up the connection.
//! No esoteric features like motor focus, electric heating and such.
//! The actual controlling of a telescope is left to the implementation
//! of the abstract base class TelescopeClient.
+
+
+//! @note You can finetune the amount of TelescopeControl related messages in the logfile by configuring the logging category stel.Telescopes.
+//! For this, e.g. set environment variable QT_LOGGING_RULES="*.debug=false;stel.Telescopes.debug=true;".
+//! By default, only Info and more severe messages are displayed.
+Q_DECLARE_LOGGING_CATEGORY(Telescopes)
+
+
class TelescopeControl : public StelObjectModule
{
Q_OBJECT
diff --git a/plugins/TelescopeControl/src/common/ASCOMSupport.cpp b/plugins/TelescopeControl/src/common/ASCOMSupport.cpp
index da34feb302d40..4a009d99fe95d 100644
--- a/plugins/TelescopeControl/src/common/ASCOMSupport.cpp
+++ b/plugins/TelescopeControl/src/common/ASCOMSupport.cpp
@@ -18,6 +18,7 @@
#include "OLE.hpp"
+#include "TelescopeControl.hpp"
#include "ASCOMSupport.hpp"
@@ -53,7 +54,7 @@ bool ASCOMSupport::isASCOMSupported()
int ASCOMSupport::getASCOMMajorVersion()
{
- #ifdef Q_OS_WIN
+#ifdef Q_OS_WIN
VARIANT v1;
HRESULT hResult;
@@ -65,26 +66,33 @@ int ASCOMSupport::getASCOMMajorVersion()
// OLE Problem
if (FAILED(hResult) || !initResult) {
+ qCCritical(Telescopes).nospace().noquote() << "ASCOM getASCOMMajorVersion(): initResult = " << initResult
+ << ", hResult = 0x" << QString::number(unsigned(hResult), 16)
+ << " = " << QString::number((hResult), 10);
+ qCCritical(Telescopes) << "Problem with ASCOM. Presumably not installed properly?";
return false;
}
hResult = OlePropertyGet(utilDispatch, &v1, const_cast(LPlatformVersion));
+ if (hResult != 0)
+ qCInfo(Telescopes) << "ASCOM platformversion call returns (0 = call successful)" << hResult;
QString version = QString::fromStdWString(v1.bstrVal);
- QString majorVersion = "";
+ QString majorVersion;
static const QRegularExpression versionRx("^([^\\.]*)\\.([^\\.]*)$");
QRegularExpressionMatch versionMatch=versionRx.match(version);
if (versionMatch.hasMatch())
{
majorVersion = versionMatch.captured(1).trimmed();
+ qCInfo(Telescopes) << "ASCOM platformversion returns version" << version << ", major:" << majorVersion;
return majorVersion.toInt();
}
return 0;
- #else // Q_OS_WIN
+#else // Q_OS_WIN
return 0;
- #endif // Q_OS_WIN
+#endif // Q_OS_WIN
}
const wchar_t* ASCOMSupport::LPlatformVersion = L"PlatformVersion";
diff --git a/plugins/TelescopeControl/src/common/OLE.cpp b/plugins/TelescopeControl/src/common/OLE.cpp
index 46b911e16fd50..ae4f15cc1682d 100644
--- a/plugins/TelescopeControl/src/common/OLE.cpp
+++ b/plugins/TelescopeControl/src/common/OLE.cpp
@@ -17,6 +17,7 @@
*/
#include "OLE.hpp"
+#include "TelescopeControl.hpp"
#ifdef Q_OS_WIN
#include
#include
@@ -40,7 +41,8 @@ static HRESULT OleInternalDispatch(
hResult = pIDispatch->GetIDsOfNames(IID_NULL, &pOleName, 1, LOCALE_USER_DEFAULT, &dispId);
if (FAILED(hResult))
{
- qWarning() << "OleInvoke: Failed to get DispId";
+ qCWarning(Telescopes).nospace().noquote() << "OleInvoke: Failed to get DispId. hResult="
+ << hResult << " (0x" << QString::number(hResult, 16) << ").";
return hResult;
}
@@ -72,8 +74,10 @@ static HRESULT OleInternalDispatch(
if (FAILED(hResult))
{
- qWarning() << "OleInvoke: Exception [scode: " << execpInfo.scode << "wcode: " << execpInfo.wCode
- << " puArgErr: " << puArgErr << "] GLE: " << GetLastError();
+ qCWarning(Telescopes).nospace().noquote() << "OleInvoke: Exception [scode: " << execpInfo.scode << " (0x"
+ << QString::number(unsigned(execpInfo.scode), 16) << ") wcode: "
+ << execpInfo.wCode << " (0x" << QString::number(unsigned(execpInfo.wCode), 16)
+ << ") puArgErr: " << puArgErr << " (0x" << QString::number(puArgErr, 16) << ")] GLE: " << GetLastError();
SysFreeString(execpInfo.bstrDescription);
SysFreeString(execpInfo.bstrHelpFile);
@@ -151,6 +155,73 @@ VARIANT OleBoolToVariant(BOOL b)
return v;
}
+QString variantToQstring(VARIANT &var)
+{
+ VARIANT varDest;
+ VariantInit(&varDest);
+ QPairout;
+
+ // Attempt to convert to string type (VT_BSTR)
+ if (SUCCEEDED(VariantChangeType(&varDest, &var, 0, VT_BSTR))) {
+ out.first="VT_BSTR";
+ out.second=QString::fromUtf16(reinterpret_cast(varDest.bstrVal));
+ VariantClear(&varDest); // Clean up
+ } else {
+ out.first="Not";
+ out.second="understood";
+ qCWarning(Telescopes) << "Unsupported variant type: " << var.vt;
+ }
+ return QString("%1: %2").arg(out.first, out.second);
+}
+
+int variantToInt(VARIANT &var)
+{
+ VARIANT varDest;
+ VariantInit(&varDest);
+ int out;
+
+ // Attempt to convert to string type (VT_BSTR)
+ if (SUCCEEDED(VariantChangeType(&varDest, &var, 0, VT_I4))){
+ out=varDest.intVal;
+ VariantClear(&varDest); // Clean up
+ } else {
+ qCWarning(Telescopes) << "Unsupported variant type: " << var.vt;
+ }
+ return out;
+}
+
+double variantToDouble(VARIANT &var)
+{
+ VARIANT varDest;
+ VariantInit(&varDest);
+ double out;
+
+ // Attempt to convert to string type (VT_BSTR)
+ if (SUCCEEDED(VariantChangeType(&varDest, &var, 0, VT_R8))){
+ out=varDest.dblVal;
+ VariantClear(&varDest); // Clean up
+ } else {
+ qCWarning(Telescopes) << "Unsupported variant type: " << var.vt;
+ }
+ return out;
+}
+
+bool variantToBool(VARIANT &var)
+{
+ VARIANT varDest;
+ VariantInit(&varDest);
+ bool out;
+
+ // Attempt to convert to string type (VT_BSTR)
+ if (SUCCEEDED(VariantChangeType(&varDest, &var, 0, VT_BOOL))){
+ out = ( varDest.boolVal == 0 ? false : true );
+ VariantClear(&varDest); // Clean up
+ } else {
+ qCWarning(Telescopes) << "Unsupported variant type: " << var.vt;
+ }
+ return out;
+}
+
VOID OleReleaseInstance(IDispatch* pIDispatch)
{
pIDispatch->Release();
diff --git a/plugins/TelescopeControl/src/common/OLE.hpp b/plugins/TelescopeControl/src/common/OLE.hpp
index fdfc441df9919..0e51e572c66ae 100644
--- a/plugins/TelescopeControl/src/common/OLE.hpp
+++ b/plugins/TelescopeControl/src/common/OLE.hpp
@@ -49,5 +49,11 @@ VARIANT OleIntToVariant(INT i);
VARIANT OleDoubleToVariant(double d);
VARIANT OleBoolToVariant(BOOL b);
+// Debugging helper
+QString variantToQstring(VARIANT &var);
+int variantToInt(VARIANT &var);
+double variantToDouble(VARIANT &var);
+bool variantToBool(VARIANT &var);
+
#endif // OLE_HPP
-#endif // Q_OS_WIN
\ No newline at end of file
+#endif // Q_OS_WIN
diff --git a/plugins/TelescopeControl/src/gui/SlewDialog.cpp b/plugins/TelescopeControl/src/gui/SlewDialog.cpp
index ea16fc6f99bb8..27143f0387497 100644
--- a/plugins/TelescopeControl/src/gui/SlewDialog.cpp
+++ b/plugins/TelescopeControl/src/gui/SlewDialog.cpp
@@ -381,13 +381,13 @@ void SlewDialog::savePointsToFile()
QString pointsJsonPath = StelFileMgr::findFile("modules/TelescopeControl", static_cast(StelFileMgr::Directory|StelFileMgr::Writable)) + "/points.json";
if (pointsJsonPath.isEmpty())
{
- qWarning() << "SlewDialog: Error saving points";
+ qCWarning(Telescopes) << "SlewDialog: Error saving points";
return;
}
QFile pointsJsonFile(pointsJsonPath);
if(!pointsJsonFile.open(QFile::WriteOnly|QFile::Text))
{
- qWarning() << "SlewDialog: Points can not be saved. A file can not be open for writing:"
+ qCWarning(Telescopes) << "SlewDialog: Points can not be saved. A file can not be open for writing:"
<< QDir::toNativeSeparators(pointsJsonPath);
return;
}
@@ -421,12 +421,12 @@ void SlewDialog::loadPointsFromFile()
if (pointsJsonPath.isEmpty())
{
- qWarning() << "SlewDialog: Error loading points";
+ qCWarning(Telescopes) << "SlewDialog: Error loading points";
return;
}
if(!QFileInfo::exists(pointsJsonPath))
{
- qWarning() << "SlewDialog::loadPointsFromFile(): No points loaded. File is missing:"
+ qCWarning(Telescopes) << "SlewDialog::loadPointsFromFile(): No points loaded. File is missing:"
<< QDir::toNativeSeparators(pointsJsonPath);
storedPointsDescriptions = result;
return;
@@ -438,7 +438,7 @@ void SlewDialog::loadPointsFromFile()
if(!pointsJsonFile.open(QFile::ReadOnly))
{
- qWarning() << "SlewDialog: No points loaded. Can't open for reading"
+ qCWarning(Telescopes) << "SlewDialog: No points loaded. Can't open for reading"
<< QDir::toNativeSeparators(pointsJsonPath);
storedPointsDescriptions = result;
return;
@@ -462,15 +462,15 @@ void SlewDialog::loadPointsFromFile()
QString newName = pointsJsonPath + ".backup." + QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss");
if(pointsJsonFile.rename(newName))
{
- qWarning() << "SlewDialog: The existing version of points.json is obsolete. Backing it up as "
+ qCWarning(Telescopes) << "SlewDialog: The existing version of points.json is obsolete. Backing it up as "
<< QDir::toNativeSeparators(newName);
- qWarning() << "SlewDialog: A blank points.json file will have to be created.";
+ qCWarning(Telescopes) << "SlewDialog: A blank points.json file will have to be created.";
storedPointsDescriptions = result;
return;
}
else
{
- qWarning() << "SlewDialog: The existing version of points.json is obsolete. Unable to rename.";
+ qCWarning(Telescopes) << "SlewDialog: The existing version of points.json is obsolete. Unable to rename.";
storedPointsDescriptions = result;
return;
}
diff --git a/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.cpp b/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.cpp
index f106d9e81cfd7..99500acb49d12 100644
--- a/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.cpp
+++ b/plugins/TelescopeControl/src/gui/TelescopeConfigurationDialog.cpp
@@ -77,7 +77,7 @@ QStringList* TelescopeConfigurationDialog::listSerialPorts()
#else
plist->append(serialPortInfo.systemLocation());
#endif
- qDebug() << "[TelescopeControl] port name:" << serialPortInfo.portName()
+ qCDebug(Telescopes) << "[TelescopeControl] port name:" << serialPortInfo.portName()
<< "; vendor identifier:" << serialPortInfo.vendorIdentifier()
<< "; product identifier:" << serialPortInfo.productIdentifier();
}
@@ -300,7 +300,7 @@ void TelescopeConfigurationDialog::initExistingTelescopeConfiguration(int slot)
rts2Refresh, ascomDeviceId, ascomUseDeviceEqCoordType))
{
// TODO: Add better debug
- qDebug() << "Cannot get telescope for slot" << slot;
+ qCWarning(Telescopes) << "Cannot get telescope for slot" << slot;
return;
}
ui->lineEditTelescopeName->setText(name);
@@ -314,7 +314,7 @@ void TelescopeConfigurationDialog::initExistingTelescopeConfiguration(int slot)
int index = ui->comboBoxDeviceModel->findText(deviceModelName);
if (index < 0)
{
- qDebug() << "TelescopeConfigurationDialog: Current device model is not in the list?";
+ qCWarning(Telescopes) << "TelescopeConfigurationDialog: Current device model is not in the list?";
emit changesDiscarded();
return;
}
diff --git a/plugins/TelescopeControl/src/gui/TelescopeDialog.cpp b/plugins/TelescopeControl/src/gui/TelescopeDialog.cpp
index 6cae949e67aa1..cf0fd581ea600 100644
--- a/plugins/TelescopeControl/src/gui/TelescopeDialog.cpp
+++ b/plugins/TelescopeControl/src/gui/TelescopeDialog.cpp
@@ -789,14 +789,14 @@ void TelescopeDialog::buttonRemovePressed()
if(!telescopeManager->removeTelescopeAtSlot(selectedSlot))
{
//TODO: Add debug
- qDebug() << "Cannot remove telescope at slot" << selectedSlot;
+ qCWarning(Telescopes) << "Cannot remove telescope at slot" << selectedSlot;
return;
}
}
else
{
//TODO: Add debug
- qDebug() << "Cannot stop telescope at slot" << selectedSlot << ". Rejecting removal.";
+ qCWarning(Telescopes) << "Cannot stop telescope at slot" << selectedSlot << ". Rejecting removal.";
return;
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 09c28e3389d23..da99cc2ffaf44 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -659,14 +659,15 @@ IF(WIN32)
ENDIF()
IF(STELLARIUM_BUILD_ARM64)
- cmake_path(APPEND QT_PATHS ${QT6_INSTALL_PREFIX} "bin" "qtpaths.bat")
+ #cmake_path(APPEND QT_PATHS ${QT6_INSTALL_PREFIX} "bin" "qtpaths.bat")
+ FIND_PROGRAM(QT_PATHS qtpaths.bat HINTS "${_qt_bin_dir}")
ENDIF()
IF(QT_PATHS)
SET(_qt_paths "--qtpaths \"${QT_PATHS}\"")
ELSE()
SET(_qt_paths "")
ENDIF()
-
+
INSTALL(CODE
"
EXECUTE_PROCESS(
@@ -692,14 +693,17 @@ IF(WIN32)
COMMAND \"${WINDEPLOYQT_COMMAND}\"
--dir \"\${CMAKE_INSTALL_PREFIX}/qtstuff\"
--no-translations
+ --verbose 1
${VIRTUAL_KBD_SETTING}
+ ${_qt_paths}
--compiler-runtime
\"\${CMAKE_INSTALL_PREFIX}/lib/libstelMain.dll\"
WORKING_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/bin\"
OUTPUT_FILE \"\${CMAKE_CURRENT_BINARY_DIR}/windeployqt-dll.log\"
ERROR_FILE \"\${CMAKE_CURRENT_BINARY_DIR}/windeployqt-dll.err\"
)
- "
+ MESSAGE(STATUS \"Running windeployqt for mainlib...\")
+ "
)
ENDIF()
# workaround for https://bugreports.qt.io/browse/QTBUG-105984
diff --git a/src/main.cpp b/src/main.cpp
index 7c1ea6dff8d48..bc60273242fb1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -454,8 +454,13 @@ int main(int argc, char **argv)
const auto virtSize = QSize(confSettings->value("video/screen_w", screenGeom.width()).toInt(),
confSettings->value("video/screen_h", screenGeom.height()).toInt());
+#ifdef Q_OS_WIN
+ const auto size = QSize(std::lround(virtSize.width()),
+ std::lround(virtSize.height()));
+#else
const auto size = QSize(std::lround(virtSize.width()/pixelRatio),
- std::lround(virtSize.height()/pixelRatio));
+ std::lround(virtSize.height()/pixelRatio));
+#endif
mainWin.resize(size);
const bool fullscreen = confSettings->value("video/fullscreen", true).toBool();
@@ -473,8 +478,13 @@ int main(int argc, char **argv)
{
const int x = confSettings->value("video/screen_x", 0).toInt();
const int y = confSettings->value("video/screen_y", 0).toInt();
+#ifdef Q_OS_WIN
+ mainWin.move(screenGeom.x() + x,
+ screenGeom.y() + y);
+#else
mainWin.move(screenGeom.x() + x/pixelRatio,
screenGeom.y() + y/pixelRatio);
+#endif
}
mainWin.show();