sensorfw
temperaturesensor.h
Go to the documentation of this file.
1 
26 #ifndef TEMPERATURE_SENSOR_CHANNEL_H
27 #define TEMPERATURE_SENSOR_CHANNEL_H
28 
29 #include <QObject>
30 
31 #include "deviceadaptor.h"
32 #include "abstractsensor.h"
33 #include "temperaturesensor_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 temperature READ temperature NOTIFY temperatureChanged)
54 
55 public:
60  static AbstractSensorChannel* factoryMethod(const QString& id)
61  {
64 
65  return sc;
66  }
67 
72  Unsigned temperature() const { return previousValue_; }
73 
74 public Q_SLOTS:
75  bool start();
76  bool stop();
77 
78 signals:
83  void temperatureChanged(const Unsigned& value);
84 
85 protected:
86  TemperatureSensorChannel(const QString& id);
88 
89 private:
90  TimedUnsigned previousValue_;
91  Bin* filterBin_;
92  Bin* marshallingBin_;
93  DeviceAdaptor* temperatureAdaptor_;
94  BufferReader<TimedUnsigned>* temperatureReader_;
95  RingBuffer<TimedUnsigned>* outputBuffer_;
96 
97  void emitData(const TimedUnsigned& value);
98 };
99 
100 #endif // TEMPERATURE_SENSOR_CHANNEL_H
TemperatureSensorChannel
Sensor for accessing the internal ambient light sensor measurements.
Definition: temperaturesensor.h:51
TemperatureSensorChannel::stop
bool stop()
TemperatureSensorChannel::temperatureChanged
void temperatureChanged(const Unsigned &value)
Sent when a change in measured data is observed.
TemperatureSensorChannel::start
bool start()
temperaturesensor_a.h
D-Bus adaptor for TemperatureSensor.
TemperatureSensorChannel::temperature
Unsigned temperature
Definition: temperaturesensor.h:53
TemperatureSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for TemperatureSensorChannel.
Definition: temperaturesensor.h:60
TemperatureSensorChannel::TemperatureSensorChannel
TemperatureSensorChannel(const QString &id)
timedunsigned.h
Datatype for unsigned values.
unsigned.h
QObject based datatype for TimedUnsigned.
TemperatureSensorChannel::~TemperatureSensorChannel
virtual ~TemperatureSensorChannel()
TimedUnsigned
Datatype for unsigned integer value with timestamp.
Definition: timedunsigned.h:34
Unsigned
QObject facae for TimedUnsigned.
Definition: unsigned.h:37
BufferReader
Definition: accelerometersensor.h:38
TemperatureSensorChannel::temperature
Unsigned temperature() const
Property for accessing the measured value.
Definition: temperaturesensor.h:72
TemperatureSensorChannelAdaptor
Definition: temperaturesensor_a.h:36