| | |
| | | : CFormView(IDD_CONFIGTOOL_FORM)
|
| | | {
|
| | | // TODO: 在此处添加构造代码
|
| | | psyscfg = (pKMSysCfg)m_cfgdatabuf;
|
| | | psyscfg = (pstKMSysCfg)m_cfgdatabuf;
|
| | |
|
| | | }
|
| | |
|
| | |
| | | m_propsyscfg1.ScrollWindow(0, Scrolldel);
|
| | | m_nScrollPos += Scrolldel;
|
| | |
|
| | | m_propsyscfg1.psyscfg = (pKMSysCfg)m_cfgdatabuf;
|
| | | m_propsyscfg1.psyscfg = (pstKMSysCfg)m_cfgdatabuf;
|
| | |
|
| | | m_propsyscfg1.m_nFrameheight = m_nFrameheight;
|
| | | m_propsyscfg1.UpdateScrollInfo();
|
| | |
| | | CString s1;
|
| | | s1.Empty();
|
| | | SetDlgItemText(IDC_EDIT_DEVICE_TYPE, s1);
|
| | | SetDlgItemText(IDC_EDIT_DEVICE_NAME, s1);
|
| | | SetDlgItemText(IDC_EDIT_FIRM_VER, s1);
|
| | | SetDlgItemText(IDC_EDIT_KLINK_VER, s1);
|
| | | SetDlgItemText(IDC_EDIT_KBUS_VER, s1);
|
| | |
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | CString s1;
|
| | |
|
| | | int res = ((CConfigToolDoc *)m_pDocument)->MyKlink.SetCommParam();
|
| | | s1.Format(_T("Com Set = %d "),res);
|
| | | int res = GetDocument()->MyKlink.SetCommParam();
|
| | | s1.Format(_T("Com Set = %d COM%d %d %s"),res, GetDocument()->MyKlink.m_nPort, GetDocument()->MyKlink.m_nBaudRate, GetDocument()->MyKlink.m_Settings);
|
| | | SysLog(s1);
|
| | | }
|
| | |
|
| | |
| | | // s1 += FormatHex(m_factorydataBuf, nCount);
|
| | | SysLog(s1);
|
| | |
|
| | | res = ((CConfigToolDoc *)m_pDocument)->MyKlink.ReadSysCfgData(1, 0, DCount, &nCount, m_cfgdatabuf);
|
| | | psyscfg = (pKMSysCfg)m_cfgdatabuf;
|
| | | res = ((CConfigToolDoc *)m_pDocument)->MyKlink.ReadSysCfgData(1, 0, 0, DCount, &nCount, m_cfgdatabuf);
|
| | | psyscfg = (pstKMSysCfg)m_cfgdatabuf;
|
| | | s1.Format(_T("read SysCfgData = %d %d bytes \r\n"), res, nCount);
|
| | | // s1 += FormatHex(m_cfgdatabuf, nCount);
|
| | | SysLog(s1);
|
| | |
| | | s1 += FormatHex(m_factorydataBuf, nCount);
|
| | | SysLog(s1);
|
| | |
|
| | | res = ((CConfigToolDoc *)m_pDocument)->MyKlink.ReadSysCfgData(1, 0, DCount, &nCount, m_cfgdatabuf);
|
| | | psyscfg = (pKMSysCfg)m_cfgdatabuf;
|
| | | res = ((CConfigToolDoc *)m_pDocument)->MyKlink.ReadSysCfgData(1, 0,0, DCount, &nCount, m_cfgdatabuf);
|
| | | psyscfg = (pstKMSysCfg)m_cfgdatabuf;
|
| | | s1.Format(_T("read SysCfgData = %d %d bytes \r\n"), res, nCount);
|
| | | s1 += FormatHex(m_cfgdatabuf, nCount);
|
| | | SysLog(s1);
|
| | |
| | | unsigned short nCount=0;
|
| | | m_propsyscfg1.GetParams();
|
| | |
|
| | | res = ((CConfigToolDoc *)m_pDocument)->MyKlink.WriteSysCfgData(1, 0, DCount, m_cfgdatabuf);
|
| | | res = ((CConfigToolDoc *)m_pDocument)->MyKlink.WriteSysCfgData(1, 0, 0, DCount, m_cfgdatabuf);
|
| | | // m_propsyscfg1.psyscfg = (pKMSysCfg)m_cfgdatabuf;
|
| | | s1.Format(_T("Download = %d %d bytes"), res, DCount);
|
| | | SysLog(s1);
|
| | |
| | | psyscfg->Version = int(syscfg1["SYSTEM"]["Version"]);
|
| | | psyscfg->workmode = int(syscfg1["SYSTEM"]["WorkMode"]);
|
| | | psyscfg->SwitchFunc = _tstoi(syscfg1["SYSTEM"]["SwitchFunc"]);
|
| | | psyscfg->Space1 = 0;
|
| | | psyscfg->nCfgBlockCount = 0;
|
| | |
|
| | | psyscfg->PortParams[0].WorkMode = int(syscfg1["Port_1"]["WorkMode"]);
|
| | | psyscfg->PortParams[0].Station = int(syscfg1["Port_1"]["Station"]);
|
| | |
| | | psyscfg->PortParams[1].RecvAddr = int(syscfg1["Port_2"]["RecvAddr"]);
|
| | | psyscfg->PortParams[1].RecvSize = int(syscfg1["Port_2"]["RecvSize"]);
|
| | |
|
| | | psyscfg->OutMappings[0] = int(syscfg1["OutMapping"]["Output_0"]);
|
| | | psyscfg->OutMappings[1] = int(syscfg1["OutMapping"]["Output_1"]);
|
| | | psyscfg->OutMappings[2] = int(syscfg1["OutMapping"]["Output_2"]);
|
| | | psyscfg->OutMappings[3] = int(syscfg1["OutMapping"]["Output_3"]);
|
| | | psyscfg->OutMappings[4] = int(syscfg1["OutMapping"]["Output_4"]);
|
| | | psyscfg->OutMappings[5] = int(syscfg1["OutMapping"]["Output_5"]);
|
| | | psyscfg->OutMappings[0].value = int(syscfg1["OutMapping"]["Output_0"]);
|
| | | psyscfg->OutMappings[1].value = int(syscfg1["OutMapping"]["Output_1"]);
|
| | | psyscfg->OutMappings[2].value = int(syscfg1["OutMapping"]["Output_2"]);
|
| | | psyscfg->OutMappings[3].value = int(syscfg1["OutMapping"]["Output_3"]);
|
| | | psyscfg->OutMappings[4].value = int(syscfg1["OutMapping"]["Output_4"]);
|
| | | psyscfg->OutMappings[5].value = int(syscfg1["OutMapping"]["Output_5"]);
|
| | |
|
| | | m_propsyscfg1.ShowParams();
|
| | |
|
| | |
| | |
|
| | | syscfg1["SYSTEM"]["Version"] = psyscfg->Version;
|
| | |
|
| | | syscfg1["OutMapping"]["Output_0"] = psyscfg->OutMappings[0];
|
| | | syscfg1["OutMapping"]["Output_1"] = psyscfg->OutMappings[1];
|
| | | syscfg1["OutMapping"]["Output_2"] = psyscfg->OutMappings[2];
|
| | | syscfg1["OutMapping"]["Output_3"] = psyscfg->OutMappings[3];
|
| | | syscfg1["OutMapping"]["Output_4"] = psyscfg->OutMappings[4];
|
| | | syscfg1["OutMapping"]["Output_5"] = psyscfg->OutMappings[5];
|
| | | syscfg1["OutMapping"]["Output_0"] = psyscfg->OutMappings[0].value;
|
| | | syscfg1["OutMapping"]["Output_1"] = psyscfg->OutMappings[1].value;
|
| | | syscfg1["OutMapping"]["Output_2"] = psyscfg->OutMappings[2].value;
|
| | | syscfg1["OutMapping"]["Output_3"] = psyscfg->OutMappings[3].value;
|
| | | syscfg1["OutMapping"]["Output_4"] = psyscfg->OutMappings[4].value;
|
| | | syscfg1["OutMapping"]["Output_5"] = psyscfg->OutMappings[5].value;
|
| | |
|
| | | CFileDialog dlg1(false, _T("*.cfg"),NULL, OFN_OVERWRITEPROMPT, _T("配置文件(*.cfg)|*.cfg|所有文件 (*.*)|*.*||"),this);
|
| | | INT_PTR r = dlg1.DoModal();
|