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