sensorfw
rotationsensor_i.h
Go to the documentation of this file.
1 
27 #ifndef ROTATIONSENSOR_I_H
28 #define ROTATIONSENSOR_I_H
29 
30 #include <QtDBus/QtDBus>
31 #include <QVector>
32 
33 #include "abstractsensor_i.h"
34 #include <datatypes/xyz.h>
35 
40 {
41  Q_OBJECT
42  Q_DISABLE_COPY(RotationSensorChannelInterface)
43  Q_PROPERTY(XYZ rotation READ rotation)
44  Q_PROPERTY(bool hasZ READ hasZ)
45 
46 public:
52  static const char* staticInterfaceName;
53 
61  static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);
62 
69 
75  bool hasZ();
76 
83  RotationSensorChannelInterface(const QString& path, int sessionId);
84 
92  static const RotationSensorChannelInterface* listenInterface(const QString& id);
93 
102 
109  static RotationSensorChannelInterface* interface(const QString& id);
110 
111 protected:
112  virtual void connectNotify(const QMetaMethod &signal);
113 
114  virtual bool dataReceivedImpl();
115 
116 private:
117  bool frameAvailableConnected;
119 Q_SIGNALS:
125  void dataAvailable(const XYZ& data);
126 
134  void frameAvailable(const QVector<XYZ>& frame);
135 };
136 
137 namespace local {
138  typedef ::RotationSensorChannelInterface RotationSensor;
139 }
140 
141 #endif /* ROTATIONSENSOR_I_H */
Base class for sensor interface.
Base-class for client facades of different sensor types.
Client interface for listening device rotation changes.
static RotationSensorChannelInterface * interface(const QString &id)
Request an interface to the sensor.
static RotationSensorChannelInterface * controlInterface(const QString &id)
Request a control interface to the sensor.
bool hasZ()
Does reported readings include Z coordinate.
RotationSensorChannelInterface(const QString &path, int sessionId)
Constructor.
virtual bool dataReceivedImpl()
Callback for subclasses in which they must read their expected data from socket.
static const RotationSensorChannelInterface * listenInterface(const QString &id)
Request a listening interface to the sensor.
static const char * staticInterfaceName
Get name of the D-Bus interface for this class.
virtual void connectNotify(const QMetaMethod &signal)
XYZ rotation()
Get latest rotation reading from sensor daemon.
void dataAvailable(const XYZ &data)
Sent when device rotation has changed.
static AbstractSensorChannelInterface * factoryMethod(const QString &id, int sessionId)
Create new instance of the class.
void frameAvailable(const QVector< XYZ > &frame)
Sent when new measurement frame has become available.
QObject facade for XYZData.
Definition: xyz.h:37
::RotationSensorChannelInterface RotationSensor
QObject based datatype for TimedXYZData.