Sensor Scol plugin
Multi platform sensors for handled devices
G:
work
subversion
scol-technologies
trunk
scol
plugins
sensor
include
SQSensor.h
1
#ifndef _SQSENSOR_H_
2
#define _SQSENSOR_H_
3
4
5
#include <set>
6
#include <stdint.h>
7
#include <vector>
8
#include "SSensor.h"
9
#include "tools/Vector3d.h"
10
11
#include <QtSensors/QtSensors>
12
13
/* CLASS NAME: Sensor
14
* \brief Represents a sensor.
15
16
* Used to store sensor datas received by events. The purpose if to get datas synchronously (by a simple 'get' method)
17
*/
18
class
SQSensor
:
public
QObject,
public
SSensor
19
{
20
Q_OBJECT
21
22
/* * * * * * * * * * * * * FRIENDS * * * * * * * * * * * * */
23
24
/* * * * * * * * * * * * * ATTRIBUTES * * * * * * * * * * * * */
25
public
:
26
protected
:
27
SSensorData
mData;
28
QSensor* mQSensor;
29
private
:
30
31
/* * * * * * * * * * * * * CONSTRUCTORS * * * * * * * * * * * * */
32
public
:
33
SQSensor
();
34
SQSensor
(SSensorType type);
35
~SQSensor
();
36
protected
:
37
private
slots:
38
void
updateData();
39
40
/* * * * * * * * * * * * * METHODS * * * * * * * * * * * * */
41
public
:
42
virtual
SSensorData
GetData();
43
void
SetData(
SSensorData
newData);
44
QSensor* GetQSensor();
45
void
SetQSensor(QSensor* aSensor);
46
protected
:
47
private
:
48
};
49
50
/* CLASS NAME: SensorManager
51
* \brief Manager sensors.
52
53
* Used to list sensor objects. It is possible to manage them through this class (enable/disable, ...).
54
*/
55
class
SQSensorManager
:
public
SSensorManager
56
{
57
/* * * * * * * * * * * * * FRIENDS * * * * * * * * * * * * */
58
59
/* * * * * * * * * * * * * ATTRIBUTES * * * * * * * * * * * * */
60
public
:
61
protected
:
62
private
:
63
static
SSensorManager
* mSingletonInstance;
64
65
/* * * * * * * * * * * * * CONSTRUCTORS * * * * * * * * * * * * */
66
public
:
67
SQSensorManager
();
68
~SQSensorManager
();
69
protected
:
70
private
:
71
72
public
:
73
74
/* * * * * * * * * * * * * METHODS * * * * * * * * * * * * */
75
public
:
76
virtual
int
SetSensorEnable(SSensorType sensorType,
bool
state);
77
virtual
void
Vibrate(
long
millis);
78
virtual
void
StartVibration();
79
virtual
void
StopVibration();
80
virtual
void
VibratePattern(std::vector<int> pattern,
bool
loop);
81
82
virtual
void
StartLocationService();
83
virtual
void
StopLocationService();
84
virtual
bool
GetLocation(
float
&longitude,
float
&latitude,
float
&altitude);
85
protected
:
86
private
:
87
};
88
89
#endif
SQSensor
Definition
SQSensor.h:19
SQSensorManager
Definition
SQSensor.h:56
SSensor
Definition
SSensor.h:61
SSensorManager
Definition
SSensor.h:105
SSensorData
Definition
SSensor.h:24
Generated by
1.9.8