Limb Range Analyzer
Cross-platform application for human limb range analysis.
SensorModule Class Reference

Introduces possibilities of retrieved sensor data processing. More...

#include <sensormodule.hpp>

Inheritance diagram for SensorModule:

Signals

void SensorModule_SignalProvideResults ()
 Signal that gets emitted when measurement results are ready to be presented in the main UI class.
 

Public Member Functions

 SensorModule ()
 Default constructor of class SensorModule. More...
 
 ~SensorModule ()
 Default destructor function. More...
 
void SensorModule_SetSensorValues (const QString &hexValue)
 Provides received string splitting and further processing. More...
 
void SensorModule_ProcessSensorComponent (const QString &hexValue, DeviceType deviceType)
 This member function retrieves accelerometer and gyroscope measurements dispatched by a BlueCoin device and estimates its rotation. More...
 
qreal SensorModule_ConvertAccelerometerValue (qint32 accValue)
 Member function that converts raw accelerometer value to required form. More...
 
qreal SensorModule_ConvertGyroscopeValue (qint32 gyroValue)
 This member function manages conversion of raw gyroscope value so that it can be further used. More...
 
void SensorModule_SetProcessingStatus (ProcessingSelection processingSelected, DeviceType deviceType)
 Function that sets SensorComponent variables through processing type and device selection parameters. More...
 
void SensorModule_SetCombinedMin (qint16 combinedMin)
 Setter member function of mCombinedMin member variable. More...
 
void SensorModule_SetCombinedMax (qint16 combinedMax)
 Setter member function of mCombinedMax member variable. More...
 
void SensorModule_ResetMeasurement (DeviceType deviceType)
 Function that manages exercise related measurement variables resetting to their initial state. More...
 
qint32 SensorModule_GetAccelerometerX (DeviceType deviceType)
 Getter function established for mAccelerometerX. More...
 
qint32 SensorModule_GetAccelerometerY (DeviceType deviceType)
 Getter function established for mAccelerometerY. More...
 
qint32 SensorModule_GetAccelerometerZ (DeviceType deviceType)
 Getter function established for mAccelerometerZ. More...
 
qint32 SensorModule_GetGyroscopeX (DeviceType deviceType)
 Getter function established for mGyroscopeX. More...
 
qint32 SensorModule_GetGyroscopeY (DeviceType deviceType)
 Getter function established for mGyroscopeY. More...
 
qint32 SensorModule_GetGyroscopeZ (DeviceType deviceType)
 Getter function established for mGyroscopeZ. More...
 
qint16 SensorModule_GetCurrentRoll (DeviceType deviceType)
 Getter member function retrieving current roll value. More...
 
qint16 SensorModule_GetCurrentPitch (DeviceType deviceType)
 Getter member function retrieving current pitch value. More...
 
qint16 SensorModule_GetCurrentYaw (DeviceType deviceType)
 Getter member function retrieving current yaw value. More...
 
qint16 SensorModule_GetCurrentMin (DeviceType deviceType)
 Getter function that returns currently measured minimum. More...
 
qint16 SensorModule_GetCurrentMax (DeviceType deviceType)
 Getter function that returns currently measured maximum. More...
 
qint16 SensorModule_GetCurrentRange (DeviceType deviceType)
 Getter function that returns currently measured range. More...
 
qint16 SensorModule_GetCurrentAngle (DeviceType deviceType)
 Getter function that returns currently measured angle. More...
 
qint16 SensorModule_GetCombinedMin ()
 Getter for mCombinedMin member variable. More...
 
qint16 SensorModule_GetCombinedMax ()
 Getter for mCombinedMax member variable. More...
 

Private Attributes

SensorComponent mComponent
 SensorComponent is a member representing currently processed sensor measurement structure.
 
SensorComponent mPrimaryComponent
 SensorComponent, a member representing primary device related sensor measurement structure.
 
SensorComponent mSecondaryComponent
 SensorComponent is member representing secondary device related sensor measurement structure.
 
QString mFullHexValue
 QString, a text string member variable that holds the entire Bluetooth received hexadecimal-form data. More...
 
QString mHexValue
 QString, a text string member variable that holds Bluetooth received measurement data. More...
 
QString mAuxiliary
 QString, a helper text member variable that separates parts of received hexadecimal string.
 
qint16 mCombinedMin
 qint16 numerical value that holds dual devices estimated minimum angle reached.
 
