提交 | 用户 | age
|
418cb3
|
1 |
|
Q |
2 |
#pragma once
|
|
3 |
|
|
4 |
#include "../MyLib/StaticEx.h"
|
|
5 |
// CMTerm1CommDevView 窗体视图
|
|
6 |
class CMTerm1CommDevView : public CFormView
|
|
7 |
{
|
|
8 |
DECLARE_DYNCREATE(CMTerm1CommDevView)
|
|
9 |
// 构造
|
|
10 |
public:
|
|
11 |
protected:
|
|
12 |
CMTerm1CommDevView(); // 动态创建所使用的受保护的构造函数
|
|
13 |
virtual ~CMTerm1CommDevView();
|
|
14 |
|
|
15 |
#ifdef AFX_DESIGN_TIME
|
|
16 |
enum { IDD = IDD_MTerm1CommDevView2 };
|
|
17 |
#endif
|
|
18 |
|
|
19 |
#ifdef _DEBUG
|
|
20 |
virtual void AssertValid() const;
|
|
21 |
CMTerm1Doc* CMTerm1CommDevView::GetDocument() const
|
|
22 |
{
|
|
23 |
return reinterpret_cast<CMTerm1Doc*>(m_pDocument);
|
|
24 |
}
|
|
25 |
|
|
26 |
#ifndef _WIN32_WCE
|
|
27 |
virtual void Dump(CDumpContext& dc) const;
|
|
28 |
#endif
|
|
29 |
#endif
|
|
30 |
|
|
31 |
protected:
|
|
32 |
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
|
33 |
DECLARE_MESSAGE_MAP()
|
|
34 |
public:
|
|
35 |
CMFCStatusBar * m_pStatusBar;
|
|
36 |
enum StatusBarIndicators {
|
|
37 |
idxMachineType = 0,
|
|
38 |
idxProgPos = 1,
|
|
39 |
idxOnline = 2,
|
|
40 |
idxRunning = 3,
|
|
41 |
idxMonitor = 4,
|
|
42 |
idxAddress = 5,
|
|
43 |
idxInfoDisp = 6,
|
|
44 |
};
|
|
45 |
COLORREF OnlineColor = RGB(0, 255, 255);
|
|
46 |
COLORREF ProgColor = RGB(0, 255, 0);
|
|
47 |
COLORREF RunningColor = RGB(0, 255, 0);
|
|
48 |
COLORREF MonitorColor = RGB(0, 255, 255);
|
|
49 |
COLORREF AddressColor = RGB(0, 255, 255);
|
|
50 |
|
|
51 |
virtual void OnInitialUpdate();
|
|
52 |
|
|
53 |
// CStatusBar m_wndStatusBar;
|
|
54 |
// CToolBar m_wndToolBar;
|
|
55 |
// CImageList m_ColorTreeImages;
|
|
56 |
// CTreeCtrl m_treectrl1;
|
|
57 |
typedef struct tagWLStat
|
|
58 |
{
|
|
59 |
uint32_t Stat; //状态
|
|
60 |
uint32_t curStat; //当前状态
|
|
61 |
uint32_t sentCount; //发送计数
|
|
62 |
uint32_t recvCount; //接收计数
|
|
63 |
uint32_t lastSendtime; //上次发送时间
|
|
64 |
uint32_t lastSenttime; //上次发送出时间
|
|
65 |
uint32_t lastRecvtime; //上次启动接收时间
|
|
66 |
uint32_t lastRecvdtime; //上次接收时间
|
|
67 |
uint32_t lastActTime; //上次动作时间
|
|
68 |
uint32_t lastAckTime; //上次应答时间
|
|
69 |
uint32_t latancy; //延迟
|
|
70 |
uint32_t cycleTime; //循环时间
|
|
71 |
uint32_t LostPackets; //丢包计数
|
|
72 |
uint32_t CtnLstPkts; //连续丢包计数
|
|
73 |
uint32_t MaxCtnLstPkts; //最大连续丢包计数
|
|
74 |
uint32_t TXErr; //发送错误计数
|
|
75 |
uint32_t RXErr; //接收错误计数
|
|
76 |
uint32_t CRCErr; //CRC错误计数
|
|
77 |
int8_t RSSI; //信号强度
|
|
78 |
int8_t SNR; //信噪比
|
|
79 |
int8_t tRSSI; //对方信号强度
|
|
80 |
int8_t tSNR; //对方信噪比
|
|
81 |
}stWLRunStat, *pstWLRunStat;
|
|
82 |
|
|
83 |
afx_msg void OnClose();
|
|
84 |
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
85 |
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
|
86 |
afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
|
|
87 |
void FindComPort();
|
|
88 |
|
|
89 |
int BInited;
|
|
90 |
int m_bResourceOpened;
|
|
91 |
int m_bPause;
|
|
92 |
|
|
93 |
CString sComSelStr;
|
|
94 |
CString sBaudSelStr;
|
|
95 |
DWORD dComNum;
|
|
96 |
volatile int MyThreadProc1ToRun = 0;
|
|
97 |
volatile int MyThreadProc1Running = 0;
|
|
98 |
|
|
99 |
|
|
100 |
CRect MainClientRect;
|
|
101 |
CRect LeftRect;
|
|
102 |
CRect RightRect;
|
|
103 |
|
|
104 |
CRect ItemRect;
|
|
105 |
CRect OrgButtonRect;
|
|
106 |
CRect ButtonRect;
|
|
107 |
CRect PicRect;
|
|
108 |
CRect PicRectUp;
|
|
109 |
CRect PicRectDown;
|
|
110 |
|
|
111 |
CRect LogRect;
|
|
112 |
|
|
113 |
int calLayerOuts();
|
|
114 |
int DisplayParams();
|
|
115 |
int GetParams();
|
|
116 |
int DelayInit();
|
|
117 |
|
|
118 |
int LoadResourceList();
|
|
119 |
int SaveResourceList();
|
|
120 |
|
|
121 |
|
|
122 |
int LoadModel();
|
|
123 |
int SaveModel();
|
|
124 |
|
|
125 |
int OpenResource(CStringA ResourceStr);
|
|
126 |
int CloseResource();
|
|
127 |
|
|
128 |
int SaveData(CString sFilePathName);
|
|
129 |
int LoadData(CString sFilePathName);
|
|
130 |
|
|
131 |
int MonitorPLC();
|
|
132 |
|
|
133 |
int UpdateDataDisplay();
|
|
134 |
|
|
135 |
public:
|
|
136 |
static UINT MyJumper1(LPVOID pParam);
|
|
137 |
DWORD WINAPI MyThreadProc1(LPVOID pParam);
|
|
138 |
|
|
139 |
bool m_bOnline = false;
|
|
140 |
bool m_bRunning = false;
|
|
141 |
bool m_bMonitoring = false;
|
|
142 |
|
|
143 |
|
|
144 |
// Combo Com port select
|
|
145 |
CComboBox m_combo_comport;
|
|
146 |
// Combo Com Baud select
|
|
147 |
CComboBox m_combo_com_baud;
|
|
148 |
afx_msg void OnBnClickedButtonStart();
|
|
149 |
afx_msg void OnBnClickedButtonStop();
|
|
150 |
afx_msg void OnBnClickedButtonClrscr();
|
|
151 |
afx_msg void OnBnClickedButtonSend();
|
|
152 |
CEdit m_edit_display;
|
|
153 |
// Combo Input
|
|
154 |
CComboBox m_combo_input;
|
|
155 |
|
|
156 |
afx_msg void OnCbnEditchangeComboInput();
|
|
157 |
afx_msg void OnCbnSelchangeComboRes();
|
|
158 |
afx_msg void OnBnClickedButtonDo();
|
|
159 |
afx_msg void OnCbnSelchangeComboCmdType();
|
|
160 |
afx_msg void OnCbnSelchangeComboDcount();
|
|
161 |
afx_msg void OnBnClickedButtonStartBulkTest();
|
|
162 |
afx_msg void OnBnClickedButtonStopBulkTest();
|
|
163 |
afx_msg void OnMenuDownload();
|
|
164 |
afx_msg void OnMenuUpload();
|
|
165 |
afx_msg void OnMenuOnline();
|
|
166 |
afx_msg void OnMenuOffline();
|
|
167 |
afx_msg void OnMenuMonitor();
|
|
168 |
afx_msg void OnMenuRun();
|
|
169 |
afx_msg void OnUpdateMenuRun(CCmdUI *pCmdUI);
|
|
170 |
afx_msg void OnUpdateMenuMonitor(CCmdUI *pCmdUI);
|
|
171 |
afx_msg void OnUpdateMenuOffline(CCmdUI *pCmdUI);
|
|
172 |
afx_msg void OnUpdateMenuOnline(CCmdUI *pCmdUI);
|
|
173 |
CEdit m_edit_mon1;
|
|
174 |
CEdit m_edit_mon2;
|
|
175 |
afx_msg void OnMenuCommset();
|
|
176 |
afx_msg void OnMenuSysregSet();
|
|
177 |
afx_msg void OnMenuStatusShow();
|
|
178 |
afx_msg void OnMenuInfoDisplay();
|
|
179 |
afx_msg void OnMenuCoilMon();
|
|
180 |
afx_msg void OnMenuDataMon();
|
|
181 |
afx_msg void OnMenuCommTool();
|
|
182 |
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
|
|
183 |
afx_msg void OnBnClickedButtonClearStat();
|
|
184 |
int Clear_COM_Stats();
|
|
185 |
afx_msg void OnBnClickedButtonRead();
|
|
186 |
afx_msg void OnBnClickedButtonConnect();
|
|
187 |
afx_msg void OnMenuEventLog();
|
|
188 |
afx_msg void OnMenuCommTest();
|
|
189 |
afx_msg void OnMenuForceIo();
|
|
190 |
afx_msg void OnMenuDatetime();
|
|
191 |
CStaticEx m_static_connect;
|
|
192 |
afx_msg void OnBnClickedButtonDisconnect();
|
|
193 |
afx_msg void OnBnClickedButton11();
|
|
194 |
afx_msg void OnBnClickedButton12();
|
|
195 |
afx_msg void OnBnClickedButton13();
|
|
196 |
|
|
197 |
afx_msg void OnBnClickedButton31();
|
|
198 |
afx_msg void OnBnClickedButton2();
|
|
199 |
afx_msg void OnBnClickedButton3();
|
|
200 |
int UpdateLEDDisplay();
|
|
201 |
int UpdateStatusBar(int nIndex);
|
|
202 |
};
|