]> git.mxchange.org Git - flightgear.git/blobdiff - utils/GPSsmooth/gps.hxx
Allow setting of NED velocities.
[flightgear.git] / utils / GPSsmooth / gps.hxx
index 6a6137ace2efd26cf41a931dfa9def2fca62f39a..2795c92cbf70c6068cfe4acc01078731d132dce1 100644 (file)
@@ -8,10 +8,10 @@
 #include <string>
 #include <vector>
 
-SG_USING_STD(cout);
-SG_USING_STD(endl);
-SG_USING_STD(string);
-SG_USING_STD(vector);
+using std::cout;
+using std::endl;
+using std::string;
+using std::vector;
 
 
 // encapsulate a gps integer time (fixme, assumes all times in a track
@@ -20,25 +20,25 @@ class GPSTime {
 
 public:
 
-    int seconds;
+    double seconds;
 
-    inline GPSTime( const int hh, const int mm, const int ss ) {
+    inline GPSTime( const int hh, const int mm, const double ss ) {
         seconds = hh*3600 + mm*60 + ss;
     }
-    inline GPSTime( const int gpstime ) {
-        int tmp = gpstime;
-        int hh = tmp / 10000;
+    inline GPSTime( const double gpstime ) {
+        double tmp = gpstime;
+        int hh = (int)(tmp / 10000);
         tmp -= hh * 10000;
-        int mm = tmp / 100;
+        int mm = (int)(tmp / 100);
         tmp -= mm * 100;
-        int ss = tmp;
+        double ss = tmp;
         seconds = hh*3600 + mm*60 + ss;
         // cout << gpstime << " = " << seconds << endl;
     }
     inline ~GPSTime() {}
 
-    inline int get_time() const { return seconds; }
-    inline int diff_sec( const GPSTime t ) const {
+    inline double get_time() const { return seconds; }
+    inline double diff_sec( const GPSTime t ) const {
         return seconds - t.seconds;        
     }
 };
@@ -72,7 +72,7 @@ public:
         course_true(0.0)
     { }
 
-    inline int get_time() const { return gps_time.get_time(); }
+    inline double get_time() const { return gps_time.get_time(); }
 };