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 作为历史根节点
---
SimpleUtil/DIOController/DIOControllerCreator.cs | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/SimpleUtil/DIOController/DIOControllerCreator.cs b/SimpleUtil/DIOController/DIOControllerCreator.cs
new file mode 100644
index 0000000..eafecd5
--- /dev/null
+++ b/SimpleUtil/DIOController/DIOControllerCreator.cs
@@ -0,0 +1,31 @@
+锘縰sing System;
+using System.IO;
+
+namespace DIOController
+{
+ public class DIOControllerCreator
+ {
+ public static IDIOController CreateController(string iniFile)
+ {
+ if (!File.Exists(iniFile)) throw new Exception("鏈壘鍒伴厤缃枃浠�");
+ string type = IniFileHelper.ReadIniData("Config", "Type", "", iniFile);
+ switch (type)
+ {
+ case "ModbusTcp":
+ string ip = IniFileHelper.ReadIniData("Config", "Ip", "127.0.0.1", iniFile);
+ string portStr = IniFileHelper.ReadIniData("Config", "Port", "502", iniFile);
+ int port = int.Parse(portStr);
+ return new ModBusTcpController
+ {
+ Ip = ip,
+ Port = port
+ };
+ case "PCI_7432":
+ string name = IniFileHelper.ReadIniData("Config", "Name", "PCI_7432", iniFile);
+ return new PCIController { Name = name };
+ default:
+ throw new Exception("鏃犳晥鐨勬帶鍒跺櫒绫诲瀷");
+ }
+ }
+ }
+}
--
Gitblit v1.9.1