Skip to content

Commit

Permalink
Fix checking for home switch status. Since HomeSP can have variable m…
Browse files Browse the repository at this point in the history
…embers, we need to check by name for the required action.
  • Loading branch information
knro committed Jul 29, 2024
1 parent 2f9db8d commit 0b69267
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 3 additions & 5 deletions libs/indibase/inditelescope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1232,12 +1232,10 @@ bool Telescope::ISNewSwitch(const char *dev, const char *name, ISState *states,
if (HomeSP.isNameMatch(name))
{
auto onSwitchName = IUFindOnSwitchName(states, names, n);
TelescopeHomeAction action = HOME_NONE;
if (HomeSP[HOME_FIND].isNameMatch(onSwitchName))
action = HOME_FIND;
else if (HomeSP[HOME_SET].isNameMatch(onSwitchName))
auto action = HOME_FIND;
if (onSwitchName == "SET")
action = HOME_SET;
else
else if (onSwitchName == "GO")
action = HOME_GO;

if (isParked())
Expand Down
7 changes: 3 additions & 4 deletions libs/indibase/inditelescope.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,9 @@ class Telescope : public DefaultDevice

enum TelescopeHomeAction
{
HOME_NONE = 1 << 0, /*!< Mount does not support any form of homing */
HOME_FIND = 1 << 1, /*!< Mount can search for home position */
HOME_SET = 1 << 2, /*!< Mount can use current-position as home position */
HOME_GO = 1 << 3, /*!< Mount can slew to home position */
HOME_FIND, /*!< Command mount to search for home position. */
HOME_SET, /*!< Command mount to accept current position as the home position. */
HOME_GO, /*!< Command mount to slew to home position. */
};

enum TelescopePECState
Expand Down

0 comments on commit 0b69267

Please sign in to comment.