forked from xin/TowerOptoSifAndSpectral
机载第一版
This commit is contained in:
36
othersoft/GPSLog/src/GPSDataParser.h
Normal file
36
othersoft/GPSLog/src/GPSDataParser.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef GPSDATAPARSER_H
|
||||
#define GPSDATAPARSER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QByteArray>
|
||||
|
||||
class GPSDataParser : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GPSDataParser(QObject *parent = nullptr);
|
||||
|
||||
void parse(const QByteArray &nmeaData);
|
||||
|
||||
signals:
|
||||
void dataParsed(const QString &gpsTime, double latitude, double longitude, double altitude);
|
||||
|
||||
|
||||
private:
|
||||
double convertToDecimalDegrees(double degreesMinutes, char direction);
|
||||
|
||||
private:
|
||||
QString m_utcTime;
|
||||
double m_latitude;
|
||||
double m_longitude;
|
||||
double m_altitude;
|
||||
|
||||
public:
|
||||
inline QString getUTCTime() const { return m_utcTime; }
|
||||
inline double getLatitude() const { return m_latitude; }
|
||||
inline double getLongitude() const { return m_longitude; }
|
||||
inline double getAltitude() const { return m_altitude; }
|
||||
};
|
||||
|
||||
#endif // GPSDATAPARSER_H
|
||||
Reference in New Issue
Block a user