Skip to content

Commit

Permalink
Cosmetic fixes Alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
azwing committed Oct 27, 2023
1 parent 6cfbe7d commit 227918b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 11 additions & 13 deletions drivers/telescope/lx200_OnStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");
Expand All @@ -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

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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();
Expand All @@ -4729,7 +4728,7 @@ bool LX200_OnStep::UpdateAlignStatus ()

bool LX200_OnStep::UpdateAlignErr()
{
// :GXnn# Get OnStep value
// :GX0n# Get OnStep value
// Returns: value

// 00 ax1Cor
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion drivers/telescope/lx200_OnStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 227918b

Please sign in to comment.