提交 | 用户 | age
|
418cb3
|
1 |
// CChidSysCfg1.cpp: 实现文件
|
Q |
2 |
//
|
|
3 |
|
|
4 |
#include "pch.h"
|
|
5 |
#include "ConfigTool.h"
|
|
6 |
#include "CChidSysCfg1.h"
|
|
7 |
#include "afxdialogex.h"
|
|
8 |
|
|
9 |
|
|
10 |
// CChidSysCfg1 对话框
|
|
11 |
|
|
12 |
IMPLEMENT_DYNAMIC(CChidSysCfg1, CDialogEx)
|
|
13 |
|
|
14 |
CChidSysCfg1::CChidSysCfg1(CWnd* pParent /*=nullptr*/)
|
|
15 |
: CDialogEx(IDD_PROP_SYSREG1, pParent)
|
|
16 |
{
|
|
17 |
|
|
18 |
}
|
|
19 |
|
|
20 |
CChidSysCfg1::~CChidSysCfg1()
|
|
21 |
{
|
|
22 |
}
|
|
23 |
|
|
24 |
void CChidSysCfg1::DoDataExchange(CDataExchange* pDX)
|
|
25 |
{
|
|
26 |
CDialogEx::DoDataExchange(pDX);
|
|
27 |
}
|
|
28 |
|
|
29 |
|
|
30 |
BEGIN_MESSAGE_MAP(CChidSysCfg1, CDialogEx)
|
|
31 |
ON_WM_VSCROLL()
|
|
32 |
ON_WM_SIZE()
|
|
33 |
ON_WM_MOUSEHWHEEL()
|
|
34 |
ON_WM_TIMER()
|
|
35 |
END_MESSAGE_MAP()
|
|
36 |
|
|
37 |
|
|
38 |
// CChidSysCfg1 消息处理程序
|
|
39 |
|
|
40 |
|
|
41 |
BOOL CChidSysCfg1::OnInitDialog()
|
|
42 |
{
|
|
43 |
CDialogEx::OnInitDialog();
|
|
44 |
|
|
45 |
// TODO: 在此添加额外的初始化
|
|
46 |
RECT rect0;
|
|
47 |
GetClientRect(&rect0);
|
|
48 |
|
|
49 |
m_nPropHeight = rect0.bottom - rect0.top;
|
|
50 |
m_nFrameheight = 300;
|
|
51 |
|
|
52 |
UpdateScrollInfo();
|
|
53 |
|
|
54 |
CString s1;
|
|
55 |
s1.Format(_T("CChildSysCfg1 OnInitDialog"));
|
|
56 |
SysLog(s1);
|
|
57 |
return TRUE; // return TRUE unless you set the focus to a control
|
|
58 |
// 异常: OCX 属性页应返回 FALSE
|
|
59 |
}
|
|
60 |
|
|
61 |
void CChidSysCfg1::OnSize(UINT nType, int cx, int cy)
|
|
62 |
{
|
|
63 |
CDialogEx::OnSize(nType, cx, cy);
|
|
64 |
|
|
65 |
// TODO: 在此处添加消息处理程序代码
|
|
66 |
}
|
|
67 |
|
|
68 |
int CChidSysCfg1::UpdateScrollInfo()
|
|
69 |
{
|
|
70 |
// TODO: 在此处添加实现代码.
|
|
71 |
SCROLLINFO vinfo;
|
|
72 |
|
|
73 |
vinfo.cbSize = sizeof(vinfo);
|
|
74 |
|
|
75 |
vinfo.fMask = SIF_ALL;
|
|
76 |
|
|
77 |
vinfo.nPage = m_nFrameheight;//滚动块自身的长短,通常有如下关系:其长度/滚动条长度(含两个箭头)=nPage/(nMax+2),
|
|
78 |
|
|
79 |
//另外nPage取值-1时,滚动条会不见了。
|
|
80 |
|
|
81 |
vinfo.nMax = m_nPropHeight;// -m_nFrameheight;//滚动条所能滚动的最大值
|
|
82 |
|
|
83 |
vinfo.nMin = 0;//滚动条所能滚动的最小值
|
|
84 |
|
|
85 |
vinfo.nTrackPos = 0;
|
|
86 |
|
|
87 |
SetScrollInfo(SB_VERT, &vinfo);//即使上述步骤一不做,使用此条语句也可以显示滚动条
|
|
88 |
|
|
89 |
CString s1;
|
|
90 |
s1.Format(_T("CChildSysCfg1 UpdateScrollInfo"));
|
|
91 |
SysLog(s1);
|
|
92 |
|
|
93 |
return 0;
|
|
94 |
}
|
|
95 |
|
|
96 |
|
|
97 |
int CChidSysCfg1::VScrollBy(int nPos)
|
|
98 |
{
|
|
99 |
// TODO: 在此处添加实现代码.
|
|
100 |
CString s1;
|
|
101 |
int nMin, nMax;
|
|
102 |
int TempPos;
|
|
103 |
this->GetScrollRange(SB_VERT, &nMin, &nMax);
|
|
104 |
TempPos = this->GetScrollPos(SB_VERT);
|
|
105 |
TempPos += nPos;
|
|
106 |
if (TempPos < 0) TempPos = 0;
|
|
107 |
if (TempPos > nMax - m_nFrameheight) TempPos = nMax - m_nFrameheight;
|
|
108 |
SetScrollPos(SB_VERT, TempPos);
|
|
109 |
|
|
110 |
int nNewPos = -TempPos;
|
|
111 |
int Scrolldel = nNewPos - m_nScrollPos;
|
|
112 |
s1.Format(_T("PropSysReg Scroll %d %d %d %d"), m_nScrollPos, TempPos, nNewPos, Scrolldel);
|
|
113 |
// SysLog(s1);
|
|
114 |
this->ScrollWindow(0, Scrolldel);
|
|
115 |
m_nScrollPos += Scrolldel;
|
|
116 |
|
|
117 |
return 0;
|
|
118 |
}
|
|
119 |
|
|
120 |
void CChidSysCfg1::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
|
121 |
{
|
|
122 |
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
|
123 |
///*
|
|
124 |
CString s1;
|
|
125 |
s1.Format(_T("PropSysReg OnVScroll %d %d"), nSBCode, nPos);
|
|
126 |
// SysLog(s1);
|
|
127 |
int nMin, nMax;
|
|
128 |
int TempPos;
|
|
129 |
if (pScrollBar == NULL) {
|
|
130 |
this->GetScrollRange(SB_VERT, &nMin, &nMax);
|
|
131 |
TempPos = this->GetScrollPos(SB_VERT);
|
|
132 |
}
|
|
133 |
else {
|
|
134 |
pScrollBar->GetScrollRange(&nMin, &nMax); //取得滚动条范围
|
|
135 |
TempPos = pScrollBar->GetScrollPos();
|
|
136 |
}
|
|
137 |
|
|
138 |
switch (nSBCode)
|
|
139 |
{
|
|
140 |
case SB_THUMBPOSITION://拖动滑块
|
|
141 |
case SB_THUMBTRACK:
|
|
142 |
if (pScrollBar == NULL) {
|
|
143 |
SetScrollPos(SB_VERT, nPos);
|
|
144 |
}
|
|
145 |
else {
|
|
146 |
pScrollBar->SetScrollPos(nPos);
|
|
147 |
}
|
|
148 |
TempPos = nPos;
|
|
149 |
break;
|
|
150 |
case SB_LINEUP://点击上边/左边的箭头
|
|
151 |
TempPos-=10;
|
|
152 |
if (TempPos < 0)TempPos = 0;
|
|
153 |
if (pScrollBar == NULL) { SetScrollPos(SB_VERT, TempPos); }
|
|
154 |
else { pScrollBar->SetScrollPos(TempPos); }
|
|
155 |
break;
|
|
156 |
case SB_LINEDOWN://点击下边/右边的箭头
|
|
157 |
TempPos+=10;
|
|
158 |
if (TempPos > nMax) TempPos = nMax;
|
|
159 |
if (pScrollBar == NULL) { SetScrollPos(SB_VERT, TempPos); }
|
|
160 |
else { pScrollBar->SetScrollPos(TempPos); }
|
|
161 |
break;
|
|
162 |
|
|
163 |
case SB_PAGEUP: // 如果向上/左滚动一页
|
|
164 |
TempPos -= 100;
|
|
165 |
if (TempPos < 0) TempPos = 0;
|
|
166 |
if (pScrollBar == NULL) { SetScrollPos(SB_VERT, TempPos); }
|
|
167 |
else { pScrollBar->SetScrollPos(TempPos); }
|
|
168 |
break;
|
|
169 |
|
|
170 |
case SB_PAGEDOWN: // 如果向下/右滚动一页
|
|
171 |
TempPos += 100;
|
|
172 |
if (TempPos > nMax) TempPos = nMax;
|
|
173 |
if (pScrollBar == NULL) { SetScrollPos(SB_VERT, TempPos); }
|
|
174 |
else { pScrollBar->SetScrollPos(TempPos); }
|
|
175 |
break;
|
|
176 |
}
|
|
177 |
int nNewPos = -TempPos;
|
|
178 |
int Scrolldel = nNewPos - m_nScrollPos;
|
|
179 |
s1.Format(_T("PropSysReg Scroll %d %d %d"), m_nScrollPos, nNewPos, Scrolldel);
|
|
180 |
// SysLog(s1);
|
|
181 |
this->ScrollWindow(0, Scrolldel);
|
|
182 |
m_nScrollPos += Scrolldel;
|
|
183 |
|
|
184 |
//*/
|
|
185 |
CDialogEx::OnVScroll(nSBCode, nPos, pScrollBar);
|
|
186 |
}
|
|
187 |
|
|
188 |
void CChidSysCfg1::OnMouseHWheel(UINT nFlags, short zDelta, CPoint pt)
|
|
189 |
{
|
|
190 |
// 此功能要求 Windows Vista 或更高版本。
|
|
191 |
// _WIN32_WINNT 符号必须 >= 0x0600。
|
|
192 |
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
|
193 |
///*
|
|
194 |
int nNewPos = m_nScrollPos;
|
|
195 |
if (zDelta < 0)
|
|
196 |
{
|
|
197 |
this->ScrollWindow(0, 0);
|
|
198 |
// if (-m_nScrollPos < m_nPropHeight - m_nFrameheight - 30)
|
|
199 |
// nNewPos = m_nScrollPos - 30;
|
|
200 |
// else
|
|
201 |
// nNewPos = -(m_nPropHeight - m_nFrameheight);
|
|
202 |
}
|
|
203 |
else if (zDelta > 0)
|
|
204 |
{
|
|
205 |
this->ScrollWindow(0, 100);
|
|
206 |
|
|
207 |
// if (-m_nScrollPos > 30)
|
|
208 |
// nNewPos = m_nScrollPos + 30;
|
|
209 |
// else
|
|
210 |
// nNewPos = 0;
|
|
211 |
}
|
|
212 |
else
|
|
213 |
{
|
|
214 |
}
|
|
215 |
// int Scrolldel = nNewPos - m_nScrollPos;
|
|
216 |
// this->ScrollWindow(0, Scrolldel);
|
|
217 |
// m_nScrollPos += Scrolldel;
|
|
218 |
// GetDlgItem(IDC_SCROLLBAR1)->SetScrollPos(-m_nScrollPos);
|
|
219 |
//*/
|
|
220 |
CDialogEx::OnMouseHWheel(nFlags, zDelta, pt);
|
|
221 |
}
|
|
222 |
|
|
223 |
void CChidSysCfg1::OnTimer(UINT_PTR nIDEvent)
|
|
224 |
{
|
|
225 |
// TODO: 在此添加消息处理程序代码和/或调用默认值
|
|
226 |
if (nIDEvent == 0)
|
|
227 |
{
|
|
228 |
KillTimer(0);
|
|
229 |
DelayInit();
|
|
230 |
}
|
|
231 |
else if (nIDEvent == 1)
|
|
232 |
{
|
|
233 |
}
|
|
234 |
CDialogEx::OnTimer(nIDEvent);
|
|
235 |
}
|
|
236 |
|
|
237 |
int CChidSysCfg1::DelayInit()
|
|
238 |
{
|
|
239 |
return 0;
|
|
240 |
}
|
|
241 |
|
|
242 |
unsigned int type_ctrl_ids[6] = { IDC_COMBO_FROM_COIL_TYPE_1 ,IDC_COMBO_FROM_COIL_TYPE_2 ,IDC_COMBO_FROM_COIL_TYPE_3 ,IDC_COMBO_FROM_COIL_TYPE_4 ,IDC_COMBO_FROM_COIL_TYPE_5 ,IDC_COMBO_FROM_COIL_TYPE_6};
|
|
243 |
unsigned int addr_ctrl_ids[6] = { IDC_COMBO_FROM_COIL_ADDR_1 ,IDC_COMBO_FROM_COIL_ADDR_2 ,IDC_COMBO_FROM_COIL_ADDR_3 ,IDC_COMBO_FROM_COIL_ADDR_4 ,IDC_COMBO_FROM_COIL_ADDR_5 ,IDC_COMBO_FROM_COIL_ADDR_6 };
|
|
244 |
unsigned int bit_ctrl_ids[6] = { IDC_COMBO_FROM_COIL_BIT_1 ,IDC_COMBO_FROM_COIL_BIT_2 ,IDC_COMBO_FROM_COIL_BIT_3 ,IDC_COMBO_FROM_COIL_BIT_4 ,IDC_COMBO_FROM_COIL_BIT_5 ,IDC_COMBO_FROM_COIL_BIT_6 };
|
|
245 |
|
|
246 |
int CChidSysCfg1::ShowParams()
|
|
247 |
{
|
|
248 |
CString s1;
|
|
249 |
s1.Format(_T("ShowParams"));
|
|
250 |
SysLog(s1);
|
|
251 |
// --------- 工作模式 ---------------------------------------
|
|
252 |
//工作模式,跳线功能等,good 指示灯
|
|
253 |
//
|
df0321
|
254 |
((CComboBox*)GetDlgItem(IDC_COMBO_WORKMODE))->SetCurSel(psyscfg->workmode);
|
418cb3
|
255 |
// -----------------------------------------------------------
|
Q |
256 |
//---------- 通讯端口1,RS232 -----------------------------
|
|
257 |
/*
|
|
258 |
s1.Format(_T("mode %d"), psyscfg->PortParams[0].WorkMode); SysLog(s1);
|
|
259 |
s1.Format(_T("station %d"), psyscfg->PortParams[0].Station); SysLog(s1);
|
|
260 |
s1.Format(_T("baudrate %d"), psyscfg->PortParams[0].BaudRate); SysLog(s1);
|
|
261 |
s1.Format(_T("bytesize %d"), psyscfg->PortParams[0].ByteSize); SysLog(s1);
|
|
262 |
s1.Format(_T("stopbits %d"), psyscfg->PortParams[0].StopBits); SysLog(s1);
|
|
263 |
s1.Format(_T("parity %d"), psyscfg->PortParams[0].Parity); SysLog(s1);
|
|
264 |
s1.Format(_T("eofchar %d"), psyscfg->PortParams[0].EofChar); SysLog(s1);
|
|
265 |
s1.Format(_T("sofchar %d"), psyscfg->PortParams[0].SofChar); SysLog(s1);
|
|
266 |
s1.Format(_T("endtype %d"), psyscfg->PortParams[0].EndType); SysLog(s1);
|
|
267 |
s1.Format(_T("recvaddr %d"), psyscfg->PortParams[0].RecvAddr); SysLog(s1);
|
|
268 |
s1.Format(_T("recvsize %d"), psyscfg->PortParams[0].RecvSize); SysLog(s1);
|
|
269 |
s1.Format(_T("endtime %d"), psyscfg->PortParams[0].EndTime); SysLog(s1);
|
|
270 |
*/
|
|
271 |
|
|
272 |
((CComboBox *)GetDlgItem(IDC_COMBO_WORKMODE1))->SetCurSel(psyscfg->PortParams[0].WorkMode);
|
|
273 |
((CComboBox *)GetDlgItem(IDC_COMBO_STATION1))->SetCurSel(psyscfg->PortParams[0].Station);
|
|
274 |
s1.Format(_T("%d"), psyscfg->PortParams[0].BaudRate * 100);
|
|
275 |
((CComboBox *)GetDlgItem(IDC_COMBO_BAUDRATE1))->SelectString(0, s1);
|
|
276 |
((CComboBox *)GetDlgItem(IDC_COMBO_BAUDRATE1))->SetWindowText(s1);
|
|
277 |
|
|
278 |
((CComboBox *)GetDlgItem(IDC_COMBO_BYTE_SIZE1))->SetCurSel(psyscfg->PortParams[0].ByteSize);
|
|
279 |
((CComboBox *)GetDlgItem(IDC_COMBO_STOP_BIT1))->SetCurSel(psyscfg->PortParams[0].StopBits);
|
|
280 |
((CComboBox *)GetDlgItem(IDC_COMBO_PARITY1))->SetCurSel(psyscfg->PortParams[0].Parity);
|
|
281 |
((CComboBox *)GetDlgItem(IDC_COMBO_EOF_CHAR1))->SetCurSel(psyscfg->PortParams[0].EofChar);
|
|
282 |
((CComboBox *)GetDlgItem(IDC_COMBO_SOF_CHAR1))->SetCurSel(psyscfg->PortParams[0].SofChar);
|
|
283 |
((CComboBox *)GetDlgItem(IDC_COMBO_END_TYPE1))->SetCurSel(psyscfg->PortParams[0].EndType);
|
|
284 |
s1.Format(_T("%d"), psyscfg->PortParams[0].RecvAddr);
|
|
285 |
((CEdit *)GetDlgItem(IDC_EDIT_BUF_ADDR1))->SetWindowText(s1);
|
|
286 |
s1.Format(_T("%d"), psyscfg->PortParams[0].RecvSize);
|
|
287 |
((CEdit *)GetDlgItem(IDC_EDIT_BUF_SIZE1))->SetWindowText(s1);;
|
|
288 |
s1.Format(_T("%d"), psyscfg->PortParams[0].EndTime);
|
|
289 |
((CEdit *)GetDlgItem(IDC_EDIT_END_TIME1))->SetWindowText(s1);;
|
|
290 |
//------------------------------------------------------------------
|
|
291 |
|
|
292 |
// --- 通讯端口2 RS485 ----------------------------
|
|
293 |
|
|
294 |
((CComboBox *)GetDlgItem(IDC_COMBO_WORKMODE2))->SetCurSel(psyscfg->PortParams[1].WorkMode);
|
|
295 |
((CComboBox *)GetDlgItem(IDC_COMBO_STATION2))->SetCurSel(psyscfg->PortParams[1].Station);
|
|
296 |
s1.Format(_T("%d"), psyscfg->PortParams[1].BaudRate * 100);
|
|
297 |
((CComboBox *)GetDlgItem(IDC_COMBO_BAUDRATE2))->SelectString(0, s1);
|
|
298 |
((CComboBox *)GetDlgItem(IDC_COMBO_BAUDRATE2))->SetWindowText(s1);
|
|
299 |
|
|
300 |
((CComboBox *)GetDlgItem(IDC_COMBO_BYTE_SIZE2))->SetCurSel(psyscfg->PortParams[1].ByteSize);
|
|
301 |
((CComboBox *)GetDlgItem(IDC_COMBO_STOP_BIT2))->SetCurSel(psyscfg->PortParams[1].StopBits);
|
|
302 |
((CComboBox *)GetDlgItem(IDC_COMBO_PARITY2))->SetCurSel(psyscfg->PortParams[1].Parity);
|
|
303 |
((CComboBox *)GetDlgItem(IDC_COMBO_EOF_CHAR2))->SetCurSel(psyscfg->PortParams[1].EofChar);
|
|
304 |
((CComboBox *)GetDlgItem(IDC_COMBO_SOF_CHAR2))->SetCurSel(psyscfg->PortParams[1].SofChar);
|
|
305 |
((CComboBox *)GetDlgItem(IDC_COMBO_END_TYPE2))->SetCurSel(psyscfg->PortParams[1].EndType);
|
|
306 |
s1.Format(_T("%d"), psyscfg->PortParams[1].RecvAddr);
|
|
307 |
((CEdit *)GetDlgItem(IDC_EDIT_BUF_ADDR2))->SetWindowText(s1);
|
|
308 |
s1.Format(_T("%d"), psyscfg->PortParams[1].RecvSize);
|
|
309 |
((CEdit *)GetDlgItem(IDC_EDIT_BUF_SIZE2))->SetWindowText(s1);;
|
|
310 |
s1.Format(_T("%d"), psyscfg->PortParams[1].EndTime);
|
|
311 |
((CEdit *)GetDlgItem(IDC_EDIT_END_TIME2))->SetWindowText(s1);;
|
|
312 |
//------------------------------------------------------------------
|
|
313 |
|
|
314 |
// --- 输入滤波 ----------------------------
|
|
315 |
int i = 0;
|
|
316 |
i = psyscfg->InputParams[0].Filter0;
|
|
317 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_1))->SetCurSel(i);
|
|
318 |
i = psyscfg->InputParams[0].Filter1;
|
|
319 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_2))->SetCurSel(i);
|
|
320 |
i = psyscfg->InputParams[1].Filter0;
|
|
321 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_3))->SetCurSel(i);
|
|
322 |
i = psyscfg->InputParams[1].Filter1;
|
|
323 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_4))->SetCurSel(i);
|
|
324 |
i = psyscfg->InputParams[2].Filter0;
|
|
325 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_5))->SetCurSel(i);
|
|
326 |
i = psyscfg->InputParams[2].Filter1;
|
|
327 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_6))->SetCurSel(i);
|
|
328 |
i = psyscfg->InputParams[3].Filter0;
|
|
329 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_7))->SetCurSel(i);
|
|
330 |
i = psyscfg->InputParams[3].Filter1;
|
|
331 |
((CComboBox *)GetDlgItem(IDC_COMBO_INPUT_FILTER_8))->SetCurSel(i);
|
|
332 |
|
|
333 |
//------------------------------------------------------------------
|
|
334 |
|
|
335 |
// --- 输出保持 ----------------------------
|
|
336 |
i = psyscfg->OutputParams[0].Hold1;
|
|
337 |
((CComboBox *)GetDlgItem(IDC_COMBO_OUTPUT_SET_1))->SetCurSel(i);
|
|
338 |
i = psyscfg->OutputParams[0].Hold2;
|
|
339 |
((CComboBox *)GetDlgItem(IDC_COMBO_OUTPUT_SET_1))->SetCurSel(i);
|
|
340 |
|
|
341 |
|
|
342 |
//------------------------------------------------------------------
|
|
343 |
|
|
344 |
// --- 输出端口映射 ----------------------------
|
|
345 |
|
|
346 |
for (int i = 0; i < 6; i++) {
|
61deef
|
347 |
unsigned short bytebitaddr = psyscfg->OutMappings[i].value;
|
418cb3
|
348 |
s1.Format(_T("mappig %d %04x"), i, bytebitaddr);
|
Q |
349 |
SysLog(s1);
|
|
350 |
unsigned char ntype = (bytebitaddr & 0xf000) >> 12;
|
|
351 |
unsigned char byteaddr = (bytebitaddr & 0x0ff0) >> 4;
|
|
352 |
unsigned char bitoff = bytebitaddr & 0x000f;
|
|
353 |
((CComboBox *)GetDlgItem(type_ctrl_ids[i]))->SetCurSel(ntype);
|
|
354 |
((CComboBox *)GetDlgItem(addr_ctrl_ids[i]))->SetCurSel(byteaddr);
|
|
355 |
((CComboBox *)GetDlgItem(bit_ctrl_ids[i]))->SetCurSel(bitoff);
|
|
356 |
}
|
|
357 |
|
|
358 |
|
|
359 |
|
|
360 |
//------------------------------------------------------------------
|
|
361 |
|
|
362 |
|
|
363 |
return 0;
|
|
364 |
}
|
|
365 |
int CChidSysCfg1::GetParams()
|
|
366 |
{
|
|
367 |
CString s1;
|
|
368 |
s1.Format(_T("GetParams"));
|
|
369 |
SysLog(s1);
|
df0321
|
370 |
psyscfg->workmode = ((CComboBox*)GetDlgItem(IDC_COMBO_WORKMODE))->GetCurSel();
|
Q |
371 |
|
418cb3
|
372 |
for (int i = 0; i < 6; i++) {
|
Q |
373 |
unsigned char ntype = ((CComboBox *)GetDlgItem(type_ctrl_ids[i]))->GetCurSel();
|
|
374 |
unsigned char byteaddr = ((CComboBox *)GetDlgItem(addr_ctrl_ids[i]))->GetCurSel();
|
|
375 |
unsigned char bitoff = ((CComboBox *)GetDlgItem(bit_ctrl_ids[i]))->GetCurSel();
|
|
376 |
unsigned short bytebitaddr = (ntype << 12) + (byteaddr << 4) + (bitoff);
|
61deef
|
377 |
psyscfg->OutMappings[i].value = bytebitaddr;
|
418cb3
|
378 |
s1.Format(_T("mappig %d %04x"), i, bytebitaddr);
|
Q |
379 |
SysLog(s1);
|
|
380 |
}
|
|
381 |
|
|
382 |
return 0;
|
|
383 |
}
|
|
384 |
|
|
385 |
|
|
386 |
BOOL CChidSysCfg1::PreTranslateMessage(MSG* pMsg)
|
|
387 |
{
|
|
388 |
// TODO: 在此添加专用代码和/或调用基类
|
|
389 |
CString s1;
|
|
390 |
if (pMsg->hwnd && pMsg->message == WM_MOUSEWHEEL)
|
|
391 |
{
|
|
392 |
if (pMsg->hwnd != this->m_hWnd)
|
|
393 |
{
|
|
394 |
pMsg->hwnd = this->m_hWnd;
|
|
395 |
//return TRUE;
|
|
396 |
}
|
|
397 |
|
|
398 |
/*
|
|
399 |
GetClassName(pMsg->hwnd, s1.GetBuffer(256), 256);
|
|
400 |
s1.ReleaseBuffer();
|
|
401 |
if (s1.Find(_T("COMBOBOX")) == 0)
|
|
402 |
{
|
|
403 |
return TRUE;
|
|
404 |
}
|
|
405 |
*/
|
|
406 |
}
|
|
407 |
return CDialogEx::PreTranslateMessage(pMsg);
|
|
408 |
}
|
|
409 |
|
|
410 |
|
|
411 |
BOOL CChidSysCfg1::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult)
|
|
412 |
{
|
|
413 |
// TODO: 在此添加专用代码和/或调用基类
|
|
414 |
//if (message == WM_MOUSEWHEEL) return true;
|
|
415 |
return CDialogEx::OnChildNotify(message, wParam, lParam, pLResult);
|
|
416 |
}
|
|
417 |
|
|
418 |
|
|
419 |
|
|
420 |
|
|
421 |
|