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_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs |  100 ++++++++++++++++++++++++++-----------------------
 1 files changed, 53 insertions(+), 47 deletions(-)

diff --git a/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs b/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs
index be5221e..4796997 100644
--- a/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs
+++ b/LB_SmartVision/Forms/Pages/HistoricalDataPage/HistoricalDataEditPage.Designer.cs
@@ -46,8 +46,8 @@
             labelStartTime = new Label();
             dataGridViewHD = new DataGridView();
             tableLayoutPanel4 = new TableLayoutPanel();
-            hopeButton1 = new ReaLTaiizor.Controls.HopeButton();
-            hopeButton2 = new ReaLTaiizor.Controls.HopeButton();
+            btnHisDataFind = new ReaLTaiizor.Controls.HopeButton();
+            btnHisDataExport = new ReaLTaiizor.Controls.HopeButton();
             grpHisData.SuspendLayout();
             tableLayoutPanel1.SuspendLayout();
             tableLayoutPanel2.SuspendLayout();
@@ -106,7 +106,6 @@
             tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 50F));
             tableLayoutPanel2.Size = new Size(854, 500);
             tableLayoutPanel2.TabIndex = 0;
-            tableLayoutPanel2.Paint += tableLayoutPanel2_Paint;
             // 
             // tableLayoutPanel3
             // 
@@ -120,8 +119,8 @@
             tableLayoutPanel3.RowCount = 3;
             tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F));
             tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 90F));
-            tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 200F));
-            tableLayoutPanel3.Size = new Size(334, 305);
+            tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Absolute, 45F));
+            tableLayoutPanel3.Size = new Size(334, 180);
             tableLayoutPanel3.TabIndex = 0;
             // 
             // tableLayoutPanelSN
@@ -135,7 +134,7 @@
             tableLayoutPanelSN.Name = "tableLayoutPanelSN";
             tableLayoutPanelSN.RowCount = 1;
             tableLayoutPanelSN.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
-            tableLayoutPanelSN.Size = new Size(328, 45);
+            tableLayoutPanelSN.Size = new Size(328, 39);
             tableLayoutPanelSN.TabIndex = 7;
             // 
             // labelSN
@@ -145,7 +144,7 @@
             labelSN.ForeColor = SystemColors.Control;
             labelSN.Location = new Point(3, 0);
             labelSN.Name = "labelSN";
-            labelSN.Size = new Size(129, 45);
+            labelSN.Size = new Size(129, 39);
             labelSN.TabIndex = 6;
             labelSN.Text = "SN鍙�";
             labelSN.TextAlign = ContentAlignment.MiddleLeft;
@@ -195,6 +194,7 @@
             comboBoxSearchBasis.Name = "comboBoxSearchBasis";
             comboBoxSearchBasis.Size = new Size(187, 28);
             comboBoxSearchBasis.TabIndex = 1;
+            comboBoxSearchBasis.SelectedIndexChanged += comboBoxSearchBasis_SelectedIndexChanged;
             // 
             // contentContainer
             // 
@@ -227,6 +227,8 @@
             dateTimePickerEnd.Dock = DockStyle.Fill;
             dateTimePickerEnd.Location = new Point(138, 50);
             dateTimePickerEnd.Margin = new Padding(3, 5, 3, 3);
+            dateTimePickerEnd.MaxDate = new DateTime(2100, 1, 1, 0, 0, 0, 0);
+            dateTimePickerEnd.MinDate = new DateTime(2020, 1, 1, 0, 0, 0, 0);
             dateTimePickerEnd.Name = "dateTimePickerEnd";
             dateTimePickerEnd.Size = new Size(187, 30);
             dateTimePickerEnd.TabIndex = 9;
@@ -236,9 +238,12 @@
             dateTimePickerStart.Dock = DockStyle.Fill;
             dateTimePickerStart.Location = new Point(138, 5);
             dateTimePickerStart.Margin = new Padding(3, 5, 3, 3);
+            dateTimePickerStart.MaxDate = new DateTime(2100, 1, 1, 0, 0, 0, 0);
+            dateTimePickerStart.MinDate = new DateTime(2020, 1, 1, 0, 0, 0, 0);
             dateTimePickerStart.Name = "dateTimePickerStart";
             dateTimePickerStart.Size = new Size(187, 30);
             dateTimePickerStart.TabIndex = 8;
+            dateTimePickerStart.ValueChanged += dateTimePickerStart_ValueChanged;
             // 
             // labelEndTime
             // 
@@ -280,8 +285,8 @@
             tableLayoutPanel4.ColumnCount = 2;
             tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
             tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
-            tableLayoutPanel4.Controls.Add(hopeButton1, 0, 0);
-            tableLayoutPanel4.Controls.Add(hopeButton2, 1, 0);
+            tableLayoutPanel4.Controls.Add(btnHisDataFind, 0, 0);
+            tableLayoutPanel4.Controls.Add(btnHisDataExport, 1, 0);
             tableLayoutPanel4.Location = new Point(657, 509);
             tableLayoutPanel4.Name = "tableLayoutPanel4";
             tableLayoutPanel4.RowCount = 1;
@@ -289,43 +294,44 @@
             tableLayoutPanel4.Size = new Size(200, 39);
             tableLayoutPanel4.TabIndex = 1;
             // 
-            // hopeButton1
+            // btnHisDataFind
             // 
