From 21635b0ad9cdba77b0ea36733db5c85fc8b8385b Mon Sep 17 00:00:00 2001 From: "parallelbgls@outlook.com" Date: Wed, 13 Jan 2016 17:51:17 +0800 Subject: [PATCH] 2016-01-13 update 1 --- .../ConfigurationManager.Designer.cs | 17 +++-- .../ModBus.Net/ConfigurationManager.resx | 9 ++- .../ModBus.Net/ModBus.Net-xamarin.csproj | 63 ------------------- .../Modbus/ModbusTcpProtocalLinker.cs | 2 +- .../Siemens/SiemensTcpProtocalLinker.cs | 2 +- Modbus.Net/ModBus.Net/TcpProtocalLinker.cs | 2 +- 6 files changed, 22 insertions(+), 73 deletions(-) delete mode 100644 Modbus.Net/ModBus.Net/ModBus.Net-xamarin.csproj diff --git a/Modbus.Net/ModBus.Net/ConfigurationManager.Designer.cs b/Modbus.Net/ModBus.Net/ConfigurationManager.Designer.cs index a8ecd42..3e90557 100644 --- a/Modbus.Net/ModBus.Net/ConfigurationManager.Designer.cs +++ b/Modbus.Net/ModBus.Net/ConfigurationManager.Designer.cs @@ -61,7 +61,7 @@ namespace ModBus.Net { } /// - /// 查找类似 COM6 的本地化字符串。 + /// 查找类似 COM1 的本地化字符串。 /// internal static string COM { get { @@ -70,7 +70,7 @@ namespace ModBus.Net { } /// - /// 查找类似 192.168.3.247 的本地化字符串。 + /// 查找类似 192.168.1.1 的本地化字符串。 /// internal static string IP { get { @@ -90,9 +90,18 @@ namespace ModBus.Net { /// /// 查找类似 502 的本地化字符串。 /// - internal static string Port { + internal static string ModbusPort { get { - return ResourceManager.GetString("Port", resourceCulture); + return ResourceManager.GetString("ModbusPort", resourceCulture); + } + } + + /// + /// 查找类似 102 的本地化字符串。 + /// + internal static string SiemensPort { + get { + return ResourceManager.GetString("SiemensPort", resourceCulture); } } } diff --git a/Modbus.Net/ModBus.Net/ConfigurationManager.resx b/Modbus.Net/ModBus.Net/ConfigurationManager.resx index 0c3084d..720ced4 100644 --- a/Modbus.Net/ModBus.Net/ConfigurationManager.resx +++ b/Modbus.Net/ModBus.Net/ConfigurationManager.resx @@ -118,15 +118,18 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - COM6 + COM1 - 192.168.3.247 + 192.168.1.1 5000 - + 502 + + 102 + \ No newline at end of file diff --git a/Modbus.Net/ModBus.Net/ModBus.Net-xamarin.csproj b/Modbus.Net/ModBus.Net/ModBus.Net-xamarin.csproj deleted file mode 100644 index 23a3ac3..0000000 --- a/Modbus.Net/ModBus.Net/ModBus.Net-xamarin.csproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - Debug - AnyCPU - {E97FCE46-855D-498B-8E58-00AFF3A1E760} - Library - ModBus.Net - ModBus.Net - v4.5 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - false - - - full - true - bin\Release - prompt - 4 - false - - - - - - - - - - - - - - - ConfigurationManager.resx - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Modbus.Net/ModBus.Net/Modbus/ModbusTcpProtocalLinker.cs b/Modbus.Net/ModBus.Net/Modbus/ModbusTcpProtocalLinker.cs index cbe4272..5205339 100644 --- a/Modbus.Net/ModBus.Net/Modbus/ModbusTcpProtocalLinker.cs +++ b/Modbus.Net/ModBus.Net/Modbus/ModbusTcpProtocalLinker.cs @@ -18,7 +18,7 @@ return true; } - public ModbusTcpProtocalLinker(string ip) : base(ip, 102) + public ModbusTcpProtocalLinker(string ip) : base(ip, int.Parse(ConfigurationManager.ModbusPort)) { } diff --git a/Modbus.Net/ModBus.Net/Siemens/SiemensTcpProtocalLinker.cs b/Modbus.Net/ModBus.Net/Siemens/SiemensTcpProtocalLinker.cs index 8f1253a..02f4d7d 100644 --- a/Modbus.Net/ModBus.Net/Siemens/SiemensTcpProtocalLinker.cs +++ b/Modbus.Net/ModBus.Net/Siemens/SiemensTcpProtocalLinker.cs @@ -29,7 +29,7 @@ namespace ModBus.Net.Siemens } public SiemensTcpProtocalLinker(string ip) - : base(ip, 102) + : base(ip, int.Parse(ConfigurationManager.SiemensPort)) { } diff --git a/Modbus.Net/ModBus.Net/TcpProtocalLinker.cs b/Modbus.Net/ModBus.Net/TcpProtocalLinker.cs index ec14b45..68b556b 100644 --- a/Modbus.Net/ModBus.Net/TcpProtocalLinker.cs +++ b/Modbus.Net/ModBus.Net/TcpProtocalLinker.cs @@ -8,7 +8,7 @@ namespace ModBus.Net public abstract class TcpProtocalLinker : ProtocalLinker { - protected TcpProtocalLinker() : this(ConfigurationManager.IP, int.Parse(ConfigurationManager.Port)) + protected TcpProtocalLinker() : this(ConfigurationManager.IP, int.Parse(ConfigurationManager.ModbusPort)) { }