-
Notifications
You must be signed in to change notification settings - Fork 8
/
acceleration.h
56 lines (40 loc) · 1.03 KB
/
acceleration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef _ACCELERATION
#define _ACCELERATION
#include<AttysComm.h>
#include <QComboBox>
class Acceleration : public QComboBox {
Q_OBJECT
public:
/**
* constructor
**/
Acceleration();
const int accelerationMapping[4] = {
AttysCommBase::ACCEL_2G,
AttysCommBase::ACCEL_4G,
AttysCommBase::ACCEL_8G,
AttysCommBase::ACCEL_16G
};
/**
* One g in m/s^2.
**/
const float oneG = 9.80665F; // m/s^2
/**
* Mapping of the index to the full scale accelerations.
**/
const float ACCEL_FULL_SCALE[4] = { 2 * oneG, 4 * oneG, 8 * oneG, 16 * oneG }; // m/s^2
private slots:
void accelerationChanged(int i);
signals:
void signalRestart();
private:
int acceleration = AttysCommBase::ACCEL_16G;
public:
inline int getAcceleration() {return acceleration;};
int getAccelerationIndex();
void setAcceleration(int _sampingRate);
int getAccelerationInmss() {
return ACCEL_FULL_SCALE[acceleration];
}
};
#endif