sensorfw
stepcountersensor.h
Go to the documentation of this file.
1 
28 #ifndef STEPCOUNTER_SENSOR_CHANNEL_H
29 #define STEPCOUNTER_SENSOR_CHANNEL_H
30 
31 #include <QObject>
32 
33 #include "deviceadaptor.h"
34 #include "abstractsensor.h"
35 #include "stepcountersensor_a.h"
36 #include "dataemitter.h"
38 #include "datatypes/unsigned.h"
39 
40 class Bin;
41 template <class TYPE> class BufferReader;
42 class FilterBase;
43 
50  public AbstractSensorChannel,
51  public DataEmitter<TimedUnsigned>
52 {
53  Q_OBJECT;
54  Q_PROPERTY(Unsigned steps READ steps);
55 
56 public:
61  static AbstractSensorChannel* factoryMethod(const QString& id)
62  {
65 
66  return sc;
67  }
68 
73  Unsigned steps() const { return previousValue_; }
74 
75 public Q_SLOTS:
76  bool start();
77  bool stop();
78 
79 signals:
84  void StepCounterChanged(const Unsigned& value);
85 
86 protected:
87  StepCounterSensorChannel(const QString& id);
89 
90 private:
91  TimedUnsigned previousValue_;
92  Bin* filterBin_;
93  Bin* marshallingBin_;
94  DeviceAdaptor* stepcounterAdaptor_;
95  BufferReader<TimedUnsigned>* stepcounterReader_;
96  RingBuffer<TimedUnsigned>* outputBuffer_;
97 
98  void emitData(const TimedUnsigned& value);
99 };
100 
101 #endif // STEPCOUNTER_SENSOR_CHANNEL_H
StepCounterSensorChannel::start
bool start()
StepCounterSensorChannel
Sensor for accessing the internal step counter sensor measurements.
Definition: stepcountersensor.h:52
StepCounterSensorChannel::stop
bool stop()
timedunsigned.h
Datatype for unsigned values.
StepCounterSensorChannel::steps
Unsigned steps() const
Property for accessing the measured value.
Definition: stepcountersensor.h:73
StepCounterSensorChannel::StepCounterChanged
void StepCounterChanged(const Unsigned &value)
Sent when a change in measured data is observed.
unsigned.h
QObject based datatype for TimedUnsigned.
stepcountersensor_a.h
D-Bus adaptor for stepcounter sensor.
StepCounterSensorChannel::~StepCounterSensorChannel
virtual ~StepCounterSensorChannel()
TimedUnsigned
Datatype for unsigned integer value with timestamp.
Definition: timedunsigned.h:34
StepCounterSensorChannel::StepCounterSensorChannel
StepCounterSensorChannel(const QString &id)
Unsigned
QObject facae for TimedUnsigned.
Definition: unsigned.h:37
BufferReader
Definition: accelerometersensor.h:38
StepCounterSensorChannel::factoryMethod
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for StepCounterSensorChannel.
Definition: stepcountersensor.h:61
StepCounterSensorChannel::steps
Unsigned steps
Definition: stepcountersensor.h:53
StepCounterSensorChannelAdaptor
Definition: stepcountersensor_a.h:39