Route and Results buttons updated.
[speedfreak] / Client / gpsdata.h
index fd1d451..0327c45 100644 (file)
 #include <maemo5location.h>
 #include <QFile>
 #include <QTextStream>
+#include <QXmlStreamWriter>
+#include <qdatetime.h>
 
 class GPSData : public QObject
 {
     Q_OBJECT
 public:
-    GPSData(Maemo5Location *maemo5location);
+    GPSData( Maemo5Location *maemo5location );
     ~GPSData();
-    void startRouteRecording(QString time);
-    void stopRouteRecording(QString time);
+    void startRouteRecording();
+    void stopRouteRecording();
     int roundCounter; //testing, move private!!!
-    double *getGpsDataArray();
-    int getRoundCounter();
+
+    double getDistanceTraveled();
 
 private:
     Maemo5Location *location;
     void resetAll();
-    void saveRoute();
+    QXmlStreamWriter xmlwriter;
+    void writeRouteXml(QIODevice *device, int round);
 
     int satellitesInUse; //Number of satellites in use.
     int satellitesInView;//Number of satellites in view.
@@ -47,16 +50,18 @@ private:
     double eps;          //Speed accuracy in km/h.
     double climb;        //Current rate of climb in m/s.
     double epc;          //Climb accuracy in m/s.
+    double latitudePrevious;
+    double longitudePrevious;
+    double distance;
     QString routeStartTime;
     QString routeStopTime;
-    QString latitudeNow;
-    QString longitudeNow;
-    QString latitudePrevious;
-    QString longitudePrevious;
-
+    QString sLatitudeNow;
+    QString sLongitudeNow;
+    QString sLatitudePrevious;
+    QString sLongitudePrevious;
+    QDateTime *gpsDateTime;
     bool recordingStatus;
     //int roundCounter;
-    double gpsDataArray[100][4];
 
 private slots:
     void agnss();