Gps.h
上传用户:pumpssky
上传日期:2007-12-07
资源大小:110k
文件大小:2k
- // Gps.h: interface for the CGps class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_GPS_H__F4111537_E580_49AA_8949_BD954C92D7BE__INCLUDED_)
- #define AFX_GPS_H__F4111537_E580_49AA_8949_BD954C92D7BE__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "define.h"
- #include "Serial.h"
- #include "Log.h"
- class CGmarkView;
- class CGps
- {
- public:
- void SetViewWnd(CWnd * pWnd);
- CGmarkView *m_GmarkView;
- CLog * m_pLog;
- BOOL m_bGpsMsgBusy;
- BOOL IsChecksumCorrect( char * message );
- void SetOrigPosition( double orig_lon, double orig_lat );
- void WriteRTCM( char * rtcm);
- void ClearGpsData();
- HWND GetViewHandle();
- int Connect();
- void SetViewHandle(HWND);
- int Close();
- int Initialize(int baudrate);
- int SendCmd(LPSTR cmd);
- struct COMM_DATA * m_tCommData[GPS_MAX_RECNUM];
- int m_CurrIndex;
- struct GPS_DATA m_tGpsData;
- CSerial m_portA;
- CSerial m_portB;
- void CompleteMsg(unsigned char *buf, int nBytes);
- void CreateGPSData();
- void OnReceived(unsigned char *buf, int nBytes);
- CGps();
- virtual ~CGps();
- private:
- BOOL BinCheckSum(char *buf, int len, int BinType = 0);
- void ParseCRT(char *Message);
- void ParseGSA(char *Message);
- void ParseGLL(char *Message);
- double m_orig_lat;
- double m_orig_lon;
- int GetCompleteMsg(LPSTR OrgMsg, int nOrgLen, LPSTR CompMsg, int & nCompLen);
- HWND m_hGmarkView;
- double DegToVal(char * deg);
- void ParseGGA(char * Message);
- void ParsePBN(char * Message);
- void ParseMCA(char * Message);
- void ParseSNV(char * Message);
- int IndexDecrease(int index);
- int IndexIncrease(int index);
- void GetToken(LPSTR str, int n, LPSTR token);
- void AddChecksum(LPSTR cmd, LPSTR chksum);
- };
- #endif // !defined(AFX_GPS_H__F4111537_E580_49AA_8949_BD954C92D7BE__INCLUDED_)