From d0c990eaf6cfdbf77c1f4f8db272f4964ec43310 Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期四, 15 一月 2026 15:58:15 +0800
Subject: [PATCH] 优化西门子S7通讯:支持多数据类型、UI布局调整及配置持久化修复   详细说明:    1. 通讯核心 (SiemensLBS7)        * 多类型支持:完善 SendMessage 和 ReceiveMsg,支持 Bool, Byte, Int, DInt, Real, Double, Word, DWord, String的读写。        * Bool 解析优化:增强布尔值解析逻辑,支持字符串 "1"/"0" 及 "True"/"False"(不区分大小写)。        * 错误反馈:捕获数据转换异常(如格式错误),将具体错误信息写入 Msg 属性,便于 UI 展示。

---
 LB_VisionProcesses/Communicators/CommunicatorForm.Designer.cs |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/LB_VisionProcesses/Communicators/CommunicatorForm.Designer.cs b/LB_VisionProcesses/Communicators/CommunicatorForm.Designer.cs
index 74ab279..6c2c74c 100644
--- a/LB_VisionProcesses/Communicators/CommunicatorForm.Designer.cs
+++ b/LB_VisionProcesses/Communicators/CommunicatorForm.Designer.cs
@@ -37,6 +37,8 @@
             btnConnect = new Button();
             cmbIP = new ComboBox();
             lblIP = new Label();
+            lblDataType = new Label();
+            cmbDataType = new ComboBox();
             grpReceive = new GroupBox();
             txtReceiveMsg = new TextBox();
             txtSendMsg = new TextBox();
@@ -54,6 +56,8 @@
             label6 = new Label();
             themeForm1 = new ReaLTaiizor.Forms.ThemeForm();
             controlBox1 = new ReaLTaiizor.Controls.ControlBox();
+            lblAddress = new Label();
+            txtAddress = new TextBox();
             grpSetting.SuspendLayout();
             grpReceive.SuspendLayout();
             grpTest.SuspendLayout();
@@ -72,7 +76,7 @@
             grpSetting.ForeColor = SystemColors.Control;
             grpSetting.Location = new Point(18, 74);
             grpSetting.Name = "grpSetting";
-            grpSetting.Size = new Size(200, 146);
+            grpSetting.Size = new Size(200, 210);
             grpSetting.TabIndex = 0;
             grpSetting.TabStop = false;
             grpSetting.Text = "閫氳閰嶇疆";
@@ -102,7 +106,7 @@
             // 
             // btnDisconnect
             // 
-            btnDisconnect.ForeColor = SystemColors.WindowText;
+            btnDisconnect.ForeColor = SystemColors.Control;
             btnDisconnect.Location = new Point(118, 109);
             btnDisconnect.Name = "btnDisconnect";
             btnDisconnect.Size = new Size(75, 23);
@@ -113,7 +117,7 @@
             // 
             // btnConnect
             // 
-            btnConnect.ForeColor = SystemColors.WindowText;
+            btnConnect.ForeColor = SystemColors.Control;
             btnConnect.Location = new Point(14, 109);
             btnConnect.Name = "btnConnect";
             btnConnect.Size = new Size(75, 23);
@@ -185,20 +189,41 @@
             // grpTest
             // 
             grpTest.Controls.Add(lblCom);
+            grpTest.Controls.Add(txtAddress);
             grpTest.Controls.Add(ckbRuleCheck);
             grpTest.Controls.Add(cmbCom);
             grpTest.Controls.Add(cmbType);
             grpTest.Controls.Add(lblType);
             grpTest.Controls.Add(btnRun);
+            grpTest.Controls.Add(lblAddress);
             grpTest.Controls.Add(lblMsg);
             grpTest.Controls.Add(txtMsg);
+            grpTest.Controls.Add(lblDataType);
+            grpTest.Controls.Add(cmbDataType);
             grpTest.ForeColor = SystemColors.Control;
             grpTest.Location = new Point(241, 74);
             grpTest.Name = "grpTest";
-            grpTest.Size = new Size(320, 146);
+            grpTest.Size = new Size(320, 210);
             grpTest.TabIndex = 12;
             grpTest.TabStop = false;
             grpTest.Text = "閫氳娴嬭瘯";
+            // 
+            // lblDataType
+            // 
+            lblDataType.AutoSize = true;
+            lblDataType.Location = new Point(160, 115);
+            lblDataType.Name = "lblDataType";
+            lblDataType.Size = new Size(32, 17);
+            lblDataType.TabIndex = 8;
+            lblDataType.Text = "绫诲瀷";
+            // 
+            // cmbDataType
+            // 
+            cmbDataType.FormattingEnabled = true;
+            cmbDataType.Location = new Point(200, 112);
+            cmbDataType.Name = "cmbDataType";
+            cmbDataType.Size = new Size(94, 25);
+            cmbDataType.TabIndex = 9;
             // 
             // lblCom
             // 
@@ -248,7 +273,7 @@
             // btnRun
             // 
             btnRun.ForeColor = SystemColors.WindowText;
-            btnRun.Location = new Point(215, 109);
+            btnRun.Location = new Point(215, 168);
             btnRun.Name = "btnRun";
             btnRun.Size = new Size(75, 23);
             btnRun.TabIndex = 3;
@@ -269,6 +294,7 @@
             // 
             txtMsg.Location = new Point(59, 76);
             txtMsg.Name = "txtMsg";
+            txtMsg.ReadOnly = true;
             txtMsg.Size = new Size(245, 23);
             txtMsg.TabIndex = 0;
             // 
@@ -329,6 +355,23 @@
             controlBox1.TabIndex = 0;
             controlBox1.Text = "controlBox1";
             // 
+            // lblAddress
+            // 
+            lblAddress.AutoSize = true;
+            lblAddress.Location = new Point(20, 115);
+            lblAddress.Name = "lblAddress";
+            lblAddress.Size = new Size(32, 17);
+            lblAddress.TabIndex = 0;
+            lblAddress.Text = "鍦板潃";
+            // 
+            // txtAddress
+            // 
+            txtAddress.Location = new Point(59, 112);
+            txtAddress.Name = "txtAddress";
+            txtAddress.ReadOnly = true;
+            txtAddress.Size = new Size(94, 23);
+            txtAddress.TabIndex = 6;
+            // 
             // CommunicatorForm
             // 
             AutoScaleDimensions = new SizeF(96F, 96F);
@@ -388,5 +431,9 @@
         private Label label6;
         private ReaLTaiizor.Forms.ThemeForm themeForm1;
         private ReaLTaiizor.Controls.ControlBox controlBox1;
+        private TextBox txtAddress;
+        private Label lblAddress;
+        private Label lblDataType;
+        private ComboBox cmbDataType;
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3