forked from NOVACProject/MobileDOAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGpsData.h
74 lines (53 loc) · 1.92 KB
/
GpsData.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#include <string>
// --------------- This file collects data structures and routines related to GPS reading ---------------
enum GpsFixQuality
{
INVALID = 0,
GPS_FIXED = 1,
DGPS_FIXED = 2,
PPS_FIX = 3,
RTK_FIX = 4,
FRTK_FIX = 5,
MANUAL = 7,
SIMULATED = 8
};
/** Common structure for stroring data read out from the GPS */
struct gpsData {
gpsData();
gpsData(const gpsData& other);
gpsData& operator=(gpsData other);
friend void swap(gpsData& first, gpsData& second);
/* Latitude in (decimal) degrees. Positive values corresponds to northern hemisphere. */
double latitude = 0.0;
/* Longitude in (decimal) degrees. Positive values corresponds to eastern hemisphere. */
double longitude = 0.0;
/* Altitude above sea level in meters. */
double altitude = 0.0;
/* The time stamp from the Gps (in the format hhmmss) */
long time = 0;
/* Number of satellites seen by the receiver (not all of these needs to be used) */
long nSatellitesSeen = 0;
/* Number of satellites tracked by the receiver */
long nSatellitesTracked = 0;
/* Date (in the format ddmmyy) */
int date = 0;
/* GPS status. A=active, V=void, NA=not available (i.e. not connected) */
std::string status = "NA";
/* Speed over ground in m/s */
double speed;
/* Track angle in degrees */
double course;
/* The quality of the GPS-fix */
GpsFixQuality fixQuality = GpsFixQuality::INVALID;
};
/** @return true if the provided gpsData contains a valid GPS readout
This checks that any satelite was seen and that the lat/long aren't zero. */
bool IsValidGpsData(const gpsData& data);
/* Tries to parse the text read from the GPS.
The parsed information will be filled into the provided 'data.
@return true if the parsing suceeded, otherwise false. */
bool Parse(char* gpsString, gpsData& data);
/* Convert an angle from the raw format of the GPS data DDMM.MMMMM
into the format DD.DDDDDDD */
double ConvertToDecimalDegrees(double degreesAndMinutes);