Browse Source

bacnet by yushu

wwd 3 years ago
commit
158cf012b0
100 changed files with 129696 additions and 0 deletions
  1. BIN
      NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/DesignTimeBuild/.dtbcache.v2
  2. 972 0
      NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/config/applicationhost.config
  3. 16 0
      NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/project-colors.json
  4. BIN
      NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/v17/.futdcache.v1
  5. BIN
      NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/v17/.suo
  6. 18 0
      NetCore31BACNetTransfor/App.xml
  7. 86 0
      NetCore31BACNetTransfor/AsyncClientBase.cs
  8. 14 0
      NetCore31BACNetTransfor/AsyncServerBag.cs
  9. 72 0
      NetCore31BACNetTransfor/AsyncServerBase.cs
  10. 270 0
      NetCore31BACNetTransfor/AsyncTCPClient.cs
  11. 250 0
      NetCore31BACNetTransfor/AsyncTCPServer.cs
  12. 208 0
      NetCore31BACNetTransfor/AsyncUdpClient.cs
  13. 168 0
      NetCore31BACNetTransfor/AsyncUdpSever.cs
  14. 184 0
      NetCore31BACNetTransfor/BacDevice.cs
  15. 16 0
      NetCore31BACNetTransfor/Constants.cs
  16. 20 0
      NetCore31BACNetTransfor/ILogger.cs
  17. 59 0
      NetCore31BACNetTransfor/Logger.cs
  18. 49 0
      NetCore31BACNetTransfor/LoggerImpl.cs
  19. 37 0
      NetCore31BACNetTransfor/NetCore31BACNetTransfor.csproj
  20. 6 0
      NetCore31BACNetTransfor/NetCore31BACNetTransfor.csproj.user
  21. 25 0
      NetCore31BACNetTransfor/NetCore31BACNetTransfor.sln
  22. 2171 0
      NetCore31BACNetTransfor/Program.cs
  23. 14 0
      NetCore31BACNetTransfor/Properties/PublishProfiles/FolderProfile.pubxml
  24. 9 0
      NetCore31BACNetTransfor/Properties/PublishProfiles/FolderProfile.pubxml.user
  25. 74 0
      NetCore31BACNetTransfor/Settings.cs
  26. 16 0
      NetCore31BACNetTransfor/StringHelper.cs
  27. 150 0
      NetCore31BACNetTransfor/TCPStream.cs
  28. 21 0
      NetCore31BACNetTransfor/appsetting.json
  29. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/BACnet.dll
  30. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/BouncyCastle.Crypto.dll
  31. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Common.Logging.Core.dll
  32. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Common.Logging.dll
  33. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll
  34. 1 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211116.Errors
  35. 40731 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211116.txt
  36. 24 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211117.Errors
  37. 18432 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211117.txt
  38. 22 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211127.Errors
  39. 62986 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211127.txt
  40. 2 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211129.Errors
  41. 6 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211129.txt
  42. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Abstractions.dll
  43. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Binder.dll
  44. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.CommandLine.dll
  45. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.EnvironmentVariables.dll
  46. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.FileExtensions.dll
  47. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Json.dll
  48. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.UserSecrets.dll
  49. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.dll
  50. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll
  51. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.dll
  52. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.FileProviders.Abstractions.dll
  53. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.FileProviders.Physical.dll
  54. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.FileSystemGlobbing.dll
  55. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Hosting.Abstractions.dll
  56. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Hosting.dll
  57. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Abstractions.dll
  58. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Configuration.dll
  59. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Console.dll
  60. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Debug.dll
  61. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.EventLog.dll
  62. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.EventSource.dll
  63. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.dll
  64. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Options.ConfigurationExtensions.dll
  65. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Options.dll
  66. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Primitives.dll
  67. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Win32.Registry.dll
  68. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll
  69. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.OOXML.dll
  70. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.OpenXml4Net.dll
  71. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.OpenXmlFormats.dll
  72. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.dll
  73. 2527 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.deps.json
  74. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.dll
  75. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.exe
  76. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.pdb
  77. 10 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.runtimeconfig.dev.json
  78. 9 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.runtimeconfig.json
  79. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Npoi.Mapper.dll
  80. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/PacketDotNet.dll
  81. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Quartz.dll
  82. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/SharpPcap.dll
  83. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Configuration.ConfigurationManager.dll
  84. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Diagnostics.DiagnosticSource.dll
  85. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Diagnostics.EventLog.dll
  86. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll
  87. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.IO.Ports.dll
  88. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Runtime.CompilerServices.Unsafe.dll
  89. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.AccessControl.dll
  90. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.Cryptography.ProtectedData.dll
  91. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.Permissions.dll
  92. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.Principal.Windows.dll
  93. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Text.Encodings.Web.dll
  94. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Text.Json.dll
  95. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Windows.Extensions.dll
  96. 21 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/appsetting.json
  97. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/log4net.dll
  98. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/pointlist.xls
  99. BIN
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/pointlist_bak.xls
  100. 0 0
      NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/runtimes/linux-arm/native/libSystem.IO.Ports.Native.so

BIN
NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/DesignTimeBuild/.dtbcache.v2


File diff suppressed because it is too large
+ 972 - 0
NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/config/applicationhost.config


+ 16 - 0
NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/project-colors.json

@@ -0,0 +1,16 @@
+{
+  "Version": 1,
+  "ProjectMap": {
+    "06b28b0b-5e87-4fbf-9fab-a036d15a248e": {
+      "ProjectGuid": "06b28b0b-5e87-4fbf-9fab-a036d15a248e",
+      "DisplayName": "NetCore31BACNetTransfor",
+      "ColorIndex": 0
+    },
+    "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3": {
+      "ProjectGuid": "a2fe74e1-b743-11d0-ae1a-00a0c90fffc3",
+      "DisplayName": "杂项文件",
+      "ColorIndex": -1
+    }
+  },
+  "NextColorIndex": 1
+}

BIN
NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/v17/.futdcache.v1


BIN
NetCore31BACNetTransfor/.vs/NetCore31BACNetTransfor/v17/.suo


+ 18 - 0
NetCore31BACNetTransfor/App.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+	<appSettings>
+		<add key="BacSplitSize" value="50"/>
+		<add key="WaitTime" value="2000"/>
+		<add key="HeartBeatInterval" value="10000"/>
+		<add key="LocalBacPort" value="47808"/>
+		<add key="LocalUdpPort" value="9876"/>
+		<add key="RemoteUdpIP" value="192.168.20.159"/>
+		<add key="RemoteUdpPort" value="8080"/>
+		<add key="BuildingSign" value="5700000007"/>
+		<add key="Gateway" value="1"/>
+		<add key="SendType" value="report"/>
+		<add key="MeterSignPre" value="BACnetIP.Channel_1.Device_"/>
+		<add key="FuncId" value="903"/>
+		<add key="IgnoreFirstValue" value="true"/>
+	</appSettings>
+</configuration>

+ 86 - 0
NetCore31BACNetTransfor/AsyncClientBase.cs

@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+    public class AsyncClientBase
+	{
+		private List<string> sendList = new List<string>();
+
+		private List<string> receiveList = new List<string>();
+
+		private int packetSize = 1000;
+
+		public AsyncClientBase(int packetSize)
+		{
+			this.packetSize = packetSize;
+		}
+
+		public virtual bool IsConnected()
+		{
+			return false;
+		}
+
+		public virtual void Start()
+		{
+		}
+
+		public virtual void Stop()
+		{
+		}
+
+		public void PushSend(string bag)
+		{
+			lock (this.sendList)
+			{
+				this.sendList.Add(bag);
+				while (this.sendList.Count > this.packetSize)
+				{
+					this.sendList.RemoveAt(0);
+				}
+			}
+		}
+
+		public string PopSend()
+		{
+			string result = null;
+			lock (this.sendList)
+			{
+				if (this.sendList.Count > 0)
+				{
+					result = this.sendList[0];
+					this.sendList.RemoveAt(0);
+				}
+			}
+			return result;
+		}
+
+		public void PushReceive(string bag)
+		{
+			lock (this.receiveList)
+			{
+				this.receiveList.Add(bag);
+				while (this.receiveList.Count > this.packetSize)
+				{
+					this.receiveList.RemoveAt(0);
+				}
+			}
+		}
+
+		public string PopReceive()
+		{
+			string result = null;
+			lock (this.receiveList)
+			{
+				if (this.receiveList.Count > 0)
+				{
+					result = this.receiveList[0];
+					this.receiveList.RemoveAt(0);
+				}
+			}
+			return result;
+		}
+
+	}
+}

+ 14 - 0
NetCore31BACNetTransfor/AsyncServerBag.cs

@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+    public class AsyncServerBag
+    {
+        public IPEndPoint remoteEP;
+
+        public string bag;
+    }
+}

+ 72 - 0
NetCore31BACNetTransfor/AsyncServerBase.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+    public class AsyncServerBase
+    {
+		private List<AsyncServerBag> sendList = new List<AsyncServerBag>();
+
+		private List<AsyncServerBag> receiveList = new List<AsyncServerBag>();
+
+		private int packetSize = 1000;
+
+		public AsyncServerBase(int packetSize)
+		{
+			this.packetSize = packetSize;
+		}
+
+		public void PushSend(AsyncServerBag bag)
+		{
+			lock (this.sendList)
+			{
+				this.sendList.Add(bag);
+				while (this.sendList.Count > this.packetSize)
+				{
+					this.sendList.RemoveAt(0);
+				}
+			}
+		}
+
+		public AsyncServerBag PopSend()
+		{
+			AsyncServerBag result = null;
+			lock (this.sendList)
+			{
+				if (this.sendList.Count > 0)
+				{
+					result = this.sendList[0];
+					this.sendList.RemoveAt(0);
+				}
+			}
+			return result;
+		}
+
+		public void PushReceive(AsyncServerBag bag)
+		{
+			lock (this.receiveList)
+			{
+				this.receiveList.Add(bag);
+				while (this.receiveList.Count > this.packetSize)
+				{
+					this.receiveList.RemoveAt(0);
+				}
+			}
+		}
+
+		public AsyncServerBag PopReceive()
+		{
+			AsyncServerBag result = null;
+			lock (this.receiveList)
+			{
+				if (this.receiveList.Count > 0)
+				{
+					result = this.receiveList[0];
+					this.receiveList.RemoveAt(0);
+				}
+			}
+			return result;
+		}
+	}
+}

+ 270 - 0
NetCore31BACNetTransfor/AsyncTCPClient.cs

@@ -0,0 +1,270 @@
+using System;
+using System.Collections.Generic;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+
+
+namespace NetCore31BACNetTransfor
+{
+	public class AsyncTCPClient : AsyncClientBase
+	{
+		private string address;
+
+		private int port;
+
+		private ILogger logger;
+
+		private TcpClient tcpClient;
+
+		private NetworkStream stream;
+
+		private int bufferSize = 4096;
+
+		private byte[] sendBuffer;
+
+		private byte[] receiveBuffer;
+
+		private TCPStream tcpstream;
+
+		private bool separate;
+
+		private bool separateBytes;
+
+		private byte prefix;
+
+		private byte suffix;
+
+		private byte[] prefixBytes;
+
+		private byte[] suffixBytes;
+
+		private volatile bool started;
+
+		private volatile bool connected;
+
+		private volatile bool needStop;
+
+		public AsyncTCPClient(string address, int port, ILogger logger) : base(1000)
+		{
+			this.address = address;
+			this.port = port;
+			this.logger = logger;
+			this.sendBuffer = new byte[this.bufferSize];
+			this.receiveBuffer = new byte[this.bufferSize];
+		}
+
+		public AsyncTCPClient(string address, int port, ILogger logger, int packetSize, int bufferSize) : base(packetSize)
+		{
+			this.address = address;
+			this.port = port;
+			this.bufferSize = bufferSize;
+			this.logger = logger;
+			this.sendBuffer = new byte[this.bufferSize];
+			this.receiveBuffer = new byte[this.bufferSize];
+		}
+
+		public AsyncTCPClient(string address, int port, ILogger logger, int packetSize, int bufferSize, byte prefix, byte suffix) : base(packetSize)
+		{
+			this.address = address;
+			this.port = port;
+			this.bufferSize = bufferSize;
+			this.logger = logger;
+			this.sendBuffer = new byte[this.bufferSize];
+			this.receiveBuffer = new byte[this.bufferSize];
+			this.separate = true;
+			this.separateBytes = false;
+			this.prefix = prefix;
+			this.suffix = suffix;
+			this.tcpstream = new TCPStream(this.prefix, this.suffix);
+		}
+
+		public AsyncTCPClient(string address, int port, ILogger logger, int packetSize, int bufferSize, byte[] prefixBytes, byte[] suffixBytes) : base(packetSize)
+		{
+			this.address = address;
+			this.port = port;
+			this.bufferSize = bufferSize;
+			this.logger = logger;
+			this.sendBuffer = new byte[this.bufferSize];
+			this.receiveBuffer = new byte[this.bufferSize];
+			this.separate = true;
+			this.separateBytes = true;
+			this.prefixBytes = prefixBytes;
+			this.suffixBytes = suffixBytes;
+			this.tcpstream = new TCPStream(this.prefixBytes, this.suffixBytes);
+		}
+
+		public override bool IsConnected()
+		{
+			return this.connected;
+		}
+
+		public void RequestStop()
+		{
+			this.needStop = true;
+		}
+
+		public override void Start()
+		{
+			if (!this.started)
+			{
+				Thread thread = new Thread(new ThreadStart(this.ProcessLoop));
+				thread.Start();
+				this.started = true;
+			}
+		}
+
+		public override void Stop()
+		{
+			this.needStop = true;
+		}
+
+		private void ProcessLoop()
+		{
+			while (!this.needStop)
+			{
+				if (!this.connected)
+				{
+					try
+					{
+						this.tcpClient = new TcpClient();
+						this.tcpClient.Connect(this.address, this.port);
+						this.connected = true;
+						this.stream = this.tcpClient.GetStream();
+						this.stream.BeginRead(this.receiveBuffer, 0, this.receiveBuffer.Length, new AsyncCallback(this.ReceiveCallback), this.stream);
+						this.logger.Info(string.Concat(new object[]
+						{
+							"Started ",
+							this.address,
+							":",
+							this.port
+						}));
+					}
+					catch (Exception ex)
+					{
+						this.logger.Error("Connect Error:" + ex.Message);
+						Thread.Sleep(1000);
+					}
+				}
+				if (this.connected)
+				{
+					try
+					{
+						string text = base.PopSend();
+						if (text != null)
+						{
+							byte[] bytes = Encoding.UTF8.GetBytes(text);
+							byte[] array = bytes;
+							if (this.separate)
+							{
+								if (this.separateBytes)
+								{
+									array = new byte[this.prefixBytes.Length + bytes.Length + this.suffixBytes.Length];
+									Array.Copy(this.prefixBytes, 0, array, 0, this.prefixBytes.Length);
+									Array.Copy(bytes, 0, array, this.prefixBytes.Length, bytes.Length);
+									Array.Copy(this.suffixBytes, 0, array, this.prefixBytes.Length + bytes.Length, this.suffixBytes.Length);
+								}
+								else
+								{
+									array = new byte[1 + bytes.Length + 1];
+									array[0] = this.prefix;
+									Array.Copy(bytes, 0, array, 1, bytes.Length);
+									array[1 + bytes.Length] = this.suffix;
+								}
+							}
+							this.stream.BeginWrite(array, 0, array.Length, new AsyncCallback(this.SendCallback), text);
+							Thread.Sleep(10);
+						}
+					}
+					catch (Exception ex2)
+					{
+						if (this.tcpClient != null)
+						{
+							try
+							{
+								this.tcpClient.Close();
+							}
+							catch (Exception)
+							{
+							}
+						}
+						if (this.stream != null)
+						{
+							try
+							{
+								this.stream.Close();
+							}
+							catch (Exception)
+							{
+							}
+						}
+						this.connected = false;
+						this.logger.Error("Loop Error:" + ex2.Message);
+					}
+				}
+				Thread.Sleep(1);
+			}
+			if (this.tcpClient != null)
+			{
+				try
+				{
+					this.tcpClient.Close();
+				}
+				catch (Exception)
+				{
+				}
+			}
+			if (this.stream != null)
+			{
+				try
+				{
+					this.stream.Close();
+				}
+				catch (Exception)
+				{
+				}
+			}
+			this.connected = false;
+			this.started = false;
+		}
+
+		public void SendCallback(IAsyncResult iar)
+		{
+			try
+			{
+				string str = (string)iar.AsyncState;
+				this.stream.EndWrite(iar);
+				this.logger.Info("send:" + str);
+			}
+			catch (Exception ex)
+			{
+				this.connected = false;
+				this.logger.Error("SendCallback Error:" + ex.Message);
+			}
+		}
+
+		public void ReceiveCallback(IAsyncResult iar)
+		{
+			try
+			{
+				int num = this.stream.EndRead(iar);
+				if (num > 0)
+				{
+					List<byte[]> list = this.tcpstream.Process(this.receiveBuffer, num);
+					foreach (byte[] current in list)
+					{
+						string @string = Encoding.UTF8.GetString(current);
+						base.PushReceive(@string);
+						this.logger.Info("rece:" + @string);
+					}
+				}
+				this.stream.BeginRead(this.receiveBuffer, 0, this.receiveBuffer.Length, new AsyncCallback(this.ReceiveCallback), this.stream);
+			}
+			catch (Exception ex)
+			{
+				this.connected = false;
+				this.logger.Error("ReceiveCallback Error:" + ex.Message);
+			}
+		}
+	}
+}

