Provides logical compass sensor. More...
#include <qmcompass.h>
Signals | |
void | dataAvailable (const MeeGo::QmCompassReading value) |
Public Member Functions | |
QmCompass (QObject *parent=0) | |
~QmCompass () | |
QmCompassReading | get () |
int | declinationValue () |
bool | useDeclination () |
void | setUseDeclination (bool enable) |
Properties | |
QmCompassReading | value |
bool | usedeclination |
int | declinationvalue |
Provides logical compass sensor.
Logical compass sensor uses magnetometer and accelerometer to measure current north angle.
To get meaningful direction from the compass, it must be calibrated. Calibration level varies from 0 to 3. Only measurements at level 3 are accurate. Calibration is done by rotating the device around each axis simultaneously. Rotating one's wrist for 2-3 rounds with the device in hand usually is enough. Fast changes in the magnetic environment may cause the calibration level to drop.
To get measurements and change sensor settings, the client must open a session (and call start() for data). Details can be found from documentation of QmSensor.
Definition at line 71 of file qmcompass.h.
MeeGo::QmCompass::QmCompass | ( | QObject * | parent = 0 |
) |
Constructor
parent | Parent object |
MeeGo::QmCompass::~QmCompass | ( | ) |
Destructor
void MeeGo::QmCompass::dataAvailable | ( | const MeeGo::QmCompassReading | value | ) | [signal] |
Signal to notify the listener about change of compass direction, or calibration level.
value | Current compass measurement |
int MeeGo::QmCompass::declinationValue | ( | ) |
Returns the currently used declination correction value.
QmCompassReading MeeGo::QmCompass::get | ( | ) |
Returns the previous measured compass value.
void MeeGo::QmCompass::setUseDeclination | ( | bool | enable | ) |
Sets whether the declination correction should be applied or not.
enable | If true, declination correction will be applied, if false, it will not be applied |
bool MeeGo::QmCompass::useDeclination | ( | ) |
Returns whether the sensor is applying declination correction to the output value and returning true north, or not applying it and returning magnetic north.
int MeeGo::QmCompass::declinationvalue [read] |
Definition at line 75 of file qmcompass.h.
bool MeeGo::QmCompass::usedeclination [read, write] |
Definition at line 74 of file qmcompass.h.
QmCompassReading MeeGo::QmCompass::value [read] |
Definition at line 73 of file qmcompass.h.