⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gpsrecvdlg.h

📁 该程序用MFC实现串口通信
💻 H
字号:
// GpsRecvDlg.h : header file
//

#if !defined(AFX_GPSRECVDLG_H__98779DEB_B7A7_45A4_84F6_2741349354AE__INCLUDED_)
#define AFX_GPSRECVDLG_H__98779DEB_B7A7_45A4_84F6_2741349354AE__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "GpsBuf.h"
/////////////////////////////////////////////////////////////////////////////
// CGpsRecvDlg dialog
#define WM_RECVGPSDATA    (WM_USER + 100)

struct GPSDATA
{
	SYSTEMTIME time;
	char    status;
	double  latitude;
	char    lat_hemi;
	double  longitude;
	char    lon_hemi;
	double  speed;
	double  course;
	double  mag_degree;
	char    direction;
};

class CGpsRecvDlg : public CDialog
{
// Construction
public:
	CGpsRecvDlg(CWnd* pParent = NULL);	// standard constructor

	HANDLE m_hPort;            //串口句柄
	CWinThread *m_pCommThread; //串口接收线程
	BOOL m_bExitThread;        //是否结束线程

	int m_nPort;               //串口序号
	int m_nBaud;               //波特率
	int m_nParity;             //校验位
	int m_nStopBits;           //停止位
	int m_nDataBits;           //数据位

	CGpsBuf m_GpsBuf;          //GPS数据缓冲区
	struct GPSDATA  data;      //解释后的GPS数据

	void AddDataString(LPCTSTR string);
	int DealGpsData(BYTE *buf, DWORD len);

// Dialog Data
	//{{AFX_DATA(CGpsRecvDlg)
	enum { IDD = IDD_GPSRECV_DIALOG };
	CEdit	m_Edit;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGpsRecvDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CGpsRecvDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnPortSetting();
	afx_msg void OnOpenPort();
	afx_msg void OnClosePort();
	virtual void OnOK();
	afx_msg void OnRecvGpsData(WPARAM wp, LPARAM lp);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GPSRECVDLG_H__98779DEB_B7A7_45A4_84F6_2741349354AE__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -