QC Control software

Dependencies:   mbed

Fork of dgps by Colin Stearns

Committer:
krobertson
Date:
Wed Apr 23 01:43:17 2014 +0000
Revision:
32:9cb7bc3fc9e0
Parent:
20:81d5655fecc2
Child:
36:53b69e471b5a
pushing so dylan can look

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dylanembed123 14:6be57da62283 1 #ifndef _HANDLE_GPS_H_
dylanembed123 14:6be57da62283 2 #define _HANDLE_GPS_H_
dylanembed123 7:c75d5e5e6bfc 3
dylanembed123 7:c75d5e5e6bfc 4 #include "adapt/usb.h"
dylanembed123 9:da906eeac51e 5 #include "adapt/gps.h"
dylanembed123 14:6be57da62283 6
dylanembed123 9:da906eeac51e 7 #include <string>
dylanembed123 9:da906eeac51e 8 #include <sstream>
dylanembed123 14:6be57da62283 9 #include "dataLocation.h"
dylanembed123 14:6be57da62283 10 #include <mbed.h>
dylanembed123 14:6be57da62283 11 #include "gps.h"
krobertson 20:81d5655fecc2 12 #include "packet.h"
dylanembed123 14:6be57da62283 13 #define MAXREADIN 256
dylanembed123 14:6be57da62283 14
krobertson 20:81d5655fecc2 15 typedef struct _Point{
krobertson 20:81d5655fecc2 16 double lat;
krobertson 20:81d5655fecc2 17 double lon;
krobertson 20:81d5655fecc2 18 } Point;
krobertson 20:81d5655fecc2 19
dylanembed123 7:c75d5e5e6bfc 20 class GPSHandle{
dylanembed123 7:c75d5e5e6bfc 21 private:
dylanembed123 14:6be57da62283 22 //GPS gps;
dylanembed123 7:c75d5e5e6bfc 23 bool initialized;
dylanembed123 7:c75d5e5e6bfc 24
dylanembed123 7:c75d5e5e6bfc 25 /// \brief Setup
dylanembed123 7:c75d5e5e6bfc 26 void setup();
dylanembed123 7:c75d5e5e6bfc 27 /// \brief Check if it is time to update
dylanembed123 7:c75d5e5e6bfc 28 bool check();
dylanembed123 7:c75d5e5e6bfc 29 public:
dylanembed123 7:c75d5e5e6bfc 30 /// \brief Constructor
dylanembed123 9:da906eeac51e 31 GPSHandle():initialized(false){}
dylanembed123 9:da906eeac51e 32
dylanembed123 9:da906eeac51e 33 void sendGpsCommand(std::string command);
stearnsc 8:28b866df62cf 34
krobertson 32:9cb7bc3fc9e0 35 void next_waypoint();
krobertson 32:9cb7bc3fc9e0 36
stearnsc 8:28b866df62cf 37 //handle incoming com from GPS hardware
stearnsc 8:28b866df62cf 38 void handleUpdate();
stearnsc 8:28b866df62cf 39
dylanembed123 7:c75d5e5e6bfc 40 /// \brief Run an instance of this
dylanembed123 7:c75d5e5e6bfc 41 void run();
krobertson 20:81d5655fecc2 42
krobertson 20:81d5655fecc2 43 /// \brief sends the current location
krobertson 20:81d5655fecc2 44 void sendLoc();
krobertson 20:81d5655fecc2 45
krobertson 20:81d5655fecc2 46 /// \brief checks if in image area
krobertson 20:81d5655fecc2 47 bool if_image_location();
krobertson 20:81d5655fecc2 48
krobertson 20:81d5655fecc2 49 /// \brief read in the waypoints
krobertson 20:81d5655fecc2 50 char readWaypoints();
krobertson 20:81d5655fecc2 51
krobertson 20:81d5655fecc2 52 static GPSHandle* hand;
krobertson 20:81d5655fecc2 53 static GPSHandle& getGPSHand(){
krobertson 20:81d5655fecc2 54 if(hand == NULL){
krobertson 20:81d5655fecc2 55 hand = new GPSHandle();
krobertson 20:81d5655fecc2 56 }
krobertson 20:81d5655fecc2 57 return *hand;
krobertson 20:81d5655fecc2 58 }
dylanembed123 7:c75d5e5e6bfc 59 };
dylanembed123 14:6be57da62283 60
dylanembed123 7:c75d5e5e6bfc 61 #endif