 |
AntiMicroX
|
Go to the documentation of this file.
30 class QXmlStreamReader;
31 class QXmlStreamWriter;
47 void joyEvent(
float *values,
bool ignoresets =
false);
56 QString
getPartialName(
bool forceFullFormat =
false,
bool displayNames =
false)
const;
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;
95 QHash<JoySensorDirection, JoySensorButton *> *
getButtons();
105 void moved(
float xaxis,
float yaxis,
float zaxis);
106 void active(
float xaxis,
float yaxis,
float zaxis);
107 void released(
float xaxis,
float yaxis,
float zaxis);
116 virtual void reset();
float m_pending_value[3]
Definition: joysensor.h:146
double calculateDistance() const
Get the vector length of the sensor.
Definition: joysensor.cpp:408
void setSensorDelay(unsigned int value)
Sets the sensor input delaqy to the given value.
Definition: joysensor.cpp:649
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
void moved(float xaxis, float yaxis, float zaxis)
void resetButtons()
Reset all the properties of the sensor direction buttons.
Definition: joysensor.cpp:785
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 setDeadZone(double value)
Sets the dead zone of the sensor to the given value.
Definition: joysensor.cpp:599
virtual float getZCoordinate() const =0
static const unsigned int DEFAULTSENSORDELAY
Definition: globalvariables.h:235
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
@ SENSOR_FWD
Definition: joysensordirection.h:34
bool isCalibrated() const
Check if the sensor is calibrated.
Definition: joysensor.cpp:530
void queuePendingEvent(float *values, bool ignoresets=false)
Queues next movement event from InputDaemon.
Definition: joysensor.cpp:121
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
bool m_pending_event
Definition: joysensor.h:149
double calculateYDistanceFromDeadZone() const
Get current Y distance of the sensor past the assigned dead zone.
Definition: joysensor.cpp:345
void deadZoneChanged(double value)
double getDistanceFromDeadZone() const
Get current radial distance of the sensor past the assigned dead zone.
Definition: joysensor.cpp:289
bool m_pending_ignore_sets
Definition: joysensor.h:150
bool m_calibrated
Definition: joysensor.h:147
void delayTimerExpired()
Slot called when m_delay_timer has timed out. The method will call createDeskEvent.
Definition: joysensor.cpp:780
void clearPendingEvent()
Clears a previously queued event.
Definition: joysensor.cpp:157
virtual ~JoySensor()
Definition: joysensor.cpp:43
A set of mapped events which can by switched by a controller event. Contains controller input objects...
Definition: setjoystick.h:39
double m_dead_zone
Definition: joysensor.h:136
virtual QString sensorTypeName() const =0
double calculatePitch() const
Calculate the pitch angle (in degrees) corresponding to the current position of controller.
Definition: joysensor.cpp:425
double getDiagonalRange() const
Get the assigned diagonal range value.
Definition: joysensor.cpp:264
@ SENSOR_LEFT
Definition: joysensordirection.h:30
double m_calibration_value[3]
Definition: joysensor.h:148
void sensorDelayChanged(int value)
static const int DEFAULTDIAGONALRANGE
Definition: globalvariables.h:234
virtual void setCalibration(double offsetX, double offsetY, double offsetZ)=0
JoySensorType
Definition: joysensortype.h:23
virtual void reset()
Resets internal variables back to default.
Definition: joysensor.cpp:578
double calculateZDistanceFromDeadZone() const
Get current Z distance of the sensor past the assigned dead zone.
Definition: joysensor.cpp:377
void released(float xaxis, float yaxis, float zaxis)
void setSensorName(QString tempName)
Sets the name of this sensor.
Definition: joysensor.cpp:663
static double radToDeg(double value)
Utility function which converts a given value from radians to degree.
Definition: joysensor.cpp:519
@ SENSOR_CENTERED
Definition: joysensordirection.h:29
JoySensorButton * m_active_button[ACTIVE_BUTTON_COUNT]
Definition: joysensor.h:143
bool hasPendingEvent() const
Checks if an event is queued.
Definition: joysensor.cpp:152
virtual void populateButtons()=0
bool hasSlotsAssigned() const
Check if any direction is mapped to a keyboard or mouse event.
Definition: joysensor.cpp:202
double calculateXDistanceFromDeadZone() const
Get current X distance of the sensor past the assigned dead zone.
Definition: joysensor.cpp:313
double m_max_zone
Definition: joysensor.h:138
double calculateRoll() const
Calculate the roll angle (in degrees) corresponding to the current position of controller.
Definition: joysensor.cpp:455
void diagonalRangeChanged(double value)
void activatePendingEvent()
Activates previously queued movement event This is called by InputDevice.
Definition: joysensor.cpp:138
@ SENSOR_DOWN
Definition: joysensordirection.h:33
void determineSensorEvent(JoySensorButton **eventbutton) const
Set buttons for current sensor direction zone.
Definition: joysensor.cpp:800
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
void setMaxZone(double value)
Sets the maximum zone of the sensor to the given value.
Definition: joysensor.cpp:614
void resetCalibration()
Resets the calibration of the sensor back to uncalibrated state.
Definition: joysensor.cpp:535
virtual void getCalibration(double *offsetX, double *offsetY, double *offsetZ) const =0
JoySensorDirection m_current_direction
Definition: joysensor.h:156
JoySensorType getType() const
Returns the sensor type.
Definition: joysensor.cpp:247
bool m_active
Definition: joysensor.h:141
JoySensorType m_type
Definition: joysensor.h:135
virtual JoySensorDirection calculateSensorDirection()=0
int m_originset
Definition: joysensor.h:152
SetJoystick * m_parent_set
Definition: joysensor.h:157
JoySensorDirection getCurrentDirection() const
Returns the current sensor direction.
Definition: joysensor.cpp:252
static const size_t ACTIVE_BUTTON_COUNT
Definition: joysensor.h:142
virtual void applyCalibration()=0
static const double GYRO_MAX
Definition: globalvariables.h:232
static const double ACCEL_MAX
Definition: globalvariables.h:230
QString m_sensor_name
Definition: joysensor.h:153
@ SENSOR_UP
Definition: joysensordirection.h:32
JoySensorDirection
A bitfield style enum which encodes all possible three dimensional sensor directions....
Definition: joysensordirection.h:27
double getMaxZone() const
Get the assigned max zone value.
Definition: joysensor.cpp:270
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
virtual float getXCoordinate() const =0
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition: joysensor.h:39
@ SENSOR_RIGHT
Definition: joysensordirection.h:31
QHash< JoySensorDirection, JoySensorButton * > m_buttons
Definition: joysensor.h:158
QTimer m_delay_timer
Definition: joysensor.h:154
float m_current_value[3]
Definition: joysensor.h:145
QString getSensorName() const
Returns the sensor name.
Definition: joysensor.cpp:242
unsigned int getSensorDelay() const
Get the assigned input delay.
Definition: joysensor.cpp:276
JoySensor(JoySensorType type, int originset, SetJoystick *parent_set, QObject *parent)
Definition: joysensor.cpp:29
JoySensorButton * getDirectionButton(JoySensorDirection direction)
Get a pointer to the sensor direction button for the desired direction.
Definition: joysensor.cpp:550
double m_diagonal_range
Definition: joysensor.h:137
void copyAssignments(JoySensor *dest_sensor)
Copy slots from all sensor buttons and properties from a sensor onto another.
Definition: joysensor.cpp:168
@ SENSOR_BWD
Definition: joysensordirection.h:35
SetJoystick * getParentSet() const
Get pointer to the set that a sensor belongs to.
Definition: joysensor.cpp:774
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
double getDeadZone() const
Get the assigned dead zone value.
Definition: joysensor.cpp:258
static double degToRad(double value)
Utility function which converts a given value from degree to radians.
Definition: joysensor.cpp:524
void setDiagonalRange(double value)
Set the diagonal range value for a sensor.
Definition: joysensor.cpp:629
void maxZoneChanged(double value)
static const double DEFAULTDEADZONE
Definition: globalvariables.h:233
virtual float getYCoordinate() const =0
void active(float xaxis, float yaxis, float zaxis)
unsigned int m_sensor_delay
Definition: joysensor.h:139
@ ACCELEROMETER
Definition: joysensortype.h:25
bool inDeadZone(float *values) const
Checks if the sensor vector is currently in the dead zone.
Definition: joysensor.cpp:282
void establishPropertyUpdatedConnection()
Definition: joysensor.cpp:672
QString getPartialName(bool forceFullFormat=false, bool displayNames=false) const
Get the name of this sensor.
Definition: joysensor.cpp:219
QHash< JoySensorDirection, JoySensorButton * > * getButtons()
Returns a QHash which maps the SensorDirection to the corresponding JoySensorButton.
Definition: joysensor.cpp:541