igc.h
changeset 23 8396f7857013
parent 14 3d8176df0461
child 25 1549cae72d31
--- a/igc.h	Fri Jan 27 17:16:26 2012 +0100
+++ b/igc.h	Fri Jan 27 17:21:51 2012 +0100
@@ -5,18 +5,24 @@
 
 class Fix {
   public: 
+    enum Source { baro, gps };
+
+    Fix() { }
     Fix(const QString&);
+
+    int altitude(Source s = gps) const { return alt_[s]; }
+    QTime time() const { return time_; }
+    bool is3d() const { return is3d_; }
+    QPair<QTime, int> altitudeFix(Source s) const { return qMakePair(time_, alt_[s]); }
+
+    QString longitude() const { return gps_.lon; }
+    QString latitude() const { return gps_.lat; };
+
   private:
     QTime time_;
-    bool fix3d_;
-    struct {
-	QString lon;
-	QString lat;
-    } gps_;
-    struct {
-	int baro;
-	int gps;
-    } alt_;
+    bool is3d_;
+    struct { QString lon, lat; } gps_;
+    int alt_[2];
 };
 
 typedef QList<Fix> Fixes;
@@ -28,10 +34,20 @@
     QString pilot() const { return pilot_; }
     QString glider() const { return glider_; }
     QDate date() const { return date_; }
+    
+    Fixes fixes() const { return fixes_; }
+    Fixes fixes() { return fixes_; }
+
+    Fix start() const { return start_; }
+    Fix landing() const { return landing_; }
+
   private:
     QString device_, pilot_, glider_;
     QDate date_;
     Fixes fixes_;
 
+    Fix start_;
+    Fix landing_;
+
 };
 #endif