40e49fd338d4f3a14038293d67d55f7f6508762b
[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     int getRoundCounter();
28
29 private:
30     Maemo5Location *location;
31     void resetAll();
32     void saveRoute();
33
34     int satellitesInUse; //Number of satellites in use.
35     int satellitesInView;//Number of satellites in view.
36     int signalStrength;  //Average signal strength of satellites which are in use.
37     double latitude;     //Latitude.
38     double longitude;    //Longitude.
39     double time;         //Timestamp of the update in seconds.
40     double ept;          //Time accuracy in seconds.
41     double eph;          //Horizontal position accuracy in cm.
42     double altitude;     //Fix altitude in meters.
43     double epv;          //Altitude accuracy in meters.
44     double track;        //Direction of motion in degrees(0-359).
45     double epd;          //Track accuracy in degrees.
46     double speed;        //Current speed in km/h.
47     double eps;          //Speed accuracy in km/h.
48     double climb;        //Current rate of climb in m/s.
49     double epc;          //Climb accuracy in m/s.
50     QString routeStartTime;
51     QString routeStopTime;
52     QString latitudeNow;
53     QString longitudeNow;
54     QString latitudePrevious;
55     QString longitudePrevious;
56
57     bool recordingStatus;
58     //int roundCounter;
59     double gpsDataArray[4];
60     QTimer *gpsTimer;
61     int gpsTimeMS;
62
63 private slots:
64     void agnss();
65     void awcp();
66     void locationUpdated();
67     void gpsConnected();
68     void gpsDisconnected();
69     void gpsError();
70     void gpsdRunning();
71     void gpsdStopped();
72     void gpsTimerTimeout();
73
74 };
75
76 #endif // GPSDATA_H