qint16 mCombinedMax
 qint16 numerical value that holds dual devices estimated maximum angle reached.
 
bool mConversionOK
 bool value that in its TRUE state confirms successful hexadecimal string to number conversion, FALSE otherwise.
 

Detailed Description

Introduces possibilities of retrieved sensor data processing.

This class uses obtained BlueCoin sensor data and manages its processing. This project module relies on SensorComponent struct that is maintained for single or both active Bluetooth connections.

See also
SensorComponent, Bluetooth

Constructor & Destructor Documentation

◆ SensorModule()

SensorModule::SensorModule ( )

Default constructor of class SensorModule.

This function is responsible for member variables initialization.

◆ ~SensorModule()

SensorModule::~SensorModule ( )

Default destructor function.

Destructor function for class SensorModule.

Member Function Documentation

◆ SensorModule_ConvertAccelerometerValue()

qreal SensorModule::SensorModule_ConvertAccelerometerValue ( qint32  accValue)

Member function that converts raw accelerometer value to required form.

A member function that uses raw accelerometer data transmitted by a BlueCoin device and reshapes it into needed form that is further used by a filtering algorithm, while accelerometer range and IMU maximum range values are used.

Parameters
accValue- raw accelerometer value
Returns
qreal - converted accelerometer value

◆ SensorModule_ConvertGyroscopeValue()

qreal SensorModule::SensorModule_ConvertGyroscopeValue ( qint32  gyroValue)

This member function manages conversion of raw gyroscope value so that it can be further used.

Function that serves as a converter of raw gyroscope value that uses gyroscope DPS parameter and IMU maximum range constants.

Parameters
gyroValue- raw gyroscope value
Returns
qreal - converted gyroscope value

◆ SensorModule_GetAccelerometerX()

qint32 SensorModule::SensorModule_GetAccelerometerX ( DeviceType  deviceType)

Getter function established for mAccelerometerX.

Function that returns mAccelerometerX value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint32 - value of accelerometer measured along X axis

◆ SensorModule_GetAccelerometerY()

qint32 SensorModule::SensorModule_GetAccelerometerY ( DeviceType  deviceType)

Getter function established for mAccelerometerY.

Function that returns mAccelerometerY value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint32 - value of accelerometer measured along Y axis

◆ SensorModule_GetAccelerometerZ()

qint32 SensorModule::SensorModule_GetAccelerometerZ ( DeviceType  deviceType)

Getter function established for mAccelerometerZ.

Function that returns mAccelerometerZ value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint32 - value of accelerometer measured along Z axis

◆ SensorModule_GetCombinedMax()

qint16 SensorModule::SensorModule_GetCombinedMax ( )

Getter for mCombinedMax member variable.

Function provides current mCombinedMax value that is used for dual-device maximum measurement.

Returns
qint16 - recent combined maximum value

◆ SensorModule_GetCombinedMin()

qint16 SensorModule::SensorModule_GetCombinedMin ( )

Getter for mCombinedMin member variable.

Function provides current mCombinedMin value that is used for dual-device minimum measurement.

Returns
qint16 - recent combined minimum value

◆ SensorModule_GetCurrentAngle()

qint16 SensorModule::SensorModule_GetCurrentAngle ( DeviceType  deviceType)

Getter function that returns currently measured angle.

This member function is used in order to obtain latest angle.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint16 - currently valid angle

◆ SensorModule_GetCurrentMax()

qint16 SensorModule::SensorModule_GetCurrentMax ( DeviceType  deviceType)

Getter function that returns currently measured maximum.

This member function is used in order to obtain latest maximum value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint16 - currently valid maximum value

◆ SensorModule_GetCurrentMin()

qint16 SensorModule::SensorModule_GetCurrentMin ( DeviceType  deviceType)

Getter function that returns currently measured minimum.

This member function is used in order to obtain latest minimum value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint16 - currently valid minimum value

◆ SensorModule_GetCurrentPitch()

qint16 SensorModule::SensorModule_GetCurrentPitch ( DeviceType  deviceType)

Getter member function retrieving current pitch value.

Member function that serves for retrieval of pitch angle value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint16 - up-to-date pitch value

◆ SensorModule_GetCurrentRange()

qint16 SensorModule::SensorModule_GetCurrentRange ( DeviceType  deviceType)

Getter function that returns currently measured range.

This member function is used in order to obtain latest range value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint16 - currently valid range value

◆ SensorModule_GetCurrentRoll()

