QC Control software

Dependencies:   mbed

Fork of dgps by Colin Stearns

Committer:
dylanembed123
Date:
Mon May 05 13:20:35 2014 +0000
Revision:
66:5d43988d100c
Parent:
36:53b69e471b5a
Final Project;

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