提交 | 用户 | age
|
4b03ae
|
1 |
|
Q |
2 |
// MultiTerminal2View.h: CMultiTerminal2View 类的接口
|
|
3 |
//
|
|
4 |
|
|
5 |
#pragma once
|
|
6 |
|
|
7 |
|
|
8 |
class CMultiTerminal2View : public CScrollView
|
|
9 |
{
|
|
10 |
protected: // 仅从序列化创建
|
|
11 |
CMultiTerminal2View() noexcept;
|
|
12 |
DECLARE_DYNCREATE(CMultiTerminal2View)
|
|
13 |
|
|
14 |
// 特性
|
|
15 |
public:
|
|
16 |
CMultiTerminal2Doc* GetDocument() const;
|
|
17 |
struct stCell
|
|
18 |
{
|
|
19 |
int nType;
|
|
20 |
int bFocused = 0;
|
|
21 |
int bSelected = 0;
|
|
22 |
int bModified = 0;
|
|
23 |
CString sCoilName;
|
|
24 |
};
|
|
25 |
stCell Cells[25][16] = { 1 };
|
|
26 |
// 操作
|
|
27 |
public:
|
|
28 |
bool m_bOnline = false;
|
|
29 |
bool m_bPlcRunning = false;
|
|
30 |
bool m_bMonitoring = false;
|
|
31 |
|
|
32 |
bool m_bShowComments = true;
|
|
33 |
|
|
34 |
int m_LeftMargin = 24;
|
|
35 |
int m_Cells = 16;
|
|
36 |
int m_CellWidth = 54;
|
|
37 |
int m_CellHeight = 24;
|
|
38 |
int m_CommentHeight = 34;
|
|
39 |
|
|
40 |
int m_LinePosY = 20;
|
|
41 |
|
|
42 |
int m_FocusRow;
|
|
43 |
int m_FocusCol;
|
|
44 |
|
|
45 |
void DrawCell(CDC* pDC, int nRow, int nCol);
|
|
46 |
|
|
47 |
CStatusBar * m_pStatusBar;
|
|
48 |
|
|
49 |
// 重写
|
|
50 |
public:
|
|
51 |
virtual void OnDraw(CDC* pDC); // 重写以绘制该视图
|
|
52 |
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
|
53 |
protected:
|
|
54 |
virtual void OnInitialUpdate(); // 构造后第一次调用
|
|
55 |
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
|
|
56 |
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
|
|
57 |
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
|
|
58 |
|
|
59 |
// 实现
|
|
60 |
public:
|
|
61 |
virtual ~CMultiTerminal2View();
|
|
62 |
#ifdef _DEBUG
|
|
63 |
virtual void AssertValid() const;
|
|
64 |
virtual void Dump(CDumpContext& dc) const;
|
|
65 |
|
|
66 |
#endif
|
|
67 |
|
|
68 |
protected:
|
|
69 |
|
|
70 |
// 生成的消息映射函数
|
|
71 |
protected:
|
|
72 |
DECLARE_MESSAGE_MAP()
|
|
73 |
public:
|
|
74 |
afx_msg void OnUploadFromPlc();
|
|
75 |
afx_msg void OnOnline();
|
|
76 |
afx_msg void OnOffline();
|
|
77 |
afx_msg void OnMonitor();
|
|
78 |
afx_msg void OnPlcRun();
|
|
79 |
afx_msg void OnUpdateOnline(CCmdUI *pCmdUI);
|
|
80 |
afx_msg void OnUpdateOffline(CCmdUI *pCmdUI);
|
|
81 |
afx_msg void OnUpdateMonitor(CCmdUI *pCmdUI);
|
|
82 |
afx_msg void OnUpdatePlcRun(CCmdUI *pCmdUI);
|
|
83 |
afx_msg void OnUpdateDownloadToPlc(CCmdUI *pCmdUI);
|
|
84 |
afx_msg void OnProgConvert();
|
|
85 |
afx_msg void OnUpdateProgConvert(CCmdUI *pCmdUI);
|
|
86 |
afx_msg void OnDownloadToPlc();
|
|
87 |
afx_msg void OnComunicationSet();
|
|
88 |
afx_msg void OnPlcSysregSet();
|
|
89 |
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
|
90 |
afx_msg void OnRectSelect();
|
|
91 |
afx_msg void OnUpdateRectSelect(CCmdUI *pCmdUI);
|
|
92 |
afx_msg void OnTextFirst();
|
|
93 |
afx_msg void OnUpdateTextFirst(CCmdUI *pCmdUI);
|
|
94 |
afx_msg void OnInsertBlankLine();
|
|
95 |
afx_msg void OnUpdateInsertBlankLine(CCmdUI *pCmdUI);
|
|
96 |
afx_msg void OnDeleteBlankLine();
|
|
97 |
afx_msg void OnUpdateDeleteBlankLine(CCmdUI *pCmdUI);
|
|
98 |
afx_msg void OnDisplayComments();
|
|
99 |
afx_msg void OnUpdateDisplayComments(CCmdUI *pCmdUI);
|
|
100 |
virtual void OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/);
|
|
101 |
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
|
102 |
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
|
103 |
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
|
104 |
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
|
|
105 |
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
|
|
106 |
afx_msg void OnIndicatorMonitorStatus();
|
|
107 |
afx_msg void OnUpdateIndicatorMonitorStatus(CCmdUI *pCmdUI);
|
|
108 |
};
|
|
109 |
|
|
110 |
#ifndef _DEBUG // MultiTerminal2View.cpp 中的调试版本
|
|
111 |
inline CMultiTerminal2Doc* CMultiTerminal2View::GetDocument() const
|
|
112 |
{ return reinterpret_cast<CMultiTerminal2Doc*>(m_pDocument); }
|
|
113 |
#endif
|
|
114 |
|