sensorfw
temperaturesensor.h
Go to the documentation of this file.
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
38class Bin;
39template <class TYPE> class BufferReader;
40class FilterBase;
41
49 public AbstractSensorChannel,
50 public DataEmitter<TimedUnsigned>
51{
52 Q_OBJECT
54
55public:
60 static AbstractSensorChannel* factoryMethod(const QString& id)
61 {
64
65 return sc;
66 }
67
72 Unsigned temperature() const { return previousValue_; }
73
74public Q_SLOTS:
75 bool start();
76 bool stop();
77
78signals:
83 void temperatureChanged(const Unsigned& value);
84
85protected:
86 TemperatureSensorChannel(const QString& id);
88
89private:
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
Sensor for accessing the internal ambient light sensor measurements.
Unsigned temperature() const
Property for accessing the measured value.
void temperatureChanged(const Unsigned &value)
Sent when a change in measured data is observed.
TemperatureSensorChannel(const QString &id)
virtual ~TemperatureSensorChannel()
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for TemperatureSensorChannel.
Datatype for unsigned integer value with timestamp.
Definition: timedunsigned.h:34
QObject facae for TimedUnsigned.
Definition: unsigned.h:37
D-Bus adaptor for TemperatureSensor.
Datatype for unsigned values.
QObject based datatype for TimedUnsigned.