Added feature: Show travelled distance in routesavedialog and routedialog.
[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 <QXmlStreamWriter>
17 #include <qdatetime.h>
18
19 class GPSData : public QObject
20 {
21     Q_OBJECT
22 public:
23     GPSData( Maemo5Location *maemo5location );
24     ~GPSData();
25     void startRouteRecording();
26     void stopRouteRecording();
27     int roundCounter; //testing, move private!!!
28
29     double getDistanceTraveled();
30
31 private:
32     Maemo5Location *location;
33     void resetAll();
34     QXmlStreamWriter xmlwriter;
35     void writeRouteXml(QIODevice *device, int round);
36
37     int satellitesInUse; //Number of satellites in use.
38     int satellitesInView;//Number of satellites in view.
39     int signalStrength;  //Average signal strength of satellites which are in use.
40     double latitude;     //Latitude.
41     double longitude;    //Longitude.
42     double time;         //Timestamp of the update in seconds.
43     double ept;          //Time accuracy in seconds.
44     double eph;          //Horizontal position accuracy in cm.
45     double altitude;     //Fix altitude in meters.
46     double epv;          //Altitude accuracy in meters.
47     double track;        //Direction of motion in degrees(0-359).
48     double epd;          //Track accuracy in degrees.
49     double speed;        //Current speed in km/h.
50     double eps;          //Speed accuracy in km/h.
51     double climb;        //Current rate of climb in m/s.
52     double epc;          //Climb accuracy in m/s.
53     double latitudePrevious;
54     double longitudePrevious;
55     double distance;
56     QString routeStartTime;
57     QString routeStopTime;
58     QString sLatitudeNow;
59     QString sLongitudeNow;
60     QString sLatitudePrevious;
61     QString sLongitudePrevious;
62     QDateTime *gpsDateTime;
63     bool recordingStatus;
64     //int roundCounter;
65
66 private slots:
67     void agnss();
68     void awcp();
69     void locationUpdated();
70     void gpsConnected();
71     void gpsDisconnected();
72     void gpsError();
73     void gpsdRunning();
74     void gpsdStopped();
75
76 };
77
78 #endif // GPSDATA_H