sensorfw: sensors/accelerometersensor/accelerometersensor.h Source File

sensorfw

accelerometersensor.h
Go to the documentation of this file.
1
28#ifndef ACCELEROMETER_SENSOR_CHANNEL_H
29#define ACCELEROMETER_SENSOR_CHANNEL_H
30
31#include "abstractsensor.h"
32#include "abstractchain.h"
33#include "accelerometersensor_a.h"
34#include "dataemitter.h"
35#include "datatypes/orientationdata.h"
36
37class Bin;
38 template <class TYPE> class BufferReader;
39class FilterBase;
40
41
48 class AccelerometerSensorChannel :
49 public AbstractSensorChannel,
50 public DataEmitter<AccelerationData>
51{
52 Q_OBJECT;
53 Q_PROPERTY(XYZ value READ get);
54
55public:
60 static AbstractSensorChannel* factoryMethod(const QString& id)
61 {
62 AccelerometerSensorChannel* sc = new AccelerometerSensorChannel(id);
63 new AccelerometerSensorChannelAdaptor(sc);
64
65 return sc;
66 }
67
68 XYZ get() const { return previousSample_; }
69
70 virtual void removeSession(int sessionId);
71
72 virtual bool downsamplingSupported() const;
73
74public Q_SLOTS:
75 bool start();
76 bool stop();
77
78signals:
83 void dataAvailable(const XYZ& data);
84
85protected:
86 AccelerometerSensorChannel(const QString& id);
87 virtual ~AccelerometerSensorChannel();
88
89private:
90 static double aconv_[3][3];
91 Bin* filterBin_;
92 Bin* marshallingBin_;
93 AbstractChain* accelerometerChain_;
94 BufferReader<AccelerationData>* accelerometerReader_;
95 RingBuffer<AccelerationData>* outputBuffer_;
96 AccelerationData previousSample_;
97 TimedXyzDownsampleBuffer downsampleBuffer_;
98
99 void emitData(const AccelerationData& value);
100};
101
102#endif
accelerometersensor_a.h
D-Bus adaptor for AccelerometerSensor.
AccelerometerSensorChannelAdaptor
Definition accelerometersensor_a.h:36
AccelerometerSensorChannel
Sensor providing accelerometer measurements.
Definition accelerometersensor.h:51
AccelerometerSensorChannel::value
XYZ value
Definition accelerometersensor.h:53
AccelerometerSensorChannel::~AccelerometerSensorChannel
virtual ~AccelerometerSensorChannel()
AccelerometerSensorChannel::start
bool start()
AccelerometerSensorChannel::stop
bool stop()
AccelerometerSensorChannel::removeSession
virtual void removeSession(int sessionId)
AccelerometerSensorChannel::dataAvailable
void dataAvailable(const XYZ &data)
Sent when new measurement data has become available.
AccelerometerSensorChannel::downsamplingSupported
virtual bool downsamplingSupported() const
AccelerometerSensorChannel::AccelerometerSensorChannel
AccelerometerSensorChannel(const QString &id)
AccelerometerSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for AccelerometerSensorChannel.
Definition accelerometersensor.h:60
AccelerometerSensorChannel::get
XYZ get() const
Definition accelerometersensor.h:68
BufferReader
Definition accelerometersensor.h:38
TimedXyzData
Class for vector type measurement data (timestamp, x, y, z).
Definition genericdata.h:53
XYZ
QObject facade for XYZData.
Definition xyz.h:39
orientationdata.h
Datatypes for different filters.