+ 250 - 0
NetCore31BACNetTransfor/AsyncTCPServer.cs

@@ -0,0 +1,250 @@
+
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+
+namespace NetCore31BACNetTransfor
+{
+	public class AsyncTCPServer : AsyncServerBase
+	{
+		private string address;
+
+		private int port;
+
+		private ILogger logger;
+
+		private TcpListener listener;
+
+		private ManualResetEvent listenDone = new ManualResetEvent(false);
+
+		private int bufferSize = 4096;
+
+		private Dictionary<string, Socket> socketDic = new Dictionary<string, Socket>();
+
+		private Dictionary<string, byte[]> bufferDic = new Dictionary<string, byte[]>();
+
+		private bool separate;
+
+		private bool separateBytes;
+
+		private byte prefix;
+
+		private byte suffix;
+
+		private byte[] prefixBytes;
+
+		private byte[] suffixBytes;
+
+		private volatile bool needStop;
+
+		private Dictionary<string, TCPStream> streamMap = new Dictionary<string, TCPStream>();
+
+		public AsyncTCPServer(string address, int port, ILogger logger) : base(1000)
+		{
+			this.address = address;
+			this.port = port;
+			this.logger = logger;
+		}
+
+		public AsyncTCPServer(string address, int port, ILogger logger, int packetSize, int bufferSize) : base(packetSize)
+		{
+			this.address = address;
+			this.port = port;
+			this.bufferSize = bufferSize;
+			this.logger = logger;
+		}
+
+		public AsyncTCPServer(string address, int port, ILogger logger, int packetSize, int bufferSize, byte prefix, byte suffix) : base(packetSize)
+		{
+			this.address = address;
+			this.port = port;
+			this.bufferSize = bufferSize;
+			this.logger = logger;
+			this.separate = true;
+			this.separateBytes = false;
+			this.prefix = prefix;
+			this.suffix = suffix;
+		}
+
+		public AsyncTCPServer(string address, int port, ILogger logger, int packetSize, int bufferSize, byte[] prefixBytes, byte[] suffixBytes) : base(packetSize)
+		{
+			this.address = address;
+			this.port = port;
+			this.bufferSize = bufferSize;
+			this.logger = logger;
+			this.separate = true;
+			this.separateBytes = true;
+			this.prefixBytes = prefixBytes;
+			this.suffixBytes = suffixBytes;
+		}
+
+		public void RequestStop()
+		{
+			this.needStop = true;
+		}
+
+		public void Start()
+		{
+			this.listener = new TcpListener(new IPEndPoint(IPAddress.Parse(this.address), this.port));
+			this.listener.Start();
+			this.logger.Info(string.Concat(new object[]
+			{
+				"Started ",
+				this.address,
+				":",
+				this.port
+			}));
+			Thread thread = new Thread(new ThreadStart(this.ListenLoop));
+			thread.Start();
+			Thread thread2 = new Thread(new ThreadStart(this.ProcessLoop));
+			thread2.Start();
+		}
+
+		public void Stop()
+		{
+			if (this.listener != null)
+			{
+				this.listener.Stop();
+			}
+		}
+
+		private void ListenLoop()
+		{
+			while (!this.needStop)
+			{
+				this.listener.BeginAcceptSocket(new AsyncCallback(this.ClientConnected), this.listener);
+				this.listenDone.WaitOne();
+				this.listenDone.Reset();
+				Thread.Sleep(1);
+			}
+		}
+
+		private void ClientConnected(IAsyncResult ar)
+		{
+			try
+			{
+				TcpListener tcpListener = (TcpListener)ar.AsyncState;
+				Socket socket = tcpListener.EndAcceptSocket(ar);
+				string text = socket.RemoteEndPoint.ToString();
+				this.socketDic.Remove(text);
+				this.bufferDic.Remove(text);
+				this.bufferDic.Add(text, new byte[this.bufferSize]);
+				this.socketDic.Add(text, socket);
+				socket.BeginReceive(this.bufferDic[text], 0, this.bufferSize, SocketFlags.None, new AsyncCallback(this.ReceiveCallback), socket);
+				this.logger.Error("clientConnect:" + text);
+			}
+			catch (Exception ex)
+			{
+				this.logger.Error("clientConnect Error:" + ex.Message);
+			}
+			this.listenDone.Set();
+		}
+
+		private void ProcessLoop()
+		{
+			while (true)
+			{
+				AsyncServerBag asyncServerBag = base.PopSend();
+				if (asyncServerBag != null)
+				{
+					string text = asyncServerBag.remoteEP.ToString();
+					try
+					{
+						Socket socket = this.socketDic[text];
+						byte[] bytes = Encoding.UTF8.GetBytes(asyncServerBag.bag);
+						byte[] array = bytes;
+						if (this.separate)
+						{
+							if (this.separateBytes)
+							{
+								array = new byte[this.prefixBytes.Length + bytes.Length + this.suffixBytes.Length];
+								Array.Copy(this.prefixBytes, 0, array, 0, this.prefixBytes.Length);
+								Array.Copy(bytes, 0, array, this.prefixBytes.Length, bytes.Length);
+								Array.Copy(this.suffixBytes, 0, array, this.prefixBytes.Length + bytes.Length, this.suffixBytes.Length);
+							}
+							else
+							{
+								array = new byte[1 + bytes.Length + 1];
+								array[0] = this.prefix;
+								Array.Copy(bytes, 0, array, 1, bytes.Length);
+								array[1 + bytes.Length] = this.suffix;
+							}
+						}
+						socket.BeginSend(array, 0, array.Length, SocketFlags.None, new AsyncCallback(this.SendCallback), asyncServerBag);
+					}
+					catch (Exception ex)
+					{
+						this.socketDic.Remove(text);
+						this.bufferDic.Remove(text);
+						this.logger.Error("BeginReceive Error:" + text + "\t" + ex.Message);
+					}
+				}
+				Thread.Sleep(1);
+			}
+		}
+
+		private void SendCallback(IAsyncResult iar)
+		{
+			try
+			{
+				AsyncServerBag asyncServerBag = iar.AsyncState as AsyncServerBag;
+				this.logger.Info("send:" + asyncServerBag.remoteEP.ToString() + " " + asyncServerBag.bag);
+			}
+			catch (Exception ex)
+			{
+				this.logger.Error("SendCallback Error:" + ex.Message);
+			}
+		}
+
+		private void ReceiveCallback(IAsyncResult iar)
+		{
+			Socket socket = (Socket)iar.AsyncState;
+			EndPoint remoteEndPoint = socket.RemoteEndPoint;
+			string key = remoteEndPoint.ToString();
+			try
+			{
+				int num = socket.EndReceive(iar);
+				if (num > 0)
+				{
+					IPEndPoint iPEndPoint = (IPEndPoint)remoteEndPoint;
+					string key2 = iPEndPoint.ToString();
+					if (!this.streamMap.ContainsKey(key2))
+					{
+						TCPStream value;
+						if (this.separateBytes)
+						{
+							value = new TCPStream(this.prefixBytes, this.suffixBytes);
+						}
+						else
+						{
+							value = new TCPStream(this.prefix, this.suffix);
+						}
+						this.streamMap.Add(key2, value);
+					}
+					TCPStream tCPStream = this.streamMap[key2];
+					List<byte[]> list = tCPStream.Process(this.bufferDic[key], num);
+					for (int i = 0; i < list.Count; i++)
+					{
+						byte[] bytes = list[i];
+						string @string = Encoding.UTF8.GetString(bytes);
+						AsyncServerBag asyncServerBag = new AsyncServerBag();
+						asyncServerBag.remoteEP = (IPEndPoint)remoteEndPoint;
+						asyncServerBag.bag = @string;
+						base.PushReceive(asyncServerBag);
+						this.logger.Info("rece:" + asyncServerBag.remoteEP.ToString() + " " + asyncServerBag.bag);
+					}
+				}
+				socket.BeginReceive(this.bufferDic[key], 0, this.bufferSize, SocketFlags.None, new AsyncCallback(this.ReceiveCallback), socket);
+			}
+			catch (Exception ex)
+			{
+				this.socketDic.Remove(key);
+				this.bufferDic.Remove(key);
+				this.logger.Error("ReceiveCallback Error:" + ex.Message);
+			}
+		}
+	}
+}

