www.pudn.com > GPSViewer.rar > GpsInfo.h


// GpsInfo.h: interface for the CGpsInfo class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_GPSINFO_H__FC62A824_F820_11D6_B2F9_008048D8517E__INCLUDED_) 
#define AFX_GPSINFO_H__FC62A824_F820_11D6_B2F9_008048D8517E__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
 
// define the message sent to update() of each view 
// 0 is reserved for generic update use 
#define	GPS_SYSTEM_INFO		1 
#define GPS_NMEA_INFO		2 
#define GPS_DEBUG_INPUT		3 
#define GPS_DEBUG_OUTPUT	4 
#define GPS_UNKNOWN_INPUT	5 
 
// for the use of infomask 
#define GPS_INFOMASK_POSITION_VALID		1 
#define GPS_INFOMASK_SATELLITE_VALID	2 
#define GPS_INFOMASK_DEBUG_VALID		4 
 
// NMEA type ID 
#define	GPS_NMEA_TYPE_GPGGA			0 
#define	GPS_NMEA_TYPE_GPGLL			1 
#define	GPS_NMEA_TYPE_GPGSA			2 
#define	GPS_NMEA_TYPE_GPGSV			3 
#define	GPS_NMEA_TYPE_GPRMC			4 
#define	GPS_NMEA_TYPE_OTHERS		6 
 
// Satellite Status 
#define SAT_STATUS_NOSIGNAL			0 
#define SAT_STATUS_RECEIVED			1 
#define SAT_STATUS_FIXED			2 
 
 
#define	STR_CRLF					"\r\n" 
#define GPS_TOTAL_CHANNEL_NUM		16 
 
struct GPSCHANNELINFO 
{ 
	int		iSatId; 
	int		iElevation; 
	int		iAzimuth; 
	int		iSNR; 
}; 
 
 
class CGpsInfo : public CObject   
{ 
public: 
	int NmeaTypeId(CString strNmeaId); 
	void ParseDebugInfo(CString strInfo); 
	void ParseNmeaInfo(CString strInfo); 
	int GetInfoType(); 
	void SetInfoLine(CString strInfo); 
	void SetOutputLine(CString strInfo); 
	CGpsInfo(); 
	virtual ~CGpsInfo(); 
 
	CString		m_strGpsInfo;		// the string input from serial port 
	CString		m_strGpsOutput;		// the string output as system message or debug string 
 
	double		m_dUtcTime; 
	int			m_dUtcDate; 
	double		m_dLatitude; 
	double		m_dLongitude; 
	double		m_dAltitude; 
	double		m_dGeoidSeparation; 
	double		m_dSpeedGnd; 
	double		m_dCourseGnd; 
	int			m_iNumSatUsed; 
	BOOL		m_bPositionFix; 
	GPSCHANNELINFO m_ChannelInfo[GPS_TOTAL_CHANNEL_NUM]; 
	long		m_iInfoMask; 
 
protected: 
	// privately used in GPGSV 
	int			m_iCountSatsGot; 
	int			m_iTotalMsgs; 
	BOOL		m_bGsvMsgStarted; 
 
	void GetGpsFields(CArray  &GpsFieldsArr, CString strInfo); 
}; 
 
#endif // !defined(AFX_GPSINFO_H__FC62A824_F820_11D6_B2F9_008048D8517E__INCLUDED_)