提交 | 用户 | age
|
0ed438
|
1 |
|
Q |
2 |
#pragma once
|
|
3 |
|
|
4 |
#include "ViewTree.h"
|
61deef
|
5 |
#include "KMachine.h"
|
Q |
6 |
#include <vector>
|
0ed438
|
7 |
|
418cb3
|
8 |
class CNavToolBar : public CMFCToolBar
|
0ed438
|
9 |
{
|
Q |
10 |
virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler)
|
|
11 |
{
|
|
12 |
CMFCToolBar::OnUpdateCmdUI((CFrameWnd*) GetOwner(), bDisableIfNoHndler);
|
|
13 |
}
|
|
14 |
|
|
15 |
virtual BOOL AllowShowOnList() const { return FALSE; }
|
|
16 |
};
|
|
17 |
|
61deef
|
18 |
#define MENU_DEVICE 0x10000000
|
Q |
19 |
#define MENU_PROPERTY 0x01000000
|
|
20 |
#define MENU_PORT 0x00100000
|
|
21 |
#define MENU_REMOTE_DEVICE 0x00010000
|
|
22 |
|
|
23 |
|
|
24 |
// #pragma anon_unions
|
|
25 |
typedef struct tagChnStat
|
|
26 |
{
|
|
27 |
unsigned short Stat;
|
|
28 |
unsigned short SendPackets;
|
|
29 |
unsigned short RecvPackets;
|
|
30 |
unsigned short LastSentTimeTick;
|
|
31 |
unsigned short LostPackets;
|
|
32 |
unsigned short CtnLstPkts;
|
|
33 |
unsigned short MaxCtnLstPkts;
|
|
34 |
unsigned short NotPkgErr;
|
|
35 |
unsigned short PkgLenErr;
|
|
36 |
unsigned short BCCErr;
|
|
37 |
unsigned short TimeOutErr;
|
|
38 |
unsigned short Delay;
|
|
39 |
unsigned short MaxDelay;
|
|
40 |
unsigned short SendTimeInterval;
|
|
41 |
union
|
|
42 |
{
|
|
43 |
unsigned short ClientDatas[10];
|
|
44 |
struct {
|
|
45 |
unsigned short ClientRecvPkts; //
|
|
46 |
unsigned short ClientSendPkts; //
|
|
47 |
unsigned short ClientNotPktErr; //
|
|
48 |
unsigned short ClientMisIdPkts; //
|
|
49 |
// unsigned int ClientNoEndErr; //
|
|
50 |
unsigned short ClientPkgLenErr; //
|
|
51 |
unsigned short ClientBccErr; //
|
|
52 |
unsigned short ClientTimeOutErr; //
|
|
53 |
};
|
|
54 |
};
|
|
55 |
} stChnStat;
|
|
56 |
|
|
57 |
typedef struct tagKwChnStat
|
|
58 |
{
|
|
59 |
union {
|
|
60 |
unsigned char MStat;
|
|
61 |
struct {
|
|
62 |
unsigned char bOnline : 1;
|
|
63 |
unsigned char bErr1 : 1;
|
|
64 |
unsigned char bErr2 : 1;
|
|
65 |
unsigned char bReq : 1;
|
|
66 |
};
|
|
67 |
};
|
|
68 |
unsigned char SStat;
|
|
69 |
|
|
70 |
uint32_t sentCount; //发送计数
|
|
71 |
uint32_t recvCount; //接收计数
|
|
72 |
|
|
73 |
uint32_t latancy; //延迟
|
|
74 |
uint32_t cycleTime; //循环时间
|
|
75 |
|
|
76 |
uint16_t LostPackets; //丢包计数
|
|
77 |
uint16_t CtnLstPkts; //连续丢包计数
|
|
78 |
uint16_t MaxCtnLstPkts; //最大连续丢包计数
|
|
79 |
|
|
80 |
uint16_t TXErr; //发送错误计数
|
|
81 |
uint16_t RXErr; //接收错误计数
|
|
82 |
uint16_t CRCErr; //CRC错误计数
|
|
83 |
uint16_t PktErr; //包错误 ;
|
|
84 |
uint16_t ChnErr; //频道错误;
|
|
85 |
uint16_t nErrChn; //错误的频道号;
|
|
86 |
|
|
87 |
uint16_t StepErr1; //步骤错误1
|
|
88 |
uint16_t StepErr2; //步骤错误2
|
|
89 |
uint16_t Err1Count; //微闪报警次数
|
|
90 |
uint16_t Err2Count; //大闪报警次数
|
|
91 |
uint16_t Err3Count; //严重丢失信号次数
|
|
92 |
|
|
93 |
int8_t RSSI; //信号强度
|
|
94 |
int8_t SNR; //信噪比
|
|
95 |
int8_t tRSSI; //对方信号强度
|
|
96 |
int8_t tSNR; //对方信噪比
|
|
97 |
|
|
98 |
uint32_t targetSentCount; //对方发送数量
|
|
99 |
uint32_t targetRecvdCount; //对方接受数量
|
|
100 |
} stKwChnStat;
|
|
101 |
|
|
102 |
|
418cb3
|
103 |
class CNavView : public CDockablePane
|
0ed438
|
104 |
{
|
Q |
105 |
public:
|
418cb3
|
106 |
CNavView() noexcept;
|
Q |
107 |
virtual ~CNavView();
|
0ed438
|
108 |
|
Q |
109 |
void AdjustLayout();
|
|
110 |
void OnChangeVisualStyle();
|
61deef
|
111 |
stDeviceDef m_DeviceInfo = {0};
|
Q |
112 |
stKMInfoBlock m_infoblock;
|
|
113 |
|
|
114 |
int bPortRegsUpdated[8] = { 0 };
|
|
115 |
stPortDef PortDefs[8];
|
|
116 |
|
|
117 |
std::vector<stDeviceDef> PortDeviceList[8];
|
|
118 |
int bPortDeviceUpdated[16] = { 0 };
|
|
119 |
stDeviceInfo PortDeviceInfos[16];
|
|
120 |
|
|
121 |
int LastUpdateIndex[16] = { 0 };
|
0ed438
|
122 |
|
Q |
123 |
protected:
|
418cb3
|
124 |
CNavToolBar m_wndToolBar;
|
Q |
125 |
CViewTree m_NavViewTree;
|
61deef
|
126 |
// HTREEITEM hRoot1;
|
418cb3
|
127 |
CImageList m_NavViewImages;
|
0ed438
|
128 |
UINT m_nCurrSort;
|
Q |
129 |
|
61deef
|
130 |
void FillDeviceView();
|
0ed438
|
131 |
|
Q |
132 |
// 重写
|
|
133 |
public:
|
|
134 |
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
|
135 |
|
|
136 |
protected:
|
|
137 |
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
|
138 |
afx_msg void OnSize(UINT nType, int cx, int cy);
|
|
139 |
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
|
|
140 |
afx_msg void OnClassAddMemberFunction();
|
|
141 |
afx_msg void OnClassAddMemberVariable();
|
|
142 |
afx_msg void OnClassDefinition();
|
|
143 |
afx_msg void OnClassProperties();
|
|
144 |
afx_msg void OnNewFolder();
|
61deef
|
145 |
afx_msg void OnSetComm();
|
Q |
146 |
afx_msg void OnConnect();
|
|
147 |
afx_msg void OnDisConnect();
|
0ed438
|
148 |
afx_msg void OnPaint();
|
Q |
149 |
afx_msg void OnSetFocus(CWnd* pOldWnd);
|
|
150 |
afx_msg LRESULT OnChangeActiveTab(WPARAM, LPARAM);
|
|
151 |
afx_msg void OnSort(UINT id);
|
|
152 |
afx_msg void OnUpdateSort(CCmdUI* pCmdUI);
|
418cb3
|
153 |
afx_msg void OnNMDblclkNavTree1(NMHDR *pNMHDR, LRESULT *pResult);
|
Q |
154 |
afx_msg void OnNMClkNavTree1(NMHDR *pNMHDR, LRESULT *pResult);
|
0ed438
|
155 |
DECLARE_MESSAGE_MAP()
|
418cb3
|
156 |
public:
|
Q |
157 |
afx_msg void OnTimer(UINT_PTR nIDEvent);
|
|
158 |
int DelayInit();
|
|
159 |
int UpdateDisplay();
|
|
160 |
int nDisplayCount = 0;
|
61deef
|
161 |
afx_msg void OnMenuNavSetConn();
|
Q |
162 |
afx_msg void OnMenuNavConnect();
|
|
163 |
afx_msg void OnMenuNavDisconnect();
|
|
164 |
int GetDocCount();
|
|
165 |
afx_msg void OnMenuNvUpdateFirmware();
|
|
166 |
afx_msg void OnMenuNvDeviceReadInfo();
|
|
167 |
afx_msg void OnRemoteRefreshData();
|
|
168 |
afx_msg void OnRemoteBlinkLED();
|
|
169 |
afx_msg void OnRemoteUpdateFirmware();
|
|
170 |
afx_msg void OnLedBlink();
|
|
171 |
afx_msg void OnResetDevice();
|
|
172 |
afx_msg void OnRemoteDeviceReset();
|
|
173 |
afx_msg void OnRemoteBlinkLedAll();
|
|
174 |
afx_msg void OnPortReset();
|
|
175 |
afx_msg void OnPortResetAllChild();
|
|
176 |
afx_msg void OnCommtest();
|
|
177 |
afx_msg void OnDeviceConfig();
|
0ed438
|
178 |
};
|
Q |
179 |
|