-            hopeButton1.BorderColor = Color.FromArgb(220, 223, 230);
-            hopeButton1.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary;
-            hopeButton1.DangerColor = Color.FromArgb(245, 108, 108);
-            hopeButton1.DefaultColor = Color.FromArgb(255, 255, 255);
-            hopeButton1.Font = new Font("Segoe UI", 12F);
-            hopeButton1.HoverTextColor = Color.FromArgb(48, 49, 51);
-            hopeButton1.InfoColor = Color.FromArgb(144, 147, 153);
-            hopeButton1.Location = new Point(3, 3);
-            hopeButton1.Name = "hopeButton1";
-            hopeButton1.PrimaryColor = Color.FromArgb(64, 158, 255);
-            hopeButton1.Size = new Size(94, 33);
-            hopeButton1.SuccessColor = Color.FromArgb(103, 194, 58);
-            hopeButton1.TabIndex = 0;
-            hopeButton1.Text = "鏌ヨ";
-            hopeButton1.TextColor = Color.White;
-            hopeButton1.WarningColor = Color.FromArgb(230, 162, 60);
+            btnHisDataFind.BorderColor = Color.FromArgb(220, 223, 230);
+            btnHisDataFind.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary;
+            btnHisDataFind.DangerColor = Color.FromArgb(245, 108, 108);
+            btnHisDataFind.DefaultColor = Color.FromArgb(255, 255, 255);
+            btnHisDataFind.Font = new Font("Segoe UI", 12F);
+            btnHisDataFind.HoverTextColor = Color.FromArgb(48, 49, 51);
+            btnHisDataFind.InfoColor = Color.FromArgb(144, 147, 153);
+            btnHisDataFind.Location = new Point(3, 3);
+            btnHisDataFind.Name = "btnHisDataFind";
+            btnHisDataFind.PrimaryColor = Color.FromArgb(64, 158, 255);
+            btnHisDataFind.Size = new Size(94, 33);
+            btnHisDataFind.SuccessColor = Color.FromArgb(103, 194, 58);
+            btnHisDataFind.TabIndex = 0;
+            btnHisDataFind.Text = "鏌ヨ";
+            btnHisDataFind.TextColor = Color.White;
+            btnHisDataFind.WarningColor = Color.FromArgb(230, 162, 60);
             // 
-            // hopeButton2
+            // btnHisDataExport
             // 
-            hopeButton2.BorderColor = Color.FromArgb(220, 223, 230);
-            hopeButton2.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary;
-            hopeButton2.DangerColor = Color.FromArgb(245, 108, 108);
-            hopeButton2.DefaultColor = Color.FromArgb(255, 255, 255);
-            hopeButton2.Font = new Font("Segoe UI", 12F);
-            hopeButton2.HoverTextColor = Color.FromArgb(48, 49, 51);
-            hopeButton2.InfoColor = Color.FromArgb(144, 147, 153);
-            hopeButton2.Location = new Point(103, 3);
-            hopeButton2.Name = "hopeButton2";
-            hopeButton2.PrimaryColor = Color.FromArgb(64, 158, 255);
-            hopeButton2.Size = new Size(94, 33);
-            hopeButton2.SuccessColor = Color.FromArgb(103, 194, 58);
-            hopeButton2.TabIndex = 1;
-            hopeButton2.Text = "瀵煎嚭";
-            hopeButton2.TextColor = Color.White;
-            hopeButton2.WarningColor = Color.FromArgb(230, 162, 60);
+            btnHisDataExport.BorderColor = Color.FromArgb(220, 223, 230);
+            btnHisDataExport.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary;
+            btnHisDataExport.DangerColor = Color.FromArgb(245, 108, 108);
+            btnHisDataExport.DefaultColor = Color.FromArgb(255, 255, 255);
+            btnHisDataExport.Font = new Font("Segoe UI", 12F);
+            btnHisDataExport.HoverTextColor = Color.FromArgb(48, 49, 51);
+            btnHisDataExport.InfoColor = Color.FromArgb(144, 147, 153);
+            btnHisDataExport.Location = new Point(103, 3);
+            btnHisDataExport.Name = "btnHisDataExport";
+            btnHisDataExport.PrimaryColor = Color.FromArgb(64, 158, 255);
+            btnHisDataExport.Size = new Size(94, 33);
+            btnHisDataExport.SuccessColor = Color.FromArgb(103, 194, 58);
+            btnHisDataExport.TabIndex = 1;
+            btnHisDataExport.Text = "瀵煎嚭";
+            btnHisDataExport.TextColor = Color.White;
+            btnHisDataExport.WarningColor = Color.FromArgb(230, 162, 60);
+            btnHisDataExport.Click += btnHisDataExport_Click;
             // 
             // HistoricalDataEditPage
             // 
@@ -358,15 +364,15 @@
         private TableLayoutPanel tableLayoutPanel3;
         private DataGridView dataGridViewHD;
         private TableLayoutPanel tableLayoutPanel4;
-        private ReaLTaiizor.Controls.HopeButton hopeButton1;
-        private ReaLTaiizor.Controls.HopeButton hopeButton2;
+        private ReaLTaiizor.Controls.HopeButton btnHisDataFind;
+        private ReaLTaiizor.Controls.HopeButton btnHisDataExport;
         private TableLayoutPanel tableLayoutPanel5;
         private Label labelSearchBasis;
-        private ComboBox comboBoxSearchBasis;
-        private Panel contentContainer;
         private TableLayoutPanel tableLayoutPanelSN;
         private Label labelSN;
         private TextBox textBoxSN;
+        private ComboBox comboBoxSearchBasis;
+        private Panel contentContainer;
         private TableLayoutPanel tableLayoutPanelTimeSearch;
         private DateTimePicker dateTimePickerEnd;
         private DateTimePicker dateTimePickerStart;

--
Gitblit v1.9.3