sensorfw: sensors/gyroscopesensor/gyroscopesensor.h Source File

sensorfw

gyroscopesensor.h
Go to the documentation of this file.
1
27#ifndef GYROSCOPE_SENSOR_CHANNEL_H
28#define GYROSCOPE_SENSOR_CHANNEL_H
29
30#include "abstractsensor.h"
31#include "deviceadaptor.h"
32
33#include "gyroscopesensor_a.h"
34#include "dataemitter.h"
35
36#include "datatypes/orientationdata.h"
37#include "datatypes/xyz.h"
38
39class Bin;
40template <class TYPE> class BufferReader;
41class FilterBase;
42
43 class GyroscopeSensorChannel :
44 public AbstractSensorChannel,
45 public DataEmitter<TimedXyzData>
46{
47 Q_OBJECT;
48 Q_PROPERTY(XYZ value READ get);
49
50public:
55 static AbstractSensorChannel* factoryMethod(const QString& id)
56 {
57 GyroscopeSensorChannel* sc = new GyroscopeSensorChannel(id);
58 new GyroscopeSensorChannelAdaptor(sc);
59
60 return sc;
61 }
62
63 XYZ get() const { return previousSample_; }
64
65public Q_SLOTS:
66 bool start();
67 bool stop();
68
69signals:
70 void dataAvailable(const XYZ& data);
71
72protected:
73 GyroscopeSensorChannel(const QString& id);
74 ~GyroscopeSensorChannel();
75
76private:
77 Bin* filterBin_;
78 Bin* marshallingBin_;
79
80 DeviceAdaptor* gyroscopeAdaptor_;
81 BufferReader<TimedXyzData>* gyroscopeReader_;
82 RingBuffer<TimedXyzData>* outputBuffer_;
83
84 TimedXyzData previousSample_;
85
86 void emitData(const TimedXyzData& value);
87
88};
89
90#endif // GYROSCOPE_SENSOR_CHANNEL_H
BufferReader
Definition accelerometersensor.h:38
GyroscopeSensorChannelAdaptor
Definition gyroscopesensor_a.h:38
GyroscopeSensorChannel
Definition gyroscopesensor.h:46
GyroscopeSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for GyroscopeSensorChannel.
Definition gyroscopesensor.h:55
GyroscopeSensorChannel::value
XYZ value
Definition gyroscopesensor.h:48
GyroscopeSensorChannel::start
bool start()
GyroscopeSensorChannel::~GyroscopeSensorChannel
~GyroscopeSensorChannel()
GyroscopeSensorChannel::get
XYZ get() const
Definition gyroscopesensor.h:63
GyroscopeSensorChannel::dataAvailable
void dataAvailable(const XYZ &data)
GyroscopeSensorChannel::stop
bool stop()
GyroscopeSensorChannel::GyroscopeSensorChannel
GyroscopeSensorChannel(const QString &id)
TimedXyzData
Class for vector type measurement data (timestamp, x, y, z).
Definition genericdata.h:53
XYZ
QObject facade for XYZData.
Definition xyz.h:39
gyroscopesensor_a.h
D-Bus adaptor for GyroscopeSensor.
orientationdata.h
Datatypes for different filters.
xyz.h
QObject based datatype for TimedXYZData.