qint16 SensorModule::SensorModule_GetCurrentRoll ( DeviceType  deviceType)

Getter member function retrieving current roll value.

Member function that serves for retrieval of roll angle value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint16 - up-to-date roll value

◆ SensorModule_GetCurrentYaw()

qint16 SensorModule::SensorModule_GetCurrentYaw ( DeviceType  deviceType)

Getter member function retrieving current yaw value.

Member function that serves for retrieval of yaw angle value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint16 - up-to-date yaw value

◆ SensorModule_GetGyroscopeX()

qint32 SensorModule::SensorModule_GetGyroscopeX ( DeviceType  deviceType)

Getter function established for mGyroscopeX.

Function that returns mGyroscopeX value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint32 - value of gyroscope measured along X axis

◆ SensorModule_GetGyroscopeY()

qint32 SensorModule::SensorModule_GetGyroscopeY ( DeviceType  deviceType)

Getter function established for mGyroscopeY.

Function that returns mGyroscopeY value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint32 - value of gyroscope measured along Y axis

◆ SensorModule_GetGyroscopeZ()

qint32 SensorModule::SensorModule_GetGyroscopeZ ( DeviceType  deviceType)

Getter function established for mGyroscopeZ.

Function that returns mGyroscopeZ value.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device
Returns
qint32 - value of gyroscope measured along Z axis

◆ SensorModule_ProcessSensorComponent()

void SensorModule::SensorModule_ProcessSensorComponent ( const QString &  hexValue,
DeviceType  deviceType 
)

This member function retrieves accelerometer and gyroscope measurements dispatched by a BlueCoin device and estimates its rotation.

A key part of SensorModule class that uses accelerometer and gyroscope data that gets processed in order to estimate device rotation - roll, pitch and yaw. Calculated angle, minimum, maximum and range values are also updated based on 3D space axis used when evaluating selected exercise.

Parameters
hexValue- hexadecimal measurement string
deviceType- selection parameter of primary or secondary Bluetooth device
See also
Bluetooth

◆ SensorModule_ResetMeasurement()

void SensorModule::SensorModule_ResetMeasurement ( DeviceType  deviceType)

Function that manages exercise related measurement variables resetting to their initial state.

Member function that re-sets rotation variables along with current angle, minimum, maximum and range of a selected device.

Parameters
deviceType- parameter distinguishing primary and secondary measurement device

◆ SensorModule_SetCombinedMax()

void SensorModule::SensorModule_SetCombinedMax ( qint16  combinedMax)

Setter member function of mCombinedMax member variable.

This function manages mCombinedMax setting according to parameter value.

Parameters
combinedMax- numerical parameter of combined maximum value

◆ SensorModule_SetCombinedMin()

void SensorModule::SensorModule_SetCombinedMin ( qint16  combinedMin)

Setter member function of mCombinedMin member variable.

This function manages mCombinedMin setting according to parameter value.

Parameters
combinedMin- numerical parameter of combined minimum value

◆ SensorModule_SetProcessingStatus()

void SensorModule::SensorModule_SetProcessingStatus ( ProcessingSelection  processingSelected,
DeviceType  deviceType 
)

Function that sets SensorComponent variables through processing type and device selection parameters.

Measurement related SensorComponent properties are set accordingly to exercise related axis used and selected BlueCoin device. Processing is either stopped through SensorModule_ResetMeasurement or established for new measurement needs.

Parameters
processingSelected- choice whether X/Y or Z axis is used
deviceType- selection of primary or secondary device
See also
SensorComponent

◆ SensorModule_SetSensorValues()

void SensorModule::SensorModule_SetSensorValues ( const QString &  hexValue)

Provides received string splitting and further processing.

This function manages the division of obtained hexadecimal string that will be processed through filtration (via SensorComponent) and then prepared for user interface presentation. When the necessary data describing three-dimensional rotation is ready, this function manages emitting of SensorModule_SignalProvideResults signal. Note that this member function is triggered immediately after Bluetooth manages characteristics reading.

Parameters
hexValue- hexadecimal measurement string
See also
SensorComponent, Bluetooth

Member Data Documentation

◆ mFullHexValue

QString SensorModule::mFullHexValue
private

QString, a text string member variable that holds the entire Bluetooth received hexadecimal-form data.

This string may include data from both BlueCoin devices.

◆ mHexValue

QString SensorModule::mHexValue
private

QString, a text string member variable that holds Bluetooth received measurement data.

This string includes one BlueCoin device data only.


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