From 61deef5cdf96cbfdd6ad45be49e80d597c00ca65 Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期二, 24 十二月 2024 08:37:21 +0800
Subject: [PATCH] 2024-12-24

---
 ConfigTool/ConfigToolView.cpp |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/ConfigTool/ConfigToolView.cpp b/ConfigTool/ConfigToolView.cpp
index 2fcde61..202c924 100644
--- a/ConfigTool/ConfigToolView.cpp
+++ b/ConfigTool/ConfigToolView.cpp
@@ -75,7 +75,7 @@
 	: CFormView(IDD_CONFIGTOOL_FORM)
 {
 	// TODO: 鍦ㄦ澶勬坊鍔犳瀯閫犱唬鐮�
-	psyscfg = (pKMSysCfg)m_cfgdatabuf;
+	psyscfg = (pstKMSysCfg)m_cfgdatabuf;
 
 }
 
@@ -281,7 +281,7 @@
 	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();
@@ -693,8 +693,8 @@
 //	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);
@@ -731,8 +731,8 @@
 	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);
@@ -753,7 +753,7 @@
 	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);
@@ -805,7 +805,7 @@
 		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"]);
@@ -833,12 +833,12 @@
 		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();
 
@@ -889,12 +889,12 @@
 
 	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();

--
Gitblit v1.9.1