Skip to content

Commit

Permalink
Fix crash in LX200 OnStep
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Oct 9, 2024
1 parent 5ffb3f6 commit abf12b4
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions drivers/telescope/lx200_OnStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ bool LX200_OnStep::initProperties()
RI::initProperties(ROTATOR_TAB);
SetParkDataType(PARK_RA_DEC);

initSlewRates();

//FocuserInterface
//Initial, these will be updated later.
FocusRelPosN[0].min = 0.;
Expand Down Expand Up @@ -135,20 +137,6 @@ bool LX200_OnStep::initProperties()
// ============== 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
SlewRateSP.resize(0);

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);
SlewRateSP.fill(getDeviceName(), "TELESCOPE_SLEW_RATE", "Slew Rate", MOTION_TAB,
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,
Expand Down Expand Up @@ -697,7 +685,7 @@ bool LX200_OnStep::updateProperties()
// updateLocation(latitude, longitude, 0);
// }
//NOTE: if updateProperties is called it clobbers this, so added here
initSlewRates();


}
else
Expand Down Expand Up @@ -5490,4 +5478,6 @@ void LX200_OnStep::initSlewRates()
SlewRateSP[7].fill("7", "48x", ISS_OFF);
SlewRateSP[8].fill("8", "Half-Max", ISS_OFF);
SlewRateSP[9].fill("9", "Max", ISS_OFF);

SlewRateSP.fill(getDeviceName(), "TELESCOPE_SLEW_RATE", "Slew Rate", MOTION_TAB, IP_RW, ISR_1OFMANY, 0, IPS_IDLE);
}

0 comments on commit abf12b4

Please sign in to comment.