56 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
57 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
58 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
60 static void joystickHelper(
int joystick_n,
double mag,
double angle);
66 virtual bool Connect()
override;
150 bool m_calibrating {
false};
153 std::vector<int> m_axisCalCenter;
154 std::vector<int> m_axisCalMin;
155 std::vector<int> m_axisCalMax;
158 std::string m_calibrationFile;
169 bool loadCalibrationData();
179 bool saveCalibrationData();
185 void applyCalibrationToDriver();
191 void applyReverseToDriver();
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
The JoyStickDriver class provides basic functionality to read events from supported game pads under L...
The JoyStick class provides an INDI driver that displays event data from game pads....
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
INDI::PropertyNumber FilterNP
static void buttonHelper(int button_n, int value)
virtual bool Disconnect() override
Disconnect from device.
std::vector< double > m_axisEMA
std::unique_ptr< JoyStickDriver > driver
INDI::PropertyNumber AxisCalibrationNP
AxisCalibrationNP Per-axis calibration values (IP_RW).
static void joystickHelper(int joystick_n, double mag, double angle)
bool saveConfigItems(FILE *fp) override
saveConfigItems Save specific properties in the provide config file handler. Child class usually over...
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual const char * getDefaultName() override
INDI::PropertyText JoystickInfoTP
INDI::PropertySwitch ButtonSP
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
static void axisHelper(int axis_n, int value)
std::vector< INDI::PropertyNumber > JoyStickNP
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool ISSnoopDevice(XMLEle *root) override
Process a snoop event from INDI server. This function is called when a snooped property is updated in...
INDI::PropertyText PortTP
void joystickEvent(int joystick_n, double mag, double angle)
INDI::PropertySwitch CalibrationSP
CalibrationSP Start / End the calibration sweep.
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
INDI::PropertySwitch AxisReverseSP
AxisReverseSP Per-axis polarity reversal toggles (IP_RW).
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
void axisEvent(int axis_n, int value)
INDI::PropertyNumber DeadZoneNP
INDI::PropertyNumber AxisNP
std::vector< double > m_joystickAngleSinEMA
std::vector< double > m_joystickAngleCosEMA
void buttonEvent(int button_n, int value)