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

📄 testserialport2dlg.h

📁 串口开发的另一种方式.rar
💻 H
字号:
// TestSerialPort2Dlg.h : header file
//
//{{AFX_INCLUDES()
#include "mdctext.h"
//}}AFX_INCLUDES

#if !defined(AFX_TESTSERIALPORT2DLG_H__E595C055_B1D0_4809_8CC8_0971D3B95545__INCLUDED_)
#define AFX_TESTSERIALPORT2DLG_H__E595C055_B1D0_4809_8CC8_0971D3B95545__INCLUDED_

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

#include "ModemStatusDlg.h"
#include "FileTransferDlg.h"

class CSuperSerialPort;



//////////////////////////////////////////////////////////////////////////
// USER MESSAGE
#define  WM_UM_RECEIVE_CHAR WM_USER+1


/////////////////////////////////////////////////////////////////////////////
// CTestSerialPort2Dlg dialog

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

// Dialog Data
	//{{AFX_DATA(CTestSerialPort2Dlg)
	enum { IDD = IDD_TESTSERIALPORT2_DIALOG };
	CButton	m_btnReceive;
	CButton	m_btnClose;
	CButton	m_btnOpen;
	CString	m_comName;
	UINT	m_uComRate;
	UINT	m_uComParity;
	BYTE	m_uComDataBits;
	BOOL	m_bKeepSend;
	BOOL	m_bKeepSave;
	BOOL	m_bUseCal;
	UINT	m_uKeepSendTime;
	UINT	m_uKeepSaveTime;
	float	m_fComStopBits;
	CString	m_strSend;
	CString	m_receiveBytes;
	CString	m_sendBytes;
	CString	m_transferSpeed;
	CMdcText	m_mdcReceive;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;
	CSuperSerialPort* m_pSSP;
	CString m_storeText;

    typedef struct tagCONTROL_EM
	{
		// 显示方式选择
		BOOL bShowAsHex;
		// 定时发送
		BOOL bKeepSend;
		DWORD dwKeepSendTime;
		// 定时保存
		BOOL bKeepSave;
		DWORD dwKeepSaveTime;
		// 启动统计
		BOOL bUseCal;
		
		tagCONTROL_EM()
		{
			bShowAsHex = false;
			bKeepSend  = false;
			dwKeepSendTime = 0;
			bKeepSave  = false;
			dwKeepSaveTime = 0;
			bUseCal    = false;
		}
    }CONTROLEM, * PCONTROLEM;

	CONTROLEM m_ctrlEm;


	enum emTIMER_TYPE 
	{
		emTIMER_SEND = 1, 
		emTIMER_SAVE = 2,
		emTIMER_USE_CAL = 3,
		emTIMER_TRANSFER_CAL = 4
	};

	// 当前路径
	CString m_curPath;
	UINT    m_preRecByte;

	// 对话框集合
	CModemStatusDlg* m_pModemStatusDlg;

	// Generated message map functions
	//{{AFX_MSG(CTestSerialPort2Dlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonOpen();
	afx_msg void OnButtonClose();
	afx_msg void OnButtonReceive();
	afx_msg void OnButtonSend();
	afx_msg void OnClose();
	afx_msg void OnRadioHex();
	afx_msg void OnRadioText();
	afx_msg void OnCheckKeepSend();
	afx_msg void OnCheckKeepSave();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnCheckUseCal();
	afx_msg void OnChangeEditKeepTime();
	afx_msg void OnChangeEditSaveTime();
	afx_msg void OnButtonModemState();
	afx_msg void OnOK();
	afx_msg void OnButtonClearReceive();
	afx_msg void OnButtonFileTransfer();
	afx_msg void OnButtonFileReceive();
	afx_msg void OnButtonClearSend();
	afx_msg void OnToolSendfile();
	afx_msg void OnToolReceivefile();
	afx_msg void OnToolModemcheck();
	afx_msg void OnHelpVersion();
	//}}AFX_MSG
	afx_msg void OnReceiveChar(WPARAM pPackage, LPARAM lParam);
	DECLARE_MESSAGE_MAP()

public:

	// 
	BOOL Init();

	//
	void ShowErrorInfo();

	//
	void SaveToLog();
};

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

#endif // !defined(AFX_TESTSERIALPORT2DLG_H__E595C055_B1D0_4809_8CC8_0971D3B95545__INCLUDED_)

⌨️ 快捷键说明

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