Improve FIT locations support
[GPXSee.git] / src / data / nmeaparser.h
blobd725be3667e1ad8ee4493ce8d6223e35a847f7f5
1 #ifndef NMEAPARSER_H
2 #define NMEAPARSER_H
4 #include <QDate>
5 #include "parser.h"
8 class NMEAParser : public Parser
10 public:
11 NMEAParser() : _errorLine(0) {}
13 bool parse(QFile *file, QList<TrackData> &tracks, QList<RouteData> &routes,
14 QList<Area> &polygons, QVector<Waypoint> &waypoints);
15 QString errorString() const {return _errorString;}
16 int errorLine() const {return _errorLine;}
18 private:
19 struct CTX {
20 CTX() : GGA(false) {}
22 QDate date;
23 QTime time;
24 bool GGA;
27 bool readEW(const char *data, int len, qreal &lon);
28 bool readLon(const char *data, int len, qreal &lon);
29 bool readNS(const char *data, int len, qreal &lat);
30 bool readLat(const char *data, int len, qreal &lat);
31 bool readDate(const char *data, int len, QDate &date);
32 bool readTime(const char *data, int len, QTime &time);
33 bool readAltitude(const char *data, int len, qreal &ele);
34 bool readGeoidHeight(const char *data, int len, qreal &gh);
36 bool readRMC(CTX &ctx, const char *line, int len, SegmentData &segment);
37 bool readGGA(CTX &ctx, const char *line, int len, SegmentData &segment);
38 bool readWPL(const char *line, int len, QVector<Waypoint> &waypoints);
39 bool readZDA(CTX &ctx, const char *line, int len);
41 int _errorLine;
42 QString _errorString;
45 #endif // NMEAPARSER_H