+ 208 - 0
NetCore31BACNetTransfor/AsyncUdpClient.cs

@@ -0,0 +1,208 @@
+using System;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+
+namespace NetCore31BACNetTransfor
+{
+	public class AsyncUdpClient : AsyncClientBase
+	{
+		private IPEndPoint localEP;
+
+		private IPEndPoint remoteEP;
+
+		private bool isAsync;
+
+		private ILogger logger;
+
+		private UdpClient udpClient;
+
+		public bool shouldStop;
+
+		public bool receiveStopped;
+
+		public bool sendStopped;
+
+		private bool WaitOne_Send;
+
+		private bool WaitOne_Rece;
+
+        public bool V { get; }
+
+        public AsyncUdpClient(IPEndPoint localEP, IPEndPoint remoteEP, bool isAsync, ILogger logger) : base(1000)
+		{
+			this.localEP = localEP;
+			this.remoteEP = remoteEP;
+			this.isAsync = isAsync;
+			this.logger = logger;
+		}
+
+		public AsyncUdpClient(IPEndPoint localEP, IPEndPoint remoteEP, bool isAsync, ILogger logger, int packetSize) : base(packetSize)
+		{
+			this.localEP = localEP;
+			this.remoteEP = remoteEP;
+			this.isAsync = isAsync;
+			this.logger = logger;
+		}
+
+        public override bool IsConnected()
+		{
+			return false;
+		}
+
+		public override void Start()
+		{
+			this.udpClient = new UdpClient(this.localEP);
+			this.udpClient.Connect(this.remoteEP);
+			this.logger.Info("Started " + this.localEP.ToString() + "  " + this.remoteEP.ToString());
+			Thread thread = new Thread(new ThreadStart(this.ReceiveLoop));
+			thread.Start();
+			Thread thread2 = new Thread(new ThreadStart(this.SendLoop));
+			thread2.Start();
+		}
+
+		public override void Stop()
+		{
+			this.shouldStop = true;
+			while (!this.sendStopped || !this.receiveStopped)
+			{
+				Thread.Sleep(1);
+			}
+			if (this.udpClient != null)
+			{
+				this.udpClient.Close();
+			}
+		}
+
+		private void ReceiveLoop()
+		{
+			this.receiveStopped = false;
+			while (!this.shouldStop)
+			{
+				if (this.isAsync)
+				{
+					this.Receive();
+				}
+				else
+				{
+					this.ReceiveSync();
+				}
+				Thread.Sleep(1);
+			}
+			this.receiveStopped = true;
+		}
+
+		private void SendLoop()
+		{
+			this.sendStopped = false;
+			while (!this.shouldStop)
+			{
+				string text = base.PopSend();
+				if (text != null)
+				{
+					if (this.isAsync)
+					{
+						this.Send(text);
+					}
+					else
+					{
+						this.SendSync(text);
+					}
+				}
+				Thread.Sleep(1);
+			}
+			this.sendStopped = true;
+		}
+
+		private void ReceiveSync()
+		{
+			try
+			{
+				IPEndPoint iPEndPoint = new IPEndPoint(IPAddress.Any, 0);
+				byte[] bytes = this.udpClient.Receive(ref iPEndPoint);
+				string str = Encoding.UTF8.GetString(bytes);
+				base.PushReceive(str);
+				this.logger.Info("rece:" + str);
+			}
+			catch (Exception ex)
+			{
+				this.logger.Error(ex.Message);
+			}
+		}
+
+		private void SendSync(string bag)
+		{
+			try
+			{
+				byte[] bytes = Encoding.UTF8.GetBytes(bag);
+				this.udpClient.Send(bytes, bytes.Length);
+				this.logger.Info("send:" + bag);
+			}
+			catch (Exception ex)
+			{
+				this.logger.Error(ex.Message);
+			}
+		}
+
+		private void Send(string msg)
+		{
+			byte[] bytes = Encoding.UTF8.GetBytes(msg);
+			this.WaitOne_Send = false;
+			this.udpClient.BeginSend(bytes, bytes.Length, new AsyncCallback(this.SendCallback), this.udpClient);
+			while (!this.shouldStop)
+			{
+				if (this.WaitOne_Send)
+				{
+					this.logger.Info("send:" + msg);
+					return;
+				}
+				Thread.Sleep(1);
+			}
+		}
+
+		public void SendCallback(IAsyncResult iar)
+		{
+			UdpClient udpClient = iar.AsyncState as UdpClient;
+			try
+			{
+				udpClient.EndSend(iar);
+				this.WaitOne_Send = true;
+			}
+			catch (Exception)
+			{
+			}
+		}
+
+		public void Receive()
+		{
+			this.WaitOne_Rece = false;
+			this.udpClient.BeginReceive(new AsyncCallback(this.ReceiveCallback), this.udpClient);
+			while (!this.shouldStop)
+			{
+				if (this.WaitOne_Rece)
+				{
+					return;
+				}
+				Thread.Sleep(1);
+			}
+		}
+
+		public void ReceiveCallback(IAsyncResult iar)
+		{
+			UdpClient udpClient = iar.AsyncState as UdpClient;
+			try
+			{
+				IPEndPoint iPEndPoint = new IPEndPoint(IPAddress.Any, 0);
+				byte[] bytes = udpClient.EndReceive(iar, ref iPEndPoint);
+				this.WaitOne_Rece = true;
+				string str = Encoding.UTF8.GetString(bytes);
+				base.PushReceive(str);
+				this.logger.Info("rece:" + str);
+			}
+			catch (Exception)
+			{
+			}
+		}
+	}
+}

+ 168 - 0
NetCore31BACNetTransfor/AsyncUdpSever.cs

@@ -0,0 +1,168 @@
+
+using System;
+using System.Net;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading;
+
+namespace NetCore31BACNetTransfor
+{
+	public class AsyncUdpSever : AsyncServerBase
+	{
+		private IPEndPoint ipEndPoint;
+
+		private bool isAsync;
+
+		private ILogger logger;
+
+		private UdpClient udpReceive;
+
+		private UdpClient udpSend;
+
+		private ManualResetEvent sendDone = new ManualResetEvent(false);
+
+		private ManualResetEvent receiveDone = new ManualResetEvent(false);
+
+		public AsyncUdpSever(IPEndPoint ipEndPoint, bool isAsync, ILogger logger) : base(1000)
+		{
+			this.ipEndPoint = ipEndPoint;
+			this.isAsync = isAsync;
+			this.logger = logger;
+		}
+
+		public AsyncUdpSever(IPEndPoint ipEndPoint, bool isAsync, ILogger logger, int packetSize) : base(packetSize)
+		{
+			this.ipEndPoint = ipEndPoint;
+			this.isAsync = isAsync;
+			this.logger = logger;
+		}
+
+		public void Start()
+		{
+			this.udpReceive = new UdpClient(this.ipEndPoint);
+			this.udpSend = new UdpClient();
+			this.logger.Info("Started " + this.ipEndPoint.ToString());
+			Thread thread = new Thread(new ThreadStart(this.ReceiveLoop));
+			thread.Start();
+			Thread thread2 = new Thread(new ThreadStart(this.SendLoop));
+			thread2.Start();
+		}
+
+		public void Stop()
+		{
+			if (this.udpReceive != null)
+			{
+				this.udpReceive.Close();
+			}
+			if (this.udpSend != null)
+			{
+				this.udpSend.Close();
+			}
+		}
+
+		private void ReceiveLoop()
+		{
+			while (true)
+			{
+				if (this.isAsync)
+				{
+					this.Receive();
+				}
+				else
+				{
+					this.ReceiveSync();
+				}
+				Thread.Sleep(1);
+			}
+		}
+
+		private void SendLoop()
+		{
+			while (true)
+			{
+				AsyncServerBag asyncServerBag = base.PopSend();
+				if (asyncServerBag != null)
+				{
+					if (this.isAsync)
+					{
+						this.Send(asyncServerBag);
+					}
+					else
+					{
+						this.SendSync(asyncServerBag);
+					}
+				}
+				Thread.Sleep(1);
+			}
+		}
+
+		private void ReceiveSync()
+		{
+			try
+			{
+				IPEndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0);
+				byte[] bytes = this.udpReceive.Receive(ref remoteEP);
+				AsyncServerBag asyncServerBag = new AsyncServerBag();
+				asyncServerBag.remoteEP = remoteEP;
+				asyncServerBag.bag = Encoding.UTF8.GetString(bytes);
+				base.PushReceive(asyncServerBag);
+				this.logger.Info("rece:" + asyncServerBag.remoteEP.ToString() + " " + asyncServerBag.bag);
+			}
+			catch (Exception ex)
+			{
+				this.logger.Error(ex.Message);
+			}
+		}
+
+		private void SendSync(AsyncServerBag bag)
+		{
+			try
+			{
+				byte[] bytes = Encoding.UTF8.GetBytes(bag.bag);
+				this.udpReceive.Send(bytes, bytes.Length, bag.remoteEP);
+				this.logger.Info("send:" + bag.remoteEP.ToString() + " " + bag.bag);
+			}
+			catch (Exception ex)
+			{
+				this.logger.Error(ex.Message);
+			}
+		}
+
+		private void Receive()
+		{
+			this.udpReceive.BeginReceive(new AsyncCallback(this.ReceiveCallback), this.udpReceive);
+			this.receiveDone.WaitOne();
+			this.receiveDone.Reset();
+		}
+
+		private void ReceiveCallback(IAsyncResult iar)
+		{
+			UdpClient udpClient = iar.AsyncState as UdpClient;
+			IPEndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0);
+			byte[] bytes = udpClient.EndReceive(iar, ref remoteEP);
+			this.receiveDone.Set();
+			AsyncServerBag asyncServerBag = new AsyncServerBag();
+			asyncServerBag.remoteEP = remoteEP;
+			asyncServerBag.bag = Encoding.UTF8.GetString(bytes);
+			base.PushReceive(asyncServerBag);
+			this.logger.Info("rece:" + asyncServerBag.remoteEP.ToString() + " " + asyncServerBag.bag);
+		}
+
+		private void Send(AsyncServerBag bag)
+		{
+			this.udpSend.Connect(bag.remoteEP);
+			byte[] bytes = Encoding.UTF8.GetBytes(bag.bag);
+			this.udpSend.BeginSend(bytes, bytes.Length, new AsyncCallback(this.SendCallback), this.udpSend);
+			this.sendDone.WaitOne();
+			this.sendDone.Reset();
+			this.logger.Info("send:" + bag.remoteEP.ToString() + " " + bag.bag);
+		}
+
+		private void SendCallback(IAsyncResult iar)
+		{
+			UdpClient udpClient = iar.AsyncState as UdpClient;
+			udpClient.EndSend(iar);
+			this.sendDone.Set();
+		}
+	}
+}

+ 184 - 0
NetCore31BACNetTransfor/BacDevice.cs

@@ -0,0 +1,184 @@
+using NPOI.HSSF.UserModel;
+using NPOI.SS.UserModel;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.IO.BACnet;
+using System.Net;
+using System.Text.RegularExpressions;
+
+namespace NetCore31BACNetTransfor
+{
+    public class BacDevice
+    {
+        public BacnetAddress Address { get; set; }
+        public uint DeviceId { get; set; }
+        public ObservableCollection<BacProperty> Properties { get; set; }
+        public int ScanIndex { get; set; } = 0; //扫点序号
+
+        public BacDevice(BacnetAddress adr, uint device_id)
+        {
+            Address = adr;
+            DeviceId = device_id;
+        }
+
+      
+    
+
+
+    public void LoadProperties(uint dID, Dictionary<string, Point> c)
+        {
+            try
+            {
+                if (Properties == null) Properties = new ObservableCollection<BacProperty>();
+                foreach (var p in c)
+                {
+                    var pro = BacProperty.getPro(p.Key, p.Value);
+                    if (pro == null) continue;
+                    pro.Device = this;
+                    if (pro.Device.DeviceId == dID)
+                    {
+                        Properties.Add(pro);
+                    }
+                }
+
+            }
+            catch (Exception exp)
+            {
+                Logger.Error("BacDevice.LoadProperties: ", exp);
+            }
+        }
+        public void LoadPropertiesFromExcel(string file)
+        {
+            try
+            {
+                if (!File.Exists(file)) return;
+                if (Properties == null) Properties = new ObservableCollection<BacProperty>();
+                using (FileStream fp = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+                {
+                    var book = new HSSFWorkbook(fp);
+                    for (int sheetNum = 0; sheetNum < book.NumberOfSheets; sheetNum++)
+                    {
+                        var sheet = book.GetSheetAt(sheetNum);
+                        if (sheet.FirstRowNum < 0 || sheet.FirstRowNum >= sheet.LastRowNum) continue;
+                        for (var rowNum = sheet.FirstRowNum + 1; rowNum <= sheet.LastRowNum; rowNum++)
+                        {
+                            var rowContent = sheet.GetRow(rowNum);
+                            if (rowContent == null) continue;
+                            var pro = BacProperty.FromExcelRow(rowContent);
+                            if (pro == null) continue;
+                            pro.Device = this;
+                            Properties.Add(pro);
+                        }
+                    }
+                }
+            }
+            catch (Exception exp)
+            {
+                Logger.Error("BacDevice.LoadPropertiesFromExcel: ", exp);
+            }
+        }
+    }
+    public class BacProperty
+    {
+        public BacDevice Device { get; set; }
+        public BacnetObjectId ObjectId { get; set; }
+        public string PROP_DESCRIPTION { get; set; }
+        public string PROP_OBJECT_NAME { get; set; }
+        public string PROP_PRESENT_VALUE { get; set; }
+
+
+        public string building { get; set; }
+        public string meter { get; set; }
+        public string funcid { get; set; }
+        public static BacProperty FromExcelRow(IRow row)
+        {
+            if (row == null) return null;
+            try
+            {
+                BacProperty rst = new BacProperty();
+                rst.PROP_OBJECT_NAME = row.GetCell(1)?.ToString();
+                rst.ObjectId = new BacnetObjectId(
+                    (BacnetObjectTypes)Enum.Parse(typeof(BacnetObjectTypes), row.GetCell(2)?.ToString()),
+                    uint.Parse(row.GetCell(3)?.ToString()));
+                rst.PROP_DESCRIPTION = row.GetCell(5)?.ToString();
+                rst.PROP_PRESENT_VALUE = row.GetCell(6)?.ToString();
+                return rst;
+            }
+            catch (Exception exp)
+            {
+                Logger.Error("BacProperty.FromExcelRow", exp);
+                return null;
+            }
+        }
+        public static BacProperty getPro(string key, Point point)
+        {
+            //Key = "192.168.20.159:2068-1968-analogInput-0"
+            try
+            {
+                BacProperty rst = new BacProperty();
+                //rst.PROP_OBJECT_NAME = row.GetCell(1).ToString();
+                rst.ObjectId = new BacnetObjectId(getObjectType(Regex.Split(key, "-", RegexOptions.IgnoreCase)[2]),
+                    uint.Parse(Regex.Split(key, "-", RegexOptions.IgnoreCase)[3]));
+                // rst.PROP_DESCRIPTION = row.GetCell(5).ToString();
+                //rst.PROP_PRESENT_VALUE = row.GetCell(6).ToString();
+                rst.building = point.buildingSign;
+                rst.meter = point.meterSign;
+                foreach (var funcid in point.functionList)
+                {
+                    rst.funcid = Convert.ToString(funcid.functionID);
+                    break;
+                }
+
+                return rst;
+            }
+            catch (Exception exp)
+            {
+                Logger.Error("BacProperty.getPro", exp);
+                return null;
+            }
+        }
+        private static BacnetObjectTypes getObjectType(string type)
+        {
+            // TODO Auto-generated method stub
+            if ("analogInput".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_ANALOG_INPUT;
+            }
+            else if ("analogOutput".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_ANALOG_OUTPUT;
+            }
+            else if ("analogValue".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_ANALOG_VALUE;
+            }
+            else if ("binaryInput".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_BINARY_INPUT;
+            }
+            else if ("binaryOutput".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_BINARY_OUTPUT;
+            }
+            else if ("binaryValue".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_BINARY_VALUE;
+            }
+            else if ("multiStateInput".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_MULTI_STATE_INPUT;
+            }
+            else if ("multiStateOutput".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_MULTI_STATE_OUTPUT;
+            }
+            else if ("multiStateValue".Equals(type))
+            {
+                return BacnetObjectTypes.OBJECT_MULTI_STATE_VALUE;
+            }
+            return BacnetObjectTypes.OBJECT_ANALOG_INPUT;
+        }
+    }
+}

+ 16 - 0
NetCore31BACNetTransfor/Constants.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+    public class Constants
+    {
+
+        public const string Enter = "\r\n";
+        public const char Split = ';';
+        public const string ExcelDir = @"ExcelDir";
+        public const string CombineExcelDir = @"CombineExcelDir";
+        public const string AimExcelDir = @"AimExcelDir";
+    }
+}

+ 20 - 0
NetCore31BACNetTransfor/ILogger.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+	public interface ILogger
+    {
+
+		void Debug(string message);
+
+		void Info(string message);
+
+		void Warn(string message);
+
+		void Error(string message);
+
+		void Fatal(string message);
+	}
+}

+ 59 - 0
NetCore31BACNetTransfor/Logger.cs

@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+    public static class Logger
+    {
+        public static string Dir = "Logs";
+        static object locker = new object();
+        public static void Log(string fileName, string msg, bool hasTime = true)
+        {
+            try
+            {
+                lock (locker)
+                {
+                    Console.WriteLine(msg);
+                    if (!Directory.Exists(Dir))
+                        Directory.CreateDirectory(Dir);
+                    File.AppendAllLines(Path.Combine(Dir, fileName),
+                        new string[] { (hasTime ? DateTime.Now.ToString("HH:mm:ss  ") : "") + msg });
+                }
+            }
+            catch
+            {
+            }
+        }
+
+        public static void Log(string msg, bool hasTime = true)
+        {
+            Log(DateTime.Today.ToString("yyyyMMdd") + @".txt", msg, hasTime);
+        }
+
+        public static void Warning(string msg)
+        {
+            //Log(DateTime.Today.ToString("yyyyMMdd"), msg);
+            Log(DateTime.Today.ToString("yyyyMMdd") + ".Warnings", msg);
+        }
+
+        public static void Error(string msg)
+        {
+            //Log(DateTime.Today.ToString("yyyyMMdd"), msg);
+            Log(DateTime.Today.ToString("yyyyMMdd") + ".Errors", msg);
+        }
+
+        public static void Error(Exception exp)
+        {
+            if (exp == null) return;
+            Error(exp.Message + "\n" + exp.StackTrace);
+        }
+
+        public static void Error(string preStr, Exception exp)
+        {
+            if (exp == null) return;
+            Error(preStr + ":" + exp.Message + "\n" + exp.StackTrace);
+        }
+    }
+}

+ 49 - 0
NetCore31BACNetTransfor/LoggerImpl.cs

@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+	public class LoggerImpl : ILogger
+	{
+		private static LoggerImpl instance;
+
+		public static LoggerImpl Instance()
+		{
+			if (LoggerImpl.instance == null)
+			{
+				LoggerImpl.instance = new LoggerImpl();
+			}
+			return LoggerImpl.instance;
+		}
+
+		private LoggerImpl()
+		{
+		}
+
+		public void Debug(string message)
+		{
+			Console.WriteLine("Debug\t" + message);
+		}
+
+		public void Info(string message)
+		{
+			Console.WriteLine("Info\t" + message);
+		}
+
+		public void Warn(string message)
+		{
+			Console.WriteLine("Warn\t" + message);
+		}
+
+		public void Error(string message)
+		{
+			Console.WriteLine("Error\t" + message);
+		}
+
+		public void Fatal(string message)
+		{
+			Console.WriteLine("Fatal\t" + message);
+		}
+	}
+}

+ 37 - 0
NetCore31BACNetTransfor/NetCore31BACNetTransfor.csproj

@@ -0,0 +1,37 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="BACnet" Version="2.0.4" />
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
+    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
+    <PackageReference Include="Npoi.Mapper" Version="3.5.1" />
+    <PackageReference Include="Quartz" Version="3.3.3" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <None Update="appsetting.json">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="pointlist.xls">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="pointlist_bak.xls">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="setting.xls">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Update="util.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+
+</Project>

+ 6 - 0
NetCore31BACNetTransfor/NetCore31BACNetTransfor.csproj.user

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <_LastSelectedProfileId>D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
+  </PropertyGroup>
+</Project>

+ 25 - 0
NetCore31BACNetTransfor/NetCore31BACNetTransfor.sln

