AntiMicroX
Public Member Functions | Private Member Functions | Private Attributes
InputDeviceCalibration Class Reference

Calibration storage backend which can store multiple calibration items for different controllers. More...

#include <inputdevicecalibration.h>

Collaboration diagram for InputDeviceCalibration:
[legend]

Public Member Functions

 InputDeviceCalibration (InputDevice *device)
 
void setStickCalibration (int index, double offsetX, double gainX, double offsetY, double gainY)
 Updates the stored calibration for the given stick from the parent controller. More...
 
void setAccelerometerCalibration (double orientationX, double orientationY, double orientationZ)
 Updates the stored calibration for the given accelerometer from the parent controller. More...
 
void setGyroscopeCalibration (double offsetX, double offsetY, double offsetZ)
 Updates the stored calibration for the given gyroscope from the parent controller. More...
 
void applyCalibrations () const
 Applies all applicable stored calibration values to the individual input elements of the parent controller. More...
 
void readConfig (QXmlStreamReader *xml)
 Reads all calibration values from the given XML stream into the internal calibration data storage. More...
 
void writeConfig (QXmlStreamWriter *xml) const
 Writes all stored calibration values from the internal storage into the given XML stream. More...
 

Private Member Functions

void setCalibration (QString id, CalibrationData new_calibration)
 Updated the given CalibrationData structure of the controller with the given ID in the calibration storage backend. More...
 

Private Attributes

QHash< QString, QList< CalibrationData > > m_data
 
InputDevicem_device
 

Detailed Description

Calibration storage backend which can store multiple calibration items for different controllers.

Constructor & Destructor Documentation

◆ InputDeviceCalibration()

InputDeviceCalibration::InputDeviceCalibration ( InputDevice device)
explicit

Member Function Documentation

◆ applyCalibrations()

void InputDeviceCalibration::applyCalibrations ( ) const

Applies all applicable stored calibration values to the individual input elements of the parent controller.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readConfig()

void InputDeviceCalibration::readConfig ( QXmlStreamReader *  xml)

Reads all calibration values from the given XML stream into the internal calibration data storage.

Parameters
QXmlStreamReaderinstance that will be used to read calibration values.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAccelerometerCalibration()

void InputDeviceCalibration::setAccelerometerCalibration ( double  orientationX,
double  orientationY,
double  orientationZ 
)

Updates the stored calibration for the given accelerometer from the parent controller.

Parameters
[in]orientationXX coordinate of the neutral orientation vector
[in]orientationYY coordinate of the neutral orientation vector
[in]orientationZZ coordinate of the neutral orientation vector
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCalibration()

void InputDeviceCalibration::setCalibration ( QString  id,
CalibrationData  new_calibration 
)
private

Updated the given CalibrationData structure of the controller with the given ID in the calibration storage backend.

Parameters
[in]idID of the device to which the calibration data belongs to
[in]new_calibrationThe CalibrationData structure to be stored
Here is the caller graph for this function:

◆ setGyroscopeCalibration()

void InputDeviceCalibration::setGyroscopeCalibration ( double  offsetX,
double  offsetY,
double  offsetZ 
)

Updates the stored calibration for the given gyroscope from the parent controller.

Parameters
[in]offsetXOffset value for X axis
[in]offsetYOffset value for Y axis
[in]offsetZOffset value for Z axis
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStickCalibration()

void InputDeviceCalibration::setStickCalibration ( int  index,
double  offsetX,
double  gainX,
double  offsetY,
double  gainY 
)

Updates the stored calibration for the given stick from the parent controller.

Parameters
[in]indexStick index
[in]offsetXOffset value for X axis
[in]gainXGain value for X axis
[in]offsetYOffset value for Y axis
[in]gainYGain value for Y axis
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeConfig()

void InputDeviceCalibration::writeConfig ( QXmlStreamWriter *  xml) const

Writes all stored calibration values from the internal storage into the given XML stream.

Parameters
QXmlStreamWriterinstance that will be used to write calibration values.
Here is the caller graph for this function:

Field Documentation

◆ m_data

QHash<QString, QList<CalibrationData> > InputDeviceCalibration::m_data
private

◆ m_device

InputDevice* InputDeviceCalibration::m_device
private

The documentation for this class was generated from the following files: