Shun 2 лет назад
Родитель
Сommit
d15e0d8eeb
61 измененных файлов с 361 добавлено и 165 удалено
  1. 2 2
      src/YSAI.DAQ/YSAI.Can/YSAI.Can.csproj
  2. 1 1
      src/YSAI.DAQ/YSAI.Core/YSAI.Core.csproj
  3. 22 3
      src/YSAI.DAQ/YSAI.Core/communication/net/udp/UdpData.cs
  4. 49 31
      src/YSAI.DAQ/YSAI.Core/communication/net/udp/UdpOperate.cs
  5. 2 0
      src/YSAI.DAQ/YSAI.Core/communication/serial/SerialOperate.cs
  6. 19 0
      src/YSAI.DAQ/YSAI.Core/interface/ISend.cs
  7. 0 7
      src/YSAI.DAQ/YSAI.DAQ.sln
  8. 2 2
      src/YSAI.DAQ/YSAI.DB/YSAI.DB.csproj
  9. 1 1
      src/YSAI.DAQ/YSAI.DaqManage/YSAI.DaqManage.csproj
  10. 0 7
      src/YSAI.DAQ/YSAI.Document/Class1.cs
  11. 0 9
      src/YSAI.DAQ/YSAI.Document/YSAI.Document.csproj
  12. 2 2
      src/YSAI.DAQ/YSAI.Kafka/YSAI.Kafka.csproj
  13. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Can.Pack/YSAI.Can.dll
  14. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Can.Pack/YSAI.Can.pdb
  15. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Can.Pack/YSAI.Core.dll
  16. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.DB.Pack/YSAI.Core.dll
  17. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.DB.Pack/YSAI.DB.dll
  18. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.DB.Pack/YSAI.DB.pdb
  19. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Kafka.Pack/YSAI.Core.dll
  20. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Kafka.Pack/YSAI.Kafka.dll
  21. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Kafka.Pack/YSAI.Kafka.pdb
  22. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Modbus.Pack/YSAI.Core.dll
  23. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Modbus.Pack/YSAI.Modbus.dll
  24. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Modbus.Pack/YSAI.Modbus.pdb
  25. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Mqtt.Pack/YSAI.Core.dll
  26. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Mqtt.Pack/YSAI.Mqtt.dll
  27. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Mqtt.Pack/YSAI.Mqtt.pdb
  28. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Core.dll
  29. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Opc.dll
  30. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Opc.pdb
  31. 5 0
      src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Opc.xml
  32. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.RabbitMQ.Pack/YSAI.Core.dll
  33. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.RabbitMQ.Pack/YSAI.RabbitMQ.dll
  34. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.RabbitMQ.Pack/YSAI.RabbitMQ.pdb
  35. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.S7.Pack/YSAI.Core.dll
  36. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.S7.Pack/YSAI.S7.dll
  37. BIN
      src/YSAI.DAQ/YSAI.Lib/YSAI.S7.Pack/YSAI.S7.pdb
  38. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Can.Param.json
  39. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.DB.Param.json
  40. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Kafka.Param.json
  41. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Modbus.Param.json
  42. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.Mqtt.Param.json
  43. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDa.Param.json
  44. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcDaHttp.Param.json
  45. 3 2
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcUa.Param.json
  46. 7 0
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcUa.ParamDetails.json
  47. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.RabbitMQ.Param.json
  48. 1 1
      src/YSAI.DAQ/YSAI.Manage/param/YSAI.S7.Param.json
  49. 2 2
      src/YSAI.DAQ/YSAI.Modbus/YSAI.Modbus.csproj
  50. 2 2
      src/YSAI.DAQ/YSAI.Mqtt/YSAI.Mqtt.csproj
  51. 2 2
      src/YSAI.DAQ/YSAI.Opc/YSAI.Opc.csproj
  52. 6 0
      src/YSAI.DAQ/YSAI.Opc/ua/client/OpcUaClientData.cs
  53. 20 14
      src/YSAI.DAQ/YSAI.Opc/ua/client/OpcUaClientOperate.cs
  54. 2 2
      src/YSAI.DAQ/YSAI.RabbitMQ/YSAI.RabbitMQ.csproj
  55. 1 1
      src/YSAI.DAQ/YSAI.RelayManage/YSAI.RelayManage.csproj
  56. 2 2
      src/YSAI.DAQ/YSAI.S7/YSAI.S7.csproj
  57. 76 13
      src/YSAI.DAQ/YSAI.Test.All/Program.cs
  58. 3 0
      src/YSAI.DAQ/YSAI.Test.Console/Program.cs
  59. 0 50
      src/YSAI.DAQ/YSAI.Test.Winform/Form2.cs
  60. 120 0
      src/YSAI.DAQ/YSAI.Test.Winform/Form2.resx
  61. 1 1
      src/YSAI.DAQ/YSAI.Test/YSAI.Test.csproj

+ 2 - 2
src/YSAI.DAQ/YSAI.Can/YSAI.Can.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.10</Version>
+	  <Version>1.0.0.11</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -24,7 +24,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+    <PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 
   <!--<ItemGroup>

+ 1 - 1
src/YSAI.DAQ/YSAI.Core/YSAI.Core.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
     <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-    <Version>1.0.0.30</Version>
+    <Version>1.0.0.31</Version>
     <Authors>Shun</Authors>
     <Company>YSAI</Company>
     <Product>SCADA</Product>

+ 22 - 3
src/YSAI.DAQ/YSAI.Core/communication/net/udp/UdpData.cs

@@ -24,10 +24,14 @@ namespace YSAI.Core.communication.net.udp
             public int Port { get; set; } = 6688;
 
             /// <summary>
-            /// 启用广播模式
+            /// 模式
             /// </summary>
-            public bool EnableBroadcast { get; set; } = true;
+            public Mode Mode { get; set; } = Mode.Service;
 
+            /// <summary>
+            /// 广播模式
+            /// </summary>
+            public bool EnableBroadcast { get; set; } = true;
             /// <summary>
             /// 重写基类中的Equals方法
             /// </summary>
@@ -50,7 +54,8 @@ namespace YSAI.Core.communication.net.udp
                         SendWait.Equals(basics.SendWait) &&
                         SendWaitInterval.Equals(basics.SendWaitInterval) &&
                         Ip.Equals(basics.Ip) &&
-                        Port.Equals(basics.Port))
+                        Port.Equals(basics.Port)&&
+                        Mode.Equals(basics.Port))
                     {
                         return true;
                     }
@@ -61,6 +66,20 @@ namespace YSAI.Core.communication.net.udp
                 }
             }
         }
+        /// <summary>
+        /// 模式
+        /// </summary>
+        public enum Mode
+        {
+            /// <summary>
+            /// 服务端最好指定IP
+            /// </summary>
+            Service,
+            /// <summary>
+            /// 客户端
+            /// </summary>
+            Client
+        }
 
         /// <summary>
         /// 终端数据

+ 49 - 31
src/YSAI.DAQ/YSAI.Core/communication/net/udp/UdpOperate.cs

@@ -11,7 +11,7 @@ using YSAI.Unility;
 
 namespace YSAI.Core.communication.net.udp
 {
-    public class UdpOperate : IBaseAbstract, ICommunication
+    public class UdpOperate : IBaseAbstract, ICommunication, IUdpSend
     {
         protected override string LogHead => "[ UdpOperate 操作 ]";
         protected override string ClassName => "UdpOperate";
@@ -101,6 +101,7 @@ namespace YSAI.Core.communication.net.udp
                             {
                                 OnEventHandler(this, new EventResult(false, $"接收到[{ClassName}]监控数据长度错误(小于等于零)"));  //数据传递出去
                                 OffAsync();
+                                return;
                             }
                         }
                         else
@@ -112,6 +113,7 @@ namespace YSAI.Core.communication.net.udp
                     {
                         OnEventHandler(this, new EventResult(false, $"[{ClassName}]监控异常,关闭对象:{ex.Message}"));
                         OffAsync();
+                        return;
                     }
                 }
             }, token.Token);
@@ -127,24 +129,27 @@ namespace YSAI.Core.communication.net.udp
                 {
                     return Break("On", false, "已打开");
                 }
-                if (basics.EnableBroadcast)
-                {
-                    //设置参数
-                    IPEndPoint IpPort = new IPEndPoint(IPAddress.Parse(basics.Ip), basics.Port);
-                    //广播模式
-                    Communication = new UdpClient(IpPort);
-                    //使用广播模式
-                    Communication.EnableBroadcast = basics.EnableBroadcast;
-                }
-                else
+
+                IPEndPoint IpPort;
+                switch (basics.Mode)
                 {
-                    Communication = new UdpClient();
-                    //设置参数
-                    IPEndPoint IpPort = new IPEndPoint(IPAddress.Parse(basics.Ip), basics.Port);
-                    //连接到主站
-                    Communication.Connect(IpPort);
-                    //使用广播模式
-                    Communication.EnableBroadcast = basics.EnableBroadcast;
+                    case UdpData.Mode.Service:
+                        //设置参数
+                        IpPort = new IPEndPoint(IPAddress.Parse(basics.Ip), basics.Port);
+                        //自身当服务端
+                        Communication = new UdpClient(IpPort);
+                        //使用广播模式
+                        Communication.EnableBroadcast = basics.EnableBroadcast;
+                        break;
+                    case UdpData.Mode.Client:
+                        Communication = new UdpClient();
+                        //设置参数
+                        IpPort = new IPEndPoint(IPAddress.Parse(basics.Ip), basics.Port);
+                        //连接到服务端
+                        Communication.Connect(IpPort);
+                        //使用广播模式
+                        Communication.EnableBroadcast = basics.EnableBroadcast;
+                        break;
                 }
                 //当使用发送等待,则不启用监控
                 if (!basics.SendWait)
@@ -214,15 +219,21 @@ namespace YSAI.Core.communication.net.udp
             Depart("Send");
             try
             {
-                if (Communication != null )
+                if (Communication != null)
                 {
-                    if (Communication.Send(Data, Data.Length,new IPEndPoint(IPAddress.Parse("255.255.255.255"),basics.Port)) > 0)
+                    switch (basics.Mode)
                     {
-                        return Break("Send", true);
-                    }
-                    else
-                    {
-                        return Break("Send", false, "数据发送失败");
+                        case UdpData.Mode.Service:
+                            return Break("Send", false, "请指定终端地址");
+                        case UdpData.Mode.Client:
+                            if (Communication.Send(Data, Data.Length) > 0)
+                            {
+                                return Break("Send", true);
+                            }
+                            else
+                            {
+                                return Break("Send", false, "数据发送失败");
+                            }
                     }
                 }
                 return Break("Send", false, "未连接");
@@ -245,14 +256,21 @@ namespace YSAI.Core.communication.net.udp
             {
                 if (Communication != null)
                 {
-                    if (Communication.Send(Data, Data.Length, iPEndPoint) > 0)
-                    {
-                        return Break("Send", true);
-                    }
-                    else
+                    switch (basics.Mode)
                     {
-                        return Break("Send", false, "数据发送失败");
+                        case UdpData.Mode.Service:
+                            if (Communication.Send(Data, Data.Length, iPEndPoint) > 0)
+                            {
+                                return Break("Send", true);
+                            }
+                            else
+                            {
+                                return Break("Send", false, "数据发送失败");
+                            }
+                        case UdpData.Mode.Client:
+                            return Break("Send", false, "无须指定终端地址");
                     }
+                   
                 }
                 return Break("Send", false, "未连接");
             }

+ 2 - 0
src/YSAI.DAQ/YSAI.Core/communication/serial/SerialOperate.cs

@@ -105,6 +105,7 @@ namespace YSAI.Core.communication.serial
                                 {
                                     OnEventHandler(this, new EventResult(false, $"接收到[{ClassName}]监控数据长度错误(小于等于零)"));  //数据传递出去
                                     OffAsync();
+                                    return;
                                 }
                             }
                             else
@@ -121,6 +122,7 @@ namespace YSAI.Core.communication.serial
                     {
                         OnEventHandler(this, new EventResult(false, $"[{ClassName}]监控异常,关闭对象:{ex.Message}"));
                         OffAsync();
+                        return;
                     }
                 }
             }, token.Token);

+ 19 - 0
src/YSAI.DAQ/YSAI.Core/interface/ISend.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Net;
 using System.Text;
 using System.Threading.Tasks;
 using YSAI.Core.data;
@@ -25,4 +26,22 @@ namespace YSAI.Core.@interface
         /// <returns>统一出参</returns>
         Task<OperateResult> SendAsync(byte[] Data);
     }
+
+    public interface IUdpSend
+    {
+        /// <summary>
+        /// 发送
+        /// </summary>
+        /// <param name="Data">字节数据</param>
+        /// <param name="iPEndPoint">终端,如果你开启了广播模式,此项为空则是广播255.255.255.255,反之不能为空</param>
+        /// <returns>统一出参</returns>
+        OperateResult Send(byte[] Data, IPEndPoint iPEndPoint);
+        /// <summary>
+        /// 发送
+        /// </summary>
+        /// <param name="Data">字节数据</param>
+        /// <param name="iPEndPoint">终端,如果你开启了广播模式,此项为空则是广播255.255.255.255,反之不能为空</param>
+        /// <returns>统一出参</returns>
+        Task<OperateResult> SendAsync(byte[] Data, IPEndPoint iPEndPoint);
+    }
 }

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

@@ -89,8 +89,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YSAI.Tool.Core", "YSAI.Tool
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YSAI.Tool", "YSAI.Tool\YSAI.Tool.csproj", "{3C333E39-520D-4183-8E3D-D0FF6628C15E}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YSAI.Document", "YSAI.Document\YSAI.Document.csproj", "{863DE76E-F597-4624-A6B4-860B97FA06D0}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YSAI.Test.All", "YSAI.Test.All\YSAI.Test.All.csproj", "{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YSAI.Test.Winform", "YSAI.Test.Winform\YSAI.Test.Winform.csproj", "{CF7C703A-2A1A-45B8-83DC-432C99AB6D2E}"
@@ -237,10 +235,6 @@ Global
 		{3C333E39-520D-4183-8E3D-D0FF6628C15E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{3C333E39-520D-4183-8E3D-D0FF6628C15E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{3C333E39-520D-4183-8E3D-D0FF6628C15E}.Release|Any CPU.Build.0 = Release|Any CPU
-		{863DE76E-F597-4624-A6B4-860B97FA06D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{863DE76E-F597-4624-A6B4-860B97FA06D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{863DE76E-F597-4624-A6B4-860B97FA06D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{863DE76E-F597-4624-A6B4-860B97FA06D0}.Release|Any CPU.Build.0 = Release|Any CPU
 		{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{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
@@ -292,7 +286,6 @@ Global
 		{4B503AF7-E1D3-4C94-AE98-4175CC94CD4B} = {12CB0510-7B1E-4518-AA3B-412A4D323D42}
 		{E85BF19B-E671-4A1E-BC67-B545700B4BF1} = {1856E9E1-33C4-45C1-832C-854F9BE1ACC4}
 		{3C333E39-520D-4183-8E3D-D0FF6628C15E} = {1856E9E1-33C4-45C1-832C-854F9BE1ACC4}
-		{863DE76E-F597-4624-A6B4-860B97FA06D0} = {0A264424-1AD7-49FA-B813-D96498066479}
 		{1CFDF4C1-53F7-4A32-B83D-4B99AFC95A8D} = {12CB0510-7B1E-4518-AA3B-412A4D323D42}
 		{CF7C703A-2A1A-45B8-83DC-432C99AB6D2E} = {12CB0510-7B1E-4518-AA3B-412A4D323D42}
 	EndGlobalSection

+ 2 - 2
src/YSAI.DAQ/YSAI.DB/YSAI.DB.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.10</Version>
+	  <Version>1.0.0.11</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -18,7 +18,7 @@
 		<PackageReference Include="System.Data.OracleClient" Version="1.0.8" />
 		<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
 		<PackageReference Include="System.Data.SQLite" Version="1.0.118" />
-		<PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+		<PackageReference Include="YSAI.Core" Version="1.0.0.31" />
 	</ItemGroup>
 	<!--<ItemGroup>
 		<ProjectReference Include="..\YSAI.Core\YSAI.Core.csproj" />

+ 1 - 1
src/YSAI.DAQ/YSAI.DaqManage/YSAI.DaqManage.csproj

@@ -7,7 +7,7 @@
   </PropertyGroup>
 	<ItemGroup>
 		<FrameworkReference Include="Microsoft.AspNetCore.App" />
-		<PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+		<PackageReference Include="YSAI.Core" Version="1.0.0.31" />
 	</ItemGroup>
 
 	<!--<ItemGroup>

+ 0 - 7
src/YSAI.DAQ/YSAI.Document/Class1.cs

@@ -1,7 +0,0 @@
-namespace YSAI.Document
-{
-    public class Class1
-    {
-
-    }
-}

+ 0 - 9
src/YSAI.DAQ/YSAI.Document/YSAI.Document.csproj

@@ -1,9 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
-    <ImplicitUsings>enable</ImplicitUsings>
-    <Nullable>enable</Nullable>
-  </PropertyGroup>
-
-</Project>

+ 2 - 2
src/YSAI.DAQ/YSAI.Kafka/YSAI.Kafka.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.11</Version>
+	  <Version>1.0.0.12</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -14,7 +14,7 @@
 
   <ItemGroup>
     <PackageReference Include="Confluent.Kafka" Version="2.2.0" />
-    <PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+    <PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 	
 	<!--<ItemGroup>

BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Can.Pack/YSAI.Can.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Can.Pack/YSAI.Can.pdb


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Can.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.DB.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.DB.Pack/YSAI.DB.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.DB.Pack/YSAI.DB.pdb


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Kafka.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Kafka.Pack/YSAI.Kafka.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Kafka.Pack/YSAI.Kafka.pdb


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Modbus.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Modbus.Pack/YSAI.Modbus.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Modbus.Pack/YSAI.Modbus.pdb


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Mqtt.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Mqtt.Pack/YSAI.Mqtt.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Mqtt.Pack/YSAI.Mqtt.pdb


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Opc.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Opc.pdb


+ 5 - 0
src/YSAI.DAQ/YSAI.Lib/YSAI.Opc.Pack/YSAI.Opc.xml

@@ -1218,6 +1218,11 @@
             自定义名称(唯一)
             </summary>
         </member>
+        <member name="P:YSAI.Opc.ua.client.OpcUaClientData.Basics.Timeout">
+            <summary>
+            超时时间
+            </summary>
+        </member>
         <member name="P:YSAI.Opc.ua.client.OpcUaClientData.Basics.SamplingInterval">
             <summary>
             取样时间间隔

BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.RabbitMQ.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.RabbitMQ.Pack/YSAI.RabbitMQ.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.RabbitMQ.Pack/YSAI.RabbitMQ.pdb


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.S7.Pack/YSAI.Core.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.S7.Pack/YSAI.S7.dll


BIN
src/YSAI.DAQ/YSAI.Lib/YSAI.S7.Pack/YSAI.S7.pdb


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

@@ -1,5 +1,5 @@
 {
-    "SN": "b5467d26-a45b-49cf-b4cb-6599a2feb69b",
+    "SN": "c9d76128-4737-4e33-abe5-5b1b65a2f81f",
     "BaudRate": 0,
     "CanChannel": 0,
     "HandleInterval": 1000,

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

@@ -1,5 +1,5 @@
 {
-    "SN": "887cffd7-b8d2-4dc4-b222-8aebc562263c",
+    "SN": "a9ca0d11-11b2-44f2-942d-1db86e33f49f",
     "ConnectStr": null,
     "DBType": "SqlServer",
     "HandleInterval": 1000,

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

@@ -1,5 +1,5 @@
 {
-    "SN": "6a926394-0ad3-497e-898d-cbd0a5f55ff9",
+    "SN": "d82fb4b6-f0a3-4c23-adc7-ce6b4d406e8f",
     "BootstrapServers": null,
     "WaitTime": 1000,
     "SecurityProtocol": "Plaintext",

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

@@ -1,5 +1,5 @@
 {
-    "SN": "988cdc95-4a08-4599-ad01-9d8ad19cd102",
+    "SN": "1406c41b-39fd-455e-9409-3acb773f555b",
     "SlaveAddress": 1,
     "ProtocolType": "Tcp",
     "ReadTimeOut": 2000,

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

@@ -1,5 +1,5 @@
 {
-    "SN": "f7bb2e7c-6b9b-4425-a22b-08a15e1fcbe8",
+    "SN": "7a66d14f-f392-44cf-92cf-a543d5a620be",
     "Ip": null,
     "Port": 0,
     "UserName": null,

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

@@ -1,5 +1,5 @@
 {
-    "SN": "7fb502ba-3b1a-4067-b3b8-bcfdc2719fba",
+    "SN": "2094c35a-1981-48e3-a9d1-77af83f0ed6e",
     "SName": "Knight.OPC.Server.Demo",
     "ApiVerType": "COM_DA_30",
     "UpdateRate": 100,

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

@@ -1,5 +1,5 @@
 {
-    "SN": "d5fdc2cb-b347-4df0-9016-9c7ca111446b",
+    "SN": "31032536-d326-401d-927c-ef6f8cedf36a",
     "Ip": "127.0.0.1",
     "Port": 6688,
     "Key": null,

+ 3 - 2
src/YSAI.DAQ/YSAI.Manage/param/YSAI.OpcUa.Param.json

@@ -1,11 +1,12 @@
 {
-    "SN": "e4240beb-cb25-4c29-94d5-8f95c3eea4fa",
+    "SN": "55e7e7b0-bd7e-4a18-a7c2-90df6e69cfd0",
     "UserName": null,
     "Password": null,
     "Cer": null,
     "SecreKey": null,
     "ServerUrl": null,
-    "CustomName": "6510AAAA33DA40C187168C248A2272F0",
+    "CustomName": "EBEA82304E5541BE90C2944D053228AB",
+    "Timeout": 1000,
     "SamplingInterval": 1000,
     "PublishingInterval": 1000,
     "TaskNumber": 5,

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

@@ -48,6 +48,13 @@
         "EnumArray": null,
         "ObjArray": null
     },
+    {
+        "Name": "Timeout",
+        "Describe": "超时时间",
+        "ParamType": "Int32",
+        "EnumArray": null,
+        "ObjArray": null
+    },
     {
         "Name": "SamplingInterval",
         "Describe": "取样时间间隔",

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

@@ -1,5 +1,5 @@
 {
-    "SN": "21327139-c193-48ca-b562-2f7bf4e31069",
+    "SN": "16929759-1b43-4582-8d68-c1b1d1205233",
     "ExChangeName": null,
     "HostName": null,
     "Port": 0,

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

@@ -1,5 +1,5 @@
 {
-    "SN": "b36ccb0a-dd64-4e34-b785-9b206fde8cbe",
+    "SN": "6b62b748-7736-49a9-9cf3-1bb292ee8295",
     "Ip": null,
     "Port": 0,
     "S7CpuType": "S7200",

+ 2 - 2
src/YSAI.DAQ/YSAI.Modbus/YSAI.Modbus.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.10</Version>
+	  <Version>1.0.0.11</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -13,7 +13,7 @@
   </PropertyGroup>
 
 	<ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+    <PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 
 	<!--<ItemGroup>

+ 2 - 2
src/YSAI.DAQ/YSAI.Mqtt/YSAI.Mqtt.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.11</Version>
+	  <Version>1.0.0.12</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -15,7 +15,7 @@
   <ItemGroup>
     <PackageReference Include="MQTTnet" Version="4.3.1.873" />
     <PackageReference Include="MQTTnet.AspNetCore" Version="4.3.1.873" />
-    <PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+    <PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 
 	<!--<ItemGroup>

+ 2 - 2
src/YSAI.DAQ/YSAI.Opc/YSAI.Opc.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.13</Version>
+	  <Version>1.0.0.14</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -13,7 +13,7 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="OPCFoundation.NetStandard.Opc.Ua" Version="1.4.372.56" />
-	<PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+	<PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 
 

+ 6 - 0
src/YSAI.DAQ/YSAI.Opc/ua/client/OpcUaClientData.cs

@@ -64,6 +64,12 @@ namespace YSAI.Opc.ua.client
             [Description("自定义名称(唯一)")]
             public string? CustomName { get; set; } = Guid.NewGuid().ToString().Replace("-", string.Empty).Trim().ToUpper();
 
+            /// <summary>
+            /// 超时时间
+            /// </summary>
+            [Description("超时时间")]
+            public int Timeout { get; set; } = 1000;
+
             /// <summary>
             /// 取样时间间隔
             /// </summary>

+ 20 - 14
src/YSAI.DAQ/YSAI.Opc/ua/client/OpcUaClientOperate.cs

@@ -232,7 +232,7 @@ namespace YSAI.Opc.ua.client
                 null,
                 0,
                 TimestampsToReturn.Neither,
-                nodesToRead, new CancellationToken()).Result;
+                nodesToRead, CancellationToken.None).Result;
 
             return readResponse.Results[0];
         }
@@ -384,7 +384,7 @@ namespace YSAI.Opc.ua.client
                     AttributeId = Attributes.Description
                 });
             }
-            return clientSession?.ReadAsync(null, 0, TimestampsToReturn.Neither, nodesToRead, new CancellationToken()).Result.Results.ToArray();
+            return clientSession?.ReadAsync(null, 0, TimestampsToReturn.Neither, nodesToRead, CancellationToken.None).Result.Results.ToArray();
         }
 
         /// <summary>
@@ -758,7 +758,7 @@ namespace YSAI.Opc.ua.client
                             if (Nodes.Count > 0)
                             {
                                 //先在会话中,移除这个订阅
-                                if (!clientSession.RemoveSubscriptionAsync(allSubscriptions[Tag]).Result)
+                                if (!clientSession.RemoveSubscriptionAsync(allSubscriptions[Tag],CancellationToken.None).WaitAsync(new TimeSpan(0,0,0,0, basics.Timeout)).Result)
                                 {
                                     //如果从会话中异常订阅失败则直接跳出
                                     return Break("AddSubscribe", false, "从会话中移除订阅失败");
@@ -791,10 +791,10 @@ namespace YSAI.Opc.ua.client
                                 //添加订阅
                                 clientSession?.AddSubscription(allSubscriptions[Tag]);
                                 //在服务器端创建订阅
-                                if (allSubscriptions[Tag].CreateAsync().Wait(60000))
+                                if (allSubscriptions[Tag].CreateAsync().Wait(basics.Timeout))
                                 {
                                     // 在服务器端创建监控项
-                                    if (allSubscriptions[Tag].ApplyChangesAsync().Wait(60000))
+                                    if (allSubscriptions[Tag].ApplyChangesAsync().Wait(basics.Timeout))
                                     {
                                         return Break("AddSubscribe", true);
                                     }
@@ -844,10 +844,10 @@ namespace YSAI.Opc.ua.client
                             //添加订阅
                             clientSession?.AddSubscription(allSubscriptions[Tag]);
                             //在服务器端创建订阅
-                            if (allSubscriptions[Tag].CreateAsync().Wait(60000))
+                            if (allSubscriptions[Tag].CreateAsync().Wait(basics.Timeout))
                             {
                                 // 在服务器端创建监控项
-                                if (allSubscriptions[Tag].ApplyChangesAsync().Wait(60000))
+                                if (allSubscriptions[Tag].ApplyChangesAsync().Wait(basics.Timeout))
                                 {
                                     return Break("AddSubscribe", true);
                                 }
@@ -928,7 +928,7 @@ namespace YSAI.Opc.ua.client
                                 {
                                     if (alls2.Key.Equals(alls.Key))
                                     {
-                                        if (!clientSession.RemoveSubscriptionAsync(alls.Value).Wait(10000))
+                                        if (!clientSession.RemoveSubscriptionAsync(alls.Value).Wait(basics.Timeout))
                                         {
                                             LogHelper.Error("移除订阅超时");
                                         }
@@ -981,7 +981,7 @@ namespace YSAI.Opc.ua.client
                     NodeId = new NodeId(Key),
                 };
 
-                DeleteNodesResponse? deleteNodesResponse = clientSession?.DeleteNodesAsync(null, waitDelete, new CancellationToken()).Result;
+                DeleteNodesResponse? deleteNodesResponse = clientSession?.DeleteNodesAsync(null, waitDelete, CancellationToken.None).Result;
 
                 foreach (var item in deleteNodesResponse.Results)
                 {
@@ -1162,7 +1162,7 @@ namespace YSAI.Opc.ua.client
                     UserIdentity = new UserIdentity(basics.UserName, basics.Password);
                 }
                 //通过调用CreateSession服务创建与服务器的新通信会话
-                clientSession = Session.Create(AC, endpoint, false, false, AC.ApplicationName, 1800000, UserIdentity, null).Result;
+                clientSession = Session.Create(AC, endpoint, false, false, AC.ApplicationName, (uint)basics.Timeout, UserIdentity, null).WaitAsync(new TimeSpan(0,0,0,0, basics.Timeout)).Result;
 
                 //当会话关闭,则关闭订阅
                 clientSession.DeleteSubscriptionsOnClose = true;
@@ -1224,9 +1224,15 @@ namespace YSAI.Opc.ua.client
 
                 if (clientSession != null)
                 {
-                    clientSession.Close(true);
-                    clientSession.Dispose();
-                    clientSession = null;
+                    if (StatusCode.IsGood(clientSession.Close(true)))
+                    {
+                        clientSession.Dispose();
+                        clientSession = null;
+                    }
+                    else
+                    {
+                        return Break("Off", false,"关闭失败");
+                    }
                 }
 
                 //任务清空
@@ -1384,7 +1390,7 @@ namespace YSAI.Opc.ua.client
                         WriteValueCollection writeValues = new WriteValueCollection { writeValue };
 
                         // 写入当前的值
-                        WriteResponse? writeResponse = clientSession?.WriteAsync(null, writeValues, new CancellationToken()).Result;
+                        WriteResponse? writeResponse = clientSession?.WriteAsync(null, writeValues, CancellationToken.None).Result;
 
                         foreach (var scc in writeResponse.Results)
                         {

+ 2 - 2
src/YSAI.DAQ/YSAI.RabbitMQ/YSAI.RabbitMQ.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.11</Version>
+	  <Version>1.0.0.12</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -14,7 +14,7 @@
 
   <ItemGroup>
     <PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
-    <PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+    <PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 	<!--<ItemGroup>
 		<ProjectReference Include="..\YSAI.Core\YSAI.Core.csproj" />

+ 1 - 1
src/YSAI.DAQ/YSAI.RelayManage/YSAI.RelayManage.csproj

@@ -9,7 +9,7 @@
 	<ItemGroup>
 		<PackageReference Include="RabbitMQ.Client" Version="6.5.0" />
 		<PackageReference Include="Confluent.Kafka" Version="2.2.0" />
-		<PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+		<PackageReference Include="YSAI.Core" Version="1.0.0.31" />
 		<FrameworkReference Include="Microsoft.AspNetCore.App" />
 	</ItemGroup>
 

+ 2 - 2
src/YSAI.DAQ/YSAI.S7/YSAI.S7.csproj

@@ -5,7 +5,7 @@
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
 	  <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
-	  <Version>1.0.0.10</Version>
+	  <Version>1.0.0.11</Version>
 	  <Authors>Shun</Authors>
 	  <Company>YSAI</Company>
 	  <Product>SCADA</Product>
@@ -13,7 +13,7 @@
   </PropertyGroup>
 
 	<ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+    <PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 
 	<!--<ItemGroup>

+ 76 - 13
src/YSAI.DAQ/YSAI.Test.All/Program.cs

@@ -1,45 +1,108 @@
 using System.Collections.Concurrent;
+using System.Net;
 using System.Text;
 using YSAI.Core.communication.net.tcp.client;
 using YSAI.Core.communication.net.tcp.service;
 using YSAI.Core.communication.net.udp;
 using YSAI.Core.communication.net.ws.client;
 using YSAI.Core.communication.net.ws.service;
+using YSAI.Core.communication.serial;
 using YSAI.Core.data;
 using YSAI.Core.handler;
 using YSAI.Core.@interface;
 using YSAI.Core.subscription;
+using YSAI.Unility;
 
-UdpOperate udpOperate = UdpOperate.Instance(new UdpData.Basics 
+//Console.WriteLine(Encoding.Default.GetString((byte[])ByteTool.HexStringToByteArray("58 44 34 20 53 20 20 20 20 20 20 35 2E 30 32 33 20 67 20 33 20 31 20 30 20 30 0D 0A")));;
+
+SerialOperate serialOperate = SerialOperate.Instance(new SerialData.Basics 
 {
-        EnableBroadcast = true,
-        Ip= "0.0.0.0",
-        Port=8081
+   BaudRate=9600,
+   DataBit=8,
+   ParityBit=System.IO.Ports.Parity.None,
+   PortName="COM2",
+   StopBit=System.IO.Ports.StopBits.One
 });
-udpOperate.OnEvent += UdpOperate_OnEvent;
-OperateResult operateResult = udpOperate.On();
+
+OperateResult operateResult = serialOperate.On();
 Console.WriteLine(operateResult.Message);
+serialOperate.OnEvent += SerialOperate_OnEvent;
 
 while (true)
 {
-    for (int i = 0; i < 100; i++)
+    for (int i = 0; i < 5; i++)
     {
         string str = Console.ReadLine();
-        operateResult = udpOperate.Send(Encoding.Default.GetBytes(str));
+        operateResult = serialOperate.Send(Encoding.Default.GetBytes(str));
         Console.WriteLine(operateResult.Message);
     }
-
-    Console.ReadLine();
-    operateResult = udpOperate.Off();
+    operateResult = serialOperate.Off();
     Console.WriteLine(operateResult.Message);
 }
 
-void UdpOperate_OnEvent(object? sender, EventResult e)
+void SerialOperate_OnEvent(object? sender, EventResult e)
 {
-    Console.WriteLine("事件数据:" + e.Message);
+    Console.WriteLine(e.Message);
 }
 
 
+////服务端
+//UdpOperate udpOperate = UdpOperate.Instance(new UdpData.Basics
+//{
+//    Ip = "127.0.0.1",
+//    Port = 1234,
+//    Mode = UdpData.Mode.Service
+//});
+//udpOperate.OnEvent += delegate (object? sender, EventResult e) { UdpOperate_OnEvent(sender, e, "服务端"); };
+//OperateResult operateResult = udpOperate.On();
+//Console.WriteLine(operateResult.Message);
+
+//string IP = "";
+////客户端
+//UdpOperate udpOperate1 = UdpOperate.Instance(new UdpData.Basics
+//{
+//    Ip = "127.0.0.1",
+//    Port = 1234,
+//    Mode = UdpData.Mode.Client
+//});
+//udpOperate1.OnEvent +=delegate(object? sender, EventResult e) { UdpOperate_OnEvent(sender, e, "客户端"); };
+//operateResult = udpOperate1.On();
+//Console.WriteLine(operateResult.Message);
+
+//while (true)
+//{
+//    for (int i = 0; i < 5; i++)
+//    {
+//        string str = Console.ReadLine();
+//        if (!IP.IsEmpty())
+//        {
+//            operateResult = udpOperate.Send(Encoding.Default.GetBytes(str), new System.Net.IPEndPoint(IPAddress.Parse(IP.Split(':')[0]), int.Parse(IP.Split(':')[1])));
+//            Console.WriteLine(operateResult.Message);
+//        }
+
+//        operateResult = udpOperate1.Send(Encoding.Default.GetBytes(str+"666666"));
+//        Console.WriteLine(operateResult.Message);
+
+//    }
+
+//    Console.ReadLine();
+//    operateResult = udpOperate.Off();
+//    Console.WriteLine(operateResult.Message);
+//    operateResult = udpOperate1.Off();
+//    Console.WriteLine(operateResult.Message);
+//}
+
+//void UdpOperate_OnEvent(object? sender, EventResult e,string name)
+//{
+//    if (name.Equals("服务端"))
+//    {
+//        UdpData.TerminalMessage terminalMessage = e.RData as UdpData.TerminalMessage;
+//        IP= terminalMessage.IpPort;
+//    }
+//    Console.WriteLine(name + " - 事件数据:" + e.Message);
+//}
+
+
 //TcpServiceOperate tcpServiceOperate = TcpServiceOperate.Instance(new TcpServiceData.Basics
 //{
 //    Ip = "127.0.0.1",

+ 3 - 0
src/YSAI.DAQ/YSAI.Test.Console/Program.cs

@@ -79,6 +79,9 @@ using static YSAI.Modbus.client.ModbusClientData;
 //    bytes = ByteTool.CombineBytes(bytes, 0, bytes.Length, array, 0, array.Length);
 //}
 
+
+
+
 Console.WriteLine();
 //Console.WriteLine(Guid.NewGuid().ToString().Replace("-", string.Empty).Trim().ToUpper());
 

+ 0 - 50
src/YSAI.DAQ/YSAI.Test.Winform/Form2.cs

@@ -17,60 +17,10 @@ namespace YSAI.Test.Winform
         public Form2()
         {
             InitializeComponent();
-
-            aaa aaa = new aaa();
-
-            aaa.OnEvent += Aaa_OnEvent;
-            aaa.OnEvent += Aaa_OnEvent;
-            aaa.OnEvent += Aaa_OnEvent;
-            aaa.OnEvent += Aaa_OnEvent;
         }
 
-        private void Aaa_OnEvent(object? sender, EventResult e)
-        {
-            Debug.WriteLine(e.Message);
-        }
-
-        public class aaa
-        {
-
-            public aaa()
-            {
-                poll();
-            }
 
-            public event EventHandler<EventResult> OnEvent;
-            /// <summary>
-            /// 信息传递
-            /// </summary>
-            /// <param name="sender">自身对象</param>
-            /// <param name="e">事件结果</param>
-            protected virtual void OnEventHandler(object? sender, EventResult e)
-            {
-                EventHandler<EventResult> handler = OnEvent;
-                if (handler != null)
-                {
-                    handler(sender, e);
-                }
-            }
 
 
-            public Task poll()
-            {
-                return Task.Run(() => {
-                    while (true)
-                    {
-
-                        OnEventHandler(this, new EventResult() { Message = $"{DateTime.Now.ToLocalTime()}:{new Random().NextDouble()}" });
-
-                        Thread.Sleep(1000);
-
-                    }
-                });
-               
-            }
-
-
-        }
     }
 }

+ 120 - 0
src/YSAI.DAQ/YSAI.Test.Winform/Form2.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 1 - 1
src/YSAI.DAQ/YSAI.Test/YSAI.Test.csproj

@@ -17,7 +17,7 @@
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-	<PackageReference Include="YSAI.Core" Version="1.0.0.30" />
+	<PackageReference Include="YSAI.Core" Version="1.0.0.31" />
   </ItemGroup>
 
   <ItemGroup>