@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetCore31BACNetTransfor", "NetCore31BACNetTransfor.csproj", "{06B28B0B-5E87-4FBF-9FAB-A036D15A248E}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{06B28B0B-5E87-4FBF-9FAB-A036D15A248E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{06B28B0B-5E87-4FBF-9FAB-A036D15A248E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{06B28B0B-5E87-4FBF-9FAB-A036D15A248E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{06B28B0B-5E87-4FBF-9FAB-A036D15A248E}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {6E2C794F-9CFB-41BD-BEA7-08E33352BADA}
+	EndGlobalSection
+EndGlobal

File diff suppressed because it is too large
+ 2171 - 0
NetCore31BACNetTransfor/Program.cs


+ 14 - 0
NetCore31BACNetTransfor/Properties/PublishProfiles/FolderProfile.pubxml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+https://go.microsoft.com/fwlink/?LinkID=208121. 
+-->
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration>Release</Configuration>
+    <Platform>Any CPU</Platform>
+    <PublishDir>bin\Release\netcoreapp3.1\publish\</PublishDir>
+    <PublishProtocol>FileSystem</PublishProtocol>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <SelfContained>false</SelfContained>
+  </PropertyGroup>
+</Project>

File diff suppressed because it is too large
+ 9 - 0
NetCore31BACNetTransfor/Properties/PublishProfiles/FolderProfile.pubxml.user


+ 74 - 0
NetCore31BACNetTransfor/Settings.cs

@@ -0,0 +1,74 @@
+using System;
+using System.Threading.Tasks;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Hosting;
+
+namespace NetCore31BACNetTransfor
+{
+    public static class Settings
+    {
+        public static int BacSplitSize { get; private set; }
+        public static int WaitTime { get; private set; }
+        public static int HeartBeatInterval { get; private set; }
+        public static int LocalBacPort { get; private set; }
+        public static int LocalUdpPort { get; private set; }
+        public static string RemoteUdpIP { get; private set; }
+        public static int RemoteUdpPort { get; private set; }
+
+        public static int AcquisitionFrequency { get; private set; }
+
+        public static string BuildingSign { get; private set; }
+        public static int Gateway { get; private set; }
+        public static string SendType { get; private set; }
+        public static string MeterSignPre { get; private set; }
+        public static string FuncId { get; private set; }
+        public static bool IgnoreFirstValue { get; private set; }
+
+        public static bool Localdebug { get; private set; }
+        public static bool RollCall { get; private set; }
+
+        
+
+
+
+
+
+        public static void InitSettings(string[] args)
+        {
+
+
+            IConfigurationBuilder builder = new ConfigurationBuilder().SetBasePath(System.IO.Directory.GetCurrentDirectory()).AddJsonFile("appsetting.json", true, reloadOnChange: true);
+
+            IConfigurationRoot Configuration = builder.Build();
+
+            //conStrings = Configuration.GetConnectionString("SqlServerConnection");
+
+            // Application code should start here.
+
+            IConfigurationSection section = Configuration.GetSection("appSettings");
+
+
+
+            LocalUdpPort = int.Parse(section.GetSection("LocalUdpPort").Value);
+            BacSplitSize = int.Parse(section.GetSection("BacSplitSize").Value);
+            WaitTime = int.Parse(section.GetSection("WaitTime").Value);
+            HeartBeatInterval = int.Parse(section.GetSection("HeartBeatInterval").Value);
+            LocalBacPort = int.Parse(section.GetSection("LocalBacPort").Value);
+          
+            RemoteUdpIP = section.GetSection("RemoteUdpIP").Value;
+            RemoteUdpPort = int.Parse(section.GetSection("RemoteUdpPort").Value);
+            AcquisitionFrequency = int.Parse(section.GetSection("AcquisitionFrequency").Value);
+
+            BuildingSign = section.GetSection("BuildingSign").Value;
+            Gateway = int.Parse(section.GetSection("Gateway").Value);
+            SendType = section.GetSection("SendType").Value;
+            MeterSignPre = section.GetSection("MeterSignPre").Value;
+            FuncId = section.GetSection("FuncId").Value;
+            IgnoreFirstValue = string.Equals("true", section.GetSection("IgnoreFirstValue").Value, StringComparison.CurrentCultureIgnoreCase);
+            Localdebug = string.Equals("true", section.GetSection("Localdebug").Value, StringComparison.CurrentCultureIgnoreCase);
+            RollCall = string.Equals("true", section.GetSection("RollCall").Value, StringComparison.CurrentCultureIgnoreCase);
+
+            Logger.Log("InitSettings Finished"); 
+        }
+    }
+}

+ 16 - 0
NetCore31BACNetTransfor/StringHelper.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+    public static class StringHelper
+    {
+
+        public static void AppendWithSplit<T>(this StringBuilder sb, T str)
+        {
+            sb.Append(str);
+            sb.Append(Constants.Split);
+        }
+    }
+}

+ 150 - 0
NetCore31BACNetTransfor/TCPStream.cs

@@ -0,0 +1,150 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NetCore31BACNetTransfor
+{
+    public class TCPStream
+    {
+		private bool separateBytes;
+
+		private byte prefix;
+
+		private byte suffix;
+
+		private byte[] prefixBytes;
+
+		private byte[] suffixBytes;
+
+		private List<byte> contents = new List<byte>();
+
+		private bool content_valid;
+
+		private List<byte> buffer = new List<byte>();
+
+		public TCPStream(byte prefix, byte suffix)
+		{
+			this.separateBytes = false;
+			this.prefix = prefix;
+			this.suffix = suffix;
+		}
+
+		public TCPStream(byte[] prefixBytes, byte[] suffixBytes)
+		{
+			this.separateBytes = true;
+			this.prefixBytes = prefixBytes;
+			this.suffixBytes = suffixBytes;
+		}
+
+		public List<byte[]> Process(byte[] bytes, int length)
+		{
+			List<byte[]> list = new List<byte[]>();
+			if (this.separateBytes)
+			{
+				for (int i = 0; i < length; i++)
+				{
+					this.buffer.Add(bytes[i]);
+				}
+				while (true)
+				{
+					int num = this.FindIndexForward(this.buffer, this.buffer.Count, this.suffixBytes);
+					if (num == -1)
+					{
+						break;
+					}
+					int num2 = this.FindIndexBackward(this.buffer, num, this.prefixBytes);
+					if (num2 != -1)
+					{
+						int num3 = num - num2 - this.prefixBytes.Length;
+						if (num3 > 0)
+						{
+							byte[] array = new byte[num3];
+							for (int j = 0; j < num3; j++)
+							{
+								array[j] = this.buffer[num2 + this.prefixBytes.Length + j];
+							}
+							list.Add(array);
+						}
+					}
+					for (int k = 0; k < num + this.suffixBytes.Length; k++)
+					{
+						this.buffer.RemoveAt(0);
+					}
+				}
+			}
+			else
+			{
+				for (int l = 0; l < length; l++)
+				{
+					byte b = bytes[l];
+					if (b == this.suffix)
+					{
+						if (this.content_valid && this.contents.Count > 0)
+						{
+							byte[] array2 = new byte[this.contents.Count];
+							for (int m = 0; m < this.contents.Count; m++)
+							{
+								array2[m] = this.contents[m];
+							}
+							list.Add(array2);
+						}
+						this.contents.Clear();
+						this.content_valid = false;
+					}
+					else if (b == this.prefix)
+					{
+						this.contents.Clear();
+						this.content_valid = true;
+					}
+					else if (this.content_valid)
+					{
+						this.contents.Add(b);
+					}
+				}
+			}
+			return list;
+		}
+
+		private int FindIndexForward(List<byte> byteList, int length, byte[] bytes)
+		{
+			int result = -1;
+			for (int i = 0; i <= length - bytes.Length; i++)
+			{
+				if (this.Match(byteList, i, bytes))
+				{
+					result = i;
+					break;
+				}
+			}
+			return result;
+		}
+
+		private int FindIndexBackward(List<byte> byteList, int length, byte[] bytes)
+		{
+			int result = -1;
+			for (int i = length - bytes.Length; i >= 0; i--)
+			{
+				if (this.Match(byteList, i, bytes))
+				{
+					result = i;
+					break;
+				}
+			}
+			return result;
+		}
+
+		private bool Match(List<byte> byteList, int index, byte[] bytes)
+		{
+			bool result = true;
+			for (int i = 0; i < bytes.Length; i++)
+			{
+				if (byteList[index + i] != bytes[i])
+				{
+					result = false;
+					break;
+				}
+			}
+			return result;
+		}
+	}
+}

+ 21 - 0
NetCore31BACNetTransfor/appsetting.json

@@ -0,0 +1,21 @@
+{
+  "appSettings": {
+    "BacSplitSize": "10",
+    "WaitTime": "2000",
+    "HeartBeatInterval": "10000",
+    "LocalBacPort": "47808",
+    "LocalUdpPort": "8756",
+    "RemoteUdpIP": "10.84.19.220",
+    "AcquisitionFrequency": "50",
+    "RollCall": "true",
+    "RemoteUdpPort": "8851",
+    "BuildingSign": "4401051003",
+    "Gateway": "1",
+    "Localdebug": "false",
+    "SendType": "report",
+    "MeterSignPre": "BACnetIP.Channel_1.Device_",
+    "FuncId": "903",
+    "IgnoreFirstValue": "true"
+  }
+
+}

BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/BACnet.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/BouncyCastle.Crypto.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Common.Logging.Core.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Common.Logging.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/ICSharpCode.SharpZipLib.dll


+ 1 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211116.Errors

@@ -0,0 +1 @@
+16:42:13  DataFormatterError_rowNum01:167, colNum: 5, EMsg: 2226454A

File diff suppressed because it is too large
+ 40731 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211116.txt


+ 24 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211117.Errors

@@ -0,0 +1,24 @@
+09:28:00  DataFormatterError_rowNum01:945, colNum: 2, EMsg: Group
+09:28:00  DataFormatterError_rowNum01:948, colNum: 2, EMsg: new
+09:28:00  DataFormatterError_rowNum01:948, colNum: 3, EMsg: old
+09:28:00  InitBacnet_client: :在其上下文中,该请求的地址无效。
+   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
+   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
+   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
+   at System.IO.BACnet.BacnetIpUdpProtocolTransport.Open()
+   at System.IO.BACnet.BacnetIpUdpProtocolTransport.Start()
+   at System.IO.BACnet.BacnetClient.Start()
+   at NetCore31BACNetTransfor.Program.InitBacnet_client() in D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\Program.cs:line 857
+09:28:00  InitUdp_Client: :在其上下文中,该请求的地址无效。
+   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
+   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
+   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
+   at System.Net.Sockets.UdpClient..ctor(IPEndPoint localEP)
+   at NetCore31BACNetTransfor.AsyncUdpClient.Start() in D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\AsyncUdpClient.cs:line 56
+   at NetCore31BACNetTransfor.Program.InitUdp_Client() in D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\Program.cs:line 933
+20:33:15  DataFormatterError_rowNum01:945, colNum: 2, EMsg: Group
+20:33:15  DataFormatterError_rowNum01:948, colNum: 2, EMsg: new
+20:33:15  DataFormatterError_rowNum01:948, colNum: 3, EMsg: old
+20:51:06  DataFormatterError_rowNum01:945, colNum: 2, EMsg: Group
+20:51:06  DataFormatterError_rowNum01:948, colNum: 2, EMsg: new
+20:51:06  DataFormatterError_rowNum01:948, colNum: 3, EMsg: old

File diff suppressed because it is too large
+ 18432 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211117.txt


+ 22 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211127.Errors

@@ -0,0 +1,22 @@
+13:56:11  Init: :Input string was not in a correct format.
+   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
+   at System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
+   at System.Int32.Parse(String s)
+   at NetCore31BACNetTransfor.Program.<>c.<Init>b__73_1(String s) in D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\Program.cs:line 218
+   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
+   at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
+   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
+   at System.Linq.OrderedEnumerable`1.ToList()
+   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
+   at NetCore31BACNetTransfor.Program.Init(String[] args) in D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\Program.cs:line 218
+14:03:07  Init: :Input string was not in a correct format.
+   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)
+   at System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info)
+   at System.Int32.Parse(String s)
+   at NetCore31BACNetTransfor.Program.<>c.<Init>b__73_1(String s) in D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\Program.cs:line 221
+   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
+   at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
+   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
+   at System.Linq.OrderedEnumerable`1.ToList()
+   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
+   at NetCore31BACNetTransfor.Program.Init(String[] args) in D:\dotnetproject\DotNetCoreBACNetTransfor\NetCore31BACNetTransfor\Program.cs:line 221

File diff suppressed because it is too large
+ 62986 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211127.txt


+ 2 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211129.Errors

@@ -0,0 +1,2 @@
+14:46:09  DataFormatterError_rowNum_In_Pointlist :2176, colNum: 2, EMsg: Functions_Group_ID
+14:46:09  DataFormatterError_rowNum_In_Pointlist :2176, colNum: 3, EMsg: MIN

+ 6 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Logs/20211129.txt

@@ -0,0 +1,6 @@
+14:46:07  Begin Translate BACnet Datas
+14:46:08  InitSettings Finished
+14:56:15  Begin Translate BACnet Datas
+14:56:15  InitSettings Finished
+15:03:53  Begin Translate BACnet Datas
+15:03:53  InitSettings Finished

BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Abstractions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Binder.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.CommandLine.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.EnvironmentVariables.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.FileExtensions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Json.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.UserSecrets.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.FileProviders.Abstractions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.FileProviders.Physical.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.FileSystemGlobbing.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Hosting.Abstractions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Hosting.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Abstractions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Configuration.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Console.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Debug.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.EventLog.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.EventSource.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Options.ConfigurationExtensions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Options.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Primitives.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Win32.Registry.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Microsoft.Win32.SystemEvents.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.OOXML.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.OpenXml4Net.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.OpenXmlFormats.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NPOI.dll


File diff suppressed because it is too large
+ 2527 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.deps.json


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.exe


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.pdb


+ 10 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.runtimeconfig.dev.json

@@ -0,0 +1,10 @@
+{
+  "runtimeOptions": {
+    "additionalProbingPaths": [
+      "C:\\Users\\wangwendong\\.dotnet\\store\\|arch|\\|tfm|",
+      "C:\\Users\\wangwendong\\.nuget\\packages",
+      "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
+      "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
+    ]
+  }
+}

+ 9 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/NetCore31BACNetTransfor.runtimeconfig.json

@@ -0,0 +1,9 @@
+{
+  "runtimeOptions": {
+    "tfm": "netcoreapp3.1",
+    "framework": {
+      "name": "Microsoft.NETCore.App",
+      "version": "3.1.0"
+    }
+  }
+}

BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Npoi.Mapper.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/PacketDotNet.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/Quartz.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/SharpPcap.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Configuration.ConfigurationManager.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Diagnostics.DiagnosticSource.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Diagnostics.EventLog.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Drawing.Common.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.IO.Ports.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Runtime.CompilerServices.Unsafe.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.AccessControl.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.Cryptography.ProtectedData.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.Permissions.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Security.Principal.Windows.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Text.Encodings.Web.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Text.Json.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/System.Windows.Extensions.dll


+ 21 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/appsetting.json

@@ -0,0 +1,21 @@
+{
+  "appSettings": {
+    "BacSplitSize": "10",
+    "WaitTime": "2000",
+    "HeartBeatInterval": "10000",
+    "LocalBacPort": "47808",
+    "LocalUdpPort": "8756",
+    "RemoteUdpIP": "10.84.19.220",
+    "AcquisitionFrequency": "50",
+    "RollCall": "true",
+    "RemoteUdpPort": "8851",
+    "BuildingSign": "4401051003",
+    "Gateway": "1",
+    "Localdebug": "false",
+    "SendType": "report",
+    "MeterSignPre": "BACnetIP.Channel_1.Device_",
+    "FuncId": "903",
+    "IgnoreFirstValue": "true"
+  }
+
+}

BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/log4net.dll


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/pointlist.xls


BIN
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/pointlist_bak.xls


+ 0 - 0
NetCore31BACNetTransfor/bin/Debug/netcoreapp3.1/runtimes/linux-arm/native/libSystem.IO.Ports.Native.so


Some files were not shown because too many files changed in this diff