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

📄 serialsunview.h

📁 多文档界面设计配置文件读写串口操作串口封装类
💻 H
字号:
// SerialSunView.h : interface of the CSerialSunView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_SERIALSUNVIEW_H__4D4E4682_0070_464F_BC8A_C744E533263D__INCLUDED_)
#define AFX_SERIALSUNVIEW_H__4D4E4682_0070_464F_BC8A_C744E533263D__INCLUDED_

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

#include "SerialPort.h"
#include "StringChang.h"
#include "afxcmn.h"
#include "Config.h"
#include "afxwin.h"

class CSerialSunView : public CFormView
{
protected: // create from serialization only
	CSerialSunView();
	DECLARE_DYNCREATE(CSerialSunView)

public:
	//{{AFX_DATA(CSerialSunView)
	enum { IDD = IDD_SERIALSUN_FORM };
	CComboBox	s_RtuId;
	//}}AFX_DATA

// Attributes
public:
	CSerialSunDoc* GetDocument();
		

	int ports;
	CSerialPort nControl[8];  //初始化的串口
	CConfig config;           //配置文件对象,得到配置参数
	CWinThread* m_pThread;    //线程指针
	BOOL IsStar;              //串口初始化标志,如果已经初始化
	CString ControlRTU;       //需要单独控制的RTU

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CSerialSunView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	void GetAllId();
	void InitCOM(int i);
	LRESULT OnGetStr(WPARAM wParam, LPARAM lParam);
	virtual ~CSerialSunView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CSerialSunView)
	afx_msg void OnDestroy();
	afx_msg void OnSetcom();
	afx_msg void OnReadcom();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in SerialSunView.cpp
inline CSerialSunDoc* CSerialSunView::GetDocument()
   { return (CSerialSunDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_SERIALSUNVIEW_H__4D4E4682_0070_464F_BC8A_C744E533263D__INCLUDED_)

⌨️ 快捷键说明

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