Shun hace 2 años
padre
commit
8ad5c4d75c
Se han modificado 43 ficheros con 1377 adiciones y 176 borrados
  1. 19 2
      src/YSAI.DAQ/YSAI.Can.Pack/Program.cs
  2. 2 2
      src/YSAI.DAQ/YSAI.Can.Pack/YSAI.Can.Pack.csproj
  3. 0 28
      src/YSAI.DAQ/YSAI.Core/data/AddressManage.cs
  4. 19 2
      src/YSAI.DAQ/YSAI.DB.Pack/Program.cs
  5. 1 1
      src/YSAI.DAQ/YSAI.DB.Pack/YSAI.DB.Pack.csproj
  6. 19 2
      src/YSAI.DAQ/YSAI.Kafka.Pack/Program.cs
  7. 1 1
      src/YSAI.DAQ/YSAI.Kafka.Pack/YSAI.Kafka.Pack.csproj
  8. 60 64
      src/YSAI.DAQ/YSAI.Manage/Controllers/InfoOperateController.cs
  9. 80 4
      src/YSAI.DAQ/YSAI.Manage/YSAI.Manage.csproj
  10. 5 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Can.Param.json
  11. 104 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Can.ParamDetails.json
  12. 8 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.DB.Param.json
  13. 65 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.DB.ParamDetails.json
  14. 7 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Kafka.Param.json
  15. 74 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Kafka.ParamDetails.json
  16. 15 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Modbus.Param.json
  17. 286 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Modbus.ParamDetails.json
  18. 9 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Mqtt.Param.json
  19. 67 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Mqtt.ParamDetails.json
  20. 6 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDa.Param.json
  21. 46 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDa.ParamDetails.json
  22. 10 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDaHttp.Param.json
  23. 69 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDaHttp.ParamDetails.json
  24. 11 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcUa.Param.json
  25. 65 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcUa.ParamDetails.json
  26. 8 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.RabbitMQ.Param.json
  27. 44 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.RabbitMQ.ParamDetails.json
  28. 11 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.S7.Param.json
  29. 101 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.S7.ParamDetails.json
  30. 20 2
      src/YSAI.DAQ/YSAI.Modbus.Pack/Program.cs
  31. 1 1
      src/YSAI.DAQ/YSAI.Modbus.Pack/YSAI.Modbus.Pack.csproj
  32. 2 0
      src/YSAI.DAQ/YSAI.Modbus/client/ModbusClientData.cs
  33. 20 2
      src/YSAI.DAQ/YSAI.Mqtt.Pack/Program.cs
  34. 1 1
      src/YSAI.DAQ/YSAI.Mqtt.Pack/YSAI.Mqtt.Pack.csproj
  35. 48 2
      src/YSAI.DAQ/YSAI.Opc.Pack/Program.cs
  36. 1 1
      src/YSAI.DAQ/YSAI.Opc.Pack/YSAI.Opc.Pack.csproj
  37. 19 2
      src/YSAI.DAQ/YSAI.RabbitMQ.Pack/Program.cs
  38. 1 1
      src/YSAI.DAQ/YSAI.RabbitMQ.Pack/YSAI.RabbitMQ.Pack.csproj
  39. 21 2
      src/YSAI.DAQ/YSAI.S7.Pack/Program.cs
  40. 1 1
      src/YSAI.DAQ/YSAI.S7.Pack/YSAI.S7.Pack.csproj
  41. 8 16
      src/YSAI.DAQ/YSAI.Test/TestAll.cs
  42. 13 33
      src/YSAI.DAQ/YSAI.Unility/FileTool.cs
  43. 9 6
      src/YSAI.DAQ/YSAI.Unility/JsonTool.cs

+ 19 - 2
src/YSAI.DAQ/YSAI.Can.Pack/Program.cs

@@ -1,10 +1,27 @@
-namespace YSAI.Can.Pack
+using YSAI.Unility;
+
+namespace YSAI.Can.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+            string Name = "YSAI.Can";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new CanData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<CanData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2 - 2
src/YSAI.DAQ/YSAI.Can.Pack/YSAI.Can.Pack.csproj


+ 0 - 28
src/YSAI.DAQ/YSAI.Core/data/AddressManage.cs

@@ -1,28 +0,0 @@
-using Newtonsoft.Json;
-using Newtonsoft.Json.Converters;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using YSAI.Core.@enum;
-
-namespace YSAI.Core.data
-{
-    /// <summary>
-    /// 地址管理
-    /// </summary>
-    public class AddressManage : Address
-    {
-        /// <summary>
-        /// 数采类型
-        /// </summary>
-        [JsonConverter(typeof(StringEnumConverter))]
-        public LibType DType { get; set; }
-
-        /// <summary>
-        /// 指定数采类型的实例参数
-        /// </summary>
-        public object? InstanceParam { get; set; }
-    }
-}

+ 19 - 2
src/YSAI.DAQ/YSAI.DB.Pack/Program.cs

@@ -1,10 +1,27 @@
-namespace YSAI.DB.Pack
+using YSAI.Unility;
+
+namespace YSAI.DB.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+            string Name = "YSAI.DB";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new DBData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<DBData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/YSAI.DAQ/YSAI.DB.Pack/YSAI.DB.Pack.csproj


+ 19 - 2
src/YSAI.DAQ/YSAI.Kafka.Pack/Program.cs

@@ -1,10 +1,27 @@
-namespace YSAI.Kafka.Pack
+using YSAI.Unility;
+
+namespace YSAI.Kafka.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+            string Name = "YSAI.Kafka";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new KafkaData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<KafkaData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/YSAI.DAQ/YSAI.Kafka.Pack/YSAI.Kafka.Pack.csproj


+ 60 - 64
src/YSAI.DAQ/YSAI.Manage/Controllers/InfoOperateController.cs

@@ -2,6 +2,7 @@
 using YSAI.Core.@enum;
 using YSAI.Core.data;
 using YSAI.Unility;
+using Newtonsoft.Json.Linq;
 
 namespace YSAI.Manage.Controllers
 {
@@ -12,70 +13,65 @@ namespace YSAI.Manage.Controllers
     [Route("api/[controller]/[action]")]
     public class InfoOperateController : Controller
     {
-        ///// <summary>
-        ///// 参数
-        ///// </summary>
-        ///// <param name="DType">库类型</param>
-        ///// <returns>统一出参</returns>
-        //[HttpGet]
-        //public object Param(LibType DType)
-        //{
-        //    switch (DType)
-        //    {
-        //        case LibType.DB:
-        //            return new DBData.Basics();
-        //        case LibType.Modbus:
-        //            return new ModbusClientData.Basics();
-        //        case LibType.OpcUa:
-        //            return new OpcUaClientData.Basics();
-        //        case LibType.OpcDa:
-        //            return new OpcDaClientData.Basics();
-        //        case LibType.OpcDaHttp:
-        //            return new OpcDaHttpData.Basics();
-        //        case LibType.S7:
-        //            return new S7ClientData.Basics();
-        //        case LibType.Kafka:
-        //            return new KafkaData.Basics();
-        //        case LibType.Mqtt:
-        //            return new MqttClientData.Basics();
-        //        case LibType.RabbitMQ:
-        //            return new RabbitMQData.Basics();
-        //        default:
-        //            return new OperateResult(false, "输入有误", 0.1);
-        //    }
-        //}
+        /// <summary>
+        /// 文件夹路径
+        /// </summary>
+        private readonly string Path = $"{AppDomain.CurrentDomain.BaseDirectory}param";
+        /// <summary>
+        /// 参数文件名
+        /// </summary>
+        private readonly string ParamFileName = $"YSAI.*.Param.json";
+        /// <summary>
+        /// 参数详情文件名
+        /// </summary>
+        private readonly string ParamDetailsFileName = $"YSAI.*.ParamDetails.json";
 
-        ///// <summary>
-        ///// 参数详情
-        ///// </summary>
-        ///// <param name="DType">库类型</param>
-        ///// <returns>统一出参</returns>
-        //[HttpGet]
-        //public OperateResult ParamDetails(LibType DType)
-        //{
-        //    switch (DType)
-        //    {
-        //        case LibType.DB:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<DBData.Basics>(), RType: ResultType.Json);
-        //        case LibType.Modbus:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<ModbusClientData.Basics>(), RType: ResultType.Json);
-        //        case LibType.OpcUa:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<OpcUaClientData.Basics>(), RType: ResultType.Json);
-        //        case LibType.OpcDa:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<OpcDaClientData.Basics>(), RType: ResultType.Json);
-        //        case LibType.OpcDaHttp:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<OpcDaHttpData.Basics>(), RType: ResultType.Json);
-        //        case LibType.S7:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<S7ClientData.Basics>(), RType: ResultType.Json);
-        //        case LibType.Kafka:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<KafkaData.Basics>(), RType: ResultType.Json);
-        //        case LibType.Mqtt:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<MqttClientData.Basics>(), RType: ResultType.Json);
-        //        case LibType.RabbitMQ:
-        //            return new OperateResult(true, string.Empty, 0.1, RData: ReflexTool.GetClassAllPropertyData<RabbitMQData.Basics>(), RType: ResultType.Json);
-        //        default:
-        //            return new OperateResult(false, "输入有误", 0.1);
-        //    }
-        //}
+        /// <summary>
+        /// 获取库类型集合
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        public List<string> LibTypes()
+        {
+            List<string> LTypes = new List<string>();
+            string[] Files = Directory.GetFiles(Path, ParamFileName, SearchOption.TopDirectoryOnly);
+            foreach (string File in Files)
+            {
+                LTypes.Add(FileTool.GetFileName(File).Split('.')[1]);
+            }
+            return LTypes;
+        }
+
+        /// <summary>
+        /// 参数
+        /// </summary>
+        /// <param name="LType">库类型</param>
+        /// <returns>统一出参</returns>
+        [HttpGet]
+        public object Param(string LType)
+        {
+            string path = $"{Path}//{ParamFileName.Replace("*", LType)}";
+            if (System.IO.File.Exists(path))
+            {
+                return FileTool.FileToString(path); 
+            }
+            return new OperateResult(false, $"{LType} 不存在", 0.8);
+        }
+
+        /// <summary>
+        /// 参数详情
+        /// </summary>
+        /// <param name="LType">库类型</param>
+        /// <returns>统一出参</returns>
+        [HttpGet]
+        public object ParamDetails(string LType)
+        {
+            string path = $"{Path}//{ParamDetailsFileName.Replace("*", LType)}";
+            if (System.IO.File.Exists(path))
+            {
+                return FileTool.FileToString(path);
+            }
+            return new OperateResult(false, $"{LType} 不存在", 0.8);
+        }
     }
 }

+ 80 - 4
src/YSAI.DAQ/YSAI.Manage/YSAI.Manage.csproj

@@ -10,12 +10,92 @@
 
   <ItemGroup>
     <Content Remove="config\ReflectionConfig.json" />
+    <Content Remove="param\YSAI.Can.Param.json" />
+    <Content Remove="param\YSAI.Can.ParamDetails.json" />
+    <Content Remove="param\YSAI.DB.Param.json" />
+    <Content Remove="param\YSAI.DB.ParamDetails.json" />
+    <Content Remove="param\YSAI.Kafka.Param.json" />
+    <Content Remove="param\YSAI.Kafka.ParamDetails.json" />
+    <Content Remove="param\YSAI.Modbus.Param.json" />
+    <Content Remove="param\YSAI.Modbus.ParamDetails.json" />
+    <Content Remove="param\YSAI.Mqtt.Param.json" />
+    <Content Remove="param\YSAI.Mqtt.ParamDetails.json" />
+    <Content Remove="param\YSAI.OpcDa.Param.json" />
+    <Content Remove="param\YSAI.OpcDa.ParamDetails.json" />
+    <Content Remove="param\YSAI.OpcDaHttp.Param.json" />
+    <Content Remove="param\YSAI.OpcDaHttp.ParamDetails.json" />
+    <Content Remove="param\YSAI.OpcUa.Param.json" />
+    <Content Remove="param\YSAI.OpcUa.ParamDetails.json" />
+    <Content Remove="param\YSAI.RabbitMQ.Param.json" />
+    <Content Remove="param\YSAI.RabbitMQ.ParamDetails.json" />
+    <Content Remove="param\YSAI.S7.Param.json" />
+    <Content Remove="param\YSAI.S7.ParamDetails.json" />
   </ItemGroup>
 
   <ItemGroup>
     <None Include="config\ReflectionConfig.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="param\YSAI.Can.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.Can.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.DB.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.DB.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.Kafka.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.Kafka.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.Modbus.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.Modbus.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.Mqtt.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.Mqtt.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.OpcDa.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.OpcDa.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.OpcDaHttp.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.OpcDaHttp.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.OpcUa.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.OpcUa.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.RabbitMQ.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.RabbitMQ.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.S7.Param.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="param\YSAI.S7.ParamDetails.json">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
 
   <ItemGroup>
@@ -28,8 +108,4 @@
     <ProjectReference Include="..\YSAI.RelayManage\YSAI.RelayManage.csproj" />
   </ItemGroup>
 
-  <ItemGroup>
-    <Folder Include="param\" />
-  </ItemGroup>
-
 </Project>

+ 5 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Can.Param.json

@@ -0,0 +1,5 @@
+{
+    "SN": null,
+    "BaudRate": 0,
+    "CanChannel": 0
+}

+ 104 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Can.ParamDetails.json

@@ -0,0 +1,104 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "BaudRate",
+        "Describe": "波特率",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": -1,
+                "Name": "canBITRATE_1M",
+                "Describe": ""
+            },
+            {
+                "Value": -2,
+                "Name": "canBITRATE_500K",
+                "Describe": ""
+            },
+            {
+                "Value": -3,
+                "Name": "canBITRATE_250K",
+                "Describe": ""
+            },
+            {
+                "Value": -4,
+                "Name": "canBITRATE_125K",
+                "Describe": ""
+            },
+            {
+                "Value": -5,
+                "Name": "canBITRATE_100K",
+                "Describe": ""
+            },
+            {
+                "Value": -6,
+                "Name": "canBITRATE_62K",
+                "Describe": ""
+            },
+            {
+                "Value": -7,
+                "Name": "canBITRATE_50K",
+                "Describe": ""
+            },
+            {
+                "Value": -8,
+                "Name": "canBITRATE_83K",
+                "Describe": ""
+            },
+            {
+                "Value": -9,
+                "Name": "canBITRATE_10K",
+                "Describe": ""
+            },
+            {
+                "Value": -1000,
+                "Name": "canFD_BITRATE_500K_80P",
+                "Describe": ""
+            },
+            {
+                "Value": -1001,
+                "Name": "canFD_BITRATE_1M_80P",
+                "Describe": ""
+            },
+            {
+                "Value": -1002,
+                "Name": "canFD_BITRATE_2M_80P",
+                "Describe": ""
+            },
+            {
+                "Value": -1007,
+                "Name": "canFD_BITRATE_2M_60P",
+                "Describe": ""
+            },
+            {
+                "Value": -1003,
+                "Name": "canFD_BITRATE_4M_80P",
+                "Describe": ""
+            },
+            {
+                "Value": -1004,
+                "Name": "canFD_BITRATE_8M_60P",
+                "Describe": ""
+            },
+            {
+                "Value": -1005,
+                "Name": "canFD_BITRATE_8M_80P",
+                "Describe": ""
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "CanChannel",
+        "Describe": "打开的CAN通道",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 8 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.DB.Param.json

@@ -0,0 +1,8 @@
+{
+    "SN": null,
+    "ConnectStr": null,
+    "DBType": "SqlServer",
+    "SleepTime": 0,
+    "DataChangeOut": true,
+    "SameDataOut": false
+}

+ 65 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.DB.ParamDetails.json

@@ -0,0 +1,65 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ConnectStr",
+        "Describe": "数据库连接字符串",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "DBType",
+        "Describe": "数据库类型",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "SqlServer",
+                "Describe": ""
+            },
+            {
+                "Value": 1,
+                "Name": "MySql",
+                "Describe": ""
+            },
+            {
+                "Value": 2,
+                "Name": "Oracle",
+                "Describe": ""
+            },
+            {
+                "Value": 3,
+                "Name": "SQLite",
+                "Describe": ""
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "SleepTime",
+        "Describe": "休眠时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "DataChangeOut",
+        "Describe": "数据变化抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SameDataOut",
+        "Describe": "未变项与变化项一同抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 7 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Kafka.Param.json

@@ -0,0 +1,7 @@
+{
+    "SN": "c7ba6456-dde5-4fc1-90a1-f8e0a418f422",
+    "BootstrapServers": null,
+    "WaitTime": 1000,
+    "SecurityProtocol": "Plaintext",
+    "AutoOffsetReset": "Earliest"
+}

+ 74 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Kafka.ParamDetails.json

@@ -0,0 +1,74 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "BootstrapServers",
+        "Describe": "服务器地址",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "WaitTime",
+        "Describe": "等待时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SecurityProtocol",
+        "Describe": "安全协议",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "Plaintext",
+                "Describe": ""
+            },
+            {
+                "Value": 1,
+                "Name": "Ssl",
+                "Describe": ""
+            },
+            {
+                "Value": 2,
+                "Name": "SaslPlaintext",
+                "Describe": ""
+            },
+            {
+                "Value": 3,
+                "Name": "SaslSsl",
+                "Describe": ""
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "AutoOffsetReset",
+        "Describe": "自动偏移复位",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "Latest",
+                "Describe": ""
+            },
+            {
+                "Value": 1,
+                "Name": "Earliest",
+                "Describe": ""
+            },
+            {
+                "Value": 2,
+                "Name": "Error",
+                "Describe": ""
+            }
+        ],
+        "ObjArray": null
+    }
+]

+ 15 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Modbus.Param.json

@@ -0,0 +1,15 @@
+{
+    "SN": null,
+    "SlaveAddress": 1,
+    "ProtocolType": "Tcp",
+    "ReadTimeOut": 2000,
+    "MRType": "NULL",
+    "MWType": "NULL",
+    "WriteTimeOut": 2000,
+    "TcpParam": null,
+    "UdpParam": null,
+    "SerialPortParam": null,
+    "SleepTime": 0,
+    "DataChangeOut": true,
+    "SameDataOut": false
+}

+ 286 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Modbus.ParamDetails.json

@@ -0,0 +1,286 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SlaveAddress",
+        "Describe": "寄存器地址",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ProtocolType",
+        "Describe": "协议类型",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "Rtu",
+                "Describe": "SerialPortParam"
+            },
+            {
+                "Value": 1,
+                "Name": "Ascii",
+                "Describe": "SerialPortParam"
+            },
+            {
+                "Value": 2,
+                "Name": "Tcp",
+                "Describe": "TcpParam"
+            },
+            {
+                "Value": 3,
+                "Name": "Udp",
+                "Describe": "UdpParam"
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "ReadTimeOut",
+        "Describe": "读取超时时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "MRType",
+        "Describe": "读取类型",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "Coils",
+                "Describe": "读取从1到2000个连续线圈状态"
+            },
+            {
+                "Value": 1,
+                "Name": "Inputs",
+                "Describe": "读取从1到2000个连续离散输入状态"
+            },
+            {
+                "Value": 2,
+                "Name": "HoldingRegisters",
+                "Describe": "读取保持寄存器的连续块"
+            },
+            {
+                "Value": 3,
+                "Name": "InputRegisters",
+                "Describe": "读取输入寄存器的连续块"
+            },
+            {
+                "Value": 4,
+                "Name": "NULL",
+                "Describe": "空"
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "MWType",
+        "Describe": "写入类型",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "SingleCoil",
+                "Describe": "写入单线圈值"
+            },
+            {
+                "Value": 1,
+                "Name": "SingleRegister",
+                "Describe": "写入单个保持寄存器"
+            },
+            {
+                "Value": 2,
+                "Name": "MultipleRegisters",
+                "Describe": "将1块写入123个连续寄存器"
+            },
+            {
+                "Value": 3,
+                "Name": "MultipleCoils",
+                "Describe": "写入线圈序列"
+            },
+            {
+                "Value": 4,
+                "Name": "NULL",
+                "Describe": "空"
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "WriteTimeOut",
+        "Describe": "写入超时时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "TcpParam",
+        "Describe": "TCP参数",
+        "ParamType": "TcpParam",
+        "EnumArray": null,
+        "ObjArray": [
+            {
+                "Name": "Ip",
+                "Describe": "IP",
+                "ParamType": "String",
+                "EnumArray": null,
+                "ObjArray": null
+            },
+            {
+                "Name": "Port",
+                "Describe": "端口",
+                "ParamType": "Int32",
+                "EnumArray": null,
+                "ObjArray": null
+            },
+            {
+                "Name": "ConnectTimeOut",
+                "Describe": "连接超时时间",
+                "ParamType": "Int32",
+                "EnumArray": null,
+                "ObjArray": null
+            }
+        ]
+    },
+    {
+        "Name": "UdpParam",
+        "Describe": "UDP参数",
+        "ParamType": "UdpParam",
+        "EnumArray": null,
+        "ObjArray": [
+            {
+                "Name": "Ip",
+                "Describe": "IP",
+                "ParamType": "String",
+                "EnumArray": null,
+                "ObjArray": null
+            },
+            {
+                "Name": "Port",
+                "Describe": "端口",
+                "ParamType": "Int32",
+                "EnumArray": null,
+                "ObjArray": null
+            }
+        ]
+    },
+    {
+        "Name": "SerialPortParam",
+        "Describe": "串口参数",
+        "ParamType": "SerialPortParam",
+        "EnumArray": null,
+        "ObjArray": [
+            {
+                "Name": "PortName",
+                "Describe": "串口号",
+                "ParamType": "String",
+                "EnumArray": null,
+                "ObjArray": null
+            },
+            {
+                "Name": "BaudRate",
+                "Describe": "波特率",
+                "ParamType": "Int32",
+                "EnumArray": null,
+                "ObjArray": null
+            },
+            {
+                "Name": "ParityBit",
+                "Describe": "校验位",
+                "ParamType": "Enum",
+                "EnumArray": [
+                    {
+                        "Value": 0,
+                        "Name": "None",
+                        "Describe": ""
+                    },
+                    {
+                        "Value": 1,
+                        "Name": "Odd",
+                        "Describe": ""
+                    },
+                    {
+                        "Value": 2,
+                        "Name": "Even",
+                        "Describe": ""
+                    },
+                    {
+                        "Value": 3,
+                        "Name": "Mark",
+                        "Describe": ""
+                    },
+                    {
+                        "Value": 4,
+                        "Name": "Space",
+                        "Describe": ""
+                    }
+                ],
+                "ObjArray": null
+            },
+            {
+                "Name": "DataBit",
+                "Describe": "数据位",
+                "ParamType": "Int32",
+                "EnumArray": null,
+                "ObjArray": null
+            },
+            {
+                "Name": "StopBit",
+                "Describe": "停止位",
+                "ParamType": "Enum",
+                "EnumArray": [
+                    {
+                        "Value": 0,
+                        "Name": "None",
+                        "Describe": ""
+                    },
+                    {
+                        "Value": 1,
+                        "Name": "One",
+                        "Describe": ""
+                    },
+                    {
+                        "Value": 2,
+                        "Name": "Two",
+                        "Describe": ""
+                    },
+                    {
+                        "Value": 3,
+                        "Name": "OnePointFive",
+                        "Describe": ""
+                    }
+                ],
+                "ObjArray": null
+            }
+        ]
+    },
+    {
+        "Name": "SleepTime",
+        "Describe": "休眠时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "DataChangeOut",
+        "Describe": "数据变化抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SameDataOut",
+        "Describe": "未变项与变化项一同抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 9 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Mqtt.Param.json

@@ -0,0 +1,9 @@
+{
+    "SN": null,
+    "ServerIPAddress": null,
+    "ServerPort": 0,
+    "ServerLoginID": null,
+    "ServerLoginPassword": null,
+    "ClientID": null,
+    "QualityOfServiceLevel": "AtMostOnce"
+}

+ 67 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.Mqtt.ParamDetails.json

@@ -0,0 +1,67 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ServerIPAddress",
+        "Describe": "IP地址",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ServerPort",
+        "Describe": "端口",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ServerLoginID",
+        "Describe": "登陆账号",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ServerLoginPassword",
+        "Describe": "登陆密码",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ClientID",
+        "Describe": "客户端ID",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "QualityOfServiceLevel",
+        "Describe": "QoS等级",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "AtMostOnce",
+                "Describe": ""
+            },
+            {
+                "Value": 1,
+                "Name": "AtLeastOnce",
+                "Describe": ""
+            },
+            {
+                "Value": 2,
+                "Name": "ExactlyOnce",
+                "Describe": ""
+            }
+        ],
+        "ObjArray": null
+    }
+]

+ 6 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDa.Param.json

@@ -0,0 +1,6 @@
+{
+    "SN": null,
+    "ServiceName": null,
+    "ApiVerType": "COM_DA_10",
+    "UpdateRate": 100
+}

+ 46 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDa.ParamDetails.json

@@ -0,0 +1,46 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ServiceName",
+        "Describe": "服务名",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ApiVerType",
+        "Describe": "接口版本",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "COM_DA_10",
+                "Describe": "1.x api"
+            },
+            {
+                "Value": 1,
+                "Name": "COM_DA_20",
+                "Describe": "2.x api"
+            },
+            {
+                "Value": 2,
+                "Name": "COM_DA_30",
+                "Describe": "3.x api"
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "UpdateRate",
+        "Describe": "更新频率",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 10 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDaHttp.Param.json

@@ -0,0 +1,10 @@
+{
+    "SN": null,
+    "ServerIP": null,
+    "Port": null,
+    "Key": null,
+    "RequestType": "http",
+    "SleepTime": 0,
+    "DataChangeOut": true,
+    "SameDataOut": false
+}

+ 69 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDaHttp.ParamDetails.json

@@ -0,0 +1,69 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ServerIP",
+        "Describe": "服务IP",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Port",
+        "Describe": "端口",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Key",
+        "Describe": "解密密钥",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "RequestType",
+        "Describe": "请求类型",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "http",
+                "Describe": ""
+            },
+            {
+                "Value": 1,
+                "Name": "https",
+                "Describe": ""
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "SleepTime",
+        "Describe": "休眠时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "DataChangeOut",
+        "Describe": "数据变化抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SameDataOut",
+        "Describe": "未变项与变化项一同抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 11 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcUa.Param.json

@@ -0,0 +1,11 @@
+{
+    "SN": null,
+    "UserName": null,
+    "Password": null,
+    "Cer": null,
+    "SecreKey": null,
+    "ServerUrl": null,
+    "Name": null,
+    "SamplingInterval": 1000,
+    "PublishingInterval": 20
+}

+ 65 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcUa.ParamDetails.json

@@ -0,0 +1,65 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "UserName",
+        "Describe": "用户名",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Password",
+        "Describe": "密码",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Cer",
+        "Describe": "证书路径",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SecreKey",
+        "Describe": "密钥",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ServerUrl",
+        "Describe": "服务地址",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Name",
+        "Describe": "自定义的名称空间",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SamplingInterval",
+        "Describe": "取样时间间隔",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "PublishingInterval",
+        "Describe": "发布时间间隔",
+        "ParamType": "Byte",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 8 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.RabbitMQ.Param.json

@@ -0,0 +1,8 @@
+{
+    "SN": "ac7add1a-3ae6-4077-9469-95e2096e94cf",
+    "ExChangeName": null,
+    "HostName": null,
+    "Port": 0,
+    "UserName": null,
+    "Password": null
+}

+ 44 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.RabbitMQ.ParamDetails.json

@@ -0,0 +1,44 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "ExChangeName",
+        "Describe": "交换机名称",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "HostName",
+        "Describe": "连接地址",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Port",
+        "Describe": "端口",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "UserName",
+        "Describe": "账号",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Password",
+        "Describe": "密码",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 11 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.S7.Param.json

@@ -0,0 +1,11 @@
+{
+    "SN": null,
+    "Ip": null,
+    "Port": 0,
+    "S7CpuType": "S7200",
+    "Rack": 0,
+    "Slot": 0,
+    "SleepTime": 0,
+    "DataChangeOut": true,
+    "SameDataOut": false
+}

+ 101 - 0
src/YSAI.DAQ/YSAI.Manage/param/YSAI.S7.ParamDetails.json

@@ -0,0 +1,101 @@
+[
+    {
+        "Name": "SN",
+        "Describe": "唯一标识符",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Ip",
+        "Describe": "IP",
+        "ParamType": "String",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Port",
+        "Describe": "端口",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "S7CpuType",
+        "Describe": "CPU类型",
+        "ParamType": "Enum",
+        "EnumArray": [
+            {
+                "Value": 0,
+                "Name": "S7200",
+                "Describe": ""
+            },
+            {
+                "Value": 1,
+                "Name": "Logo0BA8",
+                "Describe": ""
+            },
+            {
+                "Value": 2,
+                "Name": "S7200Smart",
+                "Describe": ""
+            },
+            {
+                "Value": 10,
+                "Name": "S7300",
+                "Describe": ""
+            },
+            {
+                "Value": 20,
+                "Name": "S7400",
+                "Describe": ""
+            },
+            {
+                "Value": 30,
+                "Name": "S71200",
+                "Describe": ""
+            },
+            {
+                "Value": 40,
+                "Name": "S71500",
+                "Describe": ""
+            }
+        ],
+        "ObjArray": null
+    },
+    {
+        "Name": "Rack",
+        "Describe": "PLC机架",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "Slot",
+        "Describe": "PLCCPU插槽",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SleepTime",
+        "Describe": "休眠时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "DataChangeOut",
+        "Describe": "数据变化抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    },
+    {
+        "Name": "SameDataOut",
+        "Describe": "未变项与变化项一同抛出",
+        "ParamType": "Boolean",
+        "EnumArray": null,
+        "ObjArray": null
+    }
+]

+ 20 - 2
src/YSAI.DAQ/YSAI.Modbus.Pack/Program.cs

@@ -1,10 +1,28 @@
-namespace YSAI.Modbus.Pack
+using YSAI.Modbus.client;
+using YSAI.Unility;
+
+namespace YSAI.Modbus.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+            string Name = "YSAI.Modbus";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new ModbusClientData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<ModbusClientData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/YSAI.DAQ/YSAI.Modbus.Pack/YSAI.Modbus.Pack.csproj


+ 2 - 0
src/YSAI.DAQ/YSAI.Modbus/client/ModbusClientData.cs

@@ -261,12 +261,14 @@ namespace YSAI.Modbus.client
             /// 读取类型
             /// </summary>
             [Description("读取类型")]
+            [JsonConverter(typeof(StringEnumConverter))]
             public ModbusReadType MRType { get; set; } = ModbusReadType.NULL;
 
             /// <summary>
             /// 写入类型
             /// </summary>
             [Description("写入类型")]
+            [JsonConverter(typeof(StringEnumConverter))]
             public ModbusWriteType MWType { get; set; } = ModbusWriteType.NULL;
 
             /// <summary>

+ 20 - 2
src/YSAI.DAQ/YSAI.Mqtt.Pack/Program.cs

@@ -1,10 +1,28 @@
-namespace YSAI.Mqtt.Pack
+using YSAI.Mqtt.client;
+using YSAI.Unility;
+
+namespace YSAI.Mqtt.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+            string Name = "YSAI.Mqtt";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new MqttClientData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<MqttClientData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/YSAI.DAQ/YSAI.Mqtt.Pack/YSAI.Mqtt.Pack.csproj


+ 48 - 2
src/YSAI.DAQ/YSAI.Opc.Pack/Program.cs

@@ -1,10 +1,56 @@
-namespace YSAI.Opc.Pack
+using YSAI.Opc.da.client;
+using YSAI.Opc.da.http;
+using YSAI.Opc.ua.client;
+using YSAI.Unility;
+
+namespace YSAI.Opc.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+
+
+            string Name = "YSAI.OpcUa";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new OpcUaClientData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<OpcUaClientData.Basics>().ToJson().JsonFormatting());
+
+            ///////////////////////////////////////
+
+            Name = "YSAI.OpcDa";
+            ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new OpcDaClientData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<OpcDaClientData.Basics>().ToJson().JsonFormatting());
+
+            ///////////////////////////////////////
+
+            Name = "YSAI.OpcDaHttp";
+            ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new OpcDaHttpData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<OpcDaHttpData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/YSAI.DAQ/YSAI.Opc.Pack/YSAI.Opc.Pack.csproj


+ 19 - 2
src/YSAI.DAQ/YSAI.RabbitMQ.Pack/Program.cs

@@ -1,10 +1,27 @@
-namespace YSAI.RabbitMQ.Pack
+using YSAI.Unility;
+
+namespace YSAI.RabbitMQ.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+            string Name = "YSAI.RabbitMQ";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new RabbitMQData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<RabbitMQData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/YSAI.DAQ/YSAI.RabbitMQ.Pack/YSAI.RabbitMQ.Pack.csproj


+ 21 - 2
src/YSAI.DAQ/YSAI.S7.Pack/Program.cs

@@ -1,10 +1,29 @@
-namespace YSAI.S7.Pack
+using YSAI.S7.client;
+using YSAI.Unility;
+using static System.Net.Mime.MediaTypeNames;
+
+namespace YSAI.S7.Pack
 {
     internal class Program
     {
         static void Main(string[] args)
         {
-            Console.WriteLine("Hello, World!");
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+            FileDirectory += "YSAI.Manage//param";
+            string Name = "YSAI.S7";
+            string ParamFile = $"{FileDirectory}//{Name}.Param.json";
+            string ParamDetailsFile = $"{FileDirectory}//{Name}.ParamDetails.json";
+            if (!Directory.Exists(FileDirectory))
+            {
+                Directory.CreateDirectory(FileDirectory);
+            }
+            FileTool.StringToFile(ParamFile, new S7ClientData.Basics().ToJson().JsonFormatting());
+            FileTool.StringToFile(ParamDetailsFile, ReflexTool.GetClassAllPropertyData<S7ClientData.Basics>().ToJson().JsonFormatting());
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
src/YSAI.DAQ/YSAI.S7.Pack/YSAI.S7.Pack.csproj


+ 8 - 16
src/YSAI.DAQ/YSAI.Test/TestAll.cs

@@ -543,12 +543,10 @@ namespace YSAI.Test
         public void 创建反射与地址配置()
         {
             //创建一个采集配置
-            List<AddressManage> addressManages = new List<AddressManage>();
+            List<Address> addressManages = new List<Address>();
 
-            AddressManage addressManage = new AddressManage();
-            addressManage.DType = Core.@enum.LibType.OpcDa;
+            Address addressManage = new Address();
             addressManage.SN = "OPCDA采集";
-            addressManage.InstanceParam = new OpcDaClientData.Basics() { SN = "OPCDA采集", ServiceName = "Knight.OPC.Server.Demo", ApiVerType = OpcDaClientData.ApiVerType.COM_DA_20 };
             addressManage.AddressArray = new List<AddressDetails>()
             {
                 new AddressDetails()
@@ -626,10 +624,8 @@ namespace YSAI.Test
 
             addressManages.Add(addressManage);
 
-            addressManage = new AddressManage();
-            addressManage.DType = Core.@enum.LibType.OpcUa;
+            addressManage = new Address();
             addressManage.SN = "OPCUA采集";
-            addressManage.InstanceParam = new OpcUaClientData.Basics() { SN = "OPCUA采集", Name = "TEST", Password = "ysai", UserName = "ysai", ServerUrl = "opc.tcp://192.168.2.38:8866/Opc.Ua.Service", SamplingInterval = 100 };
             addressManage.AddressArray = new List<AddressDetails>()
             {
                 new AddressDetails()
@@ -711,9 +707,9 @@ namespace YSAI.Test
             FileTool.StringToFile("config//DaqConfig.json", JsonTool.JsonEntityToString(addressManages).JsonFormatting());
 
 
-            List<AddressManage>? addresses = JsonTool.StringToJsonEntity<List<AddressManage>>(FileTool.FileToString("config//DaqConfig.json"));
+            List<Address>? addresses = JsonTool.StringToJsonEntity<List<Address>>(FileTool.FileToString("config//DaqConfig.json"));
 
-            OpcDaClientData.Basics? basics1 = JsonTool.StringToJsonEntity<OpcDaClientData.Basics>(addresses[0].InstanceParam.ToString());
+            //OpcDaClientData.Basics? basics1 = JsonTool.StringToJsonEntity<OpcDaClientData.Basics>(addresses[0].InstanceParam.ToString());
 
 
 
@@ -871,12 +867,10 @@ namespace YSAI.Test
         public void 创建点位地址_转发配置_反射配置()
         {
             //创建一个采集配置
-            List<AddressManage> addressManages = new List<AddressManage>();
+            List<Address> addressManages = new List<Address>();
 
-            AddressManage addressManage = new AddressManage();
-            addressManage.DType = Core.@enum.LibType.OpcDa;
+            Address addressManage = new Address();
             addressManage.SN = "OPCDA采集";
-            addressManage.InstanceParam = new OpcDaClientData.Basics() { SN = "OPCDA采集", ServiceName = "Knight.OPC.Server.Demo", ApiVerType = OpcDaClientData.ApiVerType.COM_DA_20 };
             addressManage.AddressArray = new List<AddressDetails>()
             {
                 new AddressDetails()
@@ -954,10 +948,8 @@ namespace YSAI.Test
 
             addressManages.Add(addressManage);
 
-            addressManage = new AddressManage();
-            addressManage.DType = Core.@enum.LibType.OpcUa;
+            addressManage = new Address();
             addressManage.SN = "OPCUA采集";
-            addressManage.InstanceParam = new OpcUaClientData.Basics() { SN = "OPCUA采集", Name = "TEST", Password = "ysai", UserName = "ysai", ServerUrl = "opc.tcp://192.168.2.38:8866/Opc.Ua.Service", SamplingInterval = 100 };
             addressManage.AddressArray = new List<AddressDetails>()
             {
                 new AddressDetails()

+ 13 - 33
src/YSAI.DAQ/YSAI.Unility/FileTool.cs

@@ -19,7 +19,7 @@ namespace YSAI.Unility
         /// <param name="Path">路径</param>
         /// <param name="Create">是否创建</param>
         /// <returns></returns>
-        public static string GetPathFolderPath(string Path,bool Create=true)
+        public static string GetFolderPath(string Path,bool Create=true)
         {
            string[] paths= Path.Replace("//", "◆").Replace("\\", "◆").Replace("/", "◆").Split('◆');
             paths[paths.Length-1] = string.Empty;
@@ -49,37 +49,17 @@ namespace YSAI.Unility
             }
             return folders.ToString();
         }
-//        /// <summary>
-//        /// 获取文件中数据
-//        /// </summary>
-//        /// <param name="filePath">文件路径</param>
-//        /// <returns></returns>
-//        public static string FileToString(string filePath)
-//        {
-//            if (!File.Exists(filePath)) return String.Empty;
-//            string strData = string.Empty;
-//            try
-//            {
-//                string line;
-//                // 创建一个 StreamReader 的实例来读取文件 ,using 语句也能关闭 StreamReader
-//                using (System.IO.StreamReader sr = new System.IO.StreamReader(filePath))
-//                {
-//                    // 从文件读取并显示行,直到文件的末尾
-//                    while ((line = sr.ReadLine()) != null)
-//                    {
-//                        //Console.WriteLine(line);
-//                        strData += line;
-//                    }
-//                }
-//            }
-//            catch (Exception e)
-//            {
-//#if DEBUG
-//                Console.WriteLine(e.Message);
-//#endif
-//            }
-//            return strData;
-//        }
+        /// <summary>
+        /// 获取文件名称
+        /// </summary>
+        /// <param name="Path">路径</param>
+        /// <returns></returns>
+        public static string GetFileName(string Path)
+        {
+            string[] paths = Path.Replace("//", "◆").Replace("\\", "◆").Replace("/", "◆").Split('◆');
+            return paths[paths.Length - 1];
+        }
+        
         /// <summary>
         /// 获取文件中数据
         /// </summary>
@@ -125,7 +105,7 @@ namespace YSAI.Unility
         /// </summary>
         public static void StringToFile(string filePath, string Data)
         {
-            string dir = GetPathFolderPath(filePath);
+            string dir = GetFolderPath(filePath);
             if (!string.IsNullOrEmpty(dir))
             {
                 if (!Directory.Exists(dir))

+ 9 - 6
src/YSAI.DAQ/YSAI.Unility/JsonTool.cs

@@ -104,11 +104,14 @@ namespace YSAI.Unility
                 return str;
             }
         }
-
-
-
-
-
-
+        /// <summary>
+        /// 字符串转标准json
+        /// </summary>
+        /// <param name="Json"></param>
+        /// <returns></returns>
+        public static object StringToStandardJson(string Json)
+        {
+            return new JsonSerializer().Deserialize(new JsonTextReader(new StringReader(Json)));
+        }
     }
 }