2 Copyright 2006 Johnathan Corgan.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2
6 as published by the Free Software Foundation.
8 This software is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with GNU Radio; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street,
16 Boston, MA 02110-1301, USA.
22 // Autoconf generated configure options
27 // Application level includes
28 #include "spherical.h"
33 // System level includes
34 #include <math.h> // For some reason, <cmath> doesn't include modf needed in gps.cpp
38 class GPSUpdate : public wxNotifyEvent
41 GPSUpdate(const wxEventType &event, GPRMC *gprmc);
42 virtual wxEvent *Clone() const { return new GPSUpdate(*this); }
46 extern const wxEventType wxEVT_GPS_UPDATE;
48 typedef void(wxEvtHandler::*GPSUpdateFunction)(GPSUpdate&);
50 #define EVT_GPS_UPDATE(fn) \
51 DECLARE_EVENT_TABLE_ENTRY( \
52 wxEVT_GPS_UPDATE, -1, -1, \
53 (wxObjectEventFunction)(wxEventFunction)(GPSUpdateFunction)&fn, \
60 static bool Checksum(char *sentence);
61 static char *Field(char *sentence, int num);
62 static double Coord(char *sentence, int num);
65 class GPRMC : public NMEA
68 GPRMC(char *sentence);
69 void AsString(char *buf);
83 class GPSBackground : public wxThread
86 GPSBackground(GPS *gps);
87 virtual ExitCode Entry();
88 bool IsRunning() { return m_running; }
103 GPS(wxEvtHandler *dest);
106 bool Start(wxString &port);
108 SerialPort *GetPort() { return m_port; }
109 void RxData(char *buffer);
112 void RxGPRMC(char *buffer);
114 GPSBackground *m_thread;
115 wxEvtHandler *m_dest;