Skip to content

Commit

Permalink
Slew rate labels can be reset after setTelescopeCapability. This shou…
Browse files Browse the repository at this point in the history
…ld be fixed in 2.1.1. For now, we need to reset labels after each call
  • Loading branch information
knro committed Oct 8, 2024
1 parent 9308810 commit e110e61
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
27 changes: 17 additions & 10 deletions drivers/telescope/lx200_OnStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,16 +697,7 @@ bool LX200_OnStep::updateProperties()
// updateLocation(latitude, longitude, 0);
// }
//NOTE: if updateProperties is called it clobbers this, so added here
SlewRateSP[0].fill("0", "0.25x", ISS_OFF);
SlewRateSP[1].fill("1", "0.5x", ISS_OFF);
SlewRateSP[2].fill("2", "1x", ISS_OFF);
SlewRateSP[3].fill("3", "2x", ISS_OFF);
SlewRateSP[4].fill("4", "4x", ISS_OFF);
SlewRateSP[5].fill("5", "8x", ISS_ON);
SlewRateSP[6].fill("6", "20x", ISS_OFF);
SlewRateSP[7].fill("7", "48x", ISS_OFF);
SlewRateSP[8].fill("8", "Half-Max", ISS_OFF);
SlewRateSP[9].fill("9", "Max", ISS_OFF);
initSlewRates();

}
else
Expand Down Expand Up @@ -2534,6 +2525,7 @@ bool LX200_OnStep::ReadScopeStatus()
LOGF_DEBUG("capabilities = %x", capabilities);
capabilities |= TELESCOPE_HAS_PEC;
SetTelescopeCapability(capabilities, 10 );
initSlewRates();
LX200_OnStep::updateProperties();
}
}
Expand Down Expand Up @@ -2591,6 +2583,7 @@ bool LX200_OnStep::ReadScopeStatus()
LOGF_DEBUG("capabilities = %x", capabilities);
capabilities |= TELESCOPE_HAS_PIER_SIDE;
SetTelescopeCapability(capabilities, 10 );
initSlewRates();
LX200_OnStep::updateProperties();
}
if (strstr(OSStat, "o"))
Expand Down Expand Up @@ -5484,3 +5477,17 @@ bool LX200_OnStep::Handshake()

return false;
}

void LX200_OnStep::initSlewRates()
{
SlewRateSP[0].fill("0", "0.25x", ISS_OFF);
SlewRateSP[1].fill("1", "0.5x", ISS_OFF);
SlewRateSP[2].fill("2", "1x", ISS_OFF);
SlewRateSP[3].fill("3", "2x", ISS_OFF);
SlewRateSP[4].fill("4", "4x", ISS_OFF);
SlewRateSP[5].fill("5", "8x", ISS_ON);
SlewRateSP[6].fill("6", "20x", ISS_OFF); //last OnStep - OnStepX
SlewRateSP[7].fill("7", "48x", ISS_OFF);
SlewRateSP[8].fill("8", "Half-Max", ISS_OFF);
SlewRateSP[9].fill("9", "Max", ISS_OFF);
}
2 changes: 2 additions & 0 deletions drivers/telescope/lx200_OnStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ class LX200_OnStep : public LX200Generic, public INDI::WeatherInterface, public
IPState OSDisableOutput(int output);
bool OSGetOutputState(int output);

// Reset slew rate labels
void initSlewRates();

bool sendOnStepCommand(const char *cmd);
bool sendOnStepCommandBlind(const char *cmd);
Expand Down

0 comments on commit e110e61

Please sign in to comment.