Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use MOTION_CONTROL_MODE _FOO enums #2123

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libs/indibase/inditelescope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1537,9 +1537,9 @@ bool Telescope::ISNewSwitch(const char *dev, const char *name, ISState *states,
MotionControlModeTP.update(states, names, n);
MotionControlModeTP.setState(IPS_OK);
MotionControlModeTP.apply();
if (MotionControlModeTP[MOTION_CONTROL_JOYSTICK].getState() == ISS_ON)
if (MotionControlModeTP[MOTION_CONTROL_MODE_JOYSTICK].getState() == ISS_ON)
LOG_INFO("Motion control is set to 4-way joystick.");
else if (MotionControlModeTP[MOTION_CONTROL_AXES].getState() == ISS_ON)
else if (MotionControlModeTP[MOTION_CONTROL_MODE_AXES].getState() == ISS_ON)
LOG_INFO("Motion control is set to 2 separate axes.");
else
DEBUGF(Logger::DBG_WARNING, "Motion control is set to unknown value %d!", n);
Expand Down Expand Up @@ -2422,7 +2422,7 @@ void Telescope::processButton(const char *button_n, ISState state)

void Telescope::processJoystick(const char *joystick_n, double mag, double angle)
{
if (MotionControlModeTP[MOTION_CONTROL_JOYSTICK].getState() == ISS_ON && !strcmp(joystick_n, "MOTIONDIR"))
if (MotionControlModeTP[MOTION_CONTROL_MODE_JOYSTICK].getState() == ISS_ON && !strcmp(joystick_n, "MOTIONDIR"))
{
if ((TrackState == SCOPE_PARKING) || (TrackState == SCOPE_PARKED))
{
Expand All @@ -2438,7 +2438,7 @@ void Telescope::processJoystick(const char *joystick_n, double mag, double angle

void Telescope::processAxis(const char *axis_n, double value)
{
if (MotionControlModeTP[MOTION_CONTROL_AXES].getState() == ISS_ON)
if (MotionControlModeTP[MOTION_CONTROL_MODE_AXES].getState() == ISS_ON)
{
if (!strcmp(axis_n, "MOTIONDIRNS") || !strcmp(axis_n, "MOTIONDIRWE"))
{
Expand Down
2 changes: 0 additions & 2 deletions libs/indibase/inditelescope.h
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,6 @@ class Telescope : public DefaultDevice
{
MOTION_CONTROL_MODE_JOYSTICK,
MOTION_CONTROL_MODE_AXES,
MOTION_CONTROL_JOYSTICK,
MOTION_CONTROL_AXES
};

// Lock Joystick Axis to one direction only
Expand Down
Loading