87 static double radToDeg(
double value);
88 static double degToRad(
double value);
92 virtual void getCalibration(
double *offsetX,
double *offsetY,
double *offsetZ)
const = 0;
93 virtual void setCalibration(
double offsetX,
double offsetY,
double offsetZ) = 0;
116 virtual void reset();
Definition joydpadxml.h:27
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition joysensor.h:40
void setMaxZone(double value)
Sets the maximum zone of the sensor to the given value.
Definition joysensor.cpp:614
bool m_calibrated
Definition joysensor.h:147
void resetCalibration()
Resets the calibration of the sensor back to uncalibrated state.
Definition joysensor.cpp:535
void moved(float xaxis, float yaxis, float zaxis)
void setSensorDelay(unsigned int value)
Sets the sensor input delaqy to the given value.
Definition joysensor.cpp:649
JoySensorButton * getDirectionButton(JoySensorDirection direction)
Get a pointer to the sensor direction button for the desired direction.
Definition joysensor.cpp:550
double getDistanceFromDeadZone() const
Get current radial distance of the sensor past the assigned dead zone.
Definition joysensor.cpp:289
double getDeadZone() const
Get the assigned dead zone value.
Definition joysensor.cpp:258
JoySensorType m_type
Definition joysensor.h:135
double m_diagonal_range
Definition joysensor.h:137
bool hasPendingEvent() const
Checks if an event is queued.
Definition joysensor.cpp:152
SetJoystick * getParentSet() const
Get pointer to the set that a sensor belongs to.
Definition joysensor.cpp:774
bool inDeadZone(float *values) const
Checks if the sensor vector is currently in the dead zone.
Definition joysensor.cpp:282
double calculatePitch() const
Calculate the pitch angle (in degrees) corresponding to the current position of controller.
Definition joysensor.cpp:425
void readConfig(QXmlStreamReader *xml)
Take a XML stream and set the sensor and direction button properties according to the values containe...
Definition joysensor.cpp:682
double calculateYDistanceFromDeadZone() const
Get current Y distance of the sensor past the assigned dead zone.
Definition joysensor.cpp:345
void setDiagonalRange(double value)
Set the diagonal range value for a sensor.
Definition joysensor.cpp:629
QString getSensorName() const
Returns the sensor name.
Definition joysensor.cpp:242
float m_pending_value[3]
Definition joysensor.h:146
bool m_pending_ignore_sets
Definition joysensor.h:150
JoySensorType getType() const
Returns the sensor type.
Definition joysensor.cpp:247
void diagonalRangeChanged(double value)
double calculateZDistanceFromDeadZone() const
Get current Z distance of the sensor past the assigned dead zone.
Definition joysensor.cpp:377
void setDeadZone(double value)
Sets the dead zone of the sensor to the given value.
Definition joysensor.cpp:599
bool m_pending_event
Definition joysensor.h:149
bool isDefault() const
Checks if all sensor settings and button mappings are the their default values. This is used during X...
Definition joysensor.cpp:557
double calculateXDistanceFromDeadZone() const
Get current X distance of the sensor past the assigned dead zone.
Definition joysensor.cpp:313
void active(float xaxis, float yaxis, float zaxis)
void released(float xaxis, float yaxis, float zaxis)
static double degToRad(double value)
Utility function which converts a given value from degree to radians.
Definition joysensor.cpp:524
virtual float getXCoordinate() const =0
virtual void applyCalibration()=0
virtual void setCalibration(double offsetX, double offsetY, double offsetZ)=0
void resetButtons()
Reset all the properties of the sensor direction buttons.
Definition joysensor.cpp:785
void copyAssignments(JoySensor *dest_sensor)
Copy slots from all sensor buttons and properties from a sensor onto another.
Definition joysensor.cpp:168
virtual ~JoySensor()
Definition joysensor.cpp:43
static double radToDeg(double value)
Utility function which converts a given value from radians to degree.
Definition joysensor.cpp:519
JoySensorDirection getCurrentDirection() const
Returns the current sensor direction.
Definition joysensor.cpp:252
virtual float getZCoordinate() const =0
void delayTimerExpired()
Slot called when m_delay_timer has timed out. The method will call createDeskEvent.
Definition joysensor.cpp:780
JoySensorDirection m_current_direction
Definition joysensor.h:156
virtual JoySensorDirection calculateSensorDirection()=0
void sensorDelayChanged(int value)
virtual void populateButtons()=0
QTimer m_delay_timer
Definition joysensor.h:154
virtual float getYCoordinate() const =0
void writeConfig(QXmlStreamWriter *xml) const
Write the status of the properties of a sensor and direction buttons to an XML stream.
Definition joysensor.cpp:738
double calculateRoll() const
Calculate the roll angle (in degrees) corresponding to the current position of controller.
Definition joysensor.cpp:455
void determineSensorEvent(JoySensorButton **eventbutton) const
Set buttons for current sensor direction zone.
Definition joysensor.cpp:800
virtual void getCalibration(double *offsetX, double *offsetY, double *offsetZ) const =0
bool hasSlotsAssigned() const
Check if any direction is mapped to a keyboard or mouse event.
Definition joysensor.cpp:202
unsigned int getSensorDelay() const
Get the assigned input delay.
Definition joysensor.cpp:276
virtual void reset()
Resets internal variables back to default.
Definition joysensor.cpp:578
void setSensorName(QString tempName)
Sets the name of this sensor.
Definition joysensor.cpp:663
SetJoystick * m_parent_set
Definition joysensor.h:157
bool isCalibrated() const
Check if the sensor is calibrated.
Definition joysensor.cpp:530
void createDeskEvent(JoySensorDirection direction, bool ignoresets=false)
Find the position of the three sensor axes, deactivate no longer used sensor direction button and the...
Definition joysensor.cpp:825
void maxZoneChanged(double value)
double m_calibration_value[3]
Definition joysensor.h:148
double calculateDirectionalDistance(JoySensorDirection direction) const
Used to calculate the distance value that should be used by the JoyButton in the given direction.
Definition joysensor.cpp:488
void deadZoneChanged(double value)
double calculateDistance() const
Get the vector length of the sensor.
Definition joysensor.cpp:408
JoySensorButton * m_active_button[ACTIVE_BUTTON_COUNT]
Definition joysensor.h:143
virtual QString sensorTypeName() const =0
double getMaxZone() const
Get the assigned max zone value.
Definition joysensor.cpp:270
int m_originset
Definition joysensor.h:152
void queuePendingEvent(float *values, bool ignoresets=false)
Queues next movement event from InputDaemon.
Definition joysensor.cpp:121
bool m_active
Definition joysensor.h:141
static const size_t ACTIVE_BUTTON_COUNT
Definition joysensor.h:142
void activatePendingEvent()
Activates previously queued movement event This is called by InputDevice.
Definition joysensor.cpp:138
QString getPartialName(bool forceFullFormat=false, bool displayNames=false) const
Get the name of this sensor.
Definition joysensor.cpp:219
double m_dead_zone
Definition joysensor.h:136
void joyEvent(float *values, bool ignoresets=false)
Main sensor mapping function. When activated, it generates a "moved" QT event which updates various p...
Definition joysensor.cpp:53
QHash< JoySensorDirection, JoySensorButton * > * getButtons()
Returns a QHash which maps the SensorDirection to the corresponding JoySensorButton.
Definition joysensor.cpp:541
void clearPendingEvent()
Clears a previously queued event.
Definition joysensor.cpp:157
double getDiagonalRange() const
Get the assigned diagonal range value.
Definition joysensor.cpp:264
unsigned int m_sensor_delay
Definition joysensor.h:139
double m_max_zone
Definition joysensor.h:138
void establishPropertyUpdatedConnection()
Definition joysensor.cpp:672
float m_current_value[3]
Definition joysensor.h:145
QString m_sensor_name
Definition joysensor.h:153
QHash< JoySensorDirection, JoySensorButton * > m_buttons
Definition joysensor.h:158
A set of mapped events which can by switched by a controller event. Contains controller input objects...
Definition setjoystick.h:40
JoySensorDirection
A bitfield style enum which encodes all possible three dimensional sensor directions....
Definition joysensordirection.h:28
JoySensorType
Definition joysensortype.h:24