sensorfw: sensors/compasssensor/compasssensor.h Source File

sensorfw

compasssensor.h
Go to the documentation of this file.
1
28#ifndef COMPASS_SENSOR_CHANNEL_H
29#define COMPASS_SENSOR_CHANNEL_H
30
31#include "abstractsensor.h"
32#include "abstractchain.h"
33#include "compasssensor_a.h"
34#include "dataemitter.h"
35#include "orientationdata.h"
36#include "datatypes/compass.h"
37
38class Bin;
39class CompassAdaptor;
40template <class TYPE> class BufferReader;
41class FilterBase;
42
49 class CompassSensorChannel :
50 public AbstractSensorChannel,
51 public DataEmitter<CompassData>
52{
53 Q_OBJECT;
54
55 Q_PROPERTY(quint16 declinationvalue READ declinationValue);
56 Q_PROPERTY(Compass value READ get);
57
58public:
59 static AbstractSensorChannel* factoryMethod(const QString& id)
60 {
61 CompassSensorChannel* sc = new CompassSensorChannel(id);
62 new CompassSensorChannelAdaptor(sc);
63
64 return sc;
65 }
66
67 quint16 declinationValue() const;
68
69 Compass get() const { return compassData; }
70
71public Q_SLOTS:
72 bool start();
73 bool stop();
74
75signals:
76 void dataAvailable(const Compass& value);
77
78protected:
79 CompassSensorChannel(const QString& id);
80 virtual ~CompassSensorChannel();
81
82private:
83 CompassData compassData;
84
85 Bin* filterBin_;
86 Bin* marshallingBin_;
87
88 AbstractChain* compassChain_;
89 BufferReader<CompassData>* inputReader_;
90 RingBuffer<CompassData>* outputBuffer_;
91
92 void emitData(const CompassData& value);
93};
94
95#endif
BufferReader
Definition accelerometersensor.h:38
CompassData
Datatype for compass measurements.
Definition orientationdata.h:112
CompassSensorChannelAdaptor
Definition compasssensor_a.h:35
CompassSensorChannel
Logical sensor for measuring compass direction using magnetometer and accelerometer sensors.
Definition compasssensor.h:52
CompassSensorChannel::declinationvalue
quint16 declinationvalue
Definition compasssensor.h:55
CompassSensorChannel::declinationValue
quint16 declinationValue() const
CompassSensorChannel::start
bool start()
CompassSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Definition compasssensor.h:59
CompassSensorChannel::dataAvailable
void dataAvailable(const Compass &value)
CompassSensorChannel::get
Compass get() const
Definition compasssensor.h:69
CompassSensorChannel::~CompassSensorChannel
virtual ~CompassSensorChannel()
CompassSensorChannel::value
Compass value
Definition compasssensor.h:56
CompassSensorChannel::stop
bool stop()
CompassSensorChannel::CompassSensorChannel
CompassSensorChannel(const QString &id)
Compass
QObject facade for CompassData.
Definition compass.h:38
compass.h
QObject based datatype for CompassData.
compasssensor_a.h
D-Bus adaptor for CompassSensor.
orientationdata.h
Datatypes for different filters.