From 5176249078640d86142a0d6b361c2a3278c3c79b Mon Sep 17 00:00:00 2001 From: Jasem Mutlaq Date: Mon, 5 Feb 2024 10:53:19 +0300 Subject: [PATCH] Fix LX200Telescope longitude format. Must always be in INDI standard format 0 to +360 eastwards --- drivers/telescope/lx200telescope.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/telescope/lx200telescope.cpp b/drivers/telescope/lx200telescope.cpp index c7a1139bd5..93bfa6d2a7 100644 --- a/drivers/telescope/lx200telescope.cpp +++ b/drivers/telescope/lx200telescope.cpp @@ -1425,9 +1425,16 @@ bool LX200Telescope::sendScopeLocation() { snprintf(lng_sexagesimal, MAXINDIFORMAT, "%02d:%02d:%02.1lf", long_dd, long_mm, long_ssf); f_scansexa(lng_sexagesimal, &(LocationNP.np[LOCATION_LONGITUDE].value)); + // JM 2024.02.05: INDI Longitude MUST be 0 to +360 eastward + // We cannot use cartographic format in the INDI drivers! + if (LocationNP.np[LOCATION_LONGITUDE].value < 0) + { + LocationNP.np[LOCATION_LONGITUDE].value += 360; + fs_sexa(lng_sexagesimal, LocationNP.np[LOCATION_LONGITUDE].value, 2, 36000); + } } - LOGF_INFO("Mount has Latitude %s (%g) Longitude %s (%g) (Longitude sign in carthography format)", + LOGF_INFO("Mount has Latitude %s (%g) Longitude (0 to +360 Eastwards) %s (%g)", lat_sexagesimal, LocationN[LOCATION_LATITUDE].value, lng_sexagesimal,