?? nmea.h
字號:
#ifndef __NMEA_H__
#define __NMEA_H__
typedef enum tagNMEA_BOOLEAN
{
Unknown,
True,
False
} NMEA_BOOLEAN;
typedef enum tagNMEA_EASTWEST
{
EW_Unknown = 0,
East,
West
} NMEA_EASTWEST;
typedef enum tagNMEA_NORTHSOUTH
{
NS_Unknown = 0,
North,
South
} NMEA_NORTHSOUTH;
struct NMEA_TIME
{
WORD wHour;
WORD wMinute;
WORD wSecond;
};
struct NMEA_DATE
{
WORD wYear;
WORD wMonth;
WORD wDay;
};
struct NMEA_ANGLE
{
WORD Degrees;
WORD Minutes;
WORD Seconds;
WORD CentiSeconds;
};
struct NMEA_LATITUDE
{
NMEA_ANGLE Value;
NMEA_NORTHSOUTH Northing;
};
struct NMEA_LONGITUDE
{
NMEA_ANGLE Value;
NMEA_EASTWEST Easting;
};
class CNmeaSentence
{
public:
//constructors / Destructors
CNmeaSentence(const CString& sSentence) { m_Sentence = sSentence; };
//methods
NMEA_BOOLEAN Boolean(int nField) const;
double Double(int nField) const;
NMEA_EASTWEST EastOrWest(int nField) const;
CString Field(int nDesiredField) const;
int Integer(int nField) const;
NMEA_NORTHSOUTH NorthOrSouth(int nField) const;
NMEA_TIME Time(int nField) const;
NMEA_DATE Date(int nField) const;
NMEA_BOOLEAN IsChecksumBad(int nField) const;
NMEA_LONGITUDE Longitude(int nPositionFieldNumber, int nEastingFieldNumber) const;
NMEA_LATITUDE Latitude(int nPositionFieldNumber, int nNorthingFieldNumber) const;
NMEA_ANGLE Angle(int nField) const;
BYTE ComputeChecksum() const;
static DWORD NmeaAngleToHundrethsOfSeconds(const NMEA_ANGLE& angle);
static DWORD NmeaBearingToHundrethsOfDegrees(const double& value);
protected:
static DWORD HexValue(const CString& sHexString);
static inline int CNmeaSentence::HexDigitToInt(char c);
CString m_Sentence;
};
class CRMCResponse
{
public:
//constructors / Destructors
CRMCResponse();
~CRMCResponse();
//data variables
NMEA_TIME m_Time;
NMEA_DATE m_Date;
BOOL m_IsDataValid;
NMEA_LATITUDE m_Latitude;
NMEA_LONGITUDE m_Longitude;
double m_SpeedOverGroundKnots;
double m_Bearing;
//methods
void Empty(void);
BOOL Parse(const CNmeaSentence& sentence);
};
class CGGAResponse
{
public:
//constructors / Destructors
CGGAResponse();
~CGGAResponse();
//data variables
int m_GPSQuality;
int m_nSatellites;
double m_AntennaAltitudeMeters;
//methods
#ifdef _DEBUG
void Dump(CDumpContext& dc) const;
#endif
void Empty();
BOOL Parse(const CNmeaSentence& sentence);
};
#endif //__NMEA_H__
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -