sensorfw
orientationsensor.h
Go to the documentation of this file.
26#ifndef ORIENTATION_SENSOR_CHANNEL_H
27#define ORIENTATION_SENSOR_CHANNEL_H
28
29#include "abstractsensor.h"
30#include "abstractchain.h"
31#include "orientationsensor_a.h"
32#include "dataemitter.h"
34#include "datatypes/posedata.h"
35#include "datatypes/unsigned.h"
36
37class Bin;
38template <class TYPE> class BufferReader;
39class FilterBase;
40
49 public AbstractSensorChannel,
50 public DataEmitter<PoseData>
51{
52 Q_OBJECT;
53 Q_PROPERTY(Unsigned orientation READ orientation);
54
55public:
56
61 static AbstractSensorChannel* factoryMethod(const QString& id)
62 {
65
66 return sc;
67 }
68
74 {
75 TimedUnsigned o = orientationChain_->property("orientation").value<TimedUnsigned>();
76 return Unsigned(o);
77 }
78
79public Q_SLOTS:
80 bool start();
81 bool stop();
82
83signals:
89
90protected:
91 OrientationSensorChannel(const QString& id);
93
94private:
95 PoseData prevOrientation;
96 Bin* filterBin_;
97 Bin* marshallingBin_;
98
99 AbstractChain* orientationChain_;
100
101 BufferReader<PoseData>* orientationReader_;
102
103 RingBuffer<PoseData>* outputBuffer_;
104
109 void emitData(const PoseData& value);
110};
111
112#endif // ORIENTATION_SENSOR_CHANNEL_H
Sensor for accessing device orientation.
OrientationSensorChannel(const QString &id)
virtual ~OrientationSensorChannel()
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for OrientationSensorChannel.
void orientationChanged(const int &orientation)
Sent whenever orientation interpretation has changed.
Unsigned orientation() const
Property method returning current orientation.
Datatype for device pose interpretation.
Definition: posedata.h:34
Datatype for unsigned integer value with timestamp.
Definition: timedunsigned.h:34
QObject facae for TimedUnsigned.
Definition: unsigned.h:37
Datatypes for different filters.
D-Bus Adaptor for OrientationSensor.
Datatype for device 'pose' (orientation)
QObject based datatype for TimedUnsigned.