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

📄 m8dlg.h

📁 通过串口升级mega8的自编程例子原码
💻 H
字号:
// M8Dlg.h : header file
//

#if !defined(AFX_M8DLG_H__326127CE_FF58_49B5_8E87_0B68C34270C5__INCLUDED_)
#define AFX_M8DLG_H__326127CE_FF58_49B5_8E87_0B68C34270C5__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CM8Dlg dialog

#include "SerialPort.h"
#include "SendData.h"
#include "ReceiveData.h"
#include "ProgressCtrlX.h"

class CM8Dlg : public CDialog
{
typedef struct //端口
{
	UINT		nPort;		//端口号
	UINT		nBaud;		//波特率
	char		nParity;	//类型
	UINT		nDatabits;	//数据位
	UINT		nStopsbits;	//停止位
} PortData;
// Construction
public:
	CString ByteToHex(BYTE n_byte);
	CM8Dlg(CWnd* pParent = NULL);	// standard constructor

	BOOL ProcessReplace(CString n_FileName);

	// Dialog Data
	//{{AFX_DATA(CM8Dlg)
	enum { IDD = IDD_M8_DIALOG };
	CEdit	m_ReceveEdit;
	CEdit	m_SendEdit;
	CProgressCtrlX	m_Progress;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	CStringArray m_PortArray;
	CSerialPort nSendPort;
	PortData m_SendPortData;

	CByteArray			m_Receive;//接收应答报文
	int					m_ReceiveCount;//接收字节计数器
	int					m_ReceiveStartCount;//接收到报文头计数器
	BOOL				m_ReceiveStart, //接收到报文头标志
						m_ReceiveFlag; //开始接收标志
	BOOL		        m_tt;

	CSendData			m_SendData;
	CReceiveData		m_ReceiveData;

	BYTE		m_Type_temp;			//临时命令类型			

	clock_t start, finish;

	int m_Type_B; //编程命令标志;

	BYTE HexToByte(CString n_ByteStr);

	// Generated message map functions
	//{{AFX_MSG(CM8Dlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnOpenFile();
	afx_msg void OnPortSet();
	afx_msg void OnSendAuto();
	afx_msg LONG OnCommunication(WPARAM ch, LPARAM port);
	afx_msg void OnTimer(UINT nIDEvent);
	virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_M8DLG_H__326127CE_FF58_49B5_8E87_0B68C34270C5__INCLUDED_)

⌨️ 快捷键说明

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