QC Control software

Dependencies:   mbed

Fork of dgps by Colin Stearns

Revision:
15:e3e03a9df89e
Parent:
14:6be57da62283
Child:
27:db73f8ac6c75
--- a/handle/dataLocation.h	Thu Apr 10 02:19:07 2014 +0000
+++ b/handle/dataLocation.h	Thu Apr 10 05:38:45 2014 +0000
@@ -1,26 +1,41 @@
 /**
   *  \brief Data location data holder
   **/
-
+#ifndef _DATA_LOCATION_H_
+#define _DATA_LOCATION_H_
 #define MAXNUMLOCS 64
 
+#include "usb.h"
+
 typedef struct DataLocS{
-    double lat,lon,alt;
+    double lat;
+    double lon;
+    double alt;
     double timestamp;
+    double heading;
+    double tilt;
 }DataLoc;
 
 // Storage of data location
 class DataLocation{
 private:
     // Current value of lat lon and alt
-    double lat,lon,alt;
-    double timestamp;
+   DataLoc loc;
 public:
     DataLocation(){}
-    DataLocation(double latA,double lonA,double altA,double timestampA=0):lat(latA),lon(lonA),alt(altA),timestamp(timestampA){}
-    double& getLat(){return lat;}
-    double& getLon(){return lon;}
-    double& getAlt(){return alt;}
+    DataLocation(double latA,double lonA,double altA,double timestampA=0){
+        loc.lat=latA;
+        loc.lon=lonA;
+        loc.alt=altA;
+        loc.timestamp=timestampA;
+    }
+    double& getLat(){return loc.lat;}
+    double& getLon(){return loc.lon;}
+    double& getAlt(){return loc.alt;}
+    double& getTime(){return loc.timestamp;}
+    double& getHeading(){return loc.heading;}
+    double& getTilt(){return loc.tilt;}
+    DataLoc& getLoc(){return loc;}
 };
 
 /// \brief Location holder type
@@ -54,23 +69,26 @@
     LocHolder():headLocs(0),headTarg(0),headBase(0),sizeLocs(0),sizeTarg(0),sizeBase(0){}
     
     /// \brief Get locations type
-    DataLocation* get(LHType type);
+    DataLocation* get(LHType type=LHType_locs);
     
     /// \brief Get Current value
-    DataLocation& getC(LHType type,int offset=0);
+    DataLocation& getC(LHType type=LHType_locs,int offset=0);
     
     /// \brief Get Index
-    unsigned int& getI(LHType type,LHIType indexType=LHIType_head);
+    unsigned int& getI(LHType type=LHType_locs,LHIType indexType=LHIType_head);
     
     /// \brief Fix an index that might be out of bounds;
     unsigned int getRealIndex(LHType type,int index,int offset=0,bool useSize=true);
     
     /// \brief Increment index
-    void inc(LHType type,int amount=1,bool abs=false);
+    void inc(LHType type=LHType_locs,int amount=1,bool abs=false);
     
     /// \brief Append a location to the end.
     void add(LHType type,DataLocation newLoc);
+
 };
-
-static LocHolder mainLocHolder;
-static LocHolder& Locs(){return mainLocHolder;}
\ No newline at end of file
+class DH{
+public:
+    static LocHolder& Locs();
+};
+#endif
\ No newline at end of file