Skip to content

Commit

Permalink
fixed 9 stars align
Browse files Browse the repository at this point in the history
  • Loading branch information
azwing committed Oct 23, 2023
1 parent bb8869e commit 8f41c14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</device>
<device label="LX200 OnStep" manufacturer="OnStep">
<driver name="LX200 OnStep">indi_lx200_OnStep</driver>
<version>1.20</version>
<version>1.21</version>
</device>
<device label="LX200 OpenAstroTech" manufacturer="OpenAstroTech">
<driver name="LX200 OpenAstroTech">indi_lx200_OpenAstroTech</driver>
Expand Down
15 changes: 11 additions & 4 deletions drivers/telescope/lx200_OnStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ LX200_OnStep::LX200_OnStep() : LX200Generic(), WI(this), RotatorInterface(this)
currentCatalog = LX200_STAR_C;
currentSubCatalog = 0;

setVersion(1, 20); // don't forget to update libindi/drivers.xml
setVersion(1, 21); // 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);
Expand Down Expand Up @@ -4616,7 +4616,7 @@ IPState LX200_OnStep::AlignStartGeometric (int stars)
// Check for max number of stars and gracefully fall back to max, if more are requested.
char read_buffer[RB_MAX_LEN] = {0};
int error_or_fail = getCommandSingleCharErrorOrLongResponse(PortFD, read_buffer, ":A?#");
if(error_or_fail != 4 || read_buffer[0] < '0' || read_buffer[0] > '9' || read_buffer[1] < '0' || read_buffer[1] > '9'
if(error_or_fail != 4 || read_buffer[0] < '0' || read_buffer[0] > '9' || read_buffer[1] < '0' || read_buffer[1] > ':'
|| read_buffer[2] < '0' || read_buffer[2] > '9')
{
LOGF_INFO("Getting Alignment Status: response Error, response = %s>", read_buffer);
Expand Down Expand Up @@ -4662,7 +4662,7 @@ bool LX200_OnStep::UpdateAlignStatus ()
// :A?# Align status
// Returns: mno#
// where m is the maximum number of alignment stars
// n is the current alignment star (0 otherwise)
// n is the current alignment star (0 otherwise) or ':' in case 9 stars selected
// o is the last required alignment star when an alignment is in progress (0 otherwise)

char msg[40] = {0};
Expand All @@ -4671,7 +4671,7 @@ bool LX200_OnStep::UpdateAlignStatus ()

char read_buffer[RB_MAX_LEN] = {0};
int error_or_fail = getCommandSingleCharErrorOrLongResponse(PortFD, read_buffer, ":A?#");
if(error_or_fail != 4 || read_buffer[0] < '0' || read_buffer[0] > '9' || read_buffer[1] < '0' || read_buffer[1] > '9'
if(error_or_fail != 4 || read_buffer[0] < '0' || read_buffer[0] > '9' || read_buffer[1] < '0' || read_buffer[1] > ':'
|| read_buffer[2] < '0' || read_buffer[2] > '9')
{
LOGF_INFO("Getting Alignment Status: response Error, response = %s>", read_buffer);
Expand All @@ -4683,7 +4683,14 @@ bool LX200_OnStep::UpdateAlignStatus ()
snprintf(stars, sizeof(stars), "%d", max_stars);
IUSaveText(&OSNAlignT[5], stars);
snprintf(stars, sizeof(stars), "%d", current_star);
if (read_buffer[1] > '9')
{
IUSaveText(&OSNAlignT[6], ":");
}
else
{
IUSaveText(&OSNAlignT[6], stars);
}
snprintf(stars, sizeof(stars), "%d", align_stars);
IUSaveText(&OSNAlignT[7], stars);
LOGF_DEBUG("Align: max_stars: %i current star: %u, align_stars %u", max_stars, current_star, align_stars);
Expand Down
2 changes: 2 additions & 0 deletions drivers/telescope/lx200_OnStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
===========================================
Version not yet updated/No INDI release:
Version 1.21
- fixed Onstep returning '9:9' when 9 star alignment is achieved thanks to Howard Dutton
Version 1.20
- fixed wrong messages due to different return with OnStepX
- fixed Focuser Temerature not shown on Ekos
Expand Down

0 comments on commit 8f41c14

Please sign in to comment.