forked from vranki/ExtPlane-Panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunits.h
More file actions
40 lines (35 loc) · 992 Bytes
/
units.h
File metadata and controls
40 lines (35 loc) · 992 Bytes
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
#ifndef UNITS_H
#define UNITS_H
#include <QString>
enum VelocityUnit {
VELOCITY_UNKNOWN = 0,
VELOCITY_MS,
VELOCITY_KMH,
VELOCITY_KTS,
VELOCITY_FPM
};
enum DistanceUnit {
DISTANCE_UNKNOWN = 0,
DISTANCE_M,
DISTANCE_FT
};
enum PressureUnit {
PRESSURE_UNKNOWN = 0,
PRESSURE_PA,
PRESSURE_HPA,
PRESSURE_INCHES_HG
};
class Units {
public:
Units();
static double convertSpeed(VelocityUnit from, VelocityUnit to, double value);
static double convertDistance(DistanceUnit from, DistanceUnit to, double value);
static double convertPressure(PressureUnit from, PressureUnit to, double value);
static QString unitName(VelocityUnit unit);
static QString unitName(DistanceUnit unit);
static QString unitName(PressureUnit unit);
static VelocityUnit velocityUnitForName(QString name);
static DistanceUnit distanceUnitForName(QString name);
static PressureUnit pressureUnitForName(QString name);
};
#endif // UNITS_H