From 227918ba98fd4ccbcd40270076f4dd277f44588f Mon Sep 17 00:00:00 2001 From: azwing Date: Fri, 27 Oct 2023 12:20:35 +0200 Subject: [PATCH] Cosmetic fixes Alignment --- drivers/telescope/lx200_OnStep.cpp | 24 +++++++++++------------- drivers/telescope/lx200_OnStep.h | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/telescope/lx200_OnStep.cpp b/drivers/telescope/lx200_OnStep.cpp index 2b6060a13b..cc9814b6be 100644 --- a/drivers/telescope/lx200_OnStep.cpp +++ b/drivers/telescope/lx200_OnStep.cpp @@ -331,13 +331,12 @@ bool LX200_OnStep::initProperties() IUFillSwitch(&OSNAlignStarsS[6], "7", "7 Stars", ISS_OFF); IUFillSwitch(&OSNAlignStarsS[7], "8", "8 Stars", ISS_OFF); IUFillSwitch(&OSNAlignStarsS[8], "9", "9 Stars", ISS_OFF); - IUFillSwitchVector(&OSNAlignStarsSP, OSNAlignStarsS, 9, getDeviceName(), "AlignStars", "Align using some stars, Alpha only", + IUFillSwitchVector(&OSNAlignStarsSP, OSNAlignStarsS, 9, getDeviceName(), "AlignStars", "Select # of stars", ALIGN_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE); IUFillSwitch(&OSNAlignS[0], "0", "Start Align", ISS_OFF); IUFillSwitch(&OSNAlignS[1], "1", "Issue Align", ISS_OFF); - IUFillSwitch(&OSNAlignS[2], "3", "Write Align", ISS_OFF); - IUFillSwitchVector(&OSNAlignSP, OSNAlignS, 2, getDeviceName(), "NewAlignStar", "Align using up to 6 stars, Alpha only", + IUFillSwitchVector(&OSNAlignSP, OSNAlignS, 2, getDeviceName(), "NewAlignStar", "Align using up to 9 stars", ALIGN_TAB, IP_RW, ISR_ATMOST1, 0, IPS_IDLE); IUFillSwitch(&OSNAlignWriteS[0], "0", "Write Align to NVRAM/Flash", ISS_OFF); @@ -356,7 +355,7 @@ bool LX200_OnStep::initProperties() IUFillText(&OSNAlignT[5], "5", "Max Stars", "Not Updated"); IUFillText(&OSNAlignT[6], "6", "Current Star", "Not Updated"); IUFillText(&OSNAlignT[7], "7", "# of Align Stars", "Not Updated"); - IUFillTextVector(&OSNAlignTP, OSNAlignT, 8, getDeviceName(), "NAlign Process", "", ALIGN_TAB, IP_RO, 0, IPS_IDLE); + IUFillTextVector(&OSNAlignTP, OSNAlignT, 8, getDeviceName(), "Align Process", "", ALIGN_TAB, IP_RO, 0, IPS_IDLE); IUFillText(&OSNAlignErrT[0], "0", "EQ Polar Error Alt", "Available once Aligned"); IUFillText(&OSNAlignErrT[1], "1", "EQ Polar Error Az", "Available once Aligned"); @@ -366,7 +365,7 @@ bool LX200_OnStep::initProperties() // IUFillText(&OSNAlignErrT[5], "5", "Max Stars", "Not Updated"); // 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); + IUFillTextVector(&OSNAlignErrTP, OSNAlignErrT, 2, getDeviceName(), "Align OnStep results", "", ALIGN_TAB, IP_RO, 0, IPS_IDLE); // =============== INFO_TAB @@ -1915,7 +1914,7 @@ bool LX200_OnStep::ISNewSwitch(const char *dev, const char *name, ISState *state } else { - LOGF_ERROR("Command for Refine Polar Alignment Failed, error=%s", response); + LOGF_ERROR("Command for Refine Polar Alignment Failed, error=%s", response[0]); UpdateAlignStatus(); OSNAlignPolarRealignSP.s = IPS_ALERT; IDSetSwitch(&OSNAlignPolarRealignSP, nullptr); @@ -4621,7 +4620,7 @@ IPState LX200_OnStep::AlignStartGeometric (int stars) { //See here https://groups.io/g/onstep/message/3624 char cmd[CMD_MAX_LEN] = {0}; - + LOG_INFO("Sending Command to Start Alignment"); IUSaveText(&OSNAlignT[0], "Align STARTED"); IUSaveText(&OSNAlignT[1], "GOTO a star, center it"); @@ -4712,13 +4711,13 @@ bool LX200_OnStep::UpdateAlignStatus () if (current_star <= align_stars) { - snprintf(msg, sizeof(msg), "%s Manual Align: Star %d/%d", read_buffer, current_star, align_stars ); + snprintf(msg, sizeof(msg), "%s Alignment: Star %d/%d", read_buffer, current_star, align_stars ); IUSaveText(&OSNAlignT[4], msg); } if (current_star > align_stars && max_stars > 1) { LOGF_DEBUG("Align: current star: %u, align_stars %u", int(current_star), int(align_stars)); - snprintf(msg, sizeof(msg), "Manual Align: Completed"); + snprintf(msg, sizeof(msg), "Align: Completed"); AlignDone(); IUSaveText(&OSNAlignT[4], msg); UpdateAlignErr(); @@ -4729,7 +4728,7 @@ bool LX200_OnStep::UpdateAlignStatus () bool LX200_OnStep::UpdateAlignErr() { - // :GXnn# Get OnStep value + // :GX0n# Get OnStep value // Returns: value // 00 ax1Cor @@ -4767,7 +4766,7 @@ bool LX200_OnStep::UpdateAlignErr() LOGF_INFO("Polar Align Error Status response Error, response = %s>", read_buffer); return false; } - error_or_fail = getCommandDoubleResponse(PortFD, &azmCor, read_buffer, ":GX02#"); + error_or_fail = getCommandDoubleResponse(PortFD, &azmCor, read_buffer, ":GX03#"); if (error_or_fail < 2) { LOGF_INFO("Polar Align Error Status response Error, response = %s>", read_buffer); @@ -5438,8 +5437,7 @@ void LX200_OnStep::PrintTrackState() return; } -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 LX200_OnStep::setUTCOffset(double offset) { bool result = true; char temp_string[RB_MAX_LEN]; diff --git a/drivers/telescope/lx200_OnStep.h b/drivers/telescope/lx200_OnStep.h index 5214e5f977..8aa7ec20c7 100644 --- a/drivers/telescope/lx200_OnStep.h +++ b/drivers/telescope/lx200_OnStep.h @@ -421,7 +421,7 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public ISwitchVectorProperty OSNAlignStarsSP; ISwitch OSNAlignStarsS[9]; ISwitchVectorProperty OSNAlignSP; - ISwitch OSNAlignS[4]; + ISwitch OSNAlignS[2]; ISwitchVectorProperty OSNAlignWriteSP; ISwitch OSNAlignWriteS[1]; ISwitchVectorProperty OSNAlignPolarRealignSP;