From 17c6efddf04ac32a04de2df07b71489aab4fb73a Mon Sep 17 00:00:00 2001 From: azwing Date: Wed, 26 Jan 2022 17:27:57 +0100 Subject: [PATCH 01/22] Allowing Meridian Flip Limits East and West -180 .. 180 --- drivers.xml | 2 +- drivers/telescope/lx200_OnStep.cpp | 12 ++++++------ drivers/telescope/lx200_OnStep.h | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers.xml b/drivers.xml index 7991e233e8..7dfccfa70f 100644 --- a/drivers.xml +++ b/drivers.xml @@ -19,7 +19,7 @@ indi_lx200_OnStep - 1.13 + 1.14 indi_lx200_TeenAstro diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 1741684257..9a5583ec66 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -195,8 +195,8 @@ bool LX200_OnStep::initProperties() IUFillSwitchVector(&PreferredPierSideSP, PreferredPierSideS, 3, getDeviceName(), "Preferred Pier Side", "Preferred Pier Side", MOTION_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); - IUFillNumber(&minutesPastMeridianN[0], "East", "East", "%g", 0, 180, 1, 30); - IUFillNumber(&minutesPastMeridianN[1], "West", "West", "%g", 0, 180, 1, 30); + IUFillNumber(&minutesPastMeridianN[0], "East", "East", "%g", -180, 180, 1, 16); + IUFillNumber(&minutesPastMeridianN[1], "West", "West", "%g", -180, 180, 1, -16); IUFillNumberVector(&minutesPastMeridianNP, minutesPastMeridianN, 2, getDeviceName(), "Minutes Past Meridian", "Minutes Past Meridian", MOTION_TAB, IP_RW, 0, IPS_IDLE); @@ -993,13 +993,13 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ { minPMEast = values[i]; LOGF_DEBUG("===CMD==> minutesPastMeridianN[0]/East = %f", minPMEast); - nset += minPMEast >= 0 && minPMEast <= 180; //range 0 to 180 + nset += minPMEast >= -180 && minPMEast <= 180; //range -180 to 180 } else if (bktp == &minutesPastMeridianN[1]) { minPMWest = values[i]; LOGF_DEBUG("===CMD==> minutesPastMeridianN[1]/West= %f", minPMWest); - nset += minPMWest >= 0 && minPMWest <= 180; //range 0 to 180 + nset += minPMWest >= -180 && minPMWest <= 180; //range -180 to 180 } } if (nset == 2) @@ -1009,7 +1009,7 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ if (sendOnStepCommand(cmd)) { minutesPastMeridianNP.s = IPS_ALERT; - IDSetNumber(&minutesPastMeridianNP, "Error Backlash DEC limit."); + IDSetNumber(&minutesPastMeridianNP, "Error minutesPastMeridian East."); } const struct timespec timeout = {0, 100000000L}; nanosleep(&timeout, nullptr); // time for OnStep to respond to previous cmd @@ -1017,7 +1017,7 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ if (sendOnStepCommand(cmd)) { minutesPastMeridianNP.s = IPS_ALERT; - IDSetNumber(&minutesPastMeridianNP, "Error Backlash RA limit."); + IDSetNumber(&minutesPastMeridianNP, "Error minutesPastMeridian West."); } minutesPastMeridianNP.np[0].value = minPMEast; diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index b8d60c0c40..40d9eb92c8 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,6 +25,9 @@ =========================================== Version not yet updated/No INDI release: + Version 1.14 + - Modified range for Minutes Pas Meridian East and West to -180 .. +180 + - Modified debug messages Minutes Pas Meridian (Was B"acklash ...) Version 1.13 - Timeouts and misc errors due to new behavior of SWS (SmartWebServer) From aafa893e6f4c11430bab06897201538cb98847c9 Mon Sep 17 00:00:00 2001 From: azwing Date: Wed, 26 Jan 2022 18:26:09 +0100 Subject: [PATCH 02/22] setup version --- drivers/telescope/lx200_OnStep.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 9a5583ec66..2e8f4c9bac 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this) currentCatalog = LX200_STAR_C; currentSubCatalog = 0; - setVersion(1, 13); // don't forget to update libindi/drivers.xml + setVersion(1, 14); // don't forget to update libindi/drivers.xml setLX200Capability(LX200_HAS_TRACKING_FREQ | LX200_HAS_SITES | LX200_HAS_ALIGNMENT_TYPE | LX200_HAS_PULSE_GUIDING | LX200_HAS_PRECISE_TRACKING_FREQ); @@ -195,8 +195,8 @@ bool LX200_OnStep::initProperties() IUFillSwitchVector(&PreferredPierSideSP, PreferredPierSideS, 3, getDeviceName(), "Preferred Pier Side", "Preferred Pier Side", MOTION_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); - IUFillNumber(&minutesPastMeridianN[0], "East", "East", "%g", -180, 180, 1, 16); - IUFillNumber(&minutesPastMeridianN[1], "West", "West", "%g", -180, 180, 1, -16); + IUFillNumber(&minutesPastMeridianN[0], "East", "East ± 180", "%g", -180, 180, 1, 16); + IUFillNumber(&minutesPastMeridianN[1], "West", "West ± 180", "%g", -180, 180, 1, -16); IUFillNumberVector(&minutesPastMeridianNP, minutesPastMeridianN, 2, getDeviceName(), "Minutes Past Meridian", "Minutes Past Meridian", MOTION_TAB, IP_RW, 0, IPS_IDLE); From a5b5fa9cd464f7033e8b8789cf84c2d958e45b00 Mon Sep 17 00:00:00 2001 From: azwing Date: Thu, 27 Jan 2022 12:09:56 +0100 Subject: [PATCH 03/22] defaut Meridian Value to -20 West / +20 East --- drivers/telescope/lx200_OnStep.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 2e8f4c9bac..dd35d7234f 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -195,8 +195,8 @@ bool LX200_OnStep::initProperties() IUFillSwitchVector(&PreferredPierSideSP, PreferredPierSideS, 3, getDeviceName(), "Preferred Pier Side", "Preferred Pier Side", MOTION_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); - IUFillNumber(&minutesPastMeridianN[0], "East", "East ± 180", "%g", -180, 180, 1, 16); - IUFillNumber(&minutesPastMeridianN[1], "West", "West ± 180", "%g", -180, 180, 1, -16); + IUFillNumber(&minutesPastMeridianN[0], "East", "East ± 180", "%g", -180, 180, 1, 20); + IUFillNumber(&minutesPastMeridianN[1], "West", "West ± 180", "%g", -180, 180, 1, -20); IUFillNumberVector(&minutesPastMeridianNP, minutesPastMeridianN, 2, getDeviceName(), "Minutes Past Meridian", "Minutes Past Meridian", MOTION_TAB, IP_RW, 0, IPS_IDLE); From ebfc278794c870516ccb2c2c306fbe606c2d0725 Mon Sep 17 00:00:00 2001 From: azwing Date: Fri, 18 Mar 2022 15:41:26 +0100 Subject: [PATCH 04/22] Fixed setUTCOffset to Onstep formt :SG[sHH]# --- drivers.xml | 2 +- drivers/telescope/lx200_OnStep.cpp | 16 +++++++++++++++- drivers/telescope/lx200_OnStep.h | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers.xml b/drivers.xml index 34af2ae8ed..d313652b56 100644 --- a/drivers.xml +++ b/drivers.xml @@ -19,7 +19,7 @@ indi_lx200_OnStep - 1.14 + 1.15 indi_lx200_TeenAstro diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index dd35d7234f..3582207851 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this) currentCatalog = LX200_STAR_C; currentSubCatalog = 0; - setVersion(1, 14); // don't forget to update libindi/drivers.xml + setVersion(1, 15); // don't forget to update libindi/drivers.xml setLX200Capability(LX200_HAS_TRACKING_FREQ | LX200_HAS_SITES | LX200_HAS_ALIGNMENT_TYPE | LX200_HAS_PULSE_GUIDING | LX200_HAS_PRECISE_TRACKING_FREQ); @@ -5060,3 +5060,17 @@ void LX200_OnStep::PrintTrackState() return; } +bool LX200_OnStep::setUTCOffset(double offset) //azwing fix after change in lx200driver.cpp +{ + bool result = true; + int ss_timezone; + const bool send_to_skysensor = (getUTCOffset(PortFD, &ss_timezone) != 0 || offset != ss_timezone); + if (send_to_skysensor) + { + char temp_string[RB_MAX_LEN]; + snprintf(temp_string, sizeof(temp_string), ":SG %+03d#", static_cast(offset)); + result = (setStandardProcedure(PortFD, temp_string) == 0); + } + return result; +} + diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 40d9eb92c8..9183f012af 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,6 +25,8 @@ =========================================== Version not yet updated/No INDI release: + Version 1.15 + - Fixed setUTCOffset after change in lx200driver to comply with OnStep format :SG[sHH]# Version 1.14 - Modified range for Minutes Pas Meridian East and West to -180 .. +180 - Modified debug messages Minutes Pas Meridian (Was B"acklash ...) @@ -193,6 +195,7 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public virtual bool sendScopeTime() override; virtual bool sendScopeLocation() override; + virtual bool setUTCOffset(double offset) override; //azwing fix after change in lx200driver.cpp // Goto virtual bool Goto(double ra, double dec) override; From 42abb84ba5bfb56feb317fffb7dcaef463bb5655 Mon Sep 17 00:00:00 2001 From: azwing Date: Sat, 19 Mar 2022 17:55:55 +0100 Subject: [PATCH 05/22] fix after change in lx200driver.cpp and fix to have UTC hh:00, hh:30, hh:45 --- drivers/telescope/lx200_OnStep.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 3582207851..6e4079dc9e 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -5060,17 +5060,17 @@ void LX200_OnStep::PrintTrackState() return; } -bool LX200_OnStep::setUTCOffset(double offset) //azwing fix after change in lx200driver.cpp +bool LX200_OnStep::setUTCOffset(double offset) //azwing fix after change in lx200driver.cpp and fix to have UTC hh:00, hh:30, hh:45 { bool result = true; - int ss_timezone; - const bool send_to_skysensor = (getUTCOffset(PortFD, &ss_timezone) != 0 || offset != ss_timezone); - if (send_to_skysensor) - { - char temp_string[RB_MAX_LEN]; - snprintf(temp_string, sizeof(temp_string), ":SG %+03d#", static_cast(offset)); - result = (setStandardProcedure(PortFD, temp_string) == 0); - } + char temp_string[RB_MAX_LEN]; + int utc_hour, utc_min; + // strange thing offset is rounded up to first decimal so that .75 is .8 + utc_hour=int(offset)*-1; + utc_min=(offset-int(offset))*60; + if (utc_min > 30) utc_min=45; + snprintf(temp_string, sizeof(temp_string), ":SG%03d:%02d#", utc_hour, utc_min); + result = (setStandardProcedure(PortFD, temp_string) == 0); return result; } From 4a2732e8beb04baabf31260377b0098dafba8b22 Mon Sep 17 00:00:00 2001 From: azwing Date: Sun, 20 Mar 2022 19:42:54 +0100 Subject: [PATCH 06/22] fix negtives UTC Offsets --- drivers/telescope/lx200_OnStep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 6e4079dc9e..425d0f6abc 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -5067,7 +5067,7 @@ bool LX200_OnStep::setUTCOffset(double offset) //azwing fix after change in lx2 int utc_hour, utc_min; // strange thing offset is rounded up to first decimal so that .75 is .8 utc_hour=int(offset)*-1; - utc_min=(offset-int(offset))*60; + utc_min=abs((offset-int(offset))*60); // negtive offsets require this abs() if (utc_min > 30) utc_min=45; snprintf(temp_string, sizeof(temp_string), ":SG%03d:%02d#", utc_hour, utc_min); result = (setStandardProcedure(PortFD, temp_string) == 0); From 9ade76d6f3ad66bd4971ff0b1f40f5ecc5980132 Mon Sep 17 00:00:00 2001 From: azwing Date: Sun, 3 Apr 2022 13:46:21 +0200 Subject: [PATCH 07/22] fixed UTC uninitialized structure tahnks Norikyu --- drivers.xml | 8 ++++---- drivers/telescope/ioptronHC8406.cpp | 7 ++++++- drivers/telescope/lx200_OnStep.cpp | 5 ++++- drivers/telescope/lx200_OnStep.h | 2 ++ drivers/telescope/lx200_TeenAstro.cpp | 6 +++++- drivers/telescope/lx200pulsar2.cpp | 4 +++- drivers/telescope/lx200telescope.cpp | 5 +++++ drivers/telescope/rainbow.cpp | 7 ++++++- tools/evalINDI.c | 1 + 9 files changed, 36 insertions(+), 9 deletions(-) diff --git a/drivers.xml b/drivers.xml index bd523c33fb..54477a63d0 100644 --- a/drivers.xml +++ b/drivers.xml @@ -19,11 +19,11 @@ indi_lx200_OnStep - 1.15 + 1.16 indi_lx200_TeenAstro - 1.2 + 1.3 indi_lx200_16 @@ -211,7 +211,7 @@ indi_ioptronHC8406 - 1.1 + 1.3 indi_ioptronv3_telescope @@ -227,7 +227,7 @@ indi_lx200pulsar2 - 1.0 + 1.3 indi_skycommander_telescope diff --git a/drivers/telescope/ioptronHC8406.cpp b/drivers/telescope/ioptronHC8406.cpp index 2626278d13..0512186a16 100644 --- a/drivers/telescope/ioptronHC8406.cpp +++ b/drivers/telescope/ioptronHC8406.cpp @@ -110,7 +110,7 @@ socat -v PTY,link=/tmp/serial,wait-slave,raw /dev/ttyUSB0,raw ioptronHC8406::ioptronHC8406() { - setVersion(1, 2); + setVersion(1, 3); setLX200Capability(LX200_HAS_FOCUS | LX200_HAS_PULSE_GUIDING); SetTelescopeCapability(TELESCOPE_CAN_PARK | TELESCOPE_CAN_SYNC | TELESCOPE_CAN_GOTO | TELESCOPE_CAN_ABORT | TELESCOPE_HAS_TIME | TELESCOPE_HAS_LOCATION | @@ -1155,6 +1155,10 @@ bool ioptronHC8406::sendScopeTime() int day, month, year, result; struct tm ltm; struct tm utm; + + memset(<m, 0, sizeof(ltm)); + memset(&utm, 0, sizeof(utm)); + time_t time_epoch; if (isSimulation()) @@ -1203,6 +1207,7 @@ bool ioptronHC8406::sendScopeTime() ltm.tm_mday = day; ltm.tm_mon = month - 1; ltm.tm_year = year - 1900; + ltm.tm_isdst = 0; // Get time epoch time_epoch = mktime(<m); diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 425d0f6abc..c498bf893f 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this) currentCatalog = LX200_STAR_C; currentSubCatalog = 0; - setVersion(1, 15); // don't forget to update libindi/drivers.xml + setVersion(1, 16); // don't forget to update libindi/drivers.xml setLX200Capability(LX200_HAS_TRACKING_FREQ | LX200_HAS_SITES | LX200_HAS_ALIGNMENT_TYPE | LX200_HAS_PULSE_GUIDING | LX200_HAS_PRECISE_TRACKING_FREQ); @@ -4749,6 +4749,8 @@ bool LX200_OnStep::sendScopeTime() struct tm ltm; struct tm utm; time_t time_epoch; + memset(<m, 0, sizeof(ltm)); + memset(&utm, 0, sizeof(utm)); double offset = 0; if (getUTFOffset(&offset)) @@ -4786,6 +4788,7 @@ bool LX200_OnStep::sendScopeTime() return false; } + ltm.tm_isdst = 0; // Get local time epoch in UNIX seconds time_epoch = mktime(<m); diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 9183f012af..47f6fcb25c 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,6 +25,8 @@ =========================================== Version not yet updated/No INDI release: + Version 1.16 + - fixed uninitialized UTC structure thanks to Norikyu Version 1.15 - Fixed setUTCOffset after change in lx200driver to comply with OnStep format :SG[sHH]# Version 1.14 diff --git a/drivers/telescope/lx200_TeenAstro.cpp b/drivers/telescope/lx200_TeenAstro.cpp index 548ad1660c..a04b18bea7 100644 --- a/drivers/telescope/lx200_TeenAstro.cpp +++ b/drivers/telescope/lx200_TeenAstro.cpp @@ -58,7 +58,7 @@ extern std::mutex lx200CommsLock; */ LX200_TeenAstro::LX200_TeenAstro() { - setVersion(1, 2); // don't forget to update drivers.xml + setVersion(1, 3); // don't forget to update drivers.xml DBG_SCOPE = INDI::Logger::getInstance().addDebugLevel("Scope Verbose", "SCOPE"); @@ -888,6 +888,9 @@ bool LX200_TeenAstro::sendScopeTime() struct tm ltm; struct tm utm; time_t time_epoch; + + memset(<m, 0, sizeof(ltm)); + memset(&utm, 0, sizeof(utm)); double offset = 0; @@ -926,6 +929,7 @@ bool LX200_TeenAstro::sendScopeTime() return false; } + ltm.tm_isdst = 0; // Get local time epoch in UNIX seconds time_epoch = mktime(<m); diff --git a/drivers/telescope/lx200pulsar2.cpp b/drivers/telescope/lx200pulsar2.cpp index ea2c29211e..6f116af831 100644 --- a/drivers/telescope/lx200pulsar2.cpp +++ b/drivers/telescope/lx200pulsar2.cpp @@ -1241,7 +1241,7 @@ bool isParking(const int fd) // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- LX200Pulsar2::LX200Pulsar2() : LX200Generic(), just_started_slewing(false) { - setVersion(1, 2); + setVersion(1, 3); //setLX200Capability(0); setLX200Capability(LX200_HAS_PULSE_GUIDING); @@ -3362,6 +3362,7 @@ bool LX200Pulsar2::storeScopeLocation() bool LX200Pulsar2::sendScopeTime() { struct tm ltm; + memset(<m, 0, sizeof(ltm)); if (isSimulation()) { const time_t t = time(nullptr); @@ -3378,6 +3379,7 @@ bool LX200Pulsar2::sendScopeTime() ltm.tm_year -= 1900; } + ltm.tm_isdst = 0; // Get time epoch and convert to TimeT const time_t time_epoch = mktime(<m); struct tm utm; diff --git a/drivers/telescope/lx200telescope.cpp b/drivers/telescope/lx200telescope.cpp index 786aeca4ca..fff61e35a8 100644 --- a/drivers/telescope/lx200telescope.cpp +++ b/drivers/telescope/lx200telescope.cpp @@ -1314,6 +1314,10 @@ bool LX200Telescope::sendScopeTime() char ctime[MAXINDINAME] = {0}; struct tm ltm; struct tm utm; + + memset(<m, 0, sizeof(ltm)); + memset(&utm, 0, sizeof(utm)); + time_t time_epoch; double offset = 0; @@ -1352,6 +1356,7 @@ bool LX200Telescope::sendScopeTime() return false; } + ltm.tm_isdst = 0; // Get local time epoch in UNIX seconds time_epoch = mktime(<m); diff --git a/drivers/telescope/rainbow.cpp b/drivers/telescope/rainbow.cpp index 0c68f6b398..2b8c6be200 100644 --- a/drivers/telescope/rainbow.cpp +++ b/drivers/telescope/rainbow.cpp @@ -33,7 +33,7 @@ static std::unique_ptr scope(new Rainbow()); Rainbow::Rainbow() : INDI::Telescope () { - setVersion(1, 1); + setVersion(1, 2); SetTelescopeCapability(TELESCOPE_CAN_GOTO | TELESCOPE_CAN_SYNC | @@ -1515,6 +1515,10 @@ bool Rainbow::sendScopeTime() char ctime[MAXINDINAME] = {0}; struct tm ltm; struct tm utm; + + memset(<m, 0, sizeof(ltm)); + memset(&utm, 0, sizeof(utm)); + time_t time_epoch; double offset = 0; @@ -1553,6 +1557,7 @@ bool Rainbow::sendScopeTime() return false; } + ltm.tm_isdst = 0; // Get local time epoch in UNIX seconds time_epoch = mktime(<m); diff --git a/tools/evalINDI.c b/tools/evalINDI.c index d773950336..a9e2918977 100644 --- a/tools/evalINDI.c +++ b/tools/evalINDI.c @@ -512,6 +512,7 @@ static time_t timestampINDI(char *ts) { tm.tm_mon -= 1; /* want 0..11 */ tm.tm_year -= 1900; /* want years since 1900 */ + tm.tm_isdst = 0; return (mktime(&tm)); } else From b6d3c23a8c0f34cfe67b22b79d0fb3689058b651 Mon Sep 17 00:00:00 2001 From: azwing Date: Wed, 9 Nov 2022 23:47:26 +0100 Subject: [PATCH 08/22] OnStep 1.17 minor fix --- drivers.xml | 2 +- drivers/telescope/lx200_OnStep.cpp | 8 ++++---- drivers/telescope/lx200_OnStep.h | 4 +++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers.xml b/drivers.xml index d0d4e2e087..a46e5f7333 100644 --- a/drivers.xml +++ b/drivers.xml @@ -19,7 +19,7 @@ indi_lx200_OnStep - 1.16 + 1.17 indi_lx200_OpenAstroTech diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 4a2a044568..1961d7acf7 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this) currentCatalog = LX200_STAR_C; currentSubCatalog = 0; - setVersion(1, 16); // don't forget to update libindi/drivers.xml + setVersion(1, 17); // don't forget to update libindi/drivers.xml setLX200Capability(LX200_HAS_TRACKING_FREQ | LX200_HAS_SITES | LX200_HAS_ALIGNMENT_TYPE | LX200_HAS_PULSE_GUIDING | LX200_HAS_PRECISE_TRACKING_FREQ); @@ -960,13 +960,13 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ } if (nset == 2) { - if (setMinElevationLimit(PortFD, (int)minAlt) < 0) + if (setMinElevationLimit(PortFD, (int)maxAlt) < 0) { ElevationLimitNP.s = IPS_ALERT; IDSetNumber(&ElevationLimitNP, "Error setting min elevation limit."); } - if (setMaxElevationLimit(PortFD, (int)maxAlt) < 0) + if (setMaxElevationLimit(PortFD, (int)minAlt) < 0) { ElevationLimitNP.s = IPS_ALERT; IDSetNumber(&ElevationLimitNP, "Error setting max elevation limit."); @@ -3540,7 +3540,7 @@ bool LX200_OnStep::updateLocation(double latitude, double longitude, double elev return true; } -int LX200_OnStep::setMaxElevationLimit(int fd, int max) // According to standard command is :SoDD*# Tested +int LX200_OnStep::setMinElevationLimit(int fd, int max) // According to standard command is :SoDD*# Tested { LOGF_INFO("<%s>", __FUNCTION__); diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index ca1ef7b59b..d049519157 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,6 +25,8 @@ =========================================== Version not yet updated/No INDI release: + Version 1.17 + - fixed setMaxElevationLimit / setMinElevationLimit Version 1.16 - fixed uninitialized UTC structure thanks to Norikyu Version 1.15 @@ -271,7 +273,7 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public int getCommandDoubleResponse(int fd, double *value, char *data, const char *cmd); //Reimplemented from getCommandString Will return a double, and raw value. int getCommandIntResponse(int fd, int *value, char *data, const char *cmd); - int setMaxElevationLimit(int fd, int max); + int setMinElevationLimit(int fd, int max); int OSUpdateFocuser(); //Return = 0 good, -1 = Communication error int OSUpdateRotator(); //Return = 0 good, -1 = Communication error From 12bebc21eda301581fffba39f101650e11ee0775 Mon Sep 17 00:00:00 2001 From: azwing Date: Wed, 11 Jan 2023 19:50:05 +0100 Subject: [PATCH 09/22] Onstep --- drivers/telescope/lx200_OnStep.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 6df27e7d13..72e800726f 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -511,7 +511,7 @@ bool LX200_OnStep::updateProperties() IP_RW, ISR_ATMOST1, 0, IPS_IDLE); defineProperty(&OSFocusSelectSP); //Swap focusers (only matters if two focusers) } - else //For OnStepX, up to 9 focusers + else //For OnStepX, up to 6 focusers { LOG_INFO("Focuser 2 NOT found"); OSFocuser2 = false; @@ -1220,13 +1220,13 @@ bool LX200_OnStep::ISNewSwitch(const char *dev, const char *name, ISState *state if (ReticS[0].s == ISS_ON) { - ret = ReticPlus(PortFD); + ret = increaseReticleBrightness(PortFD); //in lx200driver ReticS[0].s = ISS_OFF; IDSetSwitch(&ReticSP, "Bright"); } else { - ret = ReticMoins(PortFD); + ret = decreaseReticleBrightness(PortFD); //in lx200driver ReticS[1].s = ISS_OFF; IDSetSwitch(&ReticSP, "Dark"); } From 4ea10ad07bd5051b4d4491ed5f18051e41e9b027 Mon Sep 17 00:00:00 2001 From: azwing Date: Wed, 11 Jan 2023 19:51:28 +0100 Subject: [PATCH 10/22] Onstep --- drivers/telescope/lx200_OnStep.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index d049519157..4029e5298d 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,6 +25,8 @@ =========================================== Version not yet updated/No INDI release: + - fixed duplicate declaration of RB_MAX_LEN + - removed unused declarations Version 1.17 - fixed setMaxElevationLimit / setMinElevationLimit Version 1.16 @@ -135,16 +137,6 @@ #define RB_MAX_LEN 64 #define CMD_MAX_LEN 32 -#define setParkOnStep(fd) write(fd, "#:hQ#", 5) -#define ReticPlus(fd) write(fd, "#:B+#", 5) -#define ReticMoins(fd) write(fd, "#:B-#", 5) -#define OnStepalign1(fd) write(fd, "#:A1#", 5) -#define OnStepalign2(fd) write(fd, "#:A2#", 5) -#define OnStepalign3(fd) write(fd, "#:A3#", 5) -#define OnStepalignOK(fd) write(fd, "#:A+#", 5) -#define OnStep -#define RB_MAX_LEN 64 - #define PORTS_COUNT 10 #define STARTING_PORT 0 @@ -273,7 +265,7 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public int getCommandDoubleResponse(int fd, double *value, char *data, const char *cmd); //Reimplemented from getCommandString Will return a double, and raw value. int getCommandIntResponse(int fd, int *value, char *data, const char *cmd); - int setMinElevationLimit(int fd, int max); + int setMinElevationLimit(int fd, int min); int OSUpdateFocuser(); //Return = 0 good, -1 = Communication error int OSUpdateRotator(); //Return = 0 good, -1 = Communication error From 91af89672e83942e17497d95c09523a37dc83425 Mon Sep 17 00:00:00 2001 From: azwing Date: Mon, 27 Feb 2023 21:26:47 +0100 Subject: [PATCH 11/22] Implemented Focuser Temperature Compensation --- drivers.xml | 2 +- drivers/telescope/lx200_OnStep.cpp | 144 ++++++++++++++++++++++++++++- drivers/telescope/lx200_OnStep.h | 16 +++- 3 files changed, 156 insertions(+), 6 deletions(-) diff --git a/drivers.xml b/drivers.xml index b8afb38dae..6d01099926 100644 --- a/drivers.xml +++ b/drivers.xml @@ -29,7 +29,7 @@ indi_lx200_OnStep - 1.17 + 1.18 indi_lx200_OpenAstroTech diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 13bc4030dd..41ecbe70f7 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this) currentCatalog = LX200_STAR_C; currentSubCatalog = 0; - setVersion(1, 17); // don't forget to update libindi/drivers.xml + setVersion(1, 18); // don't forget to update libindi/drivers.xml setLX200Capability(LX200_HAS_TRACKING_FREQ | LX200_HAS_SITES | LX200_HAS_ALIGNMENT_TYPE | LX200_HAS_PULSE_GUIDING | LX200_HAS_PRECISE_TRACKING_FREQ); @@ -217,7 +217,21 @@ bool LX200_OnStep::initProperties() // IUFillSwitch(&OSFocus1InitializeS[2], "Focus1_3", "max", ISS_OFF); IUFillSwitchVector(&OSFocus1InitializeSP, OSFocus1InitializeS, 2, getDeviceName(), "Foc1Rate", "Initialize", FOCUS_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE); - + // Focus T° Compensation + IUFillNumber(&FocuserTN[0], "TFC T°", "TFC T°", "%g", 0, 1, 0.25, 25); //default value is meaningless + IUFillNumber(&FocuserTN[1], "TFC Diff T°", "TFC Diff T°", "%g", 0, 1, 0.25, 25); //default value is meaningless + IUFillNumberVector(&FocuserTNP, FocuserTN, 2, getDeviceName(), "TFC T°", "TFC T°", FOCUS_TAB, IP_RO, 0, + IPS_IDLE); + IUFillSwitch(&TFCompensationS[0], "1", "Compensation: OFF", ISS_OFF); + IUFillSwitch(&TFCompensationS[1], "2", "Compensation: ON", ISS_OFF); + IUFillSwitchVector(&TFCompensationSP, TFCompensationS, 2, getDeviceName(), "Compensation T°", "Temperature Compensation", FOCUS_TAB, IP_RW, + ISR_1OFMANY, 0, IPS_IDLE); + IUFillNumber(&TFCCoefficientN[0], "TFC Coeeficient", "TFC Coefficient µm/°C", "%+03.1f", -999, 999, 1, 100); + IUFillNumberVector(&TFCCoefficientNP, TFCCoefficientN, 1, getDeviceName(), "TFC Coeeficient", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); + IUFillNumber(&TFCDeadbandN[0], "TFC Deadband", "TFC Deadband µm", "%g", 1, 32767, 1, 5); + IUFillNumberVector(&TFCDeadbandNP, TFCDeadbandN, 1, getDeviceName(), "TFC Deadband", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); + // End Focus T° Compensation + IUFillSwitch(&OSFocusSelectS[0], "Focuser_Primary_1", "Focuser 1", ISS_ON); IUFillSwitch(&OSFocusSelectS[1], "Focuser_Primary_2", "Focuser 2/Swap", ISS_OFF); // For when OnStepX comes out @@ -488,6 +502,12 @@ bool LX200_OnStep::updateProperties() LOG_INFO("Focuser 1 found"); OSFocuser1 = true; defineProperty(&OSFocus1InitializeSP); + // Focus T° Compensation + defineProperty(&FocuserTNP); + defineProperty(&TFCompensationSP); + defineProperty(&TFCCoefficientNP); + defineProperty(&TFCDeadbandNP); + // End Focus T° Compensation OSNumFocusers = 1; } else @@ -692,7 +712,13 @@ bool LX200_OnStep::updateProperties() // Focuser // Focuser 1 + deleteProperty(FocuserTNP.name); deleteProperty(OSFocus1InitializeSP.name); + deleteProperty(TFCCoefficientNP.name); + deleteProperty(TFCDeadbandNP.name); + // Focus T° Compensation + deleteProperty(TFCompensationSP.name); + // End Focus T° Compensation // Focuser 2 //deleteProperty(OSFocus2SelSP.name); @@ -1155,6 +1181,49 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ } return true; } + + // Focus T° Compensation + if (!strcmp(name, TFCCoefficientNP.name)) + { + // :FC[sn.n]# Set focuser temperature compensation coefficient in µ/°C + char cmd[CMD_MAX_LEN] = {0}; + + if (abs(values[0]) < 1000) //Range is -999 .. + 999 + { + snprintf(cmd, 15, ":FC%d#", (int)values[0]); + sendOnStepCommandBlind(cmd); + TFCCoefficientNP.s = IPS_OK; + IDSetNumber(&TFCCoefficientNP, "TFC Coeeficient set to %d", (int)values[0]); + } + else + { + TFCCoefficientNP.s = IPS_ALERT; + IDSetNumber(&TFCCoefficientNP, "Setting TFC Coefficient Failed"); + } + return true; + } + + if (!strcmp(name, TFCDeadbandNP.name)) + { + // :FD[n]# Set focuser temperature compensation deadband amount (in steps or microns) + char cmd[CMD_MAX_LEN] = {0}; + + if ((values[0] >= 1) && (values[0] <= 32768)) //Range is 1 .. 32767 + { + snprintf(cmd, 15, ":FD%d#", (int)values[0]); + sendOnStepCommandBlind(cmd); + TFCDeadbandNP.s = IPS_OK; + IDSetNumber(&TFCDeadbandNP, "TFC Deadbandset to %d", (int)values[0]); + } + else + { + TFCDeadbandNP.s = IPS_ALERT; + IDSetNumber(&TFCDeadbandNP, "Setting TFC Deadband Failed"); + } + return true; + } + // end Focus T° Compensation + if (strstr(name, "WEATHER_")) { @@ -3780,12 +3849,81 @@ int LX200_OnStep::OSUpdateFocuser() LOG_WARN("Communication :FI# error, check connection."); flushIO(PortFD); //Unlikely to do anything, but just in case. } + + // Focus T° Compensation + // :Ft# Get Focuser Temperature + // Returns: n# + char focus_T[RB_MAX_LEN] = {0}; + int focus_T_int ; + int ft_error = getCommandIntResponse(PortFD, &focus_T_int, focus_T, ":Ft#"); + if (ft_error > 0) + { + FocuserTN[0].value = focus_T_int; + IDSetNumber(&FocuserTNP, nullptr); + LOGF_DEBUG("focus T°: %s, %i fi_error: %i", focus_T, focus_T_int, ft_error); + } + else + { + LOG_WARN("Communication :Ft# error, check connection."); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } + + // :Fe# Get Focus Differential T° + // Returns: n# + char focus_TD[RB_MAX_LEN] = {0}; + int focus_TD_int ; + int fe_error = getCommandIntResponse(PortFD, &focus_TD_int, focus_TD, ":Fe#"); + if (fe_error > 0) + { + FocuserTN[1].value = focus_TD_int; + IDSetNumber(&FocuserTNP, nullptr); + LOGF_DEBUG("focus Differential T°: %s, %i fi_error: %i", focus_TD, focus_TD_int, fe_error); + } + else + { + LOG_WARN("Communication :Fe# error, check connection."); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } + + // :FC# Get focuser temperature compensation coefficient in microns per °C) + // Return: n.n# + char focus_Coeficient[RB_MAX_LEN] = {0}; + int focus_Coefficient_int ; + int fC_error = getCommandIntResponse(PortFD, &focus_Coefficient_int, focus_Coeficient, ":FC#"); + if (fC_error > 0) + { + TFCCoefficientN[0].value = focus_Coefficient_int; + IDSetNumber(&TFCCoefficientNP, nullptr); + LOGF_DEBUG("TFC Coefficient: %s, %i fC_error: %i", focus_Coeficient, focus_Coefficient_int, fC_error); + } + else + { + LOG_WARN("Communication :FC# error, check connection."); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } + + // :FD# Get focuser temperature compensation deadband amount (in steps or microns) + // Return: n# + char focus_Deadband[RB_MAX_LEN] = {0}; + int focus_Deadband_int ; + int fD_error = getCommandIntResponse(PortFD, &focus_Deadband_int, focus_Deadband, ":FD#"); + if (fD_error > 0) + { + TFCDeadbandN[0].value = focus_Deadband_int; + IDSetNumber(&TFCDeadbandNP, nullptr); + LOGF_DEBUG("TFC Deadband: %s, %i fD_error: %i", focus_Deadband, focus_Deadband_int, fD_error); + } + else + { + LOG_WARN("Communication :FD# error, check connection."); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } + // End Focus T° Compensation FI::updateProperties(); LOGF_DEBUG("After update properties: FocusAbsPosN min: %f max: %f", FocusAbsPosN[0].min, FocusAbsPosN[0].max); } - if(OSFocuser2) { char value[RB_MAX_LEN] = {0}; diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 4029e5298d..293bcf5250 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,8 +25,9 @@ =========================================== Version not yet updated/No INDI release: - - fixed duplicate declaration of RB_MAX_LEN - - removed unused declarations + Version 1.18 + - implemented Focuser T° compensation in FOCUSER TAB + - Minor fixes Version 1.17 - fixed setMaxElevationLimit / setMinElevationLimit Version 1.16 @@ -313,6 +314,17 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public bool OSFocuser1 = false; ISwitchVectorProperty OSFocus1InitializeSP; ISwitch OSFocus1InitializeS[4]; + + // Focus T° Compensation + INumberVectorProperty FocuserTNP; + INumber FocuserTN[2]; + ISwitchVectorProperty TFCompensationSP; + ISwitch TFCompensationS[2]; + INumberVectorProperty TFCCoefficientNP; + INumber TFCCoefficientN[1]; + INumberVectorProperty TFCDeadbandNP; + INumber TFCDeadbandN[1]; + // End Focus T° Compensation int OSNumFocusers = 0; ISwitchVectorProperty OSFocusSelectSP; From 663a709c8bfcfa7b4441c5afa31f42a8749a5f2c Mon Sep 17 00:00:00 2001 From: azwing Date: Tue, 28 Feb 2023 22:31:21 +0100 Subject: [PATCH 12/22] =?UTF-8?q?Fixed=20Focuser=20T=C2=B0=20Compensation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/telescope/lx200_OnStep.cpp | 93 +++++++++++++++++++++++++----- drivers/telescope/lx200_OnStep.h | 4 +- 2 files changed, 80 insertions(+), 17 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 41ecbe70f7..be2fbe435d 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -218,15 +218,15 @@ bool LX200_OnStep::initProperties() IUFillSwitchVector(&OSFocus1InitializeSP, OSFocus1InitializeS, 2, getDeviceName(), "Foc1Rate", "Initialize", FOCUS_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE); // Focus T° Compensation - IUFillNumber(&FocuserTN[0], "TFC T°", "TFC T°", "%g", 0, 1, 0.25, 25); //default value is meaningless - IUFillNumber(&FocuserTN[1], "TFC Diff T°", "TFC Diff T°", "%g", 0, 1, 0.25, 25); //default value is meaningless + IUFillNumber(&FocuserTN[0], "TFC T°", "TFC T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless + IUFillNumber(&FocuserTN[1], "TFC Diff T°", "TFC Diff T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless IUFillNumberVector(&FocuserTNP, FocuserTN, 2, getDeviceName(), "TFC T°", "TFC T°", FOCUS_TAB, IP_RO, 0, IPS_IDLE); - IUFillSwitch(&TFCompensationS[0], "1", "Compensation: OFF", ISS_OFF); - IUFillSwitch(&TFCompensationS[1], "2", "Compensation: ON", ISS_OFF); - IUFillSwitchVector(&TFCompensationSP, TFCompensationS, 2, getDeviceName(), "Compensation T°", "Temperature Compensation", FOCUS_TAB, IP_RW, + IUFillSwitch(&TFCCompensationS[0], "Off", "Compensation: OFF", ISS_OFF); + IUFillSwitch(&TFCCompensationS[1], "On", "Compensation: ON", ISS_OFF); + IUFillSwitchVector(&TFCCompensationSP, TFCCompensationS, 2, getDeviceName(), "Compensation T°", "Temperature Compensation", FOCUS_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); - IUFillNumber(&TFCCoefficientN[0], "TFC Coeeficient", "TFC Coefficient µm/°C", "%+03.1f", -999, 999, 1, 100); + IUFillNumber(&TFCCoefficientN[0], "TFC Coeeficient", "TFC Coefficient µm/°C", "%+03.5f", -999.99999, 999.99999, 1, 100); IUFillNumberVector(&TFCCoefficientNP, TFCCoefficientN, 1, getDeviceName(), "TFC Coeeficient", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); IUFillNumber(&TFCDeadbandN[0], "TFC Deadband", "TFC Deadband µm", "%g", 1, 32767, 1, 5); IUFillNumberVector(&TFCDeadbandNP, TFCDeadbandN, 1, getDeviceName(), "TFC Deadband", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); @@ -504,7 +504,7 @@ bool LX200_OnStep::updateProperties() defineProperty(&OSFocus1InitializeSP); // Focus T° Compensation defineProperty(&FocuserTNP); - defineProperty(&TFCompensationSP); + defineProperty(&TFCCompensationSP); defineProperty(&TFCCoefficientNP); defineProperty(&TFCDeadbandNP); // End Focus T° Compensation @@ -717,7 +717,7 @@ bool LX200_OnStep::updateProperties() deleteProperty(TFCCoefficientNP.name); deleteProperty(TFCDeadbandNP.name); // Focus T° Compensation - deleteProperty(TFCompensationSP.name); + deleteProperty(TFCCompensationSP.name); // End Focus T° Compensation // Focuser 2 @@ -1188,12 +1188,12 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ // :FC[sn.n]# Set focuser temperature compensation coefficient in µ/°C char cmd[CMD_MAX_LEN] = {0}; - if (abs(values[0]) < 1000) //Range is -999 .. + 999 + if (abs(values[0]) < 1000) //Range is -999.999 .. + 999.999 { - snprintf(cmd, 15, ":FC%d#", (int)values[0]); + snprintf(cmd, 15, ":FC%+3.5f#", values[0]); sendOnStepCommandBlind(cmd); TFCCoefficientNP.s = IPS_OK; - IDSetNumber(&TFCCoefficientNP, "TFC Coeeficient set to %d", (int)values[0]); + IDSetNumber(&TFCCoefficientNP, "TFC Coeeficient set to %+3.5f", values[0]); } else { @@ -1222,9 +1222,11 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ } return true; } - // end Focus T° Compensation + + // end Focus T° Compensation + if (strstr(name, "WEATHER_")) { return WI::processNumber(dev, name, values, names, n); @@ -1883,6 +1885,39 @@ bool LX200_OnStep::ISNewSwitch(const char *dev, const char *name, ISState *state } } } + + // Focus T° Compensation + if (!strcmp(name, TFCCompensationSP.name)) + { + // :Fc[n]# Enable/disable focuser temperature compensation where [n] = 0 or 1 + // Return: 0 on failure + // 1 on success + char cmd[CMD_MAX_LEN] = {0}; + int ret = 0; + IUUpdateSwitch(&TFCCompensationSP, states, names, n); + TFCCompensationSP.s = IPS_OK; + + if (TFCCompensationS[0].s == ISS_ON) + { + snprintf(cmd, sizeof(cmd), ":Fc0#"); + ret = sendOnStepCommandBlind(cmd); + //TFCCompensationS[0].s = ISS_OFF; + IDSetSwitch(&TFCCompensationSP, "Idle"); + } + else + { + snprintf(cmd, sizeof(cmd), ":Fc1#"); + ret = sendOnStepCommandBlind(cmd); + //TFCCompensationS[1].s = ISS_OFF; + IDSetSwitch(&TFCCompensationSP, "Idle"); + } + + INDI_UNUSED(ret); + IUResetSwitch(&TFCCompensationSP); + IDSetSwitch(&TFCCompensationSP, nullptr); + return true; + } + //End Focus T° Compensation #ifdef ONSTEP_NOTDONE if (!strcmp(name, OSOutput1SP.name)) // @@ -3858,7 +3893,7 @@ int LX200_OnStep::OSUpdateFocuser() int ft_error = getCommandIntResponse(PortFD, &focus_T_int, focus_T, ":Ft#"); if (ft_error > 0) { - FocuserTN[0].value = focus_T_int; + FocuserTN[0].value = atof(focus_T); IDSetNumber(&FocuserTNP, nullptr); LOGF_DEBUG("focus T°: %s, %i fi_error: %i", focus_T, focus_T_int, ft_error); } @@ -3875,7 +3910,7 @@ int LX200_OnStep::OSUpdateFocuser() int fe_error = getCommandIntResponse(PortFD, &focus_TD_int, focus_TD, ":Fe#"); if (fe_error > 0) { - FocuserTN[1].value = focus_TD_int; + FocuserTN[1].value = atof(focus_TD); IDSetNumber(&FocuserTNP, nullptr); LOGF_DEBUG("focus Differential T°: %s, %i fi_error: %i", focus_TD, focus_TD_int, fe_error); } @@ -3892,7 +3927,7 @@ int LX200_OnStep::OSUpdateFocuser() int fC_error = getCommandIntResponse(PortFD, &focus_Coefficient_int, focus_Coeficient, ":FC#"); if (fC_error > 0) { - TFCCoefficientN[0].value = focus_Coefficient_int; + TFCCoefficientN[0].value = atof(focus_Coeficient); IDSetNumber(&TFCCoefficientNP, nullptr); LOGF_DEBUG("TFC Coefficient: %s, %i fC_error: %i", focus_Coeficient, focus_Coefficient_int, fC_error); } @@ -3918,6 +3953,34 @@ int LX200_OnStep::OSUpdateFocuser() LOG_WARN("Communication :FD# error, check connection."); flushIO(PortFD); //Unlikely to do anything, but just in case. } + + // :FC# Get focuser temperature compensation coefficient in microns per °C) + // Return: n.n# + char response[RB_MAX_LEN]; + int res = getCommandSingleCharResponse(PortFD, response, ":Fc#"); + if (res > 0) + { + if (strcmp(response,"0")) + { + TFCCompensationSP.s = IPS_OK; + TFCCompensationS[0].s = ISS_OFF; + TFCCompensationS[1].s = ISS_ON; + } + else if (strcmp(response,"1")) + { + TFCCompensationSP.s = IPS_OK; + TFCCompensationS[0].s = ISS_ON; + TFCCompensationS[1].s = ISS_OFF; + } + IDSetSwitch(&TFCCompensationSP, nullptr); + LOGF_DEBUG("TFC Enable: fc_error:%d Fc_response: %s", res, response); + } + else + { + //LOGF_DEBUG("TFC Enable1: fc_error:%i Fc_response: %s", res, response); + LOG_WARN("Communication :Fc# error, check connection."); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } // End Focus T° Compensation FI::updateProperties(); diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 293bcf5250..74922b8466 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -318,8 +318,8 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public // Focus T° Compensation INumberVectorProperty FocuserTNP; INumber FocuserTN[2]; - ISwitchVectorProperty TFCompensationSP; - ISwitch TFCompensationS[2]; + ISwitchVectorProperty TFCCompensationSP; + ISwitch TFCCompensationS[2]; INumberVectorProperty TFCCoefficientNP; INumber TFCCoefficientN[1]; INumberVectorProperty TFCDeadbandNP; From 6d1d048b9a1efad55c393a3bfe268a228c286edc Mon Sep 17 00:00:00 2001 From: azwing Date: Fri, 3 Mar 2023 22:39:06 +0100 Subject: [PATCH 13/22] removed unused properties causing undefined defNumberVector --- drivers/telescope/lx200_OnStep.cpp | 8 ++++---- drivers/telescope/lx200_OnStep.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index be2fbe435d..619d61f03d 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -620,8 +620,8 @@ bool LX200_OnStep::updateProperties() defineProperty(&OSPECIndexSP); defineProperty(&OSPECRecordSP); defineProperty(&OSPECReadSP); - defineProperty(&OSPECCurrentIndexNP); - defineProperty(&OSPECRWValuesNP); + //defineProperty(&OSPECCurrentIndexNP); + //defineProperty(&OSPECRWValuesNP); //New Align defineProperty(&OSNAlignStarsSP); @@ -739,8 +739,8 @@ bool LX200_OnStep::updateProperties() deleteProperty(OSPECIndexSP.name); deleteProperty(OSPECRecordSP.name); deleteProperty(OSPECReadSP.name); - deleteProperty(OSPECCurrentIndexNP.name); - deleteProperty(OSPECRWValuesNP.name); + //deleteProperty(OSPECCurrentIndexNP.name); + //deleteProperty(OSPECRWValuesNP.name); //New Align deleteProperty(OSNAlignStarsSP.name); diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 74922b8466..2685af16fb 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -286,7 +286,7 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public INumber ObjectNoN[1]; INumberVectorProperty MaxSlewRateNP; - INumber MaxSlewRateN[2]; + INumber MaxSlewRateN[1]; INumberVectorProperty BacklashNP; //test INumber BacklashN[2]; //Test From b143146416fda4686bf531a07cfb48a6edec362a Mon Sep 17 00:00:00 2001 From: azwing Date: Sun, 26 Mar 2023 22:19:50 +0200 Subject: [PATCH 14/22] Fixed minor bugs and typo --- drivers.xml | 2 +- drivers/telescope/lx200_OnStep.cpp | 77 +++++++++++++++++++++++------- drivers/telescope/lx200_OnStep.h | 5 ++ 3 files changed, 65 insertions(+), 19 deletions(-) diff --git a/drivers.xml b/drivers.xml index a5764d297b..3673d66673 100644 --- a/drivers.xml +++ b/drivers.xml @@ -29,7 +29,7 @@ indi_lx200_OnStep - 1.18 + 1.19 indi_lx200_OpenAstroTech diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 619d61f03d..9dcb177d55 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this) currentCatalog = LX200_STAR_C; currentSubCatalog = 0; - setVersion(1, 18); // don't forget to update libindi/drivers.xml + setVersion(1, 19); // don't forget to update libindi/drivers.xml setLX200Capability(LX200_HAS_TRACKING_FREQ | LX200_HAS_SITES | LX200_HAS_ALIGNMENT_TYPE | LX200_HAS_PULSE_GUIDING | LX200_HAS_PRECISE_TRACKING_FREQ); @@ -112,8 +112,8 @@ bool LX200_OnStep::initProperties() IUFillSwitchVector(&ReticSP, ReticS, 2, getDeviceName(), "RETICULE_BRIGHTNESS", "Reticule +/-", MAIN_CONTROL_TAB, IP_RW, ISR_ATMOST1, 60, IPS_IDLE); - IUFillNumber(&ElevationLimitN[0], "minAlt", "Elev Min", "%+03f", -90.0, 90.0, 1.0, -30.0); - IUFillNumber(&ElevationLimitN[1], "maxAlt", "Elev Max", "%+03f", -90.0, 90.0, 1.0, 89.0); + IUFillNumber(&ElevationLimitN[0], "minAlt", "Elev Min", "%g", -30, 30, 1, -30); + IUFillNumber(&ElevationLimitN[1], "maxAlt", "Elev Max", "%g", 60, 90, 1, 89); IUFillNumberVector(&ElevationLimitNP, ElevationLimitN, 2, getDeviceName(), "Slew elevation Limit", "", MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE); @@ -1459,7 +1459,7 @@ bool LX200_OnStep::ISNewSwitch(const char *dev, const char *name, ISState *state return true; } } - IUResetSwitch(&AutoFlipSP); + IUResetSwitch(&AutoFlipSP); //AutoFlipSP.s = IPS_IDLE; IDSetSwitch(&AutoFlipSP, nullptr); return true; @@ -2730,12 +2730,14 @@ bool LX200_OnStep::ReadScopeStatus() if (OSStat[2] & 0b10010000 == 0b10010000) { // Auto meridian flip + AutoFlipS[0].s = ISS_OFF; AutoFlipS[1].s = ISS_ON; AutoFlipSP.s = IPS_OK; IDSetSwitch(&AutoFlipSP, nullptr); } else { + AutoFlipS[1].s = ISS_OFF; AutoFlipS[0].s = ISS_ON; AutoFlipSP.s = IPS_OK; IDSetSwitch(&AutoFlipSP, nullptr); @@ -2996,14 +2998,16 @@ bool LX200_OnStep::ReadScopeStatus() int gx95_error = getCommandSingleCharErrorOrLongResponse(PortFD, merdidianflipauto_response, ":GX95#"); if (gx95_error > 1) { - if (merdidianflipauto_response[0] == '1' && merdidianflipauto_response[1] == 0) //Only set on 1# + if (merdidianflipauto_response[0] == '1') // && merdidianflipauto_response[1] == 0) //Only set on 1# { + AutoFlipS[0].s = ISS_OFF; AutoFlipS[1].s = ISS_ON; AutoFlipSP.s = IPS_OK; IDSetSwitch(&AutoFlipSP, nullptr); } - else + else if (merdidianflipauto_response[0] == '0') // && merdidianflipauto_response[1] == 0) //Only set on 1# { + AutoFlipS[1].s = ISS_OFF; AutoFlipS[0].s = ISS_ON; AutoFlipSP.s = IPS_OK; IDSetSwitch(&AutoFlipSP, nullptr); @@ -3065,18 +3069,19 @@ bool LX200_OnStep::ReadScopeStatus() if (OSMountType == MOUNTTYPE_GEM) { + // Minutes past Meridian, Onstep uses angulat values in degree we use minutes: 1° = 4 minutes char limit1_response[RB_MAX_LEN] = {0}; int gxea_error, gxe9_error; - double degrees_past_Meridian_East, degrees_past_Meridian_West; - gxe9_error = getCommandDoubleResponse(PortFD, °rees_past_Meridian_East, limit1_response, ":GXE9#"); + double minutes_past_Meridian_East, minutes_past_Meridian_West; + gxe9_error = getCommandDoubleResponse(PortFD, &minutes_past_Meridian_East, limit1_response, ":GXE9#"); if (gxe9_error > 1) //NOTE: Possible failure not checked. { char limit2_response[RB_MAX_LEN] = {0}; - gxea_error = getCommandDoubleResponse(PortFD, °rees_past_Meridian_West, limit2_response, ":GXEA#"); + gxea_error = getCommandDoubleResponse(PortFD, &minutes_past_Meridian_West, limit2_response, ":GXEA#"); if (gxea_error > 1) //NOTE: Possible failure not checked. { - minutesPastMeridianNP.np[0].value = degrees_past_Meridian_East; // E - minutesPastMeridianNP.np[1].value = degrees_past_Meridian_West; //W + minutesPastMeridianNP.np[0].value = minutes_past_Meridian_East; // E + minutesPastMeridianNP.np[1].value = minutes_past_Meridian_West; //W IDSetNumber(&minutesPastMeridianNP, nullptr); } else @@ -3092,6 +3097,42 @@ bool LX200_OnStep::ReadScopeStatus() } } } +// Get Overhead Limits +// :Go# Get Overhead Limit +// Returns: DD*# +// The highest elevation above the horizon that the telescope will goto + char Go[RB_MAX_LEN] = {0}; + int Go_int ; + int Go_error = getCommandIntResponse(PortFD, &Go_int, Go, ":Go#"); + if (Go_error > 0) + { + ElevationLimitN[1].value = atoi(Go); + IDSetNumber(&ElevationLimitNP, nullptr); + LOGF_DEBUG("Elevation Limit Min: %s, %i Go_nbcar: %i", Go, Go_int, Go_error); //typo + } + else + { + LOG_WARN("Communication :Go# error, check connection."); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } + +// :Gh# Get Horizon Limit, the minimum elevation of the mount relative to the horizon +// Returns: sDD*# + char Gh[RB_MAX_LEN] = {0}; + int Gh_int ; + int Gh_error = getCommandIntResponse(PortFD, &Gh_int, Gh, ":Gh#"); + if (Gh_error > 0) + { + ElevationLimitN[0].value = atoi(Gh); + IDSetNumber(&ElevationLimitNP, nullptr); + LOGF_DEBUG("Elevation Limit Min: %s, %i Gh_nbcar: %i", Gh, Gh_int, Gh_error); //typo + } + else + { + LOG_WARN("Communication :Gh# error, check connection."); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } +// End Get Overhead Limits //TODO: Improve Rotator support if (OSUpdateRotator() != 0) @@ -3859,7 +3900,7 @@ int LX200_OnStep::OSUpdateFocuser() FocusAbsPosN[0].max = focus_max_int; IUUpdateMinMax(&FocusAbsPosNP); IDSetNumber(&FocusAbsPosNP, nullptr); - LOGF_DEBUG("focus_max: %s, %i, fm_error: %i", focus_max, focus_max_int, fm_error); + LOGF_DEBUG("focus_max: %s, %i, fm_nbchar: %i", focus_max, focus_max_int, fm_error); } else { @@ -3877,7 +3918,7 @@ int LX200_OnStep::OSUpdateFocuser() FocusAbsPosN[0].min = focus_min_int; IUUpdateMinMax(&FocusAbsPosNP); IDSetNumber(&FocusAbsPosNP, nullptr); - LOGF_DEBUG("focus_min: %s, %i fi_error: %i", focus_min, focus_min_int, fi_error); + LOGF_DEBUG("focus_min: %s, %i fi_nbchar: %i", focus_min, focus_min_int, fi_error); } else { @@ -3895,7 +3936,7 @@ int LX200_OnStep::OSUpdateFocuser() { FocuserTN[0].value = atof(focus_T); IDSetNumber(&FocuserTNP, nullptr); - LOGF_DEBUG("focus T°: %s, %i fi_error: %i", focus_T, focus_T_int, ft_error); + LOGF_DEBUG("focus T°: %s, %i ft_nbcar: %i", focus_T, focus_T_int, ft_error); //typo } else { @@ -3912,7 +3953,7 @@ int LX200_OnStep::OSUpdateFocuser() { FocuserTN[1].value = atof(focus_TD); IDSetNumber(&FocuserTNP, nullptr); - LOGF_DEBUG("focus Differential T°: %s, %i fi_error: %i", focus_TD, focus_TD_int, fe_error); + LOGF_DEBUG("focus Differential T°: %s, %i fi_nbchar: %i", focus_TD, focus_TD_int, fe_error); } else { @@ -3929,7 +3970,7 @@ int LX200_OnStep::OSUpdateFocuser() { TFCCoefficientN[0].value = atof(focus_Coeficient); IDSetNumber(&TFCCoefficientNP, nullptr); - LOGF_DEBUG("TFC Coefficient: %s, %i fC_error: %i", focus_Coeficient, focus_Coefficient_int, fC_error); + LOGF_DEBUG("TFC Coefficient: %s, %i fC_nbchar: %i", focus_Coeficient, focus_Coefficient_int, fC_error); } else { @@ -3946,7 +3987,7 @@ int LX200_OnStep::OSUpdateFocuser() { TFCDeadbandN[0].value = focus_Deadband_int; IDSetNumber(&TFCDeadbandNP, nullptr); - LOGF_DEBUG("TFC Deadband: %s, %i fD_error: %i", focus_Deadband, focus_Deadband_int, fD_error); + LOGF_DEBUG("TFC Deadband: %s, %i fD_nbchar: %i", focus_Deadband, focus_Deadband_int, fD_error); } else { @@ -3973,7 +4014,7 @@ int LX200_OnStep::OSUpdateFocuser() TFCCompensationS[1].s = ISS_OFF; } IDSetSwitch(&TFCCompensationSP, nullptr); - LOGF_DEBUG("TFC Enable: fc_error:%d Fc_response: %s", res, response); + LOGF_DEBUG("TFC Enable: fc_nbchar:%d Fc_response: %s", res, response); } else { diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 2685af16fb..e1b937903e 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,6 +25,11 @@ =========================================== Version not yet updated/No INDI release: + Version 1.19 + - fixed typo on debug information saying error instead of nbchar causing confusion + - fixed Autoflip Off update + - fixed Elevation Limits update (was not read from OnStep) and format set to integer and gage for setup + - fixed minutes passed meridian not showing actual values Version 1.18 - implemented Focuser T° compensation in FOCUSER TAB - Minor fixes From 3c8a7f388d47bcd8ebbe53a76fb4a6f467947776 Mon Sep 17 00:00:00 2001 From: azwing Date: Sun, 26 Mar 2023 23:59:11 +0200 Subject: [PATCH 15/22] fix minor bugs and typo --- drivers/telescope/lx200_OnStep.cpp | 3 +++ drivers/telescope/lx200_OnStep.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 9dcb177d55..2004c0aab5 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -473,6 +473,7 @@ bool LX200_OnStep::updateProperties() defineProperty(&OnstepStatTP); // Motion Control + defineProperty(&SlewRateSP); // was missing defineProperty(&MaxSlewRateNP); defineProperty(&TrackCompSP); defineProperty(&TrackAxisSP); @@ -682,6 +683,7 @@ bool LX200_OnStep::updateProperties() IUFillSwitch(&SlewRateS[7], "7", "48x", ISS_OFF); IUFillSwitch(&SlewRateS[8], "8", "Half-Max", ISS_OFF); IUFillSwitch(&SlewRateS[9], "9", "Max", ISS_OFF); + } else { @@ -694,6 +696,7 @@ bool LX200_OnStep::updateProperties() // Options // Motion Control + deleteProperty(SlewRateSP.name); // was missing deleteProperty(MaxSlewRateNP.name); deleteProperty(TrackCompSP.name); deleteProperty(TrackAxisSP.name); diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index e1b937903e..1c771e28f0 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -30,6 +30,7 @@ - fixed Autoflip Off update - fixed Elevation Limits update (was not read from OnStep) and format set to integer and gage for setup - fixed minutes passed meridian not showing actual values + - fixed missing slewrates defineProperty and deleteProperty causing redefinitions of overides Version 1.18 - implemented Focuser T° compensation in FOCUSER TAB - Minor fixes From e593c3e86d8d5dec5eae634300d8ad8efcb8bdbb Mon Sep 17 00:00:00 2001 From: azwing Date: Mon, 27 Mar 2023 22:47:13 +0200 Subject: [PATCH 16/22] minor fixes --- drivers/telescope/lx200_OnStep.cpp | 13 +++++++++++-- drivers/telescope/lx200_OnStep.h | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 2004c0aab5..c1ec4564b4 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -137,7 +137,7 @@ bool LX200_OnStep::initProperties() IUFillSwitch(&SlewRateS[3], "3", "2x", ISS_OFF); IUFillSwitch(&SlewRateS[4], "4", "4x", ISS_OFF); IUFillSwitch(&SlewRateS[5], "5", "8x", ISS_ON); - IUFillSwitch(&SlewRateS[6], "6", "24x", ISS_OFF); + IUFillSwitch(&SlewRateS[6], "6", "20x", ISS_OFF); //last OnStep - OnStepX IUFillSwitch(&SlewRateS[7], "7", "48x", ISS_OFF); IUFillSwitch(&SlewRateS[8], "8", "Half-Max", ISS_OFF); IUFillSwitch(&SlewRateS[9], "9", "Max", ISS_OFF); @@ -679,7 +679,7 @@ bool LX200_OnStep::updateProperties() IUFillSwitch(&SlewRateS[3], "3", "2x", ISS_OFF); IUFillSwitch(&SlewRateS[4], "4", "4x", ISS_OFF); IUFillSwitch(&SlewRateS[5], "5", "8x", ISS_ON); - IUFillSwitch(&SlewRateS[6], "6", "24x", ISS_OFF); + IUFillSwitch(&SlewRateS[6], "6", "20x", ISS_OFF); IUFillSwitch(&SlewRateS[7], "7", "48x", ISS_OFF); IUFillSwitch(&SlewRateS[8], "8", "Half-Max", ISS_OFF); IUFillSwitch(&SlewRateS[9], "9", "Max", ISS_OFF); @@ -2620,6 +2620,15 @@ bool LX200_OnStep::ReadScopeStatus() // print('\tbreak;') Lasterror = (Errors)(OSStat[strlen(OSStat) - 1] - '0'); + + // Refresh current Slew Rate + int idx = OSStat[strlen(OSStat)-2] - '0'; + IUResetSwitch(&SlewRateSP); + SlewRateS[idx].s = ISS_ON; + SlewRateSP.s = IPS_OK; + IDSetSwitch(&SlewRateSP, nullptr); + LOGF_DEBUG("Guide Rate Index: %d", idx); + // End Refresh current Slew Rate } else { diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 1c771e28f0..169e9c97fe 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -31,6 +31,9 @@ - fixed Elevation Limits update (was not read from OnStep) and format set to integer and gage for setup - fixed minutes passed meridian not showing actual values - fixed missing slewrates defineProperty and deleteProperty causing redefinitions of overides + - todo focuser stops working after some time ??? could not yet reproduce + - fixed poll and update slew rates + - todo poll and update maximum slew speed SmartWebServer=>Settings Version 1.18 - implemented Focuser T° compensation in FOCUSER TAB - Minor fixes From e3f206ccd39a277dc3813d42e92883ae1fabdf33 Mon Sep 17 00:00:00 2001 From: azwing Date: Sat, 23 Sep 2023 10:51:45 +0200 Subject: [PATCH 17/22] fixes OnStepX :Ft# and :GX98# --- drivers/telescope/lx200_OnStep.cpp | 58 +++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index c1ec4564b4..eb90008321 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -585,6 +585,7 @@ bool LX200_OnStep::updateProperties() LOGF_DEBUG("OSFocuser1: %d, OSFocuser2: %d, OSNumFocusers: %i", OSFocuser1, OSFocuser2, OSNumFocusers); //Rotation Information + /* Was working with OnStep 4 char rotator_response[RB_MAX_LEN] = {0}; error_or_fail = getCommandSingleCharErrorOrLongResponse(PortFD, rotator_response, ":GX98#"); if (error_or_fail > 0) @@ -599,12 +600,42 @@ bool LX200_OnStep::updateProperties() { defineProperty(&OSRotatorDerotateSP); } + if (rotator_response[0] == '0') + { + OSRotator1 = false; + } } else { LOGF_WARN("Error: %i", error_or_fail); LOG_WARN("Error on response to rotator check (:GX98#) CHECK CONNECTION"); + }*/ + //================ For OnStepX + char rotator_response[RB_MAX_LEN] = {0}; + error_or_fail = getCommandSingleCharResponse(PortFD, rotator_response, ":GX98#"); + if (error_or_fail > 0) + { + if (rotator_response[0] == 'D' || rotator_response[0] == 'R') + { + LOG_INFO("Rotator found."); + OSRotator1 = true; + RI::updateProperties(); + } + if (rotator_response[0] == 'D') + { + defineProperty(&OSRotatorDerotateSP); + } + if (rotator_response[0] == '0') + { + OSRotator1 = false; + } } + else + { + LOGF_WARN("Error: %i", error_or_fail); + LOG_WARN("Error on response to rotator check (:GX98#) CHECK CONNECTION"); + } + //================= if (OSRotator1 == false) { @@ -3212,7 +3243,7 @@ bool LX200_OnStep::ReadScopeStatus() char cputemp_reponse[RB_MAX_LEN] = {0}; double cputemp_value; int error_return = getCommandDoubleResponse(PortFD, &cputemp_value, cputemp_reponse, ":GX9F#"); - if ( error_return >= 0 && !strcmp(cputemp_reponse, "0") ) + if ( error_return >= 0) // && !strcmp(cputemp_reponse, "0") ) { setParameterValue("WEATHER_CPU_TEMPERATURE", cputemp_value); } @@ -3937,14 +3968,14 @@ int LX200_OnStep::OSUpdateFocuser() LOG_WARN("Communication :FI# error, check connection."); flushIO(PortFD); //Unlikely to do anything, but just in case. } - + /* Was working with OnStep 4 // Focus T° Compensation // :Ft# Get Focuser Temperature // Returns: n# char focus_T[RB_MAX_LEN] = {0}; int focus_T_int ; int ft_error = getCommandIntResponse(PortFD, &focus_T_int, focus_T, ":Ft#"); - if (ft_error > 0) + if ((ft_error > 0) | (ft_error==-1001)) { FocuserTN[0].value = atof(focus_T); IDSetNumber(&FocuserTNP, nullptr); @@ -3953,9 +3984,28 @@ int LX200_OnStep::OSUpdateFocuser() else { LOG_WARN("Communication :Ft# error, check connection."); + LOGF_DEBUG("focus T°: %s, focusT_int %i ft_nbcar: %i", focus_T, focus_T_int, ft_error); flushIO(PortFD); //Unlikely to do anything, but just in case. } - + */ + //================ For OnStepX + char focus_T[RB_MAX_LEN] = {0}; + double focus_T_double ; + int ft_error = getCommandDoubleResponse(PortFD, &focus_T_double, focus_T, ":Ft#"); + if (ft_error > 0) + { + FocuserTN[0].value = atof(focus_T); + IDSetNumber(&FocuserTNP, nullptr); + LOGF_DEBUG("focus T°: %s, focus_T_double %i ft_nbcar: %i", focus_T, focus_T_double, ft_error); + } + else + { + LOG_WARN("Communication :Ft# error, check connection."); + LOGF_DEBUG("focus T°: %s, focus_T_double %i ft_nbcar: %i", focus_T, focus_T_double, ft_error); + flushIO(PortFD); //Unlikely to do anything, but just in case. + } + //================ + // :Fe# Get Focus Differential T° // Returns: n# char focus_TD[RB_MAX_LEN] = {0}; From 0214dac36257ad460a40ea9ccc087c4505d39f3c Mon Sep 17 00:00:00 2001 From: azwing Date: Mon, 25 Sep 2023 18:26:10 +0200 Subject: [PATCH 18/22] fixed Focuser Temperature in Ekos --- drivers/telescope/lx200_OnStep.cpp | 23 ++++++++++++----------- drivers/telescope/lx200_OnStep.h | 5 +++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index eb90008321..2d0331696d 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -218,14 +218,15 @@ bool LX200_OnStep::initProperties() IUFillSwitchVector(&OSFocus1InitializeSP, OSFocus1InitializeS, 2, getDeviceName(), "Foc1Rate", "Initialize", FOCUS_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE); // Focus T° Compensation - IUFillNumber(&FocuserTN[0], "TFC T°", "TFC T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless - IUFillNumber(&FocuserTN[1], "TFC Diff T°", "TFC Diff T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless - IUFillNumberVector(&FocuserTNP, FocuserTN, 2, getDeviceName(), "TFC T°", "TFC T°", FOCUS_TAB, IP_RO, 0, + IUFillNumber(&FocusTemperatureN[0], "TFC T°", "TFC T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless + IUFillNumber(&FocusTemperatureN[1], "TFC Δ T°", "TFC Δ T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless + IUFillNumberVector(&FocusTemperatureNP, FocusTemperatureN, 2, getDeviceName(), "TFC T°", "TFC T°", FOCUS_TAB, IP_RO, 0, IPS_IDLE); IUFillSwitch(&TFCCompensationS[0], "Off", "Compensation: OFF", ISS_OFF); IUFillSwitch(&TFCCompensationS[1], "On", "Compensation: ON", ISS_OFF); IUFillSwitchVector(&TFCCompensationSP, TFCCompensationS, 2, getDeviceName(), "Compensation T°", "Temperature Compensation", FOCUS_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); + IUFillNumber(&TFCCoefficientN[0], "TFC Coeeficient", "TFC Coefficient µm/°C", "%+03.5f", -999.99999, 999.99999, 1, 100); IUFillNumberVector(&TFCCoefficientNP, TFCCoefficientN, 1, getDeviceName(), "TFC Coeeficient", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); IUFillNumber(&TFCDeadbandN[0], "TFC Deadband", "TFC Deadband µm", "%g", 1, 32767, 1, 5); @@ -504,7 +505,7 @@ bool LX200_OnStep::updateProperties() OSFocuser1 = true; defineProperty(&OSFocus1InitializeSP); // Focus T° Compensation - defineProperty(&FocuserTNP); + defineProperty(&FocusTemperatureNP); defineProperty(&TFCCompensationSP); defineProperty(&TFCCoefficientNP); defineProperty(&TFCDeadbandNP); @@ -746,7 +747,7 @@ bool LX200_OnStep::updateProperties() // Focuser // Focuser 1 - deleteProperty(FocuserTNP.name); + deleteProperty(FocusTemperatureNP.name); deleteProperty(OSFocus1InitializeSP.name); deleteProperty(TFCCoefficientNP.name); deleteProperty(TFCDeadbandNP.name); @@ -3977,8 +3978,8 @@ int LX200_OnStep::OSUpdateFocuser() int ft_error = getCommandIntResponse(PortFD, &focus_T_int, focus_T, ":Ft#"); if ((ft_error > 0) | (ft_error==-1001)) { - FocuserTN[0].value = atof(focus_T); - IDSetNumber(&FocuserTNP, nullptr); + FocusTemperatureN[0].value = atof(focus_T); + IDSetNumber(&FocusTemperatureNP, nullptr); LOGF_DEBUG("focus T°: %s, %i ft_nbcar: %i", focus_T, focus_T_int, ft_error); //typo } else @@ -3994,8 +3995,8 @@ int LX200_OnStep::OSUpdateFocuser() int ft_error = getCommandDoubleResponse(PortFD, &focus_T_double, focus_T, ":Ft#"); if (ft_error > 0) { - FocuserTN[0].value = atof(focus_T); - IDSetNumber(&FocuserTNP, nullptr); + FocusTemperatureN[0].value = atof(focus_T); + IDSetNumber(&FocusTemperatureNP, nullptr); LOGF_DEBUG("focus T°: %s, focus_T_double %i ft_nbcar: %i", focus_T, focus_T_double, ft_error); } else @@ -4013,8 +4014,8 @@ int LX200_OnStep::OSUpdateFocuser() int fe_error = getCommandIntResponse(PortFD, &focus_TD_int, focus_TD, ":Fe#"); if (fe_error > 0) { - FocuserTN[1].value = atof(focus_TD); - IDSetNumber(&FocuserTNP, nullptr); + FocusTemperatureN[1].value = atof(focus_TD); + IDSetNumber(&FocusTemperatureNP, nullptr); LOGF_DEBUG("focus Differential T°: %s, %i fi_nbchar: %i", focus_TD, focus_TD_int, fe_error); } else diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 169e9c97fe..4718d48dbe 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -325,8 +325,9 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public ISwitch OSFocus1InitializeS[4]; // Focus T° Compensation - INumberVectorProperty FocuserTNP; - INumber FocuserTN[2]; + INumberVectorProperty FocusTemperatureNP; + INumber FocusTemperatureN[2]; + ISwitchVectorProperty TFCCompensationSP; ISwitch TFCCompensationS[2]; INumberVectorProperty TFCCoefficientNP; From 5394d031e94494c8c97560b58af4df3caf17651c Mon Sep 17 00:00:00 2001 From: azwing Date: Mon, 25 Sep 2023 21:35:30 +0200 Subject: [PATCH 19/22] fixed FOCUS_TEMPERATURE Property name --- drivers/telescope/lx200_OnStep.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 2d0331696d..7ed6ad3d7c 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -217,18 +217,19 @@ bool LX200_OnStep::initProperties() // IUFillSwitch(&OSFocus1InitializeS[2], "Focus1_3", "max", ISS_OFF); IUFillSwitchVector(&OSFocus1InitializeSP, OSFocus1InitializeS, 2, getDeviceName(), "Foc1Rate", "Initialize", FOCUS_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE); - // Focus T° Compensation - IUFillNumber(&FocusTemperatureN[0], "TFC T°", "TFC T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless + // Focus T° Compensation + // Property must be FOCUS_TEMPERATURE to be recognized by Ekos + IUFillNumber(&FocusTemperatureN[0], "FOCUS_TEMPERATURE", "TFC T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless IUFillNumber(&FocusTemperatureN[1], "TFC Δ T°", "TFC Δ T°", "%+2.2f", 0, 1, 0.25, 25); //default value is meaningless - IUFillNumberVector(&FocusTemperatureNP, FocusTemperatureN, 2, getDeviceName(), "TFC T°", "TFC T°", FOCUS_TAB, IP_RO, 0, + IUFillNumberVector(&FocusTemperatureNP, FocusTemperatureN, 2, getDeviceName(), "FOCUS_TEMPERATURE", "Focuser T°", FOCUS_TAB, IP_RO, 0, IPS_IDLE); IUFillSwitch(&TFCCompensationS[0], "Off", "Compensation: OFF", ISS_OFF); IUFillSwitch(&TFCCompensationS[1], "On", "Compensation: ON", ISS_OFF); IUFillSwitchVector(&TFCCompensationSP, TFCCompensationS, 2, getDeviceName(), "Compensation T°", "Temperature Compensation", FOCUS_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE); - IUFillNumber(&TFCCoefficientN[0], "TFC Coeeficient", "TFC Coefficient µm/°C", "%+03.5f", -999.99999, 999.99999, 1, 100); - IUFillNumberVector(&TFCCoefficientNP, TFCCoefficientN, 1, getDeviceName(), "TFC Coeeficient", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); + IUFillNumber(&TFCCoefficientN[0], "TFC Coefficient", "TFC Coefficient µm/°C", "%+03.5f", -999.99999, 999.99999, 1, 100); + IUFillNumberVector(&TFCCoefficientNP, TFCCoefficientN, 1, getDeviceName(), "TFC Coefficient", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); IUFillNumber(&TFCDeadbandN[0], "TFC Deadband", "TFC Deadband µm", "%g", 1, 32767, 1, 5); IUFillNumberVector(&TFCDeadbandNP, TFCDeadbandN, 1, getDeviceName(), "TFC Deadband", "", FOCUS_TAB, IP_RW, 0, IPS_IDLE); // End Focus T° Compensation @@ -1228,7 +1229,7 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ snprintf(cmd, 15, ":FC%+3.5f#", values[0]); sendOnStepCommandBlind(cmd); TFCCoefficientNP.s = IPS_OK; - IDSetNumber(&TFCCoefficientNP, "TFC Coeeficient set to %+3.5f", values[0]); + IDSetNumber(&TFCCoefficientNP, "TFC Coefficient set to %+3.5f", values[0]); } else { From d805c056119f516089118ff23467245f2c7cdf5e Mon Sep 17 00:00:00 2001 From: azwing Date: Mon, 25 Sep 2023 23:36:54 +0200 Subject: [PATCH 20/22] =?UTF-8?q?Weather=20and=20Focus=20T=C2=B0=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drivers/telescope/lx200_OnStep.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 7ed6ad3d7c..23a4065a7a 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -1170,6 +1170,7 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ snprintf(cmd, 15, ":SX9A,%d#", (int)values[0]); sendOnStepCommandBlind(cmd); OSSetTemperatureNP.s = IPS_OK; + OSSetTemperatureN[0].value=values[0]; IDSetNumber(&OSSetTemperatureNP, "Temperature set to %d", (int)values[0]); } else @@ -1189,6 +1190,7 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ snprintf(cmd, 15, ":SX9C,%d#", (int)values[0]); sendOnStepCommandBlind(cmd); OSSetHumidityNP.s = IPS_OK; + OSSetHumidityN[0].value=values[0]; IDSetNumber(&OSSetHumidityNP, "Humidity set to %d", (int)values[0]); } else @@ -1203,11 +1205,12 @@ bool LX200_OnStep::ISNewNumber(const char *dev, const char *name, double values[ { char cmd[CMD_MAX_LEN] = {0}; - if ((values[0] >= 0) && (values[0] <= 100)) + if ((values[0] >= 500) && (values[0] <= 1100)) // typo { snprintf(cmd, 15, ":SX9B,%d#", (int)values[0]); sendOnStepCommandBlind(cmd); OSSetPressureNP.s = IPS_OK; + OSSetPressureN[0].value=values[0]; IDSetNumber(&OSSetPressureNP, "Pressure set to %d", (int)values[0]); } else From 12d1114cbb0aede7afbbebb164779812614038e4 Mon Sep 17 00:00:00 2001 From: azwing Date: Mon, 25 Sep 2023 23:59:56 +0200 Subject: [PATCH 21/22] version 1.20 --- drivers.xml | 2 +- drivers/telescope/lx200_OnStep.cpp | 2 +- drivers/telescope/lx200_OnStep.h | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers.xml b/drivers.xml index bbeef1c254..1bb1eebad0 100644 --- a/drivers.xml +++ b/drivers.xml @@ -29,7 +29,7 @@ indi_lx200_OnStep - 1.19 + 1.20 indi_lx200_OpenAstroTech diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 23a4065a7a..1024da8cd1 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this) currentCatalog = LX200_STAR_C; currentSubCatalog = 0; - setVersion(1, 19); // don't forget to update libindi/drivers.xml + setVersion(1, 20); // don't forget to update libindi/drivers.xml setLX200Capability(LX200_HAS_TRACKING_FREQ | LX200_HAS_SITES | LX200_HAS_ALIGNMENT_TYPE | LX200_HAS_PULSE_GUIDING | LX200_HAS_PRECISE_TRACKING_FREQ); diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 4718d48dbe..846160871d 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -25,6 +25,11 @@ =========================================== Version not yet updated/No INDI release: + Version 1.20 + - fixed wrong messages due to different return with OnStepX + - fixed Focuser Temerature not shown on Ekos + - fixed Weather settings (P/T/Hr) when no sensor present + - minor typos Version 1.19 - fixed typo on debug information saying error instead of nbchar causing confusion - fixed Autoflip Off update From 13541533068d326fea3b54255105e54e980af67b Mon Sep 17 00:00:00 2001 From: azwing Date: Thu, 28 Sep 2023 20:39:23 +0200 Subject: [PATCH 22/22] clean up version 1.20 --- drivers/telescope/lx200_OnStep.cpp | 77 +++++++++--------------------- 1 file changed, 23 insertions(+), 54 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 1024da8cd1..20bb2c4478 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -114,17 +114,22 @@ bool LX200_OnStep::initProperties() IUFillNumber(&ElevationLimitN[0], "minAlt", "Elev Min", "%g", -30, 30, 1, -30); IUFillNumber(&ElevationLimitN[1], "maxAlt", "Elev Max", "%g", 60, 90, 1, 89); - IUFillNumberVector(&ElevationLimitNP, ElevationLimitN, 2, getDeviceName(), "Slew elevation Limit", "", MAIN_CONTROL_TAB, + IUFillNumberVector(&ElevationLimitNP, ElevationLimitN, 2, getDeviceName(), "Slew elevation Limit", "", MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE); IUFillText(&ObjectInfoT[0], "Info", "", ""); - IUFillTextVector(&ObjectInfoTP, ObjectInfoT, 1, getDeviceName(), "Object Info", "", MAIN_CONTROL_TAB, IP_RO, 0, IPS_IDLE); + IUFillTextVector(&ObjectInfoTP, ObjectInfoT, 1, getDeviceName(), "Object Info", "", MAIN_CONTROL_TAB, + IP_RO, 0, IPS_IDLE); + // ============== COMMUNICATION_TAB + // ============== CONNECTION_TAB - // ============== OPTION_TAB + // ============== OPTIONS_TAB + + // ============== FILTER_TAB - // ============== MOTION_CONTROL_TAB + // ============== MOTION_TAB //Override the standard slew rate command. Also add appropriate description. This also makes it work in Ekos Mount Control correctly //Note that SlewRateSP and MaxSlewRateNP BOTH track the rate. I have left them in there because MaxRateNP reports OnStep Values uint8_t nSlewRate = 10; @@ -145,7 +150,8 @@ bool LX200_OnStep::initProperties() IP_RW, ISR_1OFMANY, 0, IPS_IDLE); IUFillNumber(&MaxSlewRateN[0], "maxSlew", "Rate", "%f", 0.0, 9.0, 1.0, 5.0); //2.0, 9.0, 1.0, 9.0 - IUFillNumberVector(&MaxSlewRateNP, MaxSlewRateN, 1, getDeviceName(), "Max slew Rate", "", MOTION_TAB, IP_RW, 0, IPS_IDLE); + IUFillNumberVector(&MaxSlewRateNP, MaxSlewRateN, 1, getDeviceName(), "Max slew Rate", "", MOTION_TAB, + IP_RW, 0, IPS_IDLE); IUFillSwitch(&TrackCompS[0], "1", "Full Compensation", ISS_OFF); IUFillSwitch(&TrackCompS[1], "2", "Refraction", ISS_OFF); @@ -200,8 +206,10 @@ bool LX200_OnStep::initProperties() IUFillNumberVector(&minutesPastMeridianNP, minutesPastMeridianN, 2, getDeviceName(), "Minutes Past Meridian", "Minutes Past Meridian", MOTION_TAB, IP_RW, 0, IPS_IDLE); + + // ============== DATETIME_TAB - // ============== SITE_MANAGEMENT_TAB + // ============== SITE_TAB IUFillSwitch(&SetHomeS[0], "RETURN_HOME", "Return Home", ISS_OFF); IUFillSwitch(&SetHomeS[1], "AT_HOME", "At Home (Reset)", ISS_OFF); IUFillSwitchVector(&SetHomeSP, SetHomeS, 2, getDeviceName(), "HOME_INIT", "Homing", SITE_TAB, IP_RW, ISR_ATMOST1, 60, @@ -312,7 +320,7 @@ bool LX200_OnStep::initProperties() // IUFillSwitch(&OSPECReadS[2], "Write to EEPROM", "Write to EEPROM", ISS_OFF); IUFillSwitchVector(&OSPECReadSP, OSPECReadS, 2, getDeviceName(), "PEC File", "PEC File", PEC_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE); - // ============== New ALIGN_TAB + // ============== ALIGNMENT_TAB // Only supports Alpha versions currently (July 2018) Now Beta (Dec 2018) IUFillSwitch(&OSNAlignStarsS[0], "1", "1 Star", ISS_OFF); IUFillSwitch(&OSNAlignStarsS[1], "2", "2 Stars", ISS_OFF); @@ -359,6 +367,8 @@ bool LX200_OnStep::initProperties() // IUFillText(&OSNAlignErrT[6], "6", "Current Star", "Not Updated"); // IUFillText(&OSNAlignErrT[7], "7", "# of Align Stars", "Not Updated"); IUFillTextVector(&OSNAlignErrTP, OSNAlignErrT, 2, getDeviceName(), "ErrAlign Process", "", ALIGN_TAB, IP_RO, 0, IPS_IDLE); + + // =============== INFO_TAB #ifdef ONSTEP_NOTDONE // =============== OUTPUT_TAB @@ -587,32 +597,6 @@ bool LX200_OnStep::updateProperties() LOGF_DEBUG("OSFocuser1: %d, OSFocuser2: %d, OSNumFocusers: %i", OSFocuser1, OSFocuser2, OSNumFocusers); //Rotation Information - /* Was working with OnStep 4 - char rotator_response[RB_MAX_LEN] = {0}; - error_or_fail = getCommandSingleCharErrorOrLongResponse(PortFD, rotator_response, ":GX98#"); - if (error_or_fail > 0) - { - if (rotator_response[0] == 'D' || rotator_response[0] == 'R') - { - LOG_INFO("Rotator found."); - OSRotator1 = true; - RI::updateProperties(); - } - if (rotator_response[0] == 'D') - { - defineProperty(&OSRotatorDerotateSP); - } - if (rotator_response[0] == '0') - { - OSRotator1 = false; - } - } - else - { - LOGF_WARN("Error: %i", error_or_fail); - LOG_WARN("Error on response to rotator check (:GX98#) CHECK CONNECTION"); - }*/ - //================ For OnStepX char rotator_response[RB_MAX_LEN] = {0}; error_or_fail = getCommandSingleCharResponse(PortFD, rotator_response, ":GX98#"); if (error_or_fail > 0) @@ -3094,6 +3078,7 @@ bool LX200_OnStep::ReadScopeStatus() PreferredPierSideSP.s = IPS_OK; IDSetSwitch(&PreferredPierSideSP, nullptr); } + /* remove this dead code else if (strstr(preferredpierside_response, "%")) { //NOTE: This bug is only present in very early OnStepX, and should be fixed shortly after 10.03k @@ -3102,6 +3087,7 @@ bool LX200_OnStep::ReadScopeStatus() PreferredPierSideSP.s = IPS_ALERT; IDSetSwitch(&PreferredPierSideSP, nullptr); } + */ else { IUResetSwitch(&PreferredPierSideSP); @@ -3899,6 +3885,7 @@ int LX200_OnStep::OSUpdateFocuser() IDSetNumber(&FocusAbsPosNP, nullptr); LOGF_DEBUG("Current focuser: %d, %f", value_int, FocusAbsPosN[0].value); } + // :FT# get status // Returns: M# (for moving) or S# (for stopped) char valueStatus[RB_MAX_LEN] = {0}; @@ -3938,6 +3925,7 @@ int LX200_OnStep::OSUpdateFocuser() FocusAbsPosNP.s = IPS_ALERT; IDSetNumber(&FocusAbsPosNP, nullptr); } + // :FM# Get max position (in microns) // Returns: n# char focus_max[RB_MAX_LEN] = {0}; @@ -3956,6 +3944,7 @@ int LX200_OnStep::OSUpdateFocuser() LOGF_WARN("focus_max: %s, %u, fm_error: %i", focus_max, focus_max[0], fm_error); flushIO(PortFD); //Unlikely to do anything, but just in case. } + // :FI# Get full in position (in microns) // Returns: n# char focus_min[RB_MAX_LEN] = {0}; @@ -3973,28 +3962,10 @@ int LX200_OnStep::OSUpdateFocuser() LOG_WARN("Communication :FI# error, check connection."); flushIO(PortFD); //Unlikely to do anything, but just in case. } - /* Was working with OnStep 4 - // Focus T° Compensation + // :Ft# Get Focuser Temperature // Returns: n# char focus_T[RB_MAX_LEN] = {0}; - int focus_T_int ; - int ft_error = getCommandIntResponse(PortFD, &focus_T_int, focus_T, ":Ft#"); - if ((ft_error > 0) | (ft_error==-1001)) - { - FocusTemperatureN[0].value = atof(focus_T); - IDSetNumber(&FocusTemperatureNP, nullptr); - LOGF_DEBUG("focus T°: %s, %i ft_nbcar: %i", focus_T, focus_T_int, ft_error); //typo - } - else - { - LOG_WARN("Communication :Ft# error, check connection."); - LOGF_DEBUG("focus T°: %s, focusT_int %i ft_nbcar: %i", focus_T, focus_T_int, ft_error); - flushIO(PortFD); //Unlikely to do anything, but just in case. - } - */ - //================ For OnStepX - char focus_T[RB_MAX_LEN] = {0}; double focus_T_double ; int ft_error = getCommandDoubleResponse(PortFD, &focus_T_double, focus_T, ":Ft#"); if (ft_error > 0) @@ -4009,7 +3980,6 @@ int LX200_OnStep::OSUpdateFocuser() LOGF_DEBUG("focus T°: %s, focus_T_double %i ft_nbcar: %i", focus_T, focus_T_double, ft_error); flushIO(PortFD); //Unlikely to do anything, but just in case. } - //================ // :Fe# Get Focus Differential T° // Returns: n# @@ -4089,7 +4059,6 @@ int LX200_OnStep::OSUpdateFocuser() LOG_WARN("Communication :Fc# error, check connection."); flushIO(PortFD); //Unlikely to do anything, but just in case. } - // End Focus T° Compensation FI::updateProperties(); LOGF_DEBUG("After update properties: FocusAbsPosN min: %f max: %f", FocusAbsPosN[0].min, FocusAbsPosN[0].max);