Merge branch 'development/GPSroute'
[speedfreak] / Client / gpsdata.h
1 /*
2  * GPS data
3  *
4  * @author     Toni Jussila <toni.jussila@fudeco.com>
5  * @copyright  (c) 2010 Speed Freak team
6  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
7  */
8
9 #ifndef GPSDATA_H
10 #define GPSDATA_H
11
12 #include <QObject>
13 #include <maemo5location.h>
14 #include <QFile>
15 #include <QTextStream>
16 #include <QTimer>
17
18 class GPSData : public QObject
19 {
20     Q_OBJECT
21 public:
22     GPSData(Maemo5Location *maemo5location);
23     ~GPSData();
24     void startRouteRecording(QString time);
25     void stopRouteRecording(QString time);
26     int roundCounter; //testing, move private!!!
27     double *getGpsDataArray();
28     int getRoundCounter();
29
30 private:
31     Maemo5Location *location;
32     void resetAll();
33     void saveRoute();
34
35     int satellitesInUse; //Number of satellites in use.
36     int satellitesInView;//Number of satellites in view.
37     int signalStrength;  //Average signal strength of satellites which are in use.
38     double latitude;     //Latitude.
39     double longitude;    //Longitude.
40     double time;         //Timestamp of the update in seconds.
41     double ept;          //Time accuracy in seconds.
42     double eph;          //Horizontal position accuracy in cm.
43     double altitude;     //Fix altitude in meters.
44     double epv;          //Altitude accuracy in meters.
45     double track;        //Direction of motion in degrees(0-359).
46     double epd;          //Track accuracy in degrees.
47     double speed;        //Current speed in km/h.
48     double eps;          //Speed accuracy in km/h.
49     double climb;        //Current rate of climb in m/s.
50     double epc;          //Climb accuracy in m/s.
51     QString routeStartTime;
52     QString routeStopTime;
53     QString latitudeNow;
54     QString longitudeNow;
55     QString latitudePrevious;
56     QString longitudePrevious;
57
58     bool recordingStatus;
59     //int roundCounter;
60     double gpsDataArray[4];
61     QTimer *gpsTimer;
62     int gpsTimeMS;
63
64 private slots:
65     void agnss();
66     void awcp();
67     void locationUpdated();
68     void gpsConnected();
69     void gpsDisconnected();
70     void gpsError();
71     void gpsdRunning();
72     void gpsdStopped();
73     void gpsTimerTimeout();
74
75 };
76
77 #endif // GPSDATA_H