sensorfw: sensord/calibrationhandler.h Source File

sensorfw

calibrationhandler.h
Go to the documentation of this file.
1
27 #ifndef CALIBRATION_HANDLER
28 #define CALIBRATION_HANDLER
29
30 #include <QObject>
31 #include <QString>
32 #include <QTimer>
33 #include "datatypes/magneticfield.h"
34 #include "magnetometersensor.h"
35
42 class CalibrationHandler : public QObject
43 {
44 Q_OBJECT
45 Q_DISABLE_COPY(CalibrationHandler)
46
47 public:
52 CalibrationHandler(QObject* parent = 0);
53
57 ~CalibrationHandler();
58
64 bool initiateSession();
65
66 public slots:
70 void sampleReceived(const MagneticField&);
71
75 void stopCalibration();
76
80 void resumeCalibration();
81
82 private slots:
86 void calibrationTimeout();
87
88 private:
89 static const QString SENSOR_NAME;
91 MagnetometerSensorChannel* m_sensor;
92 int m_sessionId;
93 int m_level;
94 QTimer m_timer;
95 int m_calibRate;
96 int m_calibTimeout;
97 };
98
99 #endif // CALIBRATION_HANDLER
CalibrationHandler
Helper class for maintaining magnetometer calibration.
Definition: calibrationhandler.h:43
CalibrationHandler::sampleReceived
void sampleReceived(const MagneticField &)
Callback when new sample is received from magnetometer.
CalibrationHandler::stopCalibration
void stopCalibration()
Stop calibration.
CalibrationHandler::resumeCalibration
void resumeCalibration()
Resume calibration.
CalibrationHandler::~CalibrationHandler
~CalibrationHandler()
Destructor.
CalibrationHandler::CalibrationHandler
CalibrationHandler(QObject *parent=0)
Constructor.
CalibrationHandler::initiateSession
bool initiateSession()
Initialize object and start background calibration.
MagneticField
QObject facade for CalibratedMagneticFieldData.
Definition: magneticfield.h:38
MagnetometerSensorChannel
Sensor providing magnetic field measurements.
Definition: magnetometersensor.h:48
magneticfield.h
QObject based datatype for CalibratedMagneticFieldData.
magnetometersensor.h
MagnetometerSensor.