diff --git a/h-opc-cli/Repl.cs b/h-opc-cli/Repl.cs index c147629..3fbb235 100644 --- a/h-opc-cli/Repl.cs +++ b/h-opc-cli/Repl.cs @@ -99,34 +99,35 @@ private void Write(IList args) var tag = args[0]; var val = args[1]; var type = _client.GetDataType(GenerateRelativeTag(tag)); - switch(type.Name) { + switch (type.Name) + { case "Int32": var val32 = Convert.ToInt32(val); _client.Write(GenerateRelativeTag(tag), val32); break; case "Int16": var val16 = Convert.ToInt16(val); - _client.Write(GenerateRelativeTag(tag), val16); + _client.Write(GenerateRelativeTag(tag), val16); break; case "UInt16": var valuint16 = Convert.ToUInt16(val); - _client.Write(GenerateRelativeTag(tag), valuint16); + _client.Write(GenerateRelativeTag(tag), valuint16); break; case "UInt32": var valuint32 = Convert.ToUInt32(val); - _client.Write(GenerateRelativeTag(tag), valuint32); + _client.Write(GenerateRelativeTag(tag), valuint32); break; case "Boolean": var valBool = Convert.ToBoolean(val); - _client.Write(GenerateRelativeTag(tag), valBool); + _client.Write(GenerateRelativeTag(tag), valBool); break; case "Int64": var val64 = Convert.ToInt64(val); - _client.Write(GenerateRelativeTag(tag), val64); + _client.Write(GenerateRelativeTag(tag), val64); break; case "UInt64": var valuint64 = Convert.ToUInt64(val); - _client.Write(GenerateRelativeTag(tag), valuint64); + _client.Write(GenerateRelativeTag(tag), valuint64); break; default: _client.Write(GenerateRelativeTag(tag), val); @@ -179,7 +180,7 @@ private void ShowSubnodes() if (nodes == null || !nodes.Any()) Console.WriteLine("no subnodes"); else foreach (var node in nodes) - Console.WriteLine(node.Name); + Console.WriteLine(node.Name); } #endregion diff --git a/h-opc/Common/IClient.cs b/h-opc/Common/IClient.cs index ea11770..5659cb8 100644 --- a/h-opc/Common/IClient.cs +++ b/h-opc/Common/IClient.cs @@ -24,7 +24,7 @@ public interface IClient : IDisposable /// Gets the datatype of an OPC tag /// /// Tag to get datatype of - /// System.Type + /// System Type System.Type GetDataType(string tag); /// diff --git a/h-opc/Da/DaClient.cs b/h-opc/Da/DaClient.cs index 7816038..fd1d2d7 100644 --- a/h-opc/Da/DaClient.cs +++ b/h-opc/Da/DaClient.cs @@ -40,14 +40,14 @@ public DaClient(Uri serverUrl) /// Gets the datatype of an OPC tag /// /// Tag to get datatype of - /// System.Type + /// System Type public System.Type GetDataType(string tag) { var item = new OpcDa.Item { ItemName = tag }; OpcDa.ItemProperty result; try { - var propertyCollection = _server.GetProperties(new [] {item}, new [] {new OpcDa.PropertyID(1)}, false)[0]; + var propertyCollection = _server.GetProperties(new[] { item }, new[] { new OpcDa.PropertyID(1) }, false)[0]; result = propertyCollection[0]; } catch (NullReferenceException) diff --git a/h-opc/Ua/UaClient.cs b/h-opc/Ua/UaClient.cs index fe925d8..7216dfa 100644 --- a/h-opc/Ua/UaClient.cs +++ b/h-opc/Ua/UaClient.cs @@ -78,7 +78,7 @@ public void Connect() /// Gets the datatype of an OPC tag /// /// Tag to get datatype of - /// System.Type + /// System Type public System.Type GetDataType(string tag) { var nodesToRead = BuildReadValueIdCollection(tag, Attributes.Value); @@ -487,10 +487,10 @@ private Session InitializeSession(Uri url) CertificateValidator = certificateValidator, ServerConfiguration = new ServerConfiguration { - MaxSubscriptionCount = _options.MaxSubscriptionCount, - MaxMessageQueueSize = _options.MaxMessageQueueSize, - MaxNotificationQueueSize = _options.MaxNotificationQueueSize, - MaxPublishRequestCount = _options.MaxPublishRequestCount + MaxSubscriptionCount = _options.MaxSubscriptionCount, + MaxMessageQueueSize = _options.MaxMessageQueueSize, + MaxNotificationQueueSize = _options.MaxNotificationQueueSize, + MaxPublishRequestCount = _options.MaxPublishRequestCount }, SecurityConfiguration = new SecurityConfiguration { diff --git a/tests/DaTest.cs b/tests/DaTest.cs index e7dfba6..33f4e67 100644 --- a/tests/DaTest.cs +++ b/tests/DaTest.cs @@ -116,7 +116,7 @@ public void DaExploreFolder() public void DaGetDataType() { var type = _client.GetDataType(TestRegister); - Assert.AreEqual(typeof(Int16), type); + Assert.AreEqual(typeof(short), type); } } } diff --git a/tests/UaTest.cs b/tests/UaTest.cs index 17f9b29..4e53ebe 100644 --- a/tests/UaTest.cs +++ b/tests/UaTest.cs @@ -280,9 +280,9 @@ public void DisposeWithoutException() public void UaGetDataType() { var type = _client.GetDataType("Data.Dynamic.Scalar.Int32Value"); - Assert.AreEqual(typeof(Int32), type); + Assert.AreEqual(typeof(short), type); type = _client.GetDataType("Data.Dynamic.Scalar.Int16Value"); - Assert.AreEqual(typeof(Int16), type); + Assert.AreEqual(typeof(short), type); } } }