Jelajahi Sumber

新增边端 结构参数解析JSON

Shun 2 tahun lalu
induk
melakukan
20076e6d53

+ 7 - 0
src/YSAI.DAQ/YSAI.DAQ.sln

@@ -91,6 +91,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YSAI.Tool", "YSAI.Tool\YSAI
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YSAI.Test.All", "YSAI.Test.All\YSAI.Test.All.csproj", "{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YSAI.Pack.Param", "YSAI.Pack.Param\YSAI.Pack.Param.csproj", "{36696247-658B-445E-9C05-A815B73F248A}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -237,6 +239,10 @@ Global
 		{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{36696247-658B-445E-9C05-A815B73F248A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{36696247-658B-445E-9C05-A815B73F248A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{36696247-658B-445E-9C05-A815B73F248A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{36696247-658B-445E-9C05-A815B73F248A}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -281,6 +287,7 @@ Global
 		{E85BF19B-E671-4A1E-BC67-B545700B4BF1} = {1856E9E1-33C4-45C1-832C-854F9BE1ACC4}
 		{3C333E39-520D-4183-8E3D-D0FF6628C15E} = {1856E9E1-33C4-45C1-832C-854F9BE1ACC4}
 		{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D} = {12CB0510-7B1E-4518-AA3B-412A4D323D42}
+		{36696247-658B-445E-9C05-A815B73F248A} = {1EBA4FD7-DF52-49A0-8AA4-9E61ABC614F5}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {5D5D3927-6714-40C0-84EA-44C5BA4C5E87}

+ 343 - 0
src/YSAI.DAQ/YSAI.Pack.Param/Program.cs

@@ -0,0 +1,343 @@
+using Google.Protobuf.WellKnownTypes;
+using Microsoft.AspNetCore.DataProtection.KeyManagement;
+using Microsoft.Win32.SafeHandles;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+using OpcDaNetApi;
+using System.Collections.Generic;
+using YSAI.Can;
+using YSAI.DB;
+using YSAI.Kafka;
+using YSAI.Modbus.client;
+using YSAI.Mqtt.client;
+using YSAI.Opc.da.client;
+using YSAI.Opc.da.http;
+using YSAI.Opc.ua.client;
+using YSAI.RabbitMQ;
+using YSAI.S7.client;
+using YSAI.Unility;
+using static YSAI.Pack.Param.Program;
+using static YSAI.Pack.Param.Program.BodyParam.subset;
+using static YSAI.Unility.ReflexTool;
+
+namespace YSAI.Pack.Param
+{
+    internal class Program
+    {
+        static void Main(string[] args)
+        {
+            string FileDirectory = string.Empty;
+            string[] paths = AppDomain.CurrentDomain.BaseDirectory.Split('\\');
+            for (int i = 0; i < paths.Length - 5; i++)
+            {
+                FileDirectory += $"{paths[i]}//";
+            }
+
+
+            BodyHandler body1 = new BodyHandler { Body = new CanData.Basics(), FileName = "Can.json",Namespace= "YSAI.Can.CanOperator" };
+            BodyHandler body2 = new BodyHandler { Body = new DBData.Basics(), FileName = "DB.json", Namespace = "YSAI.DB.DBOperate" };
+            BodyHandler body3 = new BodyHandler { Body = new KafkaData.Basics(), FileName = "Kafka.json", Namespace = "YSAI.Kafka.KafkaOperate" };
+            BodyHandler body4 = new BodyHandler { Body = new ModbusClientData.Basics(), FileName = "Modbus.json", Namespace = "YSAI.Modbus.client.ModbusClientOperate" };
+            BodyHandler body5 = new BodyHandler { Body = new MqttClientData.Basics(), FileName = "Mqtt.json", Namespace = "YSAI.Mqtt.client.MqttClientOperate" };
+            BodyHandler body6 = new BodyHandler { Body = new OpcDaClientData.Basics(), FileName = "OpcDa.json", Namespace = "YSAI.Opc.da.client.OpcDaClientOperate" };
+            BodyHandler body7 = new BodyHandler { Body = new OpcDaHttpData.Basics(), FileName = "OpcDaHttp.json", Namespace = "YSAI.Opc.da.http.OpcDaHttpOperate" };
+            BodyHandler body8 = new BodyHandler { Body = new OpcUaClientData.Basics(), FileName = "OpcUa.json", Namespace = "YSAI.Opc.ua.client.OpcUaClientOperate" };
+            BodyHandler body9 = new BodyHandler { Body = new RabbitMQData.Basics(), FileName = "RabbitMQ.json", Namespace = "YSAI.RabbitMQ.RabbitMQOperate" };
+            BodyHandler body10 = new BodyHandler { Body = new S7ClientData.Basics(), FileName = "S7.json", Namespace = "YSAI.S7.client.S7ClientOperate" };
+
+            List<BodyHandler> bodys = new List<BodyHandler> { body1, body2, body3, body4, body5, body6, body7, body8, body9, body10 };
+
+            foreach (var item in bodys)
+            {
+                int index = item.Body.GetType().FullName.Replace("+", ".").Split('.').Length;
+                string name = $"{item.Body.GetType().FullName.Replace("+", ".").Split('.')[index - 2]}.{item.Body.GetType().FullName.Replace("+", ".").Split('.')[index - 1]}";
+                string message = item.FileName.Split('.')[0];
+                List<LibInstanceParam>? libInstanceParams = null;
+                BodyParam? bodyParam = null;
+                switch (name)
+                {
+                    case "CanData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<CanData.Basics>();
+                        break;
+                    case "DBData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<DBData.Basics>();
+                        break;
+                    case "KafkaData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<KafkaData.Basics>();
+                        break;
+                    case "ModbusClientData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<ModbusClientData.Basics>();
+                        break;
+                    case "MqttClientData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<MqttClientData.Basics>();
+                        break;
+                    case "OpcDaClientData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<OpcDaClientData.Basics>();
+                        break;
+                    case "OpcDaHttpData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<OpcDaHttpData.Basics>();
+                        break;
+                    case "OpcUaClientData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<OpcUaClientData.Basics>();
+                        break;
+                    case "RabbitMQData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<RabbitMQData.Basics>();
+                        break;
+                    case "S7ClientData.Basics":
+                        libInstanceParams = ReflexTool.GetClassAllPropertyData<S7ClientData.Basics>();
+                        break;
+                }
+
+               
+
+                if (message.Equals("Modbus"))
+                {
+                    string[] strings = new string[] { "Modbus-Tcp", "Modbus-Udp", "Modbus-Rtu", "Modbus-Ascii" };
+                    bodyParam = new BodyParam()
+                    {
+                        Code = message,
+                        Name = message,
+                        Description = message,
+                        Subset = new List<BodyParam.subset>()
+                    };
+
+
+                    for (int i = 0; i < strings.Length; i++)
+                    {
+                        bodyParam.Subset.Add(new BodyParam.subset
+                        {
+                            Description = strings[i],
+                            Name = strings[i],
+                            Propertie = new List<BodyParam.subset.propertie>()
+                        });
+
+                        foreach (var lib in libInstanceParams)
+                        {
+                            BodyParam.subset.propertie propertie = new BodyParam.subset.propertie
+                            {
+                                PropertyName = lib.Name,
+                                Description = lib.Describe,
+                                IsShow = true,
+
+                            };
+
+                            if (lib.ParamType.Equals("Enum"))
+                            {
+                                propertie.DataCate = BodyParam.subset.propertie.dataCate.select;
+                                propertie.Options = new List<BodyParam.subset.propertie.options>();
+                                foreach (var val in lib.EnumArray as List<dynamic>)
+                                {
+                                    string des = val.Describe;
+                                    if (!string.IsNullOrEmpty(des))
+                                    {
+                                        des = $"({val.Describe})";
+                                    }
+
+                                    propertie.Options.Add(new BodyParam.subset.propertie.options
+                                    {
+                                        Key = val.Name + des,
+                                        Value = val.Value,
+                                    });
+                                }
+                            }
+                            if (lib.ParamType.Equals("String"))
+                            {
+                                propertie.DataCate = BodyParam.subset.propertie.dataCate.text;
+                            }
+                            if (lib.ParamType.Equals("Boolean"))
+                            {
+                                propertie.DataCate = BodyParam.subset.propertie.dataCate.radio;
+                                propertie.Options = new List<BodyParam.subset.propertie.options>();
+                                propertie.Options.Add(new BodyParam.subset.propertie.options
+                                {
+                                    Key = "是",
+                                    Value = true,
+                                });
+                                propertie.Options.Add(new BodyParam.subset.propertie.options
+                                {
+                                    Key = "否",
+                                    Value = false,
+                                });
+                            }
+
+                            bodyParam.Subset[i].Propertie.Add(propertie);
+                        }
+                        bodyParam.Subset[i].Propertie.RemoveRange(2, 1);
+                        switch (strings[i])
+                        {
+                            case "Modbus-Tcp":
+                            case "Modbus-Udp":
+                                bodyParam.Subset[i].Propertie.RemoveRange(10, 5);
+                                break;
+                            case "Modbus-Rtu":
+                            case "Modbus-Ascii":
+                                bodyParam.Subset[i].Propertie.RemoveRange(7, 3);
+                                break;
+                        }
+
+                        bodyParam.Subset[i].Propertie.Add(new propertie
+                        {
+                            PropertyName = "ServiceName",
+                            Description = "实现类名",
+                            IsShow = false,
+                            IsMust = false,
+                            Value = item.Namespace,
+                            DataCate = propertie.dataCate.text
+                        });
+
+                    }
+                }
+                else
+                {
+                    bodyParam = new BodyParam()
+                    {
+                        Code = message,
+                        Name = message,
+                        Description = message,
+                        Subset = new List<BodyParam.subset>
+                        {
+                            new BodyParam.subset
+                            {
+                                Description = message,
+                                Name = message,
+                                Propertie = new List<BodyParam.subset.propertie>()
+                            }
+                        }
+                    };
+
+
+                    foreach (var lib in libInstanceParams)
+                    {
+                     
+                        BodyParam.subset.propertie propertie = new BodyParam.subset.propertie
+                        {
+                            PropertyName = lib.Name,
+                            Description = lib.Describe,
+                            IsShow = true,
+                        };
+
+                        if (lib.ParamType.Equals("Enum"))
+                        {
+                            propertie.DataCate = BodyParam.subset.propertie.dataCate.select;
+                            propertie.Options = new List<BodyParam.subset.propertie.options>();
+                            foreach (var val in lib.EnumArray as List<dynamic>)
+                            {
+                                string des = val.Describe;
+                                if (!string.IsNullOrEmpty(des))
+                                {
+                                    des = $"({val.Describe})";
+                                }
+
+                                propertie.Options.Add(new BodyParam.subset.propertie.options
+                                {
+                                    Key = val.Name + des,
+                                    Value = val.Value,
+                                });
+                            }
+                        }
+                        if (lib.ParamType.Equals("String"))
+                        {
+                            propertie.DataCate = BodyParam.subset.propertie.dataCate.text;
+                        }
+                        if (lib.ParamType.Equals("Boolean"))
+                        {
+                            propertie.DataCate = BodyParam.subset.propertie.dataCate.radio;
+                            propertie.Options = new List<BodyParam.subset.propertie.options>();
+                            propertie.Options.Add(new BodyParam.subset.propertie.options
+                            {
+                                Key = "是",
+                                Value = true,
+                            });
+                            propertie.Options.Add(new BodyParam.subset.propertie.options
+                            {
+                                Key = "否",
+                                Value = false,
+                            });
+                        }
+                       
+
+                        bodyParam.Subset[0].Propertie.Add(propertie);
+                    }
+
+                    if (message.Equals("RabbitMQ") || message.Equals("Mqtt") || message.Equals("Kafka"))
+                    {
+                        bodyParam.Subset[0].Propertie.Add(new propertie 
+                        {
+                            PropertyName = "Topic",
+                            Description = "主题",
+                            IsShow = true,
+                            IsMust=true,
+                            DataCate=propertie.dataCate.text
+                        });
+                    }
+
+                    bodyParam.Subset[0].Propertie.Add(new propertie
+                    {
+                        PropertyName = "ServiceName",
+                        Description = "实现类名",
+                        IsShow = false,
+                        IsMust = false,
+                        Value= item.Namespace,
+                        DataCate = propertie.dataCate.text
+                    });
+                }
+
+                string path = Path.Combine(FileDirectory, "YSAI.Pack", item.FileName);
+
+                FileTool.StringToFile(path, bodyParam.ToJson().JsonFormatting());
+            }
+        }
+        /// <summary>
+        /// 处理的结构
+        /// </summary>
+        /// <typeparam name="T">泛型对象</typeparam>
+        public class BodyHandler 
+        {
+            public object Body { get; set; }
+            public string FileName { get; set; }
+            public string Namespace { get; set; }
+        }
+
+        /// <summary>
+        /// 结构体参数
+        /// </summary>
+        public class BodyParam
+        {
+            public string Code { get; set; }
+            public string Name { get; set; }
+            public string Description { get; set; }
+            public List<subset> Subset { get; set; }
+            public class subset
+            {
+                public string Name { get; set; }
+                public string Description { get; set; }
+                public List<propertie> Propertie { get; set; }
+                public class propertie
+                {
+                    [JsonConverter(typeof(StringEnumConverter))]
+                    public dataCate DataCate { get; set; }
+                    public enum dataCate
+                    {
+                        text,
+                        select,
+                        radio
+                    }
+                    public string Default { get; set; }
+                    public string Description { get; set; }
+                    public string PropertyName { get; set; }
+                    public object? Value { get; set; }
+                    public bool IsShow { get; set; }
+                    public bool IsMust { get; set; }
+                    public List<options>? Options { get; set; } = null;
+                    public class options
+                    {
+                        public string Key { get; set; }
+                        public object Value { get; set; }
+                    }
+
+
+                }
+            }
+        }
+    }
+}

+ 21 - 0
src/YSAI.DAQ/YSAI.Pack.Param/YSAI.Pack.Param.csproj

@@ -0,0 +1,21 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\YSAI.Can\YSAI.Can.csproj" />
+    <ProjectReference Include="..\YSAI.DB\YSAI.DB.csproj" />
+    <ProjectReference Include="..\YSAI.Kafka\YSAI.Kafka.csproj" />
+    <ProjectReference Include="..\YSAI.Modbus\YSAI.Modbus.csproj" />
+    <ProjectReference Include="..\YSAI.Mqtt\YSAI.Mqtt.csproj" />
+    <ProjectReference Include="..\YSAI.Opc\YSAI.Opc.csproj" />
+    <ProjectReference Include="..\YSAI.RabbitMQ\YSAI.RabbitMQ.csproj" />
+    <ProjectReference Include="..\YSAI.S7\YSAI.S7.csproj" />
+  </ItemGroup>
+
+</Project>

+ 186 - 0
src/YSAI.DAQ/YSAI.Pack/Can.json

@@ -0,0 +1,186 @@
+{
+    "Code": "Can",
+    "Name": "Can",
+    "Description": "Can",
+    "Subset": [
+        {
+            "Name": "Can",
+            "Description": "Can",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "波特率",
+                    "PropertyName": "BaudRate",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "canBITRATE_1M",
+                            "Value": -1
+                        },
+                        {
+                            "Key": "canBITRATE_500K",
+                            "Value": -2
+                        },
+                        {
+                            "Key": "canBITRATE_250K",
+                            "Value": -3
+                        },
+                        {
+                            "Key": "canBITRATE_125K",
+                            "Value": -4
+                        },
+                        {
+                            "Key": "canBITRATE_100K",
+                            "Value": -5
+                        },
+                        {
+                            "Key": "canBITRATE_62K",
+                            "Value": -6
+                        },
+                        {
+                            "Key": "canBITRATE_50K",
+                            "Value": -7
+                        },
+                        {
+                            "Key": "canBITRATE_83K",
+                            "Value": -8
+                        },
+                        {
+                            "Key": "canBITRATE_10K",
+                            "Value": -9
+                        },
+                        {
+                            "Key": "canFD_BITRATE_500K_80P",
+                            "Value": -1000
+                        },
+                        {
+                            "Key": "canFD_BITRATE_1M_80P",
+                            "Value": -1001
+                        },
+                        {
+                            "Key": "canFD_BITRATE_2M_80P",
+                            "Value": -1002
+                        },
+                        {
+                            "Key": "canFD_BITRATE_2M_60P",
+                            "Value": -1007
+                        },
+                        {
+                            "Key": "canFD_BITRATE_4M_80P",
+                            "Value": -1003
+                        },
+                        {
+                            "Key": "canFD_BITRATE_8M_60P",
+                            "Value": -1004
+                        },
+                        {
+                            "Key": "canFD_BITRATE_8M_80P",
+                            "Value": -1005
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "CAN通道",
+                    "PropertyName": "CanChannel",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "处理间隔(毫秒)",
+                    "PropertyName": "HandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "变化抛出",
+                    "PropertyName": "ChangeOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "未变项与变化项一同抛出",
+                    "PropertyName": "AllOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务数量",
+                    "PropertyName": "TaskNumber",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务处理间隔(毫秒)",
+                    "PropertyName": "TaskHandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.Can.CanOperator",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

+ 138 - 0
src/YSAI.DAQ/YSAI.Pack/DB.json

@@ -0,0 +1,138 @@
+{
+    "Code": "DB",
+    "Name": "DB",
+    "Description": "DB",
+    "Subset": [
+        {
+            "Name": "DB",
+            "Description": "DB",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "数据库连接字符串",
+                    "PropertyName": "ConnectStr",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "数据库类型",
+                    "PropertyName": "DBType",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "SqlServer",
+                            "Value": 0
+                        },
+                        {
+                            "Key": "MySql",
+                            "Value": 1
+                        },
+                        {
+                            "Key": "Oracle",
+                            "Value": 2
+                        },
+                        {
+                            "Key": "SQLite",
+                            "Value": 3
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "处理间隔(毫秒)",
+                    "PropertyName": "HandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "变化抛出",
+                    "PropertyName": "ChangeOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "未变项与变化项一同抛出",
+                    "PropertyName": "AllOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务数量",
+                    "PropertyName": "TaskNumber",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务处理间隔(毫秒)",
+                    "PropertyName": "TaskHandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.DB.DBOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

+ 113 - 0
src/YSAI.DAQ/YSAI.Pack/Kafka.json

@@ -0,0 +1,113 @@
+{
+    "Code": "Kafka",
+    "Name": "Kafka",
+    "Description": "Kafka",
+    "Subset": [
+        {
+            "Name": "Kafka",
+            "Description": "Kafka",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "服务器地址",
+                    "PropertyName": "BootstrapServers",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "等待时间",
+                    "PropertyName": "WaitTime",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "安全协议",
+                    "PropertyName": "SecurityProtocol",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "Plaintext",
+                            "Value": 0
+                        },
+                        {
+                            "Key": "Ssl",
+                            "Value": 1
+                        },
+                        {
+                            "Key": "SaslPlaintext",
+                            "Value": 2
+                        },
+                        {
+                            "Key": "SaslSsl",
+                            "Value": 3
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "自动偏移复位",
+                    "PropertyName": "AutoOffsetReset",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "Latest",
+                            "Value": 0
+                        },
+                        {
+                            "Key": "Earliest",
+                            "Value": 1
+                        },
+                        {
+                            "Key": "Error",
+                            "Value": 2
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "主题",
+                    "PropertyName": "Topic",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": true,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.Kafka.KafkaOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

File diff ditekan karena terlalu besar
+ 1195 - 0
src/YSAI.DAQ/YSAI.Pack/Modbus.json


+ 116 - 0
src/YSAI.DAQ/YSAI.Pack/Mqtt.json

@@ -0,0 +1,116 @@
+{
+    "Code": "Mqtt",
+    "Name": "Mqtt",
+    "Description": "Mqtt",
+    "Subset": [
+        {
+            "Name": "Mqtt",
+            "Description": "Mqtt",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "IP地址",
+                    "PropertyName": "Ip",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "端口",
+                    "PropertyName": "Port",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "用户名",
+                    "PropertyName": "UserName",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "密码",
+                    "PropertyName": "Password",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "客户端ID",
+                    "PropertyName": "ClientID",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "QoS等级",
+                    "PropertyName": "QualityOfServiceLevel",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "AtMostOnce",
+                            "Value": 0
+                        },
+                        {
+                            "Key": "AtLeastOnce",
+                            "Value": 1
+                        },
+                        {
+                            "Key": "ExactlyOnce",
+                            "Value": 2
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "主题",
+                    "PropertyName": "Topic",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": true,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.Mqtt.client.MqttClientOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

+ 96 - 0
src/YSAI.DAQ/YSAI.Pack/OpcDa.json

@@ -0,0 +1,96 @@
+{
+    "Code": "OpcDa",
+    "Name": "OpcDa",
+    "Description": "OpcDa",
+    "Subset": [
+        {
+            "Name": "OpcDa",
+            "Description": "OpcDa",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "服务名",
+                    "PropertyName": "SName",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "接口版本",
+                    "PropertyName": "ApiVerType",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "COM_DA_10(1.x api)",
+                            "Value": 0
+                        },
+                        {
+                            "Key": "COM_DA_20(2.x api)",
+                            "Value": 1
+                        },
+                        {
+                            "Key": "COM_DA_30(3.x api)",
+                            "Value": 2
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "更新频率",
+                    "PropertyName": "UpdateRate",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务数量",
+                    "PropertyName": "TaskNumber",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务处理间隔(毫秒)",
+                    "PropertyName": "TaskHandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.Opc.da.client.OpcDaClientOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

+ 150 - 0
src/YSAI.DAQ/YSAI.Pack/OpcDaHttp.json

@@ -0,0 +1,150 @@
+{
+    "Code": "OpcDaHttp",
+    "Name": "OpcDaHttp",
+    "Description": "OpcDaHttp",
+    "Subset": [
+        {
+            "Name": "OpcDaHttp",
+            "Description": "OpcDaHttp",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "服务地址",
+                    "PropertyName": "Ip",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "端口",
+                    "PropertyName": "Port",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "解密密钥",
+                    "PropertyName": "Key",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "请求类型",
+                    "PropertyName": "RequestType",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "http",
+                            "Value": 0
+                        },
+                        {
+                            "Key": "https",
+                            "Value": 1
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "处理间隔(毫秒)",
+                    "PropertyName": "HandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "变化抛出",
+                    "PropertyName": "ChangeOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "未变项与变化项一同抛出",
+                    "PropertyName": "AllOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务数量",
+                    "PropertyName": "TaskNumber",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务处理间隔(毫秒)",
+                    "PropertyName": "TaskHandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.Opc.da.http.OpcDaHttpOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

+ 143 - 0
src/YSAI.DAQ/YSAI.Pack/OpcUa.json

@@ -0,0 +1,143 @@
+{
+    "Code": "OpcUa",
+    "Name": "OpcUa",
+    "Description": "OpcUa",
+    "Subset": [
+        {
+            "Name": "OpcUa",
+            "Description": "OpcUa",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "用户名",
+                    "PropertyName": "UserName",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "密码",
+                    "PropertyName": "Password",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "证书路径",
+                    "PropertyName": "Cer",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "密钥",
+                    "PropertyName": "SecreKey",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "服务地址",
+                    "PropertyName": "ServerUrl",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "自定义名称(唯一)",
+                    "PropertyName": "CustomName",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "超时时间",
+                    "PropertyName": "Timeout",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "取样时间间隔",
+                    "PropertyName": "SamplingInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "发布时间间隔",
+                    "PropertyName": "PublishingInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务数量",
+                    "PropertyName": "TaskNumber",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务处理间隔(毫秒)",
+                    "PropertyName": "TaskHandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.Opc.ua.client.OpcUaClientOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

+ 93 - 0
src/YSAI.DAQ/YSAI.Pack/RabbitMQ.json

@@ -0,0 +1,93 @@
+{
+    "Code": "RabbitMQ",
+    "Name": "RabbitMQ",
+    "Description": "RabbitMQ",
+    "Subset": [
+        {
+            "Name": "RabbitMQ",
+            "Description": "RabbitMQ",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "交换机名称",
+                    "PropertyName": "ExChangeName",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "连接地址",
+                    "PropertyName": "HostName",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "端口",
+                    "PropertyName": "Port",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "用户名",
+                    "PropertyName": "UserName",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "密码",
+                    "PropertyName": "Password",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "主题",
+                    "PropertyName": "Topic",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": true,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.RabbitMQ.RabbitMQOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}

+ 180 - 0
src/YSAI.DAQ/YSAI.Pack/S7.json

@@ -0,0 +1,180 @@
+{
+    "Code": "S7",
+    "Name": "S7",
+    "Description": "S7",
+    "Subset": [
+        {
+            "Name": "S7",
+            "Description": "S7",
+            "Propertie": [
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "唯一标识符",
+                    "PropertyName": "SN",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "IP",
+                    "PropertyName": "Ip",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "端口",
+                    "PropertyName": "Port",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "select",
+                    "Default": null,
+                    "Description": "CPU类型",
+                    "PropertyName": "S7CpuType",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "S7200",
+                            "Value": 0
+                        },
+                        {
+                            "Key": "Logo0BA8",
+                            "Value": 1
+                        },
+                        {
+                            "Key": "S7200Smart",
+                            "Value": 2
+                        },
+                        {
+                            "Key": "S7300",
+                            "Value": 10
+                        },
+                        {
+                            "Key": "S7400",
+                            "Value": 20
+                        },
+                        {
+                            "Key": "S71200",
+                            "Value": 30
+                        },
+                        {
+                            "Key": "S71500",
+                            "Value": 40
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "PLC机架",
+                    "PropertyName": "Rack",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "PLCCPU插槽",
+                    "PropertyName": "Slot",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "处理间隔(毫秒)",
+                    "PropertyName": "HandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "变化抛出",
+                    "PropertyName": "ChangeOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "radio",
+                    "Default": null,
+                    "Description": "未变项与变化项一同抛出",
+                    "PropertyName": "AllOut",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": [
+                        {
+                            "Key": "是",
+                            "Value": true
+                        },
+                        {
+                            "Key": "否",
+                            "Value": false
+                        }
+                    ]
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务数量",
+                    "PropertyName": "TaskNumber",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "任务处理间隔(毫秒)",
+                    "PropertyName": "TaskHandleInterval",
+                    "Value": null,
+                    "IsShow": true,
+                    "IsMust": false,
+                    "Options": null
+                },
+                {
+                    "DataCate": "text",
+                    "Default": null,
+                    "Description": "实现类名",
+                    "PropertyName": "ServiceName",
+                    "Value": "YSAI.S7.client.S7ClientOperate",
+                    "IsShow": false,
+                    "IsMust": false,
+                    "Options": null
+                }
+            ]
+        }
+    ]
+}