sensorfw
orientationsensor.h
Go to the documentation of this file.
1 
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 
37 class Bin;
38 template <class TYPE> class BufferReader;
39 class FilterBase;
40 
49  public AbstractSensorChannel,
50  public DataEmitter<PoseData>
51 {
52  Q_OBJECT;
53  Q_PROPERTY(Unsigned orientation READ orientation);
54 
55 public:
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 
79 public Q_SLOTS:
80  bool start();
81  bool stop();
82 
83 signals:
88  void orientationChanged(const int& orientation);
89 
90 protected:
91  OrientationSensorChannel(const QString& id);
93 
94 private:
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
OrientationSensorChannel::orientationChanged
void orientationChanged(const int &orientation)
Sent whenever orientation interpretation has changed.
OrientationSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for OrientationSensorChannel.
Definition: orientationsensor.h:61
posedata.h
Datatype for device 'pose' (orientation)
orientationdata.h
Datatypes for different filters.
OrientationSensorChannel::start
bool start()
OrientationSensorChannelAdaptor
Definition: orientationsensor_a.h:37
unsigned.h
QObject based datatype for TimedUnsigned.
OrientationSensorChannel::~OrientationSensorChannel
virtual ~OrientationSensorChannel()
PoseData
Datatype for device pose interpretation.
Definition: posedata.h:34
TimedUnsigned
Datatype for unsigned integer value with timestamp.
Definition: timedunsigned.h:34
orientationsensor_a.h
D-Bus Adaptor for OrientationSensor.
OrientationSensorChannel::orientation
Unsigned orientation
Definition: orientationsensor.h:52
Unsigned
QObject facae for TimedUnsigned.
Definition: unsigned.h:37
OrientationSensorChannel::stop
bool stop()
OrientationSensorChannel
Sensor for accessing device orientation.
Definition: orientationsensor.h:51
BufferReader
Definition: accelerometersensor.h:38
OrientationSensorChannel::OrientationSensorChannel
OrientationSensorChannel(const QString &id)
OrientationSensorChannel::orientation
Unsigned orientation() const
Property method returning current orientation.
Definition: orientationsensor.h:73