QC Control software

Dependencies:   mbed

Fork of dgps by Colin Stearns

handle/handleGPS.h

Committer:
dylanembed123
Date:
2014-05-05
Revision:
66:5d43988d100c
Parent:
36:53b69e471b5a

File content as of revision 66:5d43988d100c:

#ifndef _HANDLE_GPS_H_
#define _HANDLE_GPS_H_

#include "adapt/usb.h"
#include "adapt/gps.h"

#include <mbed.h>
#include <string>
#include <sstream>

#include "packet.h"
#include "dataLocation.h"
#include "gps.h"

#define MAXREADIN 256

typedef struct _Point{
    double lat;
    double lon;
} Point;

class GPSHandle{
private:
    //GPS gps;
    bool initialized;
    
    /// \brief Setup
    void setup();
    /// \brief Check if it is time to update
    bool check();
public:
    /// \brief Constructor
    GPSHandle():initialized(false){}
    
    void sendGpsCommand(std::string command);
    
    void next_waypoint();
    
    //handle incoming com from GPS hardware
    void handleUpdate();
    
    /// \brief Run an instance of this
    void run();
    
    /// \brief sends the current location
    void sendLoc();
    
    /// \brief checks if in image area
    bool if_image_location();
    
    /// \brief read in the waypoints
    char readWaypoints();
    
    static GPSHandle* hand;
    static GPSHandle& getGPSHand(){
        if(hand == NULL){
            hand = new GPSHandle();
        }
        return *hand;
    }
};

#endif