sensorfw
pressuresensor.h
Go to the documentation of this file.
1 
26 #ifndef PRESSURE_SENSOR_CHANNEL_H
27 #define PRESSURE_SENSOR_CHANNEL_H
28 
29 #include <QObject>
30 
31 #include "deviceadaptor.h"
32 #include "abstractsensor.h"
33 #include "pressuresensor_a.h"
34 #include "dataemitter.h"
36 #include "datatypes/unsigned.h"
37 
38 class Bin;
39 template <class TYPE> class BufferReader;
40 class FilterBase;
41 
49  public AbstractSensorChannel,
50  public DataEmitter<TimedUnsigned>
51 {
52  Q_OBJECT
53  Q_PROPERTY(Unsigned pressure READ pressure NOTIFY pressureChanged)
54 
55 public:
60  static AbstractSensorChannel* factoryMethod(const QString& id)
61  {
64 
65  return sc;
66  }
67 
72  Unsigned pressure() const { return previousValue_; }
73 
74 public Q_SLOTS:
75  bool start();
76  bool stop();
77 
78 signals:
83  void pressureChanged(const Unsigned& value);
84 
85 protected:
86  PressureSensorChannel(const QString& id);
88 
89 private:
90  TimedUnsigned previousValue_;
91  Bin* filterBin_;
92  Bin* marshallingBin_;
93  DeviceAdaptor* pressureAdaptor_;
94  BufferReader<TimedUnsigned>* pressureReader_;
95  RingBuffer<TimedUnsigned>* outputBuffer_;
96 
97  void emitData(const TimedUnsigned& value);
98 };
99 
100 #endif // PRESSURE_SENSOR_CHANNEL_H
Sensor for accessing the internal ambient light sensor measurements.
void pressureChanged(const Unsigned &value)
Sent when a change in measured data is observed.
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for PressureSensorChannel.
PressureSensorChannel(const QString &id)
Unsigned pressure() const
Property for accessing the measured value.
virtual ~PressureSensorChannel()
Datatype for unsigned integer value with timestamp.
Definition: timedunsigned.h:34
QObject facae for TimedUnsigned.
Definition: unsigned.h:37
D-Bus adaptor for PressureSensor.
Datatype for unsigned values.
QObject based datatype for TimedUnsigned.