Skip to content

Commit

Permalink
Remove unused property. Use FocusMaxPos instead
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Sep 10, 2023
1 parent ae31712 commit b640316
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
36 changes: 5 additions & 31 deletions drivers/focuser/deepskydad_af3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ bool DeepSkyDadAF3::initProperties()
FocusBacklashN[0].step = 1;
FocusBacklashN[0].value = 0;

// Max. movement
IUFillNumber(&FocusMaxMoveN[0], "MAX_MOVE", "Steps", "%7.0f", 0, 9999999, 100, 0);
IUFillNumberVector(&FocusMaxMoveNP, FocusMaxMoveN, 1, getDeviceName(), "FOCUS_MAX_MOVE", "Max. movement",
MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE);

// Settle buffer
IUFillNumber(&SettleBufferN[0], "SETTLE_BUFFER", "Period (ms)", "%5.0f", 0, 99999, 100, 0);
IUFillNumberVector(&SettleBufferNP, SettleBufferN, 1, getDeviceName(), "FOCUS_SETTLE_BUFFER", "Settle buffer",
Expand Down Expand Up @@ -132,7 +127,6 @@ bool DeepSkyDadAF3::updateProperties()

if (isConnected())
{
defineProperty(&FocusMaxMoveNP);
defineProperty(&StepModeSP);
defineProperty(&SpeedModeSP);
defineProperty(&SettleBufferNP);
Expand All @@ -146,7 +140,6 @@ bool DeepSkyDadAF3::updateProperties()
}
else
{
deleteProperty(FocusMaxMoveNP.name);
deleteProperty(StepModeSP.name);
deleteProperty(SpeedModeSP.name);
deleteProperty(SettleBufferNP.name);
Expand Down Expand Up @@ -293,8 +286,8 @@ bool DeepSkyDadAF3::readMaxMovement()
int rc = sscanf(res, "(%d)", &steps);
if (rc > 0)
{
FocusMaxMoveN[0].value = steps;
FocusMaxMoveNP.s = IPS_OK;
FocusMaxPosN[0].value = steps;
FocusMaxPosNP.s = IPS_OK;
}
else
{
Expand Down Expand Up @@ -654,25 +647,6 @@ bool DeepSkyDadAF3::ISNewNumber(const char * dev, const char * name, double valu
IDSetNumber(&FocusMaxPosNP, nullptr);
return true;
}

// Max. movement
// if (strcmp(name, FocusMaxMoveNP.name) == 0)
// {
// IUUpdateNumber(&FocusMaxMoveNP, values, names, n);
// char cmd[DSD_RES] = {0};
// snprintf(cmd, DSD_RES, "[SMXM%d]", static_cast<int>(FocusMaxMoveN[0].value));
// bool rc = sendCommandSet(cmd);
// if (!rc)
// {
// FocusMaxMoveNP.s = IPS_ALERT;
// return false;
// }

// FocusMaxMoveNP.s = IPS_OK;
// IDSetNumber(&FocusMaxMoveNP, nullptr);
// return true;
// }

}

return INDI::Focuser::ISNewNumber(dev, name, values, names, n);
Expand Down Expand Up @@ -705,7 +679,7 @@ void DeepSkyDadAF3::GetFocusParams()
IDSetNumber(&FocusMaxPosNP, nullptr);

if (readMaxMovement())
IDSetNumber(&FocusMaxMoveNP, nullptr);
IDSetNumber(&FocusMaxPosNP, nullptr);

if (readTemperature())
IDSetNumber(&TemperatureNP, nullptr);
Expand Down Expand Up @@ -804,7 +778,8 @@ void DeepSkyDadAF3::TimerHit()
{
if (!isMoving())
{
if( backlashComp == 0 ) {
if( backlashComp == 0 )
{
FocusAbsPosNP.s = IPS_OK;
FocusRelPosNP.s = IPS_OK;
}
Expand Down Expand Up @@ -858,7 +833,6 @@ bool DeepSkyDadAF3::saveConfigItems(FILE * fp)

IUSaveConfigSwitch(fp, &StepModeSP);
IUSaveConfigSwitch(fp, &SpeedModeSP);
IUSaveConfigNumber(fp, &FocusMaxMoveNP);
IUSaveConfigNumber(fp, &SettleBufferNP);
IUSaveConfigNumber(fp, &MoveCurrentMultiplierNP);
IUSaveConfigNumber(fp, &HoldCurrentMultiplierNP);
Expand Down
4 changes: 0 additions & 4 deletions drivers/focuser/deepskydad_af3.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ class DeepSkyDadAF3 : public INDI::Focuser
INumber HoldCurrentMultiplierN[1];
INumberVectorProperty HoldCurrentMultiplierNP;

// Max movement
INumber FocusMaxMoveN[1];
INumberVectorProperty FocusMaxMoveNP;

// Settle buffer
INumber SettleBufferN[1];
INumberVectorProperty SettleBufferNP;
Expand Down

0 comments on commit b640316

Please sign in to comment.