sensorfw
compasssensor_i.h
Go to the documentation of this file.
1 
27 #ifndef COMPASSSENSOR_I_H
28 #define COMPASSSENSOR_I_H
29 
30 #include <QtDBus/QtDBus>
31 
32 #include "abstractsensor_i.h"
33 #include <datatypes/compass.h>
34 
39 {
40  Q_OBJECT
41  Q_DISABLE_COPY(CompassSensorChannelInterface)
42  Q_PROPERTY(Compass value READ get)
43  Q_PROPERTY(bool usedeclination READ useDeclination WRITE setUseDeclination)
44  Q_PROPERTY(int declinationvalue READ declinationValue)
45 
46 public:
50  static const char* staticInterfaceName;
51 
59  static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);
60 
67 
76 
83  void setUseDeclination(bool enable);
84 
91 
98  CompassSensorChannelInterface(const QString& path, int sessionId);
99 
107  static const CompassSensorChannelInterface* listenInterface(const QString& id);
108 
117 
124  static CompassSensorChannelInterface* interface(const QString& id);
125 
126 protected:
127  virtual bool dataReceivedImpl();
128 
129 Q_SIGNALS:
130 
137 
138 private:
139 
140  bool useDeclination_;
141 };
142 
143 namespace local {
144  typedef ::CompassSensorChannelInterface CompassSensor;
145 }
146 
147 #endif
Compass
QObject facade for CompassData.
Definition: compass.h:38
compass.h
QObject based datatype for CompassData.
CompassSensorChannelInterface::usedeclination
bool usedeclination
Definition: compasssensor_i.h:43
CompassSensorChannelInterface::setUseDeclination
void setUseDeclination(bool enable)
Sets whether the declination correction should be applied or not.
abstractsensor_i.h
Base class for sensor interface.
CompassSensorChannelInterface::dataAvailable
void dataAvailable(const Compass &value)
Sent when compass direction or calibration level has changed.
CompassSensorChannelInterface::get
Compass get()
Get latest compass reading from sensor daemon.
local
Definition: abstractsensor_i.h:516
CompassSensorChannelInterface::staticInterfaceName
static const char * staticInterfaceName
Name of the D-Bus interface for this class.
Definition: compasssensor_i.h:50
local::CompassSensor
::CompassSensorChannelInterface CompassSensor
Definition: compasssensor_i.h:144
CompassSensorChannelInterface::controlInterface
static CompassSensorChannelInterface * controlInterface(const QString &id)
Request a control interface to the sensor.
AbstractSensorChannelInterface::sessionId
int sessionId
Definition: abstractsensor_i.h:49
CompassSensorChannelInterface::listenInterface
static const CompassSensorChannelInterface * listenInterface(const QString &id)
Request a listening interface to the sensor.
AbstractSensorChannelInterface
Base-class for client facades of different sensor types.
Definition: abstractsensor_i.h:46
CompassSensorChannelInterface::factoryMethod
static AbstractSensorChannelInterface * factoryMethod(const QString &id, int sessionId)
Create new instance of the class.
CompassSensorChannelInterface::CompassSensorChannelInterface
CompassSensorChannelInterface(const QString &path, int sessionId)
Constructor.
CompassSensorChannelInterface::declinationvalue
int declinationvalue
Definition: compasssensor_i.h:44
CompassSensorChannelInterface::dataReceivedImpl
virtual bool dataReceivedImpl()
Callback for subclasses in which they must read their expected data from socket.
CompassSensorChannelInterface::value
Compass value
Definition: compasssensor_i.h:42
CompassSensorChannelInterface::useDeclination
bool useDeclination()
Returns whether the sensor is applying declination correction to the output value and returning true ...
CompassSensorChannelInterface
Client interface for accessing compass sensor.
Definition: compasssensor_i.h:39
CompassSensorChannelInterface::interface
static CompassSensorChannelInterface * interface(const QString &id)
Request an interface to the sensor.
CompassSensorChannelInterface::declinationValue
int declinationValue()
Returns the currently used declination correction value.