From 9d1660270272180cd71147d6ddd53d1382643d2e Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 02 十一月 2026 18:00:14 +0800
Subject: [PATCH] merge: 并入远程 Initial commit 作为历史根节点

---
 Plugin.TestResult/Model/ScannerConfig.cs |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/Plugin.TestResult/Model/ScannerConfig.cs b/Plugin.TestResult/Model/ScannerConfig.cs
new file mode 100644
index 0000000..acf2255
--- /dev/null
+++ b/Plugin.TestResult/Model/ScannerConfig.cs
@@ -0,0 +1,34 @@
+锘縰sing HMI.Util;
+using System;
+using System.IO.Ports;
+
+namespace Plugin.TestResult.Model
+{
+    public class ScannerConfig
+    {
+        public string PortName { get; set; }
+
+        public int BaudRate { get; set; }
+        public Parity Parity { get; set; } = Parity.None;
+        public int DataBits { get; set; }
+        public StopBits StopBits { get; set; } = StopBits.One;
+        public Handshake Handshake { get; set; } = Handshake.None;
+        public bool DtrEnable { get; set; } = true;
+        public bool RtsEnable { get; set; } = true;
+
+
+        public static ScannerConfig ReadFromIni(string iniFile, string section)
+        {
+            var res = new ScannerConfig();
+            res.PortName = IniFileHelper.ReadIniData(section, "PortName", "", iniFile);
+            res.BaudRate = int.Parse(IniFileHelper.ReadIniData(section, "BaudRate", "0", iniFile));
+            res.Parity = (Parity)Enum.Parse(typeof(Parity), IniFileHelper.ReadIniData(section, "Parity", "None", iniFile));
+            res.DataBits = int.Parse(IniFileHelper.ReadIniData(section, "DataBits", "0", iniFile));
+            res.StopBits = (StopBits)Enum.Parse(typeof(StopBits), IniFileHelper.ReadIniData(section, "StopBits", "One", iniFile));
+            res.Handshake = (Handshake)Enum.Parse(typeof(Handshake), IniFileHelper.ReadIniData(section, "Handshake", "None", iniFile));
+            res.DtrEnable = bool.Parse(IniFileHelper.ReadIniData(section, "DtrEnable", "true", iniFile));
+            res.RtsEnable = bool.Parse(IniFileHelper.ReadIniData(section, "RtsEnable", "true", iniFile));
+            return res;
+        }
+    }
+}

--
Gitblit v1.9.1