diff --git a/Modbus.Net/Modbus.Net.BigEndian3412/Modbus.Net.BigEndian3412ValueHelper.cs b/Modbus.Net/Modbus.Net.BigEndian3412/Modbus.Net.BigEndian3412ValueHelper.cs
index fd6c267..11bb1e4 100644
--- a/Modbus.Net/Modbus.Net.BigEndian3412/Modbus.Net.BigEndian3412ValueHelper.cs
+++ b/Modbus.Net/Modbus.Net.BigEndian3412/Modbus.Net.BigEndian3412ValueHelper.cs
@@ -40,11 +40,11 @@ namespace Modbus.Net
{
Array.Reverse(data, pos, 4);
byte temp;
- temp = data[pos]; data[pos] = data[pos+2]; data[pos+2] = temp;
- temp = data[pos+1]; data[pos+1] = data[pos+3]; data[pos+3] = temp;
+ temp = data[pos]; data[pos] = data[pos + 2]; data[pos + 2] = temp;
+ temp = data[pos + 1]; data[pos + 1] = data[pos + 3]; data[pos + 3] = temp;
var t = BitConverter.ToSingle(data, pos);
- temp = data[pos]; data[pos] = data[pos+2]; data[pos+2] = temp;
- temp = data[pos+1]; data[pos+1] = data[pos+3]; data[pos+3] = temp;
+ temp = data[pos]; data[pos] = data[pos + 2]; data[pos + 2] = temp;
+ temp = data[pos + 1]; data[pos + 1] = data[pos + 3]; data[pos + 3] = temp;
Array.Reverse(data, pos, 4);
pos += 4;
return t;
diff --git a/Modbus.Net/Modbus.Net.Modbus/ModbusMachine.cs b/Modbus.Net/Modbus.Net.Modbus/ModbusMachine.cs
index 8a4f1db..0e20f5f 100644
--- a/Modbus.Net/Modbus.Net.Modbus/ModbusMachine.cs
+++ b/Modbus.Net/Modbus.Net.Modbus/ModbusMachine.cs
@@ -21,7 +21,7 @@ namespace Modbus.Net.Modbus
/// 主站号
/// 端格式
public ModbusMachine(TKey id, ModbusType connectionType, string connectionString,
- IEnumerable> getAddresses, bool keepConnect, byte slaveAddress, byte masterAddress,
+ IEnumerable> getAddresses, bool keepConnect, byte slaveAddress, byte masterAddress,
Endian endian)
: base(id, getAddresses, keepConnect, slaveAddress, masterAddress)
{
diff --git a/Modbus.Net/Modbus.Net.Opc/OpcConnector.cs b/Modbus.Net/Modbus.Net.Opc/OpcConnector.cs
index 380a733..8c2f1c8 100644
--- a/Modbus.Net/Modbus.Net.Opc/OpcConnector.cs
+++ b/Modbus.Net/Modbus.Net.Opc/OpcConnector.cs
@@ -130,7 +130,7 @@ namespace Modbus.Net.Opc
{
Success = false,
Value = Encoding.ASCII.GetBytes("NoData")
- };
+ };
}
else
{
diff --git a/Modbus.Net/Modbus.Net/Controller/BaseController.cs b/Modbus.Net/Modbus.Net/Controller/BaseController.cs
index 4fabf3d..e33b5ff 100644
--- a/Modbus.Net/Modbus.Net/Controller/BaseController.cs
+++ b/Modbus.Net/Modbus.Net/Controller/BaseController.cs
@@ -136,7 +136,7 @@ namespace Modbus.Net
else if (length == 0) return null;
else
{
- duplicatedMessages = new List<(byte[],bool)>();
+ duplicatedMessages = new List<(byte[], bool)>();
var skipLength = 0;
while (receiveMessageCopy.Length >= length)
{
@@ -160,7 +160,7 @@ namespace Modbus.Net
if (length == 0) return null;
}
if (skipLength > 0)
- {
+ {
lock (WaitingMessages)
{
var def = GetMessageFromWaitingList(null);
@@ -175,7 +175,7 @@ namespace Modbus.Net
}
def.ReceiveMutex.Set();
}
- }
+ }
return null;
}
}
diff --git a/Modbus.Net/Modbus.Net/Enum/Enum.cs b/Modbus.Net/Modbus.Net/Enum/Enum.cs
index a041131..bf6bcee 100644
--- a/Modbus.Net/Modbus.Net/Enum/Enum.cs
+++ b/Modbus.Net/Modbus.Net/Enum/Enum.cs
@@ -1,9 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
namespace Modbus.Net
{
diff --git a/Modbus.Net/Modbus.Net/Helper/AssemblyHelper.cs b/Modbus.Net/Modbus.Net/Helper/AssemblyHelper.cs
index 37c95d7..64b8140 100644
--- a/Modbus.Net/Modbus.Net/Helper/AssemblyHelper.cs
+++ b/Modbus.Net/Modbus.Net/Helper/AssemblyHelper.cs
@@ -1,10 +1,6 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.IO;
-using System.Linq;
using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
namespace Modbus.Net
{
diff --git a/Modbus.Net/Modbus.Net/Helper/EnumHelper.cs b/Modbus.Net/Modbus.Net/Helper/EnumHelper.cs
index 86f677a..39f381a 100644
--- a/Modbus.Net/Modbus.Net/Helper/EnumHelper.cs
+++ b/Modbus.Net/Modbus.Net/Helper/EnumHelper.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Modbus.Net
+namespace Modbus.Net
{
#if NET462
#pragma warning disable 1591
diff --git a/Modbus.Net/Modbus.Net/Helper/ValueHelper.cs b/Modbus.Net/Modbus.Net/Helper/ValueHelper.cs
index c8635b4..d8de9f0 100644
--- a/Modbus.Net/Modbus.Net/Helper/ValueHelper.cs
+++ b/Modbus.Net/Modbus.Net/Helper/ValueHelper.cs
@@ -313,13 +313,13 @@ namespace Modbus.Net
}
foreach (var assembly in AssemblyHelper.GetAllLibraryAssemblies())
{
- var valueHelper = assembly.GetType("Modbus.Net."+endian.ToString() + "ValueHelper")?.GetProperty("Instance")?.GetValue(null, null) as ValueHelper;
+ var valueHelper = assembly.GetType("Modbus.Net." + endian.ToString() + "ValueHelper")?.GetProperty("Instance")?.GetValue(null, null) as ValueHelper;
if (valueHelper != null)
{
EndianInstanceCache[endian.ToString()] = valueHelper;
return valueHelper;
}
-
+
}
throw new NotImplementedException("ValueHelper " + endian.ToString() + " doesn't exist.");
}
diff --git a/Modbus.Net/Modbus.Net/Job/JobChainingJobLIstenerWithDataMapRepeated.cs b/Modbus.Net/Modbus.Net/Job/JobChainingJobLIstenerWithDataMapRepeated.cs
index 345d7d5..1331ec0 100644
--- a/Modbus.Net/Modbus.Net/Job/JobChainingJobLIstenerWithDataMapRepeated.cs
+++ b/Modbus.Net/Modbus.Net/Job/JobChainingJobLIstenerWithDataMapRepeated.cs
@@ -1,8 +1,6 @@
using Quartz;
-using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -41,7 +39,7 @@ namespace Modbus.Net
if (sj == null)
{
var chainRoot = context.JobDetail.Key;
- var chainParent = ChainLinks.FirstOrDefault(p => p.Value == context.JobDetail.Key).Key;
+ var chainParent = ChainLinks.FirstOrDefault(p => p.Value == context.JobDetail.Key).Key;
while (chainParent != null)
{
chainRoot = chainParent;
diff --git a/Modbus.Net/Modbus.Net/Job/MachineJobScheduler.cs b/Modbus.Net/Modbus.Net/Job/MachineJobScheduler.cs
index 45e789c..00c1eb1 100644
--- a/Modbus.Net/Modbus.Net/Job/MachineJobScheduler.cs
+++ b/Modbus.Net/Modbus.Net/Job/MachineJobScheduler.cs
@@ -90,7 +90,7 @@ namespace Modbus.Net
var jobKeys = await scheduler.GetJobKeys(GroupMatcher.GroupEquals("Modbus.Net.DataQuery.Group." + triggerKey));
await scheduler.DeleteJobs(jobKeys);
- return new MachineGetJobScheduler(scheduler, trigger);
+ return new MachineGetJobScheduler(scheduler, trigger);
}
///
diff --git a/Modbus.Net/Modbus.Net/Machine/BaseMachine.cs b/Modbus.Net/Modbus.Net/Machine/BaseMachine.cs
index 8ac615e..59a6fd3 100644
--- a/Modbus.Net/Modbus.Net/Machine/BaseMachine.cs
+++ b/Modbus.Net/Modbus.Net/Machine/BaseMachine.cs
@@ -1,5 +1,4 @@
using Microsoft.Extensions.Logging;
-using Quartz.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -646,7 +645,7 @@ namespace Modbus.Net
ErrorMsg = "Data length mismatch"
};
}
-
+
//字节坐标的主地址位置
var localMainPos = 0;
//字节坐标的子地址位置
@@ -720,7 +719,7 @@ namespace Modbus.Net
};
}
}
-
+
//如果不保持连接,断开连接
if (!KeepConnect)
BaseUtility.Disconnect();
@@ -873,7 +872,7 @@ namespace Modbus.Net
}
//将要写入的值加入队列
var data = Convert.ChangeType(value.Value / addressUnit.Zoom, dataType);
-
+
//写入数据
await
BaseUtility.GetUtilityMethods().SetDatasAsync(address,
diff --git a/Samples/AnyType/Controllers/HomeController.cs b/Samples/AnyType/Controllers/HomeController.cs
index 64c4111..ccc15eb 100644
--- a/Samples/AnyType/Controllers/HomeController.cs
+++ b/Samples/AnyType/Controllers/HomeController.cs
@@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Mvc;
using Modbus.Net;
using Modbus.Net.Modbus;
using System.Diagnostics;
+using AddressUnit = Modbus.Net.AddressUnit;
using MachineJobSchedulerCreator = Modbus.Net.MachineJobSchedulerCreator;
using ModbusMachine = Modbus.Net.Modbus.ModbusMachine;
-using AddressUnit = Modbus.Net.AddressUnit;
namespace AnyType.Controllers
{
diff --git a/Samples/MachineJob/ConsoleLogProvider.cs b/Samples/MachineJob/ConsoleLogProvider.cs
index 1d9f1a0..c9f4d7f 100644
--- a/Samples/MachineJob/ConsoleLogProvider.cs
+++ b/Samples/MachineJob/ConsoleLogProvider.cs
@@ -1,5 +1,4 @@
using Quartz.Logging;
-using System.Configuration;
namespace MachineJob
{
diff --git a/Technosoftware/DaAeHdaClient.Com/Ae/Result.cs b/Technosoftware/DaAeHdaClient.Com/Ae/Result.cs
index d6ee3c6..0372f2a 100644
--- a/Technosoftware/DaAeHdaClient.Com/Ae/Result.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Ae/Result.cs
@@ -30,22 +30,22 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
/// Defines all well known COM AE HRESULT codes.
///
internal struct Result
- {
+ {
///
- public const int S_ALREADYACKED = +0x00040200; // 0x00040200
+ public const int S_ALREADYACKED = +0x00040200; // 0x00040200
///
- public const int S_INVALIDBUFFERTIME = +0x00040201; // 0x00040201
+ public const int S_INVALIDBUFFERTIME = +0x00040201; // 0x00040201
///
- public const int S_INVALIDMAXSIZE = +0x00040202; // 0x00040202
+ public const int S_INVALIDMAXSIZE = +0x00040202; // 0x00040202
///
public const int S_INVALIDKEEPALIVETIME = +0x00040203; // 0x00040203
///
- public const int E_INVALIDBRANCHNAME = -0x3FFBFDFD; // 0xC0040203
+ public const int E_INVALIDBRANCHNAME = -0x3FFBFDFD; // 0xC0040203
///
- public const int E_INVALIDTIME = -0x3FFBFDFC; // 0xC0040204
+ public const int E_INVALIDTIME = -0x3FFBFDFC; // 0xC0040204
///
- public const int E_BUSY = -0x3FFBFDFB; // 0xC0040205
+ public const int E_BUSY = -0x3FFBFDFB; // 0xC0040205
///
- public const int E_NOINFO = -0x3FFBFDFA; // 0xC0040206
+ public const int E_NOINFO = -0x3FFBFDFA; // 0xC0040206
}
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Ae/Server.cs b/Technosoftware/DaAeHdaClient.Com/Ae/Server.cs
index 1084114..33090af 100644
--- a/Technosoftware/DaAeHdaClient.Com/Ae/Server.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Ae/Server.cs
@@ -24,10 +24,9 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
-
using Technosoftware.DaAeHdaClient.Ae;
-using Technosoftware.OpcRcw.Comn;
using Technosoftware.OpcRcw.Ae;
+using Technosoftware.OpcRcw.Comn;
#endregion
#pragma warning disable 0618
@@ -44,7 +43,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
///
/// Initializes the object with the specified OpcUrl and COM server.
///
- internal Server(OpcUrl url, object server) : base(url, server)
+ internal Server(OpcUrl url, object server) : base(url, server)
{
m_supportsAE11 = true;
@@ -177,41 +176,41 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
// verify state and arguments.
if (server_ == null) throw new NotConnectedException();
- if (state == null) throw new ArgumentNullException(nameof(state));
+ if (state == null) throw new ArgumentNullException(nameof(state));
// initialize arguments.
- object unknown = null;
- var riid = typeof(IOPCEventSubscriptionMgt).GUID;
- var bufferTime = 0;
- var maxSize = 0;
+ object unknown = null;
+ var riid = typeof(IOPCEventSubscriptionMgt).GUID;
+ var bufferTime = 0;
+ var maxSize = 0;
// invoke COM method.
try
{
((IOPCEventServer)server_).CreateEventSubscription(
- (state.Active)?1:0,
+ (state.Active) ? 1 : 0,
state.BufferTime,
state.MaxSize,
++m_handles,
ref riid,
out unknown,
out bufferTime,
- out maxSize);
+ out maxSize);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.CreateEventSubscription", e);
- }
+ }
// save actual values.
state.BufferTime = bufferTime;
- state.MaxSize = maxSize;
+ state.MaxSize = maxSize;
var subscription = new Subscription(state, unknown);
// set keep alive.
subscription.ModifyState((int)TsCAeStateMask.KeepAlive, state);
-
+
// save subscription.
m_subscriptions.Add(m_handles, subscription);
@@ -245,8 +244,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.QueryAvailableFilters", e);
- }
-
+ }
+
// return results.
return filters;
}
@@ -270,23 +269,23 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
// initialize arguments.
var count = 0;
- var ppdwEventCategories = IntPtr.Zero;
+ var ppdwEventCategories = IntPtr.Zero;
var ppszEventCategoryDescs = IntPtr.Zero;
// invoke COM method.
try
{
((IOPCEventServer)server_).QueryEventCategories(
- eventType,
+ eventType,
out count,
- out ppdwEventCategories,
+ out ppdwEventCategories,
out ppszEventCategoryDescs);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.QueryEventCategories", e);
- }
-
+ }
+
// check for empty list.
if (count == 0)
{
@@ -294,7 +293,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
}
// unmarshal arguments.
- var ids = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppdwEventCategories, count, true);
+ var ids = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppdwEventCategories, count, true);
var names = Technosoftware.DaAeHdaClient.Com.Interop.GetUnicodeStrings(ref ppszEventCategoryDescs, count, true);
// build results.
@@ -304,7 +303,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
categories[ii] = new TsCAeCategory();
- categories[ii].ID = ids[ii];
+ categories[ii].ID = ids[ii];
categories[ii].Name = names[ii];
}
@@ -336,15 +335,15 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).QueryConditionNames(
- eventCategory,
+ eventCategory,
out count,
out ppszConditionNames);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.QueryConditionNames", e);
- }
-
+ }
+
// check for empty list.
if (count == 0)
{
@@ -382,21 +381,21 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).QuerySubConditionNames(
- conditionName,
+ conditionName,
out count,
out ppszSubConditionNames);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.QuerySubConditionNames", e);
- }
+ }
// check for empty list.
if (count == 0)
{
return new string[0];
}
-
+
// unmarshal arguments.
var names = Technosoftware.DaAeHdaClient.Com.Interop.GetUnicodeStrings(ref ppszSubConditionNames, count, true);
@@ -428,15 +427,15 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).QuerySourceConditions(
- sourceName,
+ sourceName,
out count,
out ppszConditionNames);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.QuerySourceConditions", e);
- }
-
+ }
+
// check for empty list.
if (count == 0)
{
@@ -476,7 +475,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).QueryEventAttributes(
- eventCategory,
+ eventCategory,
out count,
out ppdwAttrIDs,
out ppszAttrDescs,
@@ -485,8 +484,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.QueryEventAttributes", e);
- }
-
+ }
+
// check for empty list.
if (count == 0)
{
@@ -494,9 +493,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
}
// unmarshal arguments.
- var ids = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppdwAttrIDs, count, true);
+ var ids = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppdwAttrIDs, count, true);
var names = Technosoftware.DaAeHdaClient.Com.Interop.GetUnicodeStrings(ref ppszAttrDescs, count, true);
- var types = Technosoftware.DaAeHdaClient.Com.Interop.GetInt16s(ref ppvtAttrTypes, count, true);
+ var types = Technosoftware.DaAeHdaClient.Com.Interop.GetInt16s(ref ppvtAttrTypes, count, true);
// build results.
var attributes = new TsCAeAttribute[count];
@@ -505,8 +504,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
attributes[ii] = new TsCAeAttribute();
- attributes[ii].ID = ids[ii];
- attributes[ii].Name = names[ii];
+ attributes[ii].ID = ids[ii];
+ attributes[ii].Name = names[ii];
attributes[ii].DataType = Technosoftware.DaAeHdaClient.Com.Interop.GetType((VarEnum)types[ii]);
}
@@ -529,12 +528,12 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
/// A list of item urls for each specified attribute.
public TsCAeItemUrl[] TranslateToItemIDs(
string sourceName,
- int eventCategory,
+ int eventCategory,
string conditionName,
string subConditionName,
- int[] attributeIDs)
+ int[] attributeIDs)
{
- lock (this)
+ lock (this)
{
// verify state and arguments.
if (server_ == null) throw new NotConnectedException();
@@ -543,19 +542,19 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
var ppszAttrItemIDs = IntPtr.Zero;
var ppszNodeNames = IntPtr.Zero;
var ppCLSIDs = IntPtr.Zero;
-
- var count = (attributeIDs != null)?attributeIDs.Length:0;
+
+ var count = (attributeIDs != null) ? attributeIDs.Length : 0;
// call server.
try
{
((IOPCEventServer)server_).TranslateToItemIDs(
- (sourceName != null)?sourceName:"",
+ (sourceName != null) ? sourceName : "",
eventCategory,
- (conditionName != null)?conditionName:"",
- (subConditionName != null)?subConditionName:"",
+ (conditionName != null) ? conditionName : "",
+ (subConditionName != null) ? subConditionName : "",
count,
- (count > 0)?attributeIDs:new int[0],
+ (count > 0) ? attributeIDs : new int[0],
out ppszAttrItemIDs,
out ppszNodeNames,
out ppCLSIDs);
@@ -563,15 +562,15 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.TranslateToItemIDs", e);
- }
-
+ }
+
// unmarshal results.
- var itemIDs = Technosoftware.DaAeHdaClient.Com.Interop.GetUnicodeStrings(ref ppszAttrItemIDs, count, true);
+ var itemIDs = Technosoftware.DaAeHdaClient.Com.Interop.GetUnicodeStrings(ref ppszAttrItemIDs, count, true);
var nodeNames = Technosoftware.DaAeHdaClient.Com.Interop.GetUnicodeStrings(ref ppszNodeNames, count, true);
- var clsids = Technosoftware.DaAeHdaClient.Com.Interop.GetGUIDs(ref ppCLSIDs, count, true);
-
+ var clsids = Technosoftware.DaAeHdaClient.Com.Interop.GetGUIDs(ref ppCLSIDs, count, true);
+
var itemUrls = new TsCAeItemUrl[count];
-
+
// fill in item urls.
for (var ii = 0; ii < count; ii++)
{
@@ -579,9 +578,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
itemUrls[ii].ItemName = itemIDs[ii];
itemUrls[ii].ItemPath = null;
- itemUrls[ii].Url.Scheme = OpcUrlScheme.DA;
+ itemUrls[ii].Url.Scheme = OpcUrlScheme.DA;
itemUrls[ii].Url.HostName = nodeNames[ii];
- itemUrls[ii].Url.Path = string.Format("{{{0}}}", clsids[ii]);
+ itemUrls[ii].Url.Path = string.Format("{{{0}}}", clsids[ii]);
}
// return results.
@@ -602,7 +601,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
public TsCAeCondition GetConditionState(
string sourceName,
string conditionName,
- int[] attributeIDs)
+ int[] attributeIDs)
{
lock (this)
{
@@ -616,20 +615,20 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).GetConditionState(
- (sourceName != null)?sourceName:"",
- (conditionName != null)?conditionName:"",
- (attributeIDs != null)?attributeIDs.Length:0,
- (attributeIDs != null)?attributeIDs:new int[0],
+ (sourceName != null) ? sourceName : "",
+ (conditionName != null) ? conditionName : "",
+ (attributeIDs != null) ? attributeIDs.Length : 0,
+ (attributeIDs != null) ? attributeIDs : new int[0],
out ppConditionState);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.GetConditionState", e);
- }
-
+ }
+
// unmarshal results.
- var conditions = Interop.GetConditions(ref ppConditionState, 1, true);
-
+ var conditions = Interop.GetConditions(ref ppConditionState, 1, true);
+
// fill in attribute ids.
for (var ii = 0; ii < conditions[0].Attributes.Count; ii++)
{
@@ -672,15 +671,15 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer2)server_).EnableConditionByArea2(
- areas.Length,
+ areas.Length,
areas,
out ppErrors);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer2.EnableConditionByArea2", e);
- }
-
+ }
+
// unmarshal arguments.
errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, areas.Length, true);
}
@@ -689,18 +688,18 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).EnableConditionByArea(
- areas.Length,
+ areas.Length,
areas);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.EnableConditionByArea", e);
- }
-
+ }
+
// create dummy error array (0 == S_OK).
errors = new int[areas.Length];
}
-
+
// build results.
var results = new OpcResult[errors.Length];
@@ -713,7 +712,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
return results;
}
}
-
+
//======================================================================
// DisableConditionByArea
@@ -745,15 +744,15 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer2)server_).DisableConditionByArea2(
- areas.Length,
+ areas.Length,
areas,
out ppErrors);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer2.DisableConditionByArea2", e);
- }
-
+ }
+
// unmarshal arguments.
errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, areas.Length, true);
}
@@ -762,18 +761,18 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).DisableConditionByArea(
- areas.Length,
+ areas.Length,
areas);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.DisableConditionByArea", e);
- }
-
+ }
+
// create dummy error array (0 == S_OK).
errors = new int[areas.Length];
}
-
+
// build results.
var results = new OpcResult[errors.Length];
@@ -818,15 +817,15 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer2)server_).EnableConditionBySource2(
- sources.Length,
+ sources.Length,
sources,
out ppErrors);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer2.EnableConditionBySource2", e);
- }
-
+ }
+
// unmarshal arguments.
errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, sources.Length, true);
}
@@ -835,18 +834,18 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).EnableConditionBySource(
- sources.Length,
+ sources.Length,
sources);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.EnableConditionBySource", e);
- }
-
+ }
+
// create dummy error array (0 == S_OK).
errors = new int[sources.Length];
}
-
+
// build results.
var results = new OpcResult[errors.Length];
@@ -891,15 +890,15 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer2)server_).DisableConditionBySource2(
- sources.Length,
+ sources.Length,
sources,
out ppErrors);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer2.DisableConditionBySource2", e);
- }
-
+ }
+
// unmarshal arguments.
errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, sources.Length, true);
}
@@ -908,18 +907,18 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
try
{
((IOPCEventServer)server_).DisableConditionBySource(
- sources.Length,
+ sources.Length,
sources);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.DisableConditionBySource", e);
- }
-
+ }
+
// create dummy error array (0 == S_OK).
errors = new int[sources.Length];
}
-
+
// build results.
var results = new OpcResult[errors.Length];
@@ -962,23 +961,23 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
failures[ii] = new TsCAeEnabledStateResult();
- failures[ii].Enabled = false;
+ failures[ii].Enabled = false;
failures[ii].EffectivelyEnabled = false;
- failures[ii].Result = OpcResult.E_FAIL;
+ failures[ii].Result = OpcResult.E_FAIL;
}
return failures;
}
// initialize arguments.
- var pbEnabled = IntPtr.Zero;
+ var pbEnabled = IntPtr.Zero;
var pbEffectivelyEnabled = IntPtr.Zero;
- var ppErrors = IntPtr.Zero;
+ var ppErrors = IntPtr.Zero;
try
{
((IOPCEventServer2)server_).GetEnableStateByArea(
- areas.Length,
+ areas.Length,
areas,
out pbEnabled,
out pbEffectivelyEnabled,
@@ -987,14 +986,14 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer2.GetEnableStateByArea", e);
- }
-
- // unmarshal arguments.
- var enabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEnabled, areas.Length, true);
- var effectivelyEnabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEffectivelyEnabled, areas.Length, true);
- var errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, areas.Length, true);
+ }
+
+ // unmarshal arguments.
+ var enabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEnabled, areas.Length, true);
+ var effectivelyEnabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEffectivelyEnabled, areas.Length, true);
+ var errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, areas.Length, true);
+
-
// build results.
var results = new TsCAeEnabledStateResult[errors.Length];
@@ -1002,9 +1001,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
results[ii] = new TsCAeEnabledStateResult();
- results[ii].Enabled = enabled[ii] != 0;
+ results[ii].Enabled = enabled[ii] != 0;
results[ii].EffectivelyEnabled = effectivelyEnabled[ii] != 0;
- results[ii].Result = Interop.GetResultID(errors[ii]);
+ results[ii].Result = Interop.GetResultID(errors[ii]);
}
// return results
@@ -1041,23 +1040,23 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
failures[ii] = new TsCAeEnabledStateResult();
- failures[ii].Enabled = false;
+ failures[ii].Enabled = false;
failures[ii].EffectivelyEnabled = false;
- failures[ii].Result = OpcResult.E_FAIL;
+ failures[ii].Result = OpcResult.E_FAIL;
}
return failures;
}
// initialize arguments.
- var pbEnabled = IntPtr.Zero;
+ var pbEnabled = IntPtr.Zero;
var pbEffectivelyEnabled = IntPtr.Zero;
- var ppErrors = IntPtr.Zero;
+ var ppErrors = IntPtr.Zero;
try
{
((IOPCEventServer2)server_).GetEnableStateBySource(
- sources.Length,
+ sources.Length,
sources,
out pbEnabled,
out pbEffectivelyEnabled,
@@ -1066,14 +1065,14 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer2.GetEnableStateBySource", e);
- }
-
- // unmarshal arguments.
- var enabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEnabled, sources.Length, true);
- var effectivelyEnabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEffectivelyEnabled, sources.Length, true);
- var errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, sources.Length, true);
+ }
+
+ // unmarshal arguments.
+ var enabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEnabled, sources.Length, true);
+ var effectivelyEnabled = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref pbEffectivelyEnabled, sources.Length, true);
+ var errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, sources.Length, true);
+
-
// build results.
var results = new TsCAeEnabledStateResult[errors.Length];
@@ -1081,9 +1080,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
results[ii] = new TsCAeEnabledStateResult();
- results[ii].Enabled = enabled[ii] != 0;
+ results[ii].Enabled = enabled[ii] != 0;
results[ii].EffectivelyEnabled = effectivelyEnabled[ii] != 0;
- results[ii].Result = Interop.GetResultID(errors[ii]);
+ results[ii].Result = Interop.GetResultID(errors[ii]);
}
// return results
@@ -1102,10 +1101,10 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
/// The conditions being acknowledged.
/// A list of result id indictaing whether each condition was successfully acknowledged.
public OpcResult[] AcknowledgeCondition(
- string acknowledgerID,
- string comment,
+ string acknowledgerID,
+ string comment,
TsCAeEventAcknowledgement[] conditions)
- {
+ {
lock (this)
{
// verify state and arguments.
@@ -1120,17 +1119,17 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
// initialize arguments.
var count = conditions.Length;
- var pszSource = new string[count];
- var pszConditionName = new string[count];
+ var pszSource = new string[count];
+ var pszConditionName = new string[count];
var pftActiveTime = new OpcRcw.Ae.FILETIME[count];
- var pdwCookie = new int[count];
+ var pdwCookie = new int[count];
- for (var ii = 0; ii < count; ii ++)
+ for (var ii = 0; ii < count; ii++)
{
- pszSource[ii] = conditions[ii].SourceName;
+ pszSource[ii] = conditions[ii].SourceName;
pszConditionName[ii] = conditions[ii].ConditionName;
- pftActiveTime[ii] = Interop.Convert(Com.Interop.GetFILETIME(conditions[ii].ActiveTime));
- pdwCookie[ii] = conditions[ii].Cookie;
+ pftActiveTime[ii] = Interop.Convert(Com.Interop.GetFILETIME(conditions[ii].ActiveTime));
+ pdwCookie[ii] = conditions[ii].Cookie;
}
var ppErrors = IntPtr.Zero;
@@ -1151,11 +1150,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventServer.AckCondition", e);
- }
-
+ }
+
// unmarshal results.
var errors = Technosoftware.DaAeHdaClient.Com.Interop.GetInt32s(ref ppErrors, count, true);
-
+
// build results.
var results = new OpcResult[count];
@@ -1180,9 +1179,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
/// The expression used to filter the names of children returned.
/// The set of elements that meet the filter criteria.
public TsCAeBrowseElement[] Browse(
- string areaID,
- TsCAeBrowseType browseType,
- string browseFilter)
+ string areaID,
+ TsCAeBrowseType browseType,
+ string browseFilter)
{
lock (this)
{
@@ -1213,10 +1212,10 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
/// The object used to continue the browse if the number nodes exceeds the maximum specified.
/// The set of elements that meet the filter criteria.
public TsCAeBrowseElement[] Browse(
- string areaID,
- TsCAeBrowseType browseType,
- string browseFilter,
- int maxElements,
+ string areaID,
+ TsCAeBrowseType browseType,
+ string browseFilter,
+ int maxElements,
out IOpcBrowsePosition position)
{
position = null;
@@ -1239,7 +1238,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
var elements = new ArrayList();
var result = FetchElements(browseType, maxElements, enumerator, elements);
-
+
// dispose of enumerator if all done.
if (result != 0)
{
@@ -1256,7 +1255,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
return (TsCAeBrowseElement[])elements.ToArray(typeof(TsCAeBrowseElement));
}
}
-
+
//======================================================================
// BrowseNext
@@ -1282,12 +1281,12 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
// fetch enumerator from position object.
var enumerator = ((BrowsePosition)position).Enumerator;
-
+
// fetch elements.
var elements = new ArrayList();
var result = FetchElements(((BrowsePosition)position).BrowseType, maxElements, enumerator, elements);
-
+
// dispose of position object if all done.
if (result != 0)
{
@@ -1298,7 +1297,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
// return results.
return (TsCAeBrowseElement[])elements.ToArray(typeof(TsCAeBrowseElement));
}
- }
+ }
#endregion
#region Private Methods
@@ -1333,19 +1332,19 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
// verify object.
if (unknown == null)
{
- throw new OpcResultException(new OpcResult( (int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null ),"The response from the server was invalid or incomplete");
+ throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "The response from the server was invalid or incomplete");
}
// save object.
m_browser = unknown;
}
-
+
///
/// Moves the browse position prior to executing a browse operation.
///
private void ChangeBrowsePosition(string areaID)
{
- var targetID = (areaID != null)?areaID:"";
+ var targetID = (areaID != null) ? areaID : "";
// invoke COM method.
try
@@ -1357,9 +1356,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventAreaBrowser.ChangeBrowsePosition", e);
- }
+ }
}
-
+
///
/// Creates an enumerator for the names at the current position.
///
@@ -1374,22 +1373,22 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
{
((IOPCEventAreaBrowser)m_browser).BrowseOPCAreas(
dwBrowseFilterType,
- (browseFilter != null)?browseFilter:"",
+ (browseFilter != null) ? browseFilter : "",
out enumerator);
}
catch (Exception e)
{
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventAreaBrowser.BrowseOPCAreas", e);
- }
+ }
// verify object.
if (enumerator == null)
{
- throw new OpcResultException(new OpcResult( (int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null ),"The response from the server was invalid or incomplete");
+ throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "The response from the server was invalid or incomplete");
}
// return result.
- return (System.Runtime.InteropServices.ComTypes.IEnumString)enumerator;
+ return (System.Runtime.InteropServices.ComTypes.IEnumString)enumerator;
}
///
@@ -1412,7 +1411,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException("IOPCEventAreaBrowser.GetQualifiedAreaName", e);
}
}
-
+
// fetch source qualified name.
else
{
@@ -1438,47 +1437,47 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
var buffer = new string[1];
// re-calculate buffer length.
- var bufferLength = (maxElements > 0 && maxElements-elements.Count < buffer.Length)?maxElements-elements.Count:buffer.Length;
+ var bufferLength = (maxElements > 0 && maxElements - elements.Count < buffer.Length) ? maxElements - elements.Count : buffer.Length;
// fetch first batch of names.
var pFetched = Marshal.AllocCoTaskMem(sizeof(int));
-
+
try
{
var result = enumerator.Next(bufferLength, buffer, pFetched);
- while (result == 0)
- {
+ while (result == 0)
+ {
var fetched = Marshal.ReadInt32(pFetched);
- // create elements.
- for (var ii = 0; ii < fetched; ii++)
- {
- var element = new TsCAeBrowseElement();
+ // create elements.
+ for (var ii = 0; ii < fetched; ii++)
+ {
+ var element = new TsCAeBrowseElement();
- element.Name = buffer[ii];
- element.QualifiedName = GetQualifiedName(buffer[ii], browseType);
- element.NodeType = browseType;
-
- elements.Add(element);
- }
+ element.Name = buffer[ii];
+ element.QualifiedName = GetQualifiedName(buffer[ii], browseType);
+ element.NodeType = browseType;
- // check for halt.
- if (maxElements > 0 && elements.Count >= maxElements)
- {
- break;
- }
+ elements.Add(element);
+ }
- // re-calculate buffer length.
- bufferLength = (maxElements > 0 && maxElements-elements.Count < buffer.Length)?maxElements-elements.Count:buffer.Length;
-
- // fetch next block.
+ // check for halt.
+ if (maxElements > 0 && elements.Count >= maxElements)
+ {
+ break;
+ }
+
+ // re-calculate buffer length.
+ bufferLength = (maxElements > 0 && maxElements - elements.Count < buffer.Length) ? maxElements - elements.Count : buffer.Length;
+
+ // fetch next block.
result = enumerator.Next(bufferLength, buffer, pFetched);
- }
+ }
- // return final result.
- return result;
- }
+ // return final result.
+ return result;
+ }
finally
{
if (pFetched != IntPtr.Zero)
@@ -1486,7 +1485,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
Marshal.FreeCoTaskMem(pFetched);
}
}
- }
+ }
#endregion
#region Private Members
@@ -1496,7 +1495,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
private Hashtable m_subscriptions = new Hashtable();
#endregion
}
-
+
#region BrowsePosition Class
///
/// Stores the state of a browse operation.
@@ -1509,14 +1508,14 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
/// Saves the parameters for an incomplete browse information.
///
public BrowsePosition(
- string areaID,
- TsCAeBrowseType browseType,
- string browseFilter,
- System.Runtime.InteropServices.ComTypes.IEnumString enumerator)
+ string areaID,
+ TsCAeBrowseType browseType,
+ string browseFilter,
+ System.Runtime.InteropServices.ComTypes.IEnumString enumerator)
:
- base (areaID, browseType, browseFilter)
+ base(areaID, browseType, browseFilter)
{
- m_enumerator = enumerator;
+ m_enumerator = enumerator;
}
#endregion
@@ -1543,11 +1542,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
// Release unmanaged resources.
// Set large fields to null.
- if (m_enumerator != null)
- {
- Technosoftware.DaAeHdaClient.Com.Interop.ReleaseServer(m_enumerator);
- m_enumerator = null;
- }
+ if (m_enumerator != null)
+ {
+ Technosoftware.DaAeHdaClient.Com.Interop.ReleaseServer(m_enumerator);
+ m_enumerator = null;
+ }
// Call Dispose on your base class.
m_disposed = true;
@@ -1568,7 +1567,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
#endregion
#region Private Members
- System.Runtime.InteropServices.ComTypes.IEnumString m_enumerator = null;
+ System.Runtime.InteropServices.ComTypes.IEnumString m_enumerator = null;
#endregion
}
#endregion
diff --git a/Technosoftware/DaAeHdaClient.Com/Ae/Subscription.cs b/Technosoftware/DaAeHdaClient.Com/Ae/Subscription.cs
index 9b9b894..092f4e5 100644
--- a/Technosoftware/DaAeHdaClient.Com/Ae/Subscription.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Ae/Subscription.cs
@@ -23,11 +23,9 @@
#region Using Directives
using System;
using System.Runtime.InteropServices;
-
using Technosoftware.DaAeHdaClient.Ae;
-using Technosoftware.OpcRcw.Ae;
-
using Technosoftware.DaAeHdaClient.Utilities;
+using Technosoftware.OpcRcw.Ae;
#endregion
@@ -333,7 +331,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Ae
// build results.
var filters = new TsCAeSubscriptionFilters
{
- EventTypes = pdwEventType, LowSeverity = pdwLowSeverity, HighSeverity = pdwHighSeverity
+ EventTypes = pdwEventType,
+ LowSeverity = pdwLowSeverity,
+ HighSeverity = pdwHighSeverity
};
diff --git a/Technosoftware/DaAeHdaClient.Com/ComUtils.cs b/Technosoftware/DaAeHdaClient.Com/ComUtils.cs
index 0606b1a..9429394 100644
--- a/Technosoftware/DaAeHdaClient.Com/ComUtils.cs
+++ b/Technosoftware/DaAeHdaClient.Com/ComUtils.cs
@@ -22,59 +22,58 @@
#region Using Directives
using System;
-using System.Reflection;
-using System.Net;
-using System.Globalization;
-using System.Runtime.InteropServices;
using System.Collections.Generic;
-
+using System.Globalization;
+using System.Net;
+using System.Reflection;
+using System.Runtime.InteropServices;
using Technosoftware.DaAeHdaClient.Utilities;
#endregion
namespace Technosoftware.DaAeHdaClient.Com
{
- ///
- /// Exposes WIN32 and COM API functions.
- ///
- internal class ComUtils
- {
- #region NetApi Function Declarations
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct SERVER_INFO_100
- {
- public uint sv100_platform_id;
- [MarshalAs(UnmanagedType.LPWStr)]
- public string sv100_name;
- }
+ ///
+ /// Exposes WIN32 and COM API functions.
+ ///
+ internal class ComUtils
+ {
+ #region NetApi Function Declarations
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct SERVER_INFO_100
+ {
+ public uint sv100_platform_id;
+ [MarshalAs(UnmanagedType.LPWStr)]
+ public string sv100_name;
+ }
- private const uint LEVEL_SERVER_INFO_100 = 100;
- private const uint LEVEL_SERVER_INFO_101 = 101;
+ private const uint LEVEL_SERVER_INFO_100 = 100;
+ private const uint LEVEL_SERVER_INFO_101 = 101;
- private const int MAX_PREFERRED_LENGTH = -1;
+ private const int MAX_PREFERRED_LENGTH = -1;
- private const uint SV_TYPE_WORKSTATION = 0x00000001;
- private const uint SV_TYPE_SERVER = 0x00000002;
+ private const uint SV_TYPE_WORKSTATION = 0x00000001;
+ private const uint SV_TYPE_SERVER = 0x00000002;
- [DllImport("Netapi32.dll")]
- private static extern int NetServerEnum(
- IntPtr servername,
- uint level,
- out IntPtr bufptr,
- int prefmaxlen,
- out int entriesread,
- out int totalentries,
- uint servertype,
- IntPtr domain,
- IntPtr resume_handle);
+ [DllImport("Netapi32.dll")]
+ private static extern int NetServerEnum(
+ IntPtr servername,
+ uint level,
+ out IntPtr bufptr,
+ int prefmaxlen,
+ out int entriesread,
+ out int totalentries,
+ uint servertype,
+ IntPtr domain,
+ IntPtr resume_handle);
- [DllImport("Netapi32.dll")]
- private static extern int NetApiBufferFree(IntPtr buffer);
+ [DllImport("Netapi32.dll")]
+ private static extern int NetApiBufferFree(IntPtr buffer);
- ///
- /// Enumerates computers on the local network.
- ///
- public static List EnumComputers()
- {
+ ///
+ /// Enumerates computers on the local network.
+ ///
+ public static List EnumComputers()
+ {
IntPtr pInfo;
int totalEntries;
@@ -91,160 +90,160 @@ namespace Technosoftware.DaAeHdaClient.Com
IntPtr.Zero);
if (result != 0)
- {
- throw new ApplicationException("NetApi Error = " + string.Format("0x{0:X8}", result));
- }
+ {
+ throw new ApplicationException("NetApi Error = " + string.Format("0x{0:X8}", result));
+ }
- var computers = new List();
+ var computers = new List();
- var pos = pInfo;
+ var pos = pInfo;
- for (var ii = 0; ii < entriesRead; ii++)
- {
- var info = (SERVER_INFO_100)Marshal.PtrToStructure(pos, typeof(SERVER_INFO_100));
-
- computers.Add(info.sv100_name);
+ for (var ii = 0; ii < entriesRead; ii++)
+ {
+ var info = (SERVER_INFO_100)Marshal.PtrToStructure(pos, typeof(SERVER_INFO_100));
- pos = (IntPtr)(pos.ToInt64() + Marshal.SizeOf(typeof(SERVER_INFO_100)));
- }
+ computers.Add(info.sv100_name);
- NetApiBufferFree(pInfo);
+ pos = (IntPtr)(pos.ToInt64() + Marshal.SizeOf(typeof(SERVER_INFO_100)));
+ }
- return computers;
- }
- #endregion
+ NetApiBufferFree(pInfo);
- #region OLE32 Function/Interface Declarations
- private const int MAX_MESSAGE_LENGTH = 1024;
+ return computers;
+ }
+ #endregion
- private const uint FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
- private const uint FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
+ #region OLE32 Function/Interface Declarations
+ private const int MAX_MESSAGE_LENGTH = 1024;
- [DllImport("Kernel32.dll")]
- private static extern int FormatMessageW(
- int dwFlags,
- IntPtr lpSource,
- int dwMessageId,
- int dwLanguageId,
- IntPtr lpBuffer,
- int nSize,
- IntPtr Arguments);
-
- [DllImport("Kernel32.dll")]
+ private const uint FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;
+ private const uint FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000;
+
+ [DllImport("Kernel32.dll")]
+ private static extern int FormatMessageW(
+ int dwFlags,
+ IntPtr lpSource,
+ int dwMessageId,
+ int dwLanguageId,
+ IntPtr lpBuffer,
+ int nSize,
+ IntPtr Arguments);
+
+ [DllImport("Kernel32.dll")]
private static extern int GetSystemDefaultLangID();
-
- [DllImport("Kernel32.dll")]
+
+ [DllImport("Kernel32.dll")]
private static extern int GetUserDefaultLangID();
- ///
- /// The WIN32 system default locale.
- ///
- public const int LOCALE_SYSTEM_DEFAULT = 0x800;
+ ///
+ /// The WIN32 system default locale.
+ ///
+ public const int LOCALE_SYSTEM_DEFAULT = 0x800;
- ///
- /// The WIN32 user default locale.
- ///
- public const int LOCALE_USER_DEFAULT = 0x400;
+ ///
+ /// The WIN32 user default locale.
+ ///
+ public const int LOCALE_USER_DEFAULT = 0x400;
- ///
- /// The base for the WIN32 FILETIME structure.
- ///
- private static readonly DateTime FILETIME_BaseTime = new DateTime(1601, 1, 1);
+ ///
+ /// The base for the WIN32 FILETIME structure.
+ ///
+ private static readonly DateTime FILETIME_BaseTime = new DateTime(1601, 1, 1);
- ///
- /// WIN32 GUID struct declaration.
- ///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct GUID
- {
- public int Data1;
- public short Data2;
- public short Data3;
- [MarshalAs(UnmanagedType.ByValArray, SizeConst=8)]
- public byte[] Data4;
- }
+ ///
+ /// WIN32 GUID struct declaration.
+ ///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct GUID
+ {
+ public int Data1;
+ public short Data2;
+ public short Data3;
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
+ public byte[] Data4;
+ }
- ///
- /// The size, in bytes, of a VARIANT structure.
- ///
- private const int VARIANT_SIZE = 0x10;
-
- [DllImport("OleAut32.dll")]
- private static extern int VariantChangeTypeEx(
- IntPtr pvargDest,
- IntPtr pvarSrc,
- int lcid,
- ushort wFlags,
- short vt);
-
- ///
- /// Intializes a pointer to a VARIANT.
- ///
- [DllImport("oleaut32.dll")]
- private static extern void VariantInit(IntPtr pVariant);
-
- ///
- /// Frees all memory referenced by a VARIANT stored in unmanaged memory.
- ///
- [DllImport("oleaut32.dll")]
- public static extern void VariantClear(IntPtr pVariant);
+ ///
+ /// The size, in bytes, of a VARIANT structure.
+ ///
+ private const int VARIANT_SIZE = 0x10;
- private const int DISP_E_TYPEMISMATCH = -0x7FFDFFFB; // 0x80020005
- private const int DISP_E_OVERFLOW = -0x7FFDFFF6; // 0x8002000A
+ [DllImport("OleAut32.dll")]
+ private static extern int VariantChangeTypeEx(
+ IntPtr pvargDest,
+ IntPtr pvarSrc,
+ int lcid,
+ ushort wFlags,
+ short vt);
- private const int VARIANT_NOVALUEPROP = 0x01;
- private const int VARIANT_ALPHABOOL = 0x02; // For VT_BOOL to VT_BSTR conversions convert to "True"/"False" instead of
+ ///
+ /// Intializes a pointer to a VARIANT.
+ ///
+ [DllImport("oleaut32.dll")]
+ private static extern void VariantInit(IntPtr pVariant);
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct SOLE_AUTHENTICATION_SERVICE
- {
- public uint dwAuthnSvc;
- public uint dwAuthzSvc;
- [MarshalAs(UnmanagedType.LPWStr)]
- public string pPrincipalName;
- public int hr;
- }
-
- private const uint RPC_C_AUTHN_NONE = 0;
- private const uint RPC_C_AUTHN_DCE_PRIVATE = 1;
- private const uint RPC_C_AUTHN_DCE_PUBLIC = 2;
- private const uint RPC_C_AUTHN_DEC_PUBLIC = 4;
- private const uint RPC_C_AUTHN_GSS_NEGOTIATE = 9;
- private const uint RPC_C_AUTHN_WINNT = 10;
- private const uint RPC_C_AUTHN_GSS_SCHANNEL = 14;
- private const uint RPC_C_AUTHN_GSS_KERBEROS = 16;
- private const uint RPC_C_AUTHN_DPA = 17;
- private const uint RPC_C_AUTHN_MSN = 18;
- private const uint RPC_C_AUTHN_DIGEST = 21;
- private const uint RPC_C_AUTHN_MQ = 100;
- private const uint RPC_C_AUTHN_DEFAULT = 0xFFFFFFFF;
+ ///
+ /// Frees all memory referenced by a VARIANT stored in unmanaged memory.
+ ///
+ [DllImport("oleaut32.dll")]
+ public static extern void VariantClear(IntPtr pVariant);
- private const uint RPC_C_AUTHZ_NONE = 0;
- private const uint RPC_C_AUTHZ_NAME = 1;
- private const uint RPC_C_AUTHZ_DCE = 2;
- private const uint RPC_C_AUTHZ_DEFAULT = 0xffffffff;
+ private const int DISP_E_TYPEMISMATCH = -0x7FFDFFFB; // 0x80020005
+ private const int DISP_E_OVERFLOW = -0x7FFDFFF6; // 0x8002000A
- private const uint RPC_C_AUTHN_LEVEL_DEFAULT = 0;
- private const uint RPC_C_AUTHN_LEVEL_NONE = 1;
- private const uint RPC_C_AUTHN_LEVEL_CONNECT = 2;
- private const uint RPC_C_AUTHN_LEVEL_CALL = 3;
- private const uint RPC_C_AUTHN_LEVEL_PKT = 4;
- private const uint RPC_C_AUTHN_LEVEL_PKT_INTEGRITY = 5;
- private const uint RPC_C_AUTHN_LEVEL_PKT_PRIVACY = 6;
+ private const int VARIANT_NOVALUEPROP = 0x01;
+ private const int VARIANT_ALPHABOOL = 0x02; // For VT_BOOL to VT_BSTR conversions convert to "True"/"False" instead of
- private const uint RPC_C_IMP_LEVEL_ANONYMOUS = 1;
- private const uint RPC_C_IMP_LEVEL_IDENTIFY = 2;
- private const uint RPC_C_IMP_LEVEL_IMPERSONATE = 3;
- private const uint RPC_C_IMP_LEVEL_DELEGATE = 4;
-
- private const uint EOAC_NONE = 0x00;
- private const uint EOAC_MUTUAL_AUTH = 0x01;
- private const uint EOAC_CLOAKING = 0x10;
- private const uint EOAC_STATIC_CLOAKING = 0x20;
- private const uint EOAC_DYNAMIC_CLOAKING = 0x40;
- private const uint EOAC_SECURE_REFS = 0x02;
- private const uint EOAC_ACCESS_CONTROL = 0x04;
- private const uint EOAC_APPID = 0x08;
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct SOLE_AUTHENTICATION_SERVICE
+ {
+ public uint dwAuthnSvc;
+ public uint dwAuthzSvc;
+ [MarshalAs(UnmanagedType.LPWStr)]
+ public string pPrincipalName;
+ public int hr;
+ }
+
+ private const uint RPC_C_AUTHN_NONE = 0;
+ private const uint RPC_C_AUTHN_DCE_PRIVATE = 1;
+ private const uint RPC_C_AUTHN_DCE_PUBLIC = 2;
+ private const uint RPC_C_AUTHN_DEC_PUBLIC = 4;
+ private const uint RPC_C_AUTHN_GSS_NEGOTIATE = 9;
+ private const uint RPC_C_AUTHN_WINNT = 10;
+ private const uint RPC_C_AUTHN_GSS_SCHANNEL = 14;
+ private const uint RPC_C_AUTHN_GSS_KERBEROS = 16;
+ private const uint RPC_C_AUTHN_DPA = 17;
+ private const uint RPC_C_AUTHN_MSN = 18;
+ private const uint RPC_C_AUTHN_DIGEST = 21;
+ private const uint RPC_C_AUTHN_MQ = 100;
+ private const uint RPC_C_AUTHN_DEFAULT = 0xFFFFFFFF;
+
+ private const uint RPC_C_AUTHZ_NONE = 0;
+ private const uint RPC_C_AUTHZ_NAME = 1;
+ private const uint RPC_C_AUTHZ_DCE = 2;
+ private const uint RPC_C_AUTHZ_DEFAULT = 0xffffffff;
+
+ private const uint RPC_C_AUTHN_LEVEL_DEFAULT = 0;
+ private const uint RPC_C_AUTHN_LEVEL_NONE = 1;
+ private const uint RPC_C_AUTHN_LEVEL_CONNECT = 2;
+ private const uint RPC_C_AUTHN_LEVEL_CALL = 3;
+ private const uint RPC_C_AUTHN_LEVEL_PKT = 4;
+ private const uint RPC_C_AUTHN_LEVEL_PKT_INTEGRITY = 5;
+ private const uint RPC_C_AUTHN_LEVEL_PKT_PRIVACY = 6;
+
+ private const uint RPC_C_IMP_LEVEL_ANONYMOUS = 1;
+ private const uint RPC_C_IMP_LEVEL_IDENTIFY = 2;
+ private const uint RPC_C_IMP_LEVEL_IMPERSONATE = 3;
+ private const uint RPC_C_IMP_LEVEL_DELEGATE = 4;
+
+ private const uint EOAC_NONE = 0x00;
+ private const uint EOAC_MUTUAL_AUTH = 0x01;
+ private const uint EOAC_CLOAKING = 0x10;
+ private const uint EOAC_STATIC_CLOAKING = 0x20;
+ private const uint EOAC_DYNAMIC_CLOAKING = 0x40;
+ private const uint EOAC_SECURE_REFS = 0x02;
+ private const uint EOAC_ACCESS_CONTROL = 0x04;
+ private const uint EOAC_APPID = 0x08;
/// If function succeeds, it returns 0(S_OK). Otherwise, it returns an error code.
@@ -255,42 +254,42 @@ namespace Technosoftware.DaAeHdaClient.Com
);
[DllImport("ole32.dll")]
- private static extern int CoInitializeSecurity(
- IntPtr pSecDesc,
- int cAuthSvc,
- SOLE_AUTHENTICATION_SERVICE[] asAuthSvc,
- IntPtr pReserved1,
- uint dwAuthnLevel,
- uint dwImpLevel,
- IntPtr pAuthList,
- uint dwCapabilities,
- IntPtr pReserved3);
+ private static extern int CoInitializeSecurity(
+ IntPtr pSecDesc,
+ int cAuthSvc,
+ SOLE_AUTHENTICATION_SERVICE[] asAuthSvc,
+ IntPtr pReserved1,
+ uint dwAuthnLevel,
+ uint dwImpLevel,
+ IntPtr pAuthList,
+ uint dwCapabilities,
+ IntPtr pReserved3);
- [DllImport("ole32.dll")]
- private static extern int CoQueryProxyBlanket(
- [MarshalAs(UnmanagedType.IUnknown)]
- object pProxy,
- ref uint pAuthnSvc,
- ref uint pAuthzSvc,
- [MarshalAs(UnmanagedType.LPWStr)]
- ref string pServerPrincName,
- ref uint pAuthnLevel,
- ref uint pImpLevel,
- ref IntPtr pAuthInfo,
- ref uint pCapabilities);
+ [DllImport("ole32.dll")]
+ private static extern int CoQueryProxyBlanket(
+ [MarshalAs(UnmanagedType.IUnknown)]
+ object pProxy,
+ ref uint pAuthnSvc,
+ ref uint pAuthzSvc,
+ [MarshalAs(UnmanagedType.LPWStr)]
+ ref string pServerPrincName,
+ ref uint pAuthnLevel,
+ ref uint pImpLevel,
+ ref IntPtr pAuthInfo,
+ ref uint pCapabilities);
- [DllImport("ole32.dll")]
- private static extern int CoSetProxyBlanket(
- [MarshalAs(UnmanagedType.IUnknown)]
- object pProxy,
- uint pAuthnSvc,
+ [DllImport("ole32.dll")]
+ private static extern int CoSetProxyBlanket(
+ [MarshalAs(UnmanagedType.IUnknown)]
+ object pProxy,
+ uint pAuthnSvc,
uint pAuthzSvc,
- IntPtr pServerPrincName,
- uint pAuthnLevel,
- uint pImpLevel,
- IntPtr pAuthInfo,
- uint pCapabilities);
-
+ IntPtr pServerPrincName,
+ uint pAuthnLevel,
+ uint pImpLevel,
+ IntPtr pAuthInfo,
+ uint pCapabilities);
+
private static readonly IntPtr COLE_DEFAULT_PRINCIPAL = new IntPtr(-1);
private static readonly IntPtr COLE_DEFAULT_AUTHINFO = new IntPtr(-1);
@@ -303,262 +302,262 @@ namespace Technosoftware.DaAeHdaClient.Com
COINIT_SPEED_OVER_MEMORY = 0x8, //Trade memory for speed
}
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct COSERVERINFO
- {
- public uint dwReserved1;
- [MarshalAs(UnmanagedType.LPWStr)]
- public string pwszName;
- public IntPtr pAuthInfo;
- public uint dwReserved2;
- };
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct COSERVERINFO
+ {
+ public uint dwReserved1;
+ [MarshalAs(UnmanagedType.LPWStr)]
+ public string pwszName;
+ public IntPtr pAuthInfo;
+ public uint dwReserved2;
+ };
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct COAUTHINFO
- {
- public uint dwAuthnSvc;
- public uint dwAuthzSvc;
- public IntPtr pwszServerPrincName;
- public uint dwAuthnLevel;
- public uint dwImpersonationLevel;
- public IntPtr pAuthIdentityData;
- public uint dwCapabilities;
- }
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct COAUTHINFO
+ {
+ public uint dwAuthnSvc;
+ public uint dwAuthzSvc;
+ public IntPtr pwszServerPrincName;
+ public uint dwAuthnLevel;
+ public uint dwImpersonationLevel;
+ public IntPtr pAuthIdentityData;
+ public uint dwCapabilities;
+ }
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct COAUTHIDENTITY
- {
- public IntPtr User;
- public uint UserLength;
- public IntPtr Domain;
- public uint DomainLength;
- public IntPtr Password;
- public uint PasswordLength;
- public uint Flags;
- }
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct COAUTHIDENTITY
+ {
+ public IntPtr User;
+ public uint UserLength;
+ public IntPtr Domain;
+ public uint DomainLength;
+ public IntPtr Password;
+ public uint PasswordLength;
+ public uint Flags;
+ }
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct MULTI_QI
- {
- public IntPtr iid;
- [MarshalAs(UnmanagedType.IUnknown)]
- public object pItf;
- public uint hr;
- }
-
- private const uint CLSCTX_INPROC_SERVER = 0x1;
- private const uint CLSCTX_INPROC_HANDLER = 0x2;
- private const uint CLSCTX_LOCAL_SERVER = 0x4;
- private const uint CLSCTX_REMOTE_SERVER = 0x10;
- private const uint CLSCTX_DISABLE_AAA = 0x8000;
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct MULTI_QI
+ {
+ public IntPtr iid;
+ [MarshalAs(UnmanagedType.IUnknown)]
+ public object pItf;
+ public uint hr;
+ }
- private static readonly Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
-
- private const uint SEC_WINNT_AUTH_IDENTITY_ANSI = 0x1;
- private const uint SEC_WINNT_AUTH_IDENTITY_UNICODE = 0x2;
+ private const uint CLSCTX_INPROC_SERVER = 0x1;
+ private const uint CLSCTX_INPROC_HANDLER = 0x2;
+ private const uint CLSCTX_LOCAL_SERVER = 0x4;
+ private const uint CLSCTX_REMOTE_SERVER = 0x10;
+ private const uint CLSCTX_DISABLE_AAA = 0x8000;
- [DllImport("ole32.dll")]
- private static extern void CoCreateInstanceEx(
- ref Guid clsid,
- [MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
- uint dwClsCtx,
- [In]
- ref COSERVERINFO pServerInfo,
- uint dwCount,
- [In, Out]
- MULTI_QI[] pResults);
+ private static readonly Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
- private struct LICINFO
- {
- public int cbLicInfo;
- [MarshalAs(UnmanagedType.Bool)]
- public bool fRuntimeKeyAvail;
- [MarshalAs(UnmanagedType.Bool)]
- public bool fLicVerified;
- }
+ private const uint SEC_WINNT_AUTH_IDENTITY_ANSI = 0x1;
+ private const uint SEC_WINNT_AUTH_IDENTITY_UNICODE = 0x2;
- [ComImport]
- [GuidAttribute("00000001-0000-0000-C000-000000000046")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- private interface IClassFactory
- {
- void CreateInstance(
- [MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
- [MarshalAs(UnmanagedType.Interface)]
- [Out] out object ppvObject);
+ [DllImport("ole32.dll")]
+ private static extern void CoCreateInstanceEx(
+ ref Guid clsid,
+ [MarshalAs(UnmanagedType.IUnknown)]
+ object punkOuter,
+ uint dwClsCtx,
+ [In]
+ ref COSERVERINFO pServerInfo,
+ uint dwCount,
+ [In, Out]
+ MULTI_QI[] pResults);
- void LockServer(
- [MarshalAs(UnmanagedType.Bool)]
- bool fLock);
- }
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ private struct LICINFO
+ {
+ public int cbLicInfo;
+ [MarshalAs(UnmanagedType.Bool)]
+ public bool fRuntimeKeyAvail;
+ [MarshalAs(UnmanagedType.Bool)]
+ public bool fLicVerified;
+ }
- [ComImport]
- [GuidAttribute("B196B28F-BAB4-101A-B69C-00AA00341D07")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- private interface IClassFactory2
- {
- void CreateInstance(
- [MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
- [MarshalAs(UnmanagedType.Interface)]
- [Out] out object ppvObject);
+ [ComImport]
+ [GuidAttribute("00000001-0000-0000-C000-000000000046")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ private interface IClassFactory
+ {
+ void CreateInstance(
+ [MarshalAs(UnmanagedType.IUnknown)]
+ object punkOuter,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
+ [MarshalAs(UnmanagedType.Interface)]
+ [Out] out object ppvObject);
- void LockServer(
- [MarshalAs(UnmanagedType.Bool)]
- bool fLock);
+ void LockServer(
+ [MarshalAs(UnmanagedType.Bool)]
+ bool fLock);
+ }
- void GetLicInfo(
- [In,Out] ref LICINFO pLicInfo);
+ [ComImport]
+ [GuidAttribute("B196B28F-BAB4-101A-B69C-00AA00341D07")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ private interface IClassFactory2
+ {
+ void CreateInstance(
+ [MarshalAs(UnmanagedType.IUnknown)]
+ object punkOuter,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
+ [MarshalAs(UnmanagedType.Interface)]
+ [Out] out object ppvObject);
- void RequestLicKey(
- int dwReserved,
- [MarshalAs(UnmanagedType.BStr)]
- string pbstrKey);
-
- void CreateInstanceLic(
- [MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
- [MarshalAs(UnmanagedType.IUnknown)]
- object punkReserved,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
- [MarshalAs(UnmanagedType.BStr)]
- string bstrKey,
- [MarshalAs(UnmanagedType.IUnknown)]
- [Out] out object ppvObject);
- }
+ void LockServer(
+ [MarshalAs(UnmanagedType.Bool)]
+ bool fLock);
- [DllImport("ole32.dll")]
- private static extern void CoGetClassObject(
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid clsid,
- uint dwClsContext,
- [In] ref COSERVERINFO pServerInfo,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
- [MarshalAs(UnmanagedType.IUnknown)]
- [Out] out object ppv);
+ void GetLicInfo(
+ [In, Out] ref LICINFO pLicInfo);
- private const int LOGON32_PROVIDER_DEFAULT = 0;
- private const int LOGON32_LOGON_INTERACTIVE = 2;
- private const int LOGON32_LOGON_NETWORK = 3;
+ void RequestLicKey(
+ int dwReserved,
+ [MarshalAs(UnmanagedType.BStr)]
+ string pbstrKey);
- private const int SECURITY_ANONYMOUS = 0;
- private const int SECURITY_IDENTIFICATION = 1;
- private const int SECURITY_IMPERSONATION = 2;
- private const int SECURITY_DELEGATION = 3;
+ void CreateInstanceLic(
+ [MarshalAs(UnmanagedType.IUnknown)]
+ object punkOuter,
+ [MarshalAs(UnmanagedType.IUnknown)]
+ object punkReserved,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
+ [MarshalAs(UnmanagedType.BStr)]
+ string bstrKey,
+ [MarshalAs(UnmanagedType.IUnknown)]
+ [Out] out object ppvObject);
+ }
- [DllImport("advapi32.dll", SetLastError=true)]
- private static extern bool LogonUser(
- string lpszUsername,
- string lpszDomain,
- string lpszPassword,
- int dwLogonType,
- int dwLogonProvider,
- ref IntPtr phToken);
+ [DllImport("ole32.dll")]
+ private static extern void CoGetClassObject(
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid clsid,
+ uint dwClsContext,
+ [In] ref COSERVERINFO pServerInfo,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
+ [MarshalAs(UnmanagedType.IUnknown)]
+ [Out] out object ppv);
- [DllImport("kernel32.dll", CharSet=CharSet.Auto)]
- private extern static bool CloseHandle(IntPtr handle);
+ private const int LOGON32_PROVIDER_DEFAULT = 0;
+ private const int LOGON32_LOGON_INTERACTIVE = 2;
+ private const int LOGON32_LOGON_NETWORK = 3;
- [DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
- private extern static bool DuplicateToken(
- IntPtr ExistingTokenHandle,
- int SECURITY_IMPERSONATION_LEVEL,
- ref IntPtr DuplicateTokenHandle);
- #endregion
+ private const int SECURITY_ANONYMOUS = 0;
+ private const int SECURITY_IDENTIFICATION = 1;
+ private const int SECURITY_IMPERSONATION = 2;
+ private const int SECURITY_DELEGATION = 3;
- #region ServerInfo Class
- ///
- /// A class used to allocate and deallocate the elements of a COSERVERINFO structure.
- ///
- class ServerInfo
- {
- #region internal interface
- ///
- /// Allocates a COSERVERINFO structure.
- ///
- public COSERVERINFO Allocate(string hostName, OpcUserIdentity identity)
- {
- // initialize server info structure.
- var serverInfo = new COSERVERINFO();
+ [DllImport("advapi32.dll", SetLastError = true)]
+ private static extern bool LogonUser(
+ string lpszUsername,
+ string lpszDomain,
+ string lpszPassword,
+ int dwLogonType,
+ int dwLogonProvider,
+ ref IntPtr phToken);
+
+ [DllImport("kernel32.dll", CharSet = CharSet.Auto)]
+ private extern static bool CloseHandle(IntPtr handle);
+
+ [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
+ private extern static bool DuplicateToken(
+ IntPtr ExistingTokenHandle,
+ int SECURITY_IMPERSONATION_LEVEL,
+ ref IntPtr DuplicateTokenHandle);
+ #endregion
+
+ #region ServerInfo Class
+ ///
+ /// A class used to allocate and deallocate the elements of a COSERVERINFO structure.
+ ///
+ class ServerInfo
+ {
+ #region internal interface
+ ///
+ /// Allocates a COSERVERINFO structure.
+ ///
+ public COSERVERINFO Allocate(string hostName, OpcUserIdentity identity)
+ {
+ // initialize server info structure.
+ var serverInfo = new COSERVERINFO();
+
+ serverInfo.pwszName = hostName;
+ serverInfo.pAuthInfo = IntPtr.Zero;
+ serverInfo.dwReserved1 = 0;
+ serverInfo.dwReserved2 = 0;
- serverInfo.pwszName = hostName;
- serverInfo.pAuthInfo = IntPtr.Zero;
- serverInfo.dwReserved1 = 0;
- serverInfo.dwReserved2 = 0;
-
// no authentication for default identity
- if (OpcUserIdentity.IsDefault(identity))
+ if (OpcUserIdentity.IsDefault(identity))
{
- return serverInfo;
+ return serverInfo;
}
- m_hUserName = GCHandle.Alloc(identity.Username, GCHandleType.Pinned);
- m_hPassword = GCHandle.Alloc(identity.Password, GCHandleType.Pinned);
- m_hDomain = GCHandle.Alloc(identity.Domain, GCHandleType.Pinned);
+ m_hUserName = GCHandle.Alloc(identity.Username, GCHandleType.Pinned);
+ m_hPassword = GCHandle.Alloc(identity.Password, GCHandleType.Pinned);
+ m_hDomain = GCHandle.Alloc(identity.Domain, GCHandleType.Pinned);
- m_hIdentity = new GCHandle();
+ m_hIdentity = new GCHandle();
- // create identity structure.
- var authIdentity = new COAUTHIDENTITY();
+ // create identity structure.
+ var authIdentity = new COAUTHIDENTITY();
- authIdentity.User = m_hUserName.AddrOfPinnedObject();
- authIdentity.UserLength = (uint)((identity.Username != null)?identity.Username.Length:0);
- authIdentity.Password = m_hPassword.AddrOfPinnedObject();
- authIdentity.PasswordLength = (uint)((identity.Password != null)?identity.Password.Length:0);
- authIdentity.Domain = m_hDomain.AddrOfPinnedObject();
- authIdentity.DomainLength = (uint)((identity.Domain != null)?identity.Domain.Length:0);
- authIdentity.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
+ authIdentity.User = m_hUserName.AddrOfPinnedObject();
+ authIdentity.UserLength = (uint)((identity.Username != null) ? identity.Username.Length : 0);
+ authIdentity.Password = m_hPassword.AddrOfPinnedObject();
+ authIdentity.PasswordLength = (uint)((identity.Password != null) ? identity.Password.Length : 0);
+ authIdentity.Domain = m_hDomain.AddrOfPinnedObject();
+ authIdentity.DomainLength = (uint)((identity.Domain != null) ? identity.Domain.Length : 0);
+ authIdentity.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
- m_hIdentity = GCHandle.Alloc(authIdentity, GCHandleType.Pinned);
-
- // create authorization info structure.
- var authInfo = new COAUTHINFO();
+ m_hIdentity = GCHandle.Alloc(authIdentity, GCHandleType.Pinned);
- authInfo.dwAuthnSvc = RPC_C_AUTHN_WINNT;
- authInfo.dwAuthzSvc = RPC_C_AUTHZ_NONE;
- authInfo.pwszServerPrincName = IntPtr.Zero;
- authInfo.dwAuthnLevel = RPC_C_AUTHN_LEVEL_CONNECT;
- authInfo.dwImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE;
- authInfo.pAuthIdentityData = m_hIdentity.AddrOfPinnedObject();
- authInfo.dwCapabilities = EOAC_NONE; // EOAC_DYNAMIC_CLOAKING;
+ // create authorization info structure.
+ var authInfo = new COAUTHINFO();
- m_hAuthInfo = GCHandle.Alloc(authInfo, GCHandleType.Pinned);
-
- // update server info structure.
- serverInfo.pAuthInfo = m_hAuthInfo.AddrOfPinnedObject();
+ authInfo.dwAuthnSvc = RPC_C_AUTHN_WINNT;
+ authInfo.dwAuthzSvc = RPC_C_AUTHZ_NONE;
+ authInfo.pwszServerPrincName = IntPtr.Zero;
+ authInfo.dwAuthnLevel = RPC_C_AUTHN_LEVEL_CONNECT;
+ authInfo.dwImpersonationLevel = RPC_C_IMP_LEVEL_IMPERSONATE;
+ authInfo.pAuthIdentityData = m_hIdentity.AddrOfPinnedObject();
+ authInfo.dwCapabilities = EOAC_NONE; // EOAC_DYNAMIC_CLOAKING;
- return serverInfo;
- }
+ m_hAuthInfo = GCHandle.Alloc(authInfo, GCHandleType.Pinned);
- ///
- /// Deallocated memory allocated when the COSERVERINFO structure was created.
- ///
- public void Deallocate()
- {
- if (m_hUserName.IsAllocated) m_hUserName.Free();
- if (m_hPassword.IsAllocated) m_hPassword.Free();
- if (m_hDomain.IsAllocated) m_hDomain.Free();
- if (m_hIdentity.IsAllocated) m_hIdentity.Free();
- if (m_hAuthInfo.IsAllocated) m_hAuthInfo.Free();
- }
- #endregion
+ // update server info structure.
+ serverInfo.pAuthInfo = m_hAuthInfo.AddrOfPinnedObject();
- #region Private Members
- private GCHandle m_hUserName;
- private GCHandle m_hPassword;
- private GCHandle m_hDomain;
- private GCHandle m_hIdentity;
- private GCHandle m_hAuthInfo;
- #endregion
- }
+ return serverInfo;
+ }
+
+ ///
+ /// Deallocated memory allocated when the COSERVERINFO structure was created.
+ ///
+ public void Deallocate()
+ {
+ if (m_hUserName.IsAllocated) m_hUserName.Free();
+ if (m_hPassword.IsAllocated) m_hPassword.Free();
+ if (m_hDomain.IsAllocated) m_hDomain.Free();
+ if (m_hIdentity.IsAllocated) m_hIdentity.Free();
+ if (m_hAuthInfo.IsAllocated) m_hAuthInfo.Free();
+ }
+ #endregion
+
+ #region Private Members
+ private GCHandle m_hUserName;
+ private GCHandle m_hPassword;
+ private GCHandle m_hDomain;
+ private GCHandle m_hIdentity;
+ private GCHandle m_hAuthInfo;
+ #endregion
+ }
#endregion
#region Initialization Functions
@@ -566,138 +565,138 @@ namespace Technosoftware.DaAeHdaClient.Com
/// Initializes COM security.
///
public static void InitializeSecurity()
- {
- var error = CoInitializeSecurity(
- IntPtr.Zero,
- -1,
- null,
- IntPtr.Zero,
- RPC_C_AUTHN_LEVEL_CONNECT,
- RPC_C_IMP_LEVEL_IMPERSONATE,
- IntPtr.Zero,
- EOAC_DYNAMIC_CLOAKING,
- IntPtr.Zero);
+ {
+ var error = CoInitializeSecurity(
+ IntPtr.Zero,
+ -1,
+ null,
+ IntPtr.Zero,
+ RPC_C_AUTHN_LEVEL_CONNECT,
+ RPC_C_IMP_LEVEL_IMPERSONATE,
+ IntPtr.Zero,
+ EOAC_DYNAMIC_CLOAKING,
+ IntPtr.Zero);
// this call will fail in the debugger if the
// 'Debug | Enable Visual Studio Hosting Process'
// option is checked in the project properties.
- if (error != 0)
- {
- // throw new ExternalException("CoInitializeSecurity: " + GetSystemMessage(error), error);
- }
- }
+ if (error != 0)
+ {
+ // throw new ExternalException("CoInitializeSecurity: " + GetSystemMessage(error), error);
+ }
+ }
- ///
- /// Determines if the host is the local host.
- ///
- private static bool IsLocalHost(string hostName)
- {
- // lookup requested host.
- var requestedHost = Dns.GetHostEntry(hostName);
+ ///
+ /// Determines if the host is the local host.
+ ///
+ private static bool IsLocalHost(string hostName)
+ {
+ // lookup requested host.
+ var requestedHost = Dns.GetHostEntry(hostName);
- if (requestedHost == null || requestedHost.AddressList == null)
- {
- return true;
- }
+ if (requestedHost == null || requestedHost.AddressList == null)
+ {
+ return true;
+ }
- // check for loopback.
- for (var ii = 0; ii < requestedHost.AddressList.Length; ii++)
- {
- var requestedIP = requestedHost.AddressList[ii];
+ // check for loopback.
+ for (var ii = 0; ii < requestedHost.AddressList.Length; ii++)
+ {
+ var requestedIP = requestedHost.AddressList[ii];
- if (requestedIP == null || requestedIP.Equals(IPAddress.Loopback))
- {
- return true;
- }
- }
+ if (requestedIP == null || requestedIP.Equals(IPAddress.Loopback))
+ {
+ return true;
+ }
+ }
- // lookup local host.
- var localHost = Dns.GetHostEntry(Dns.GetHostName());
+ // lookup local host.
+ var localHost = Dns.GetHostEntry(Dns.GetHostName());
- if (localHost == null || localHost.AddressList == null)
- {
- return false;
- }
-
- // check for localhost.
- for (var ii = 0; ii < requestedHost.AddressList.Length; ii++)
- {
- var requestedIP = requestedHost.AddressList[ii];
+ if (localHost == null || localHost.AddressList == null)
+ {
+ return false;
+ }
- for (var jj = 0; jj < localHost.AddressList.Length; jj++)
- {
- if (requestedIP.Equals(localHost.AddressList[jj]))
- {
- return true;
- }
- }
- }
+ // check for localhost.
+ for (var ii = 0; ii < requestedHost.AddressList.Length; ii++)
+ {
+ var requestedIP = requestedHost.AddressList[ii];
- // must be remote.
- return false;
- }
+ for (var jj = 0; jj < localHost.AddressList.Length; jj++)
+ {
+ if (requestedIP.Equals(localHost.AddressList[jj]))
+ {
+ return true;
+ }
+ }
+ }
- ///
- /// Creates an instance of a COM server using the specified license key.
- ///
- public static object CreateInstance(Guid clsid, string hostName, OpcUserIdentity identity)
- {
- return CreateInstance1(clsid, hostName, identity);
- }
+ // must be remote.
+ return false;
+ }
- ///
- /// Creates an instance of a COM server.
- ///
- public static object CreateInstance1(Guid clsid, string hostName, OpcUserIdentity identity)
- {
- var serverInfo = new ServerInfo();
- var coserverInfo = serverInfo.Allocate(hostName, identity);
+ ///
+ /// Creates an instance of a COM server using the specified license key.
+ ///
+ public static object CreateInstance(Guid clsid, string hostName, OpcUserIdentity identity)
+ {
+ return CreateInstance1(clsid, hostName, identity);
+ }
- var hIID = GCHandle.Alloc(IID_IUnknown, GCHandleType.Pinned);
+ ///
+ /// Creates an instance of a COM server.
+ ///
+ public static object CreateInstance1(Guid clsid, string hostName, OpcUserIdentity identity)
+ {
+ var serverInfo = new ServerInfo();
+ var coserverInfo = serverInfo.Allocate(hostName, identity);
- var results = new MULTI_QI[1];
+ var hIID = GCHandle.Alloc(IID_IUnknown, GCHandleType.Pinned);
- results[0].iid = hIID.AddrOfPinnedObject();
- results[0].pItf = null;
- results[0].hr = 0;
+ var results = new MULTI_QI[1];
- try
- {
- // check whether connecting locally or remotely.
- var clsctx = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER;
+ results[0].iid = hIID.AddrOfPinnedObject();
+ results[0].pItf = null;
+ results[0].hr = 0;
- if (!string.IsNullOrEmpty(hostName) && hostName != "localhost")
- {
- clsctx = CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER;
- }
+ try
+ {
+ // check whether connecting locally or remotely.
+ var clsctx = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER;
- // create an instance.
- CoCreateInstanceEx(
- ref clsid,
- null,
- clsctx,
- ref coserverInfo,
- 1,
- results);
- }
- finally
- {
- if (hIID.IsAllocated) hIID.Free();
- serverInfo.Deallocate();
- }
+ if (!string.IsNullOrEmpty(hostName) && hostName != "localhost")
+ {
+ clsctx = CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER;
+ }
- if (results[0].hr != 0)
- {
+ // create an instance.
+ CoCreateInstanceEx(
+ ref clsid,
+ null,
+ clsctx,
+ ref coserverInfo,
+ 1,
+ results);
+ }
+ finally
+ {
+ if (hIID.IsAllocated) hIID.Free();
+ serverInfo.Deallocate();
+ }
+
+ if (results[0].hr != 0)
+ {
throw new OpcResultException(new OpcResult(OpcResult.CONNECT_E_NOCONNECTION.Code, OpcResult.FuncCallType.SysFuncCall, null), string.Format("Could not create COM server '{0}' on host '{1}'. Reason: {2}.", clsid, hostName, GetSystemMessage((int)results[0].hr, LOCALE_SYSTEM_DEFAULT)));
- }
+ }
- return results[0].pItf;
- }
+ return results[0].pItf;
+ }
// COM impersonation is a nice feature but variations between behavoirs on different
// windows platforms make it virtually impossible to support. This code is left here
// in case it becomes a critical requirement in the future.
- #if COM_IMPERSONATION_SUPPORT
+#if COM_IMPERSONATION_SUPPORT
///
/// Returns the WindowsIdentity associated with a UserIdentity.
///
@@ -937,11 +936,11 @@ namespace Technosoftware.DaAeHdaClient.Com
return instance;
}
- #endif
- #endregion
+#endif
+ #endregion
- #region Conversion Functions
+ #region Conversion Functions
#if TEST
///
@@ -2550,18 +2549,18 @@ namespace Technosoftware.DaAeHdaClient.Com
/// Returns the symbolic name for the specified error.
///
public static string GetErrorText(Type type, int error)
- {
- var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static);
-
- foreach (var field in fields)
- {
- if (error == (int)field.GetValue(type))
- {
- return field.Name;
- }
- }
+ {
+ var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static);
- return string.Format("0x{0:X8}", error);
+ foreach (var field in fields)
+ {
+ if (error == (int)field.GetValue(type))
+ {
+ return field.Name;
+ }
+ }
+
+ return string.Format("0x{0:X8}", error);
}
///
@@ -2580,63 +2579,63 @@ namespace Technosoftware.DaAeHdaClient.Com
/// Releases the server if it is a true COM server.
///
public static void ReleaseServer(object server)
- {
- if (server != null && server.GetType().IsCOMObject)
- {
- Marshal.ReleaseComObject(server);
- }
- }
+ {
+ if (server != null && server.GetType().IsCOMObject)
+ {
+ Marshal.ReleaseComObject(server);
+ }
+ }
- ///
- /// Retrieves the system message text for the specified error.
- ///
- public static string GetSystemMessage(int error, int localeId)
- {
+ ///
+ /// Retrieves the system message text for the specified error.
+ ///
+ public static string GetSystemMessage(int error, int localeId)
+ {
int langId;
switch (localeId)
{
case LOCALE_SYSTEM_DEFAULT:
- {
- langId = GetSystemDefaultLangID();
- break;
- }
+ {
+ langId = GetSystemDefaultLangID();
+ break;
+ }
case LOCALE_USER_DEFAULT:
- {
- langId = GetUserDefaultLangID();
- break;
- }
+ {
+ langId = GetUserDefaultLangID();
+ break;
+ }
default:
- {
- langId = (0xFFFF & localeId);
- break;
- }
+ {
+ langId = (0xFFFF & localeId);
+ break;
+ }
}
- var buffer = Marshal.AllocCoTaskMem(MAX_MESSAGE_LENGTH);
+ var buffer = Marshal.AllocCoTaskMem(MAX_MESSAGE_LENGTH);
- var result = FormatMessageW(
- (int)FORMAT_MESSAGE_FROM_SYSTEM,
- IntPtr.Zero,
- error,
- langId,
- buffer,
- MAX_MESSAGE_LENGTH-1,
- IntPtr.Zero);
+ var result = FormatMessageW(
+ (int)FORMAT_MESSAGE_FROM_SYSTEM,
+ IntPtr.Zero,
+ error,
+ langId,
+ buffer,
+ MAX_MESSAGE_LENGTH - 1,
+ IntPtr.Zero);
if (result > 0)
{
- var msg = Marshal.PtrToStringUni(buffer);
- Marshal.FreeCoTaskMem(buffer);
+ var msg = Marshal.PtrToStringUni(buffer);
+ Marshal.FreeCoTaskMem(buffer);
- if (msg != null && msg.Length > 0)
- {
- return msg.Trim();
- }
+ if (msg != null && msg.Length > 0)
+ {
+ return msg.Trim();
+ }
}
- return string.Format("0x{0:X8}", error);
+ return string.Format("0x{0:X8}", error);
}
///
@@ -2646,46 +2645,46 @@ namespace Technosoftware.DaAeHdaClient.Com
{
return new COMException(e.Message, errorId);
}
-
- ///
- /// Creates a COM exception.
+
+ ///
+ /// Creates a COM exception.
///
- public static Exception CreateComException(string message, int errorId)
- {
- return new COMException(message, errorId);
- }
+ public static Exception CreateComException(string message, int errorId)
+ {
+ return new COMException(message, errorId);
+ }
- ///
- /// Converts an exception to an exception that returns a COM error code.
- ///
- public static Exception CreateComException(int errorId)
- {
- return new COMException(string.Format("0x{0:X8}", errorId), errorId);
- }
+ ///
+ /// Converts an exception to an exception that returns a COM error code.
+ ///
+ public static Exception CreateComException(int errorId)
+ {
+ return new COMException(string.Format("0x{0:X8}", errorId), errorId);
+ }
- ///
- /// Converts an exception to an exception that returns a COM error code.
- ///
- public static Exception CreateComException(Exception e)
- {
- // nothing special required for external exceptions.
- if (e is COMException)
- {
- return e;
- }
+ ///
+ /// Converts an exception to an exception that returns a COM error code.
+ ///
+ public static Exception CreateComException(Exception e)
+ {
+ // nothing special required for external exceptions.
+ if (e is COMException)
+ {
+ return e;
+ }
- // convert other exceptions to E_FAIL.
- return new COMException(e.Message, OpcResult.E_FAIL.Code);
- }
+ // convert other exceptions to E_FAIL.
+ return new COMException(e.Message, OpcResult.E_FAIL.Code);
+ }
///
/// Creates an error message for a failed COM function call.
///
public static Exception CreateException(Exception e, string function)
{
- return new OpcResultException(new OpcResult((int)OpcResult.E_NETWORK_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), string.Format("Call to {0} failed. Error: {1}.", function, GetSystemMessage(Marshal.GetHRForException(e), LOCALE_SYSTEM_DEFAULT)));
+ return new OpcResultException(new OpcResult((int)OpcResult.E_NETWORK_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), string.Format("Call to {0} failed. Error: {1}.", function, GetSystemMessage(Marshal.GetHRForException(e), LOCALE_SYSTEM_DEFAULT)));
}
-
+
///
/// Checks if the error is an RPC error.
///
@@ -2724,29 +2723,29 @@ namespace Technosoftware.DaAeHdaClient.Com
{
return false;
}
- }
+ }
}
return true;
}
- #endregion
+ #endregion
- #region Utility Functions
- ///
- /// Compares a string locale to a WIN32 localeId
- ///
- public static bool CompareLocales(int localeId, string locale, bool ignoreRegion)
- {
+ #region Utility Functions
+ ///
+ /// Compares a string locale to a WIN32 localeId
+ ///
+ public static bool CompareLocales(int localeId, string locale, bool ignoreRegion)
+ {
// parse locale.
CultureInfo culture;
- try
- {
+ try
+ {
culture = new CultureInfo(locale);
- }
- catch (Exception)
- {
+ }
+ catch (Exception)
+ {
return false;
- }
+ }
// only match the language portion of the locale id.
if (ignoreRegion)
@@ -2759,15 +2758,15 @@ namespace Technosoftware.DaAeHdaClient.Com
// check for exact match.
else
- {
+ {
if (localeId == culture.LCID)
{
return true;
}
}
- return false;
- }
+ return false;
+ }
///
/// Reports an unexpected exception during a COM operation.
@@ -2777,7 +2776,7 @@ namespace Technosoftware.DaAeHdaClient.Com
var message = Utils.Format(format, args);
var code = Marshal.GetHRForException(e);
-
+
var error = code.ToString();
if (error == null)
@@ -2788,5 +2787,5 @@ namespace Technosoftware.DaAeHdaClient.Com
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient.Com/ConnectionPoint.cs b/Technosoftware/DaAeHdaClient.Com/ConnectionPoint.cs
index d8cd80c..555cff4 100644
--- a/Technosoftware/DaAeHdaClient.Com/ConnectionPoint.cs
+++ b/Technosoftware/DaAeHdaClient.Com/ConnectionPoint.cs
@@ -41,12 +41,12 @@ namespace Technosoftware.DaAeHdaClient.Com
/// The id assigned to the connection by the COM server.
///
private int cookie_;
-
+
///
/// The number of times Advise() has been called without a matching Unadvise().
///
- private int refs_;
-
+ private int refs_;
+
///
/// Initializes the object by finding the specified connection point.
///
diff --git a/Technosoftware/DaAeHdaClient.Com/Da/BrowsePosition.cs b/Technosoftware/DaAeHdaClient.Com/Da/BrowsePosition.cs
index 3e83bbe..9b22485 100644
--- a/Technosoftware/DaAeHdaClient.Com/Da/BrowsePosition.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Da/BrowsePosition.cs
@@ -32,7 +32,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
/// Implements an object that handles multi-step browse operations.
///
[Serializable]
- internal class BrowsePosition : TsCDaBrowsePosition
+ internal class BrowsePosition : TsCDaBrowsePosition
{
///
/// The continuation point for a browse operation.
@@ -48,13 +48,13 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
/// Initializes a browse position
///
internal BrowsePosition(
- OpcItem itemID,
- TsCDaBrowseFilters filters,
- string continuationPoint)
+ OpcItem itemID,
+ TsCDaBrowseFilters filters,
+ string continuationPoint)
:
base(itemID, filters)
{
ContinuationPoint = continuationPoint;
}
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Da/Interop.cs b/Technosoftware/DaAeHdaClient.Com/Da/Interop.cs
index 1905949..e42255d 100644
--- a/Technosoftware/DaAeHdaClient.Com/Da/Interop.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Da/Interop.cs
@@ -23,9 +23,8 @@
#region Using Directives
using System;
using System.Collections;
-using System.Runtime.InteropServices;
using System.Reflection;
-
+using System.Runtime.InteropServices;
using Technosoftware.DaAeHdaClient.Da;
#endregion
@@ -134,9 +133,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
output.ProductVersion = string.Format("{0}.{1}.{2}", status.wMajorVersion, status.wMinorVersion, status.wBuildNumber);
output.ServerState = (OpcServerState)status.dwServerState;
output.StatusInfo = null;
- output.StartTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Convert(status.ftStartTime));
- output.CurrentTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Convert(status.ftCurrentTime));
- output.LastUpdateTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Convert(status.ftLastUpdateTime));
+ output.StartTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Convert(status.ftStartTime));
+ output.CurrentTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Convert(status.ftCurrentTime));
+ output.LastUpdateTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Convert(status.ftLastUpdateTime));
if (deallocate)
{
@@ -622,9 +621,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
case OpcRcw.Da.Constants.OPC_WRITEABLE: return TsDaAccessRights.Writable;
case OpcRcw.Da.Constants.OPC_READABLE | OpcRcw.Da.Constants.OPC_WRITEABLE:
- {
- return TsDaAccessRights.ReadWritable;
- }
+ {
+ return TsDaAccessRights.ReadWritable;
+ }
}
return null;
diff --git a/Technosoftware/DaAeHdaClient.Com/Da/Result.cs b/Technosoftware/DaAeHdaClient.Com/Da/Result.cs
index 202ebae..eb551e1 100644
--- a/Technosoftware/DaAeHdaClient.Com/Da/Result.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Da/Result.cs
@@ -32,77 +32,77 @@ namespace Technosoftware.DaAeHdaClient.Com
/// Defines all well known COM DA HRESULT codes.
///
internal struct Result
- {
+ {
///
- public const int S_OK = +0x00000000; // 0x00000000
+ public const int S_OK = +0x00000000; // 0x00000000
///
- public const int S_FALSE = +0x00000001; // 0x00000001
+ public const int S_FALSE = +0x00000001; // 0x00000001
///
- public const int E_NOTIMPL = -0x7FFFBFFF; // 0x80004001
+ public const int E_NOTIMPL = -0x7FFFBFFF; // 0x80004001
///
- public const int E_OUTOFMEMORY = -0x7FF8FFF2; // 0x8007000E
+ public const int E_OUTOFMEMORY = -0x7FF8FFF2; // 0x8007000E
///
- public const int E_INVALIDARG = -0x7FF8FFA9; // 0x80070057
+ public const int E_INVALIDARG = -0x7FF8FFA9; // 0x80070057
///
- public const int E_NOINTERFACE = -0x7FFFBFFE; // 0x80004002
+ public const int E_NOINTERFACE = -0x7FFFBFFE; // 0x80004002
///
- public const int E_POINTER = -0x7FFFBFFD; // 0x80004003
+ public const int E_POINTER = -0x7FFFBFFD; // 0x80004003
///
- public const int E_FAIL = -0x7FFFBFFB; // 0x80004005
+ public const int E_FAIL = -0x7FFFBFFB; // 0x80004005
///
- public const int CONNECT_E_NOCONNECTION = -0x7FFBFE00; // 0x80040200
+ public const int CONNECT_E_NOCONNECTION = -0x7FFBFE00; // 0x80040200
///
- public const int CONNECT_E_ADVISELIMIT = -0x7FFBFDFF; // 0x80040201
+ public const int CONNECT_E_ADVISELIMIT = -0x7FFBFDFF; // 0x80040201
///
- public const int DISP_E_TYPEMISMATCH = -0x7FFDFFFB; // 0x80020005
+ public const int DISP_E_TYPEMISMATCH = -0x7FFDFFFB; // 0x80020005
///
- public const int DISP_E_OVERFLOW = -0x7FFDFFF6; // 0x8002000A
+ public const int DISP_E_OVERFLOW = -0x7FFDFFF6; // 0x8002000A
///
- public const int E_INVALIDHANDLE = -0x3FFBFFFF; // 0xC0040001
+ public const int E_INVALIDHANDLE = -0x3FFBFFFF; // 0xC0040001
///
- public const int E_BADTYPE = -0x3FFBFFFC; // 0xC0040004
+ public const int E_BADTYPE = -0x3FFBFFFC; // 0xC0040004
///
- public const int E_PUBLIC = -0x3FFBFFFB; // 0xC0040005
+ public const int E_PUBLIC = -0x3FFBFFFB; // 0xC0040005
///
- public const int E_BADRIGHTS = -0x3FFBFFFA; // 0xC0040006
+ public const int E_BADRIGHTS = -0x3FFBFFFA; // 0xC0040006
///
- public const int E_UNKNOWNITEMID = -0x3FFBFFF9; // 0xC0040007
+ public const int E_UNKNOWNITEMID = -0x3FFBFFF9; // 0xC0040007
///
- public const int E_INVALIDITEMID = -0x3FFBFFF8; // 0xC0040008
+ public const int E_INVALIDITEMID = -0x3FFBFFF8; // 0xC0040008
///
- public const int E_INVALIDFILTER = -0x3FFBFFF7; // 0xC0040009
+ public const int E_INVALIDFILTER = -0x3FFBFFF7; // 0xC0040009
///
- public const int E_UNKNOWNPATH = -0x3FFBFFF6; // 0xC004000A
+ public const int E_UNKNOWNPATH = -0x3FFBFFF6; // 0xC004000A
///
- public const int E_RANGE = -0x3FFBFFF5; // 0xC004000B
+ public const int E_RANGE = -0x3FFBFFF5; // 0xC004000B
///
- public const int E_DUPLICATENAME = -0x3FFBFFF4; // 0xC004000C
+ public const int E_DUPLICATENAME = -0x3FFBFFF4; // 0xC004000C
///
- public const int S_UNSUPPORTEDRATE = +0x0004000D; // 0x0004000D
+ public const int S_UNSUPPORTEDRATE = +0x0004000D; // 0x0004000D
///
- public const int S_CLAMP = +0x0004000E; // 0x0004000E
+ public const int S_CLAMP = +0x0004000E; // 0x0004000E
///
- public const int S_INUSE = +0x0004000F; // 0x0004000F
+ public const int S_INUSE = +0x0004000F; // 0x0004000F
///
- public const int E_INVALIDCONFIGFILE = -0x3FFBFFF0; // 0xC0040010
+ public const int E_INVALIDCONFIGFILE = -0x3FFBFFF0; // 0xC0040010
///
- public const int E_NOTFOUND = -0x3FFBFFEF; // 0xC0040011
+ public const int E_NOTFOUND = -0x3FFBFFEF; // 0xC0040011
///
- public const int E_INVALID_PID = -0x3FFBFDFD; // 0xC0040203
+ public const int E_INVALID_PID = -0x3FFBFDFD; // 0xC0040203
///
- public const int E_DEADBANDNOTSET = -0x3FFBFC00; // 0xC0040400
+ public const int E_DEADBANDNOTSET = -0x3FFBFC00; // 0xC0040400
///
- public const int E_DEADBANDNOTSUPPORTED = -0x3FFBFBFF; // 0xC0040401
+ public const int E_DEADBANDNOTSUPPORTED = -0x3FFBFBFF; // 0xC0040401
///
- public const int E_NOBUFFERING = -0x3FFBFBFE; // 0xC0040402
+ public const int E_NOBUFFERING = -0x3FFBFBFE; // 0xC0040402
///
- public const int E_INVALIDCONTINUATIONPOINT = -0x3FFBFBFD; // 0xC0040403
+ public const int E_INVALIDCONTINUATIONPOINT = -0x3FFBFBFD; // 0xC0040403
///
- public const int S_DATAQUEUEOVERFLOW = +0x00040404; // 0x00040404
+ public const int S_DATAQUEUEOVERFLOW = +0x00040404; // 0x00040404
///
- public const int E_RATENOTSET = -0x3FFBFBFB; // 0xC0040405
+ public const int E_RATENOTSET = -0x3FFBFBFB; // 0xC0040405
///
- public const int E_NOTSUPPORTED = -0x3FFBFBFA; // 0xC0040406
+ public const int E_NOTSUPPORTED = -0x3FFBFBFA; // 0xC0040406
}
}
@@ -114,15 +114,15 @@ namespace Technosoftware.DaAeHdaClient.Com
internal struct Result
{
///
- public const int E_TYPE_CHANGED = -0x3FFBFBF9; // 0xC0040407
+ public const int E_TYPE_CHANGED = -0x3FFBFBF9; // 0xC0040407
///
- public const int E_FILTER_DUPLICATE = -0x3FFBFBF8; // 0xC0040408
+ public const int E_FILTER_DUPLICATE = -0x3FFBFBF8; // 0xC0040408
///
- public const int E_FILTER_INVALID = -0x3FFBFBF7; // 0xC0040409
+ public const int E_FILTER_INVALID = -0x3FFBFBF7; // 0xC0040409
///
- public const int E_FILTER_ERROR = -0x3FFBFBF6; // 0xC004040A
+ public const int E_FILTER_ERROR = -0x3FFBFBF6; // 0xC004040A
///
- public const int S_FILTER_NO_DATA = +0x0004040B; // 0xC004040B
+ public const int S_FILTER_NO_DATA = +0x0004040B; // 0xC004040B
}
}
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Da/Server.cs b/Technosoftware/DaAeHdaClient.Com/Da/Server.cs
index 72019d2..bcffa01 100644
--- a/Technosoftware/DaAeHdaClient.Com/Da/Server.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Da/Server.cs
@@ -22,16 +22,13 @@
#region Using Directives
using System;
-using System.Threading;
using System.Collections;
using System.Globalization;
using System.Runtime.InteropServices;
-
-using Technosoftware.DaAeHdaClient.Da;
-using Technosoftware.DaAeHdaClient.Utilities;
-
-using Technosoftware.OpcRcw.Da;
+using System.Threading;
using Technosoftware.DaAeHdaClient.Com.Utilities;
+using Technosoftware.DaAeHdaClient.Da;
+using Technosoftware.OpcRcw.Da;
#endregion
@@ -100,7 +97,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// release all groups.
foreach (Subscription subscription in subscriptions_.Values)
{
- var methodName = "IOPCServer.RemoveGroup";
+ var methodName = "IOPCServer.RemoveGroup";
// remove subscription from server.
try
@@ -166,7 +163,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
(server).GetErrorString(
@@ -188,7 +185,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
}
finally
{
- EndComCall(methodName);
+ EndComCall(methodName);
}
}
}
@@ -237,7 +234,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
(server).GetStatus(out pStatus);
@@ -292,10 +289,10 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
var pQualities = IntPtr.Zero;
var pTimestamps = IntPtr.Zero;
var pErrors = IntPtr.Zero;
-
+
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
server.Read(
count,
@@ -424,7 +421,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
server.WriteVQT(
count,
@@ -500,7 +497,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
var revisedUpdateRate = 0;
var hDeadband = GCHandle.Alloc(result.Deadband, GCHandleType.Pinned);
-
+
// invoke COM method.
try
{
@@ -538,12 +535,12 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
}
if (group == null) throw new OpcResultException(OpcResult.E_FAIL, "The subscription was not created.");
-
+
methodName = "IOPCGroupStateMgt2.SetKeepAlive";
// set the keep alive rate if requested.
try
- {
+ {
var keepAlive = 0;
var comObject = BeginComCall(group, methodName, true);
comObject.SetKeepAlive(result.KeepAlive, out keepAlive);
@@ -562,9 +559,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
}
finally
{
- EndComCall(methodName);
+ EndComCall(methodName);
}
-
+
// save server handle.
result.ServerHandle = serverHandle;
@@ -619,7 +616,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
server.RemoveGroup((int)state.ServerHandle, 0);
@@ -635,7 +632,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
}
finally
{
- EndComCall(methodName);
+ EndComCall(methodName);
}
}
}
@@ -670,7 +667,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
server.Browse(
(itemId != null && itemId.ItemName != null) ? itemId.ItemName : "",
@@ -699,7 +696,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
}
finally
{
- EndComCall(methodName);
+ EndComCall(methodName);
}
// unmarshal results.
@@ -760,7 +757,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
server.Browse(
(itemID != null && itemID.ItemName != null) ? itemID.ItemName : "",
@@ -789,7 +786,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
}
finally
{
- EndComCall(methodName);
+ EndComCall(methodName);
}
// unmarshal results.
@@ -842,7 +839,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
// invoke COM method.
try
- {
+ {
var server = BeginComCall(methodName, true);
server.GetProperties(
itemIds.Length,
@@ -863,8 +860,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
throw Technosoftware.DaAeHdaClient.Com.Interop.CreateException(methodName, e);
}
finally
- {
- EndComCall(methodName);
+ {
+ EndComCall(methodName);
}
// unmarshal results.
diff --git a/Technosoftware/DaAeHdaClient.Com/Da/Subscription.cs b/Technosoftware/DaAeHdaClient.Com/Da/Subscription.cs
index 04a627e..798f273 100644
--- a/Technosoftware/DaAeHdaClient.Com/Da/Subscription.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Da/Subscription.cs
@@ -247,7 +247,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
var localeID = 0;
var clientHandle = 0;
var serverHandle = 0;
-
+
var subscription = BeginComCall(methodName, true);
subscription.GetState(
out updateRate,
@@ -289,7 +289,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
{
methodName = "IOPCGroupStateMgt2.GetKeepAlive";
try
- {
+ {
var keepAlive = 0;
var subscription = BeginComCall(methodName, true);
subscription.GetKeepAlive(out keepAlive);
@@ -328,7 +328,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
if (subscription_ == null) throw new NotConnectedException();
lock (lock_)
- {
+ {
var methodName = "IOPCGroupStateMgt.SetName";
// update the subscription name.
if ((masks & (int)TsCDaStateMask.Name) != 0 && state.Name != name_)
@@ -378,7 +378,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
methodName = "IOPCGroupStateMgt.SetState";
try
- {
+ {
var subscription = BeginComCall(methodName, true);
subscription.SetState(
((masks & (int)TsCDaStateMask.UpdateRate) != 0) ? hUpdateRate.AddrOfPinnedObject() : IntPtr.Zero,
@@ -415,7 +415,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
methodName = "IOPCGroupStateMgt2.SetKeepAlive";
try
- {
+ {
var subscription = BeginComCall(methodName, true);
subscription.SetKeepAlive(state.KeepAlive, out keepAlive);
@@ -477,7 +477,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
var methodName = "IOPCItemMgt.AddItems";
try
- {
+ {
var subscription = BeginComCall(methodName, true);
subscription.AddItems(
count,
@@ -647,7 +647,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Da
var methodName = "IOPCItemMgt.RemoveItems";
try
- {
+ {
var subscription = BeginComCall(methodName, true);
subscription.RemoveItems(itemIDs.Length, serverHandles, out pErrors);
diff --git a/Technosoftware/DaAeHdaClient.Com/Da20/Server.cs b/Technosoftware/DaAeHdaClient.Com/Da20/Server.cs
index d7d374e..55ce9bb 100644
--- a/Technosoftware/DaAeHdaClient.Com/Da20/Server.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Da20/Server.cs
@@ -23,14 +23,12 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
-
-using Technosoftware.DaAeHdaClient.Da;
using Technosoftware.DaAeHdaClient.Com.Da;
-using Technosoftware.DaAeHdaClient.Utilities;
-
-using Technosoftware.OpcRcw.Da;
-using Technosoftware.OpcRcw.Comn;
using Technosoftware.DaAeHdaClient.Com.Utilities;
+using Technosoftware.DaAeHdaClient.Da;
+using Technosoftware.DaAeHdaClient.Utilities;
+using Technosoftware.OpcRcw.Comn;
+using Technosoftware.OpcRcw.Da;
#endregion
diff --git a/Technosoftware/DaAeHdaClient.Com/Da20/Subscription.cs b/Technosoftware/DaAeHdaClient.Com/Da20/Subscription.cs
index ee8f561..22da721 100644
--- a/Technosoftware/DaAeHdaClient.Com/Da20/Subscription.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Da20/Subscription.cs
@@ -23,13 +23,10 @@
#region Using Directives
using System;
using System.Collections;
-
-using Technosoftware.DaAeHdaClient.Da;
using Technosoftware.DaAeHdaClient.Com.Da;
-using Technosoftware.DaAeHdaClient.Utilities;
-
-using Technosoftware.OpcRcw.Da;
using Technosoftware.DaAeHdaClient.Com.Utilities;
+using Technosoftware.DaAeHdaClient.Da;
+using Technosoftware.OpcRcw.Da;
#endregion
namespace Technosoftware.DaAeHdaClient.Com.Da20
diff --git a/Technosoftware/DaAeHdaClient.Com/EnumString.cs b/Technosoftware/DaAeHdaClient.Com/EnumString.cs
index cfcd095..f83d60b 100644
--- a/Technosoftware/DaAeHdaClient.Com/EnumString.cs
+++ b/Technosoftware/DaAeHdaClient.Com/EnumString.cs
@@ -32,7 +32,7 @@ namespace Technosoftware.DaAeHdaClient.Com
/// A wrapper for the COM IEnumString interface.
///
internal class EnumString : IDisposable
- {
+ {
///
/// A reference to the remote COM object.
///
@@ -45,7 +45,7 @@ namespace Technosoftware.DaAeHdaClient.Com
{
m_enumerator = (IEnumString)enumerator;
}
-
+
///
/// Releases the remote COM object.
///
@@ -66,7 +66,7 @@ namespace Technosoftware.DaAeHdaClient.Com
try
{
// create buffer.
- var buffer = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(IntPtr))*count);
+ var buffer = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(IntPtr)) * count);
try
{
diff --git a/Technosoftware/DaAeHdaClient.Com/Factory.cs b/Technosoftware/DaAeHdaClient.Com/Factory.cs
index 358664c..01c0a1c 100644
--- a/Technosoftware/DaAeHdaClient.Com/Factory.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Factory.cs
@@ -22,14 +22,9 @@
#region Using Directives
using System;
-using System.Xml;
-using System.Net;
-using System.Text;
-using System.Collections;
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Text;
#endregion
diff --git a/Technosoftware/DaAeHdaClient.Com/Hda/Browser.cs b/Technosoftware/DaAeHdaClient.Com/Hda/Browser.cs
index fa7fbfe..314cdfa 100644
--- a/Technosoftware/DaAeHdaClient.Com/Hda/Browser.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Hda/Browser.cs
@@ -23,10 +23,9 @@
#region Using Directives
using System;
using System.Collections;
-
using Technosoftware.DaAeHdaClient.Hda;
-using Technosoftware.OpcRcw.Hda;
using Technosoftware.OpcRcw.Comn;
+using Technosoftware.OpcRcw.Hda;
#endregion
namespace Technosoftware.DaAeHdaClient.Com.Hda
@@ -34,8 +33,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
///
/// An in-process wrapper an OPC HDA browser object.
///
- internal class Browser : ITsCHdaBrowser
- {
+ internal class Browser : ITsCHdaBrowser
+ {
//======================================================================
// Construction
@@ -73,7 +72,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
///
/// This must be called explicitly by clients to ensure the COM server is released.
///
- public virtual void Dispose()
+ public virtual void Dispose()
{
lock (this)
{
@@ -90,9 +89,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
///
/// Returns the set of attribute filters used by the browser.
///
- public TsCHdaBrowseFilterCollection Filters
- {
- get
+ public TsCHdaBrowseFilterCollection Filters
+ {
+ get
{
lock (this)
{
@@ -103,7 +102,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
//======================================================================
// Browse
-
+
///
/// Browses the server's address space at the specified branch.
///
@@ -121,7 +120,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
return elements;
}
-
+
///
/// Begins a browsing the server's address space at the specified branch.
///
@@ -141,11 +140,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
lock (this)
{
- var branchPath = (itemID != null && itemID.ItemName != null)?itemID.ItemName:"";
+ var branchPath = (itemID != null && itemID.ItemName != null) ? itemID.ItemName : "";
// move to the correct position in the server's address space.
try
- {
+ {
m_browser.ChangeBrowsePosition(OPCHDA_BROWSEDIRECTION.OPCHDA_BROWSE_DIRECT, branchPath);
}
catch (Exception e)
@@ -171,7 +170,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
// browse for items
enumerator = GetEnumerator(false);
- var items = FetchElements(enumerator, maxElements-elements.Count, false);
+ var items = FetchElements(enumerator, maxElements - elements.Count, false);
if (items != null)
{
@@ -233,13 +232,13 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
// release enumerator.
pos.Enumerator.Dispose();
-
+
pos.Enumerator = null;
pos.FetchingItems = true;
// move to the correct position in the server's address space.
try
- {
+ {
m_browser.ChangeBrowsePosition(OPCHDA_BROWSEDIRECTION.OPCHDA_BROWSE_DIRECT, pos.BranchPath);
}
catch (Exception e)
@@ -252,7 +251,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
}
// fetch next set of items.
- var items = FetchElements(pos.Enumerator, maxElements-elements.Count, false);
+ var items = FetchElements(pos.Enumerator, maxElements - elements.Count, false);
if (items != null)
{
@@ -282,7 +281,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
try
{
- var browseType = (isBranch)?OPCHDA_BROWSETYPE.OPCHDA_BRANCH:OPCHDA_BROWSETYPE.OPCHDA_LEAF;
+ var browseType = (isBranch) ? OPCHDA_BROWSETYPE.OPCHDA_BRANCH : OPCHDA_BROWSETYPE.OPCHDA_LEAF;
IEnumString pEnumerator = null;
m_browser.GetEnum(browseType, out pEnumerator);
@@ -303,13 +302,13 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
var elements = new ArrayList();
while (elements.Count < maxElements)
- {
+ {
// fetch next batch of element names.
var count = BLOCK_SIZE;
if (elements.Count + count > maxElements)
{
- count = maxElements - elements.Count;
+ count = maxElements - elements.Count;
}
var names = enumerator.Next(count);
@@ -321,18 +320,18 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
// create new element objects.
foreach (var name in names)
- {
+ {
var element = new TsCHdaBrowseElement();
- element.Name = name;
+ element.Name = name;
// lookup item id for element.
try
{
string itemID = null;
m_browser.GetItemID(name, out itemID);
-
- element.ItemName = itemID;
- element.ItemPath = null;
+
+ element.ItemName = itemID;
+ element.ItemPath = null;
element.HasChildren = isBranch;
}
catch
@@ -384,8 +383,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Whether the enumerator is return branches or items.
internal BrowsePosition(string branchPath, EnumString enumerator, bool fetchingItems)
{
- m_branchPath = branchPath;
- m_enumerator = enumerator;
+ m_branchPath = branchPath;
+ m_enumerator = enumerator;
m_fetchingItems = fetchingItems;
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Hda/DataCallback.cs b/Technosoftware/DaAeHdaClient.Com/Hda/DataCallback.cs
index 3bdc0d1..876d953 100644
--- a/Technosoftware/DaAeHdaClient.Com/Hda/DataCallback.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Hda/DataCallback.cs
@@ -30,26 +30,26 @@ using Technosoftware.OpcRcw.Hda;
#endregion
namespace Technosoftware.DaAeHdaClient.Com.Hda
-{
+{
///
/// A class that implements the HDA data callback interface.
///
- internal class DataCallback : IOPCHDA_DataCallback
- {
+ internal class DataCallback : IOPCHDA_DataCallback
+ {
///
/// Initializes the object with the containing subscription object.
///
- public DataCallback() {}
+ public DataCallback() { }
///
/// Fired when an exception occurs during callback processing.
///
public event TsCHdaCallbackExceptionEventHandler CallbackExceptionEvent
{
- add {lock (this) { _callbackExceptionEvent += value; }}
- remove {lock (this) { _callbackExceptionEvent -= value; }}
+ add { lock (this) { _callbackExceptionEvent += value; } }
+ remove { lock (this) { _callbackExceptionEvent -= value; } }
}
-
+
///
/// Creates a new request object.
///
@@ -61,8 +61,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
var request = new Request(requestHandle, callback, ++m_nextID);
// no items yet - callback may return before async call returns.
- m_requests[request.RequestID] = request;
-
+ m_requests[request.RequestID] = request;
+
// return requests.
return request;
}
@@ -103,11 +103,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when new data arrives for a subscription.
///
public void OnDataChange(
- int dwTransactionID,
- int hrStatus,
- int dwNumItems,
+ int dwTransactionID,
+ int hrStatus,
+ int dwNumItems,
OPCHDA_ITEM[] pItemValues,
- int[] phrErrors)
+ int[] phrErrors)
{
try
{
@@ -130,7 +130,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
results[ii].ServerHandle = results[ii].ClientHandle;
results[ii].ClientHandle = null;
- results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
+ results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
}
// invoke callback - remove request if unexpected error occured.
@@ -150,11 +150,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when an asynchronous read request completes.
///
public void OnReadComplete(
- int dwTransactionID,
- int hrStatus,
- int dwNumItems,
+ int dwTransactionID,
+ int hrStatus,
+ int dwNumItems,
OPCHDA_ITEM[] pItemValues,
- int[] phrErrors)
+ int[] phrErrors)
{
try
{
@@ -176,7 +176,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
results[ii] = Interop.GetItemValueCollection(pItemValues[ii], false);
results[ii].ServerHandle = pItemValues[ii].hClient;
- results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
+ results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
}
// invoke callback - remove request if all results arrived.
@@ -196,11 +196,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when an asynchronous read modified request completes.
///
public void OnReadModifiedComplete(
- int dwTransactionID,
- int hrStatus,
- int dwNumItems,
+ int dwTransactionID,
+ int hrStatus,
+ int dwNumItems,
OPCHDA_MODIFIEDITEM[] pItemValues,
- int[] phrErrors)
+ int[] phrErrors)
{
try
{
@@ -222,7 +222,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
results[ii] = Interop.GetModifiedValueCollection(pItemValues[ii], false);
results[ii].ServerHandle = pItemValues[ii].hClient;
- results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
+ results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
}
// invoke callback - remove request if all results arrived.
@@ -242,12 +242,12 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when an asynchronous read attributes request completes.
///
public void OnReadAttributeComplete(
- int dwTransactionID,
- int hrStatus,
- int hClient,
- int dwNumItems,
+ int dwTransactionID,
+ int hrStatus,
+ int hClient,
+ int dwNumItems,
OPCHDA_ATTRIBUTE[] pAttributeValues,
- int[] phrErrors)
+ int[] phrErrors)
{
try
{
@@ -273,7 +273,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
results[ii] = Interop.GetAttributeValueCollection(pAttributeValues[ii], false);
results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
-
+
item.Add(results[ii]);
}
@@ -294,11 +294,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when an asynchronous read annotations request completes.
///
public void OnReadAnnotations(
- int dwTransactionID,
- int hrStatus,
- int dwNumItems,
+ int dwTransactionID,
+ int hrStatus,
+ int dwNumItems,
OPCHDA_ANNOTATION[] pAnnotationValues,
- int[] phrErrors)
+ int[] phrErrors)
{
try
{
@@ -320,7 +320,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
results[ii] = Interop.GetAnnotationValueCollection(pAnnotationValues[ii], false);
results[ii].ServerHandle = pAnnotationValues[ii].hClient;
- results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
+ results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
}
// invoke callback - remove request if all results arrived.
@@ -340,10 +340,10 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when an asynchronous insert annotations request completes.
///
public void OnInsertAnnotations(
- int dwTransactionID,
- int hrStatus,
- int dwCount,
- int[] phClients,
+ int dwTransactionID,
+ int hrStatus,
+ int dwCount,
+ int[] phClients,
int[] phrErrors)
{
@@ -376,7 +376,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
itemResults.ServerHandle = currentHandle;
results.Add(itemResults);
-
+
currentHandle = phClients[ii];
itemResults = new TsCHdaResultCollection();
}
@@ -407,11 +407,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when a batch of data from playback request arrives.
///
public void OnPlayback(
- int dwTransactionID,
- int hrStatus,
- int dwNumItems,
+ int dwTransactionID,
+ int hrStatus,
+ int dwNumItems,
IntPtr ppItemValues,
- int[] phrErrors)
+ int[] phrErrors)
{
try
{
@@ -436,16 +436,16 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
// get pointer to item.
var pItem = (IntPtr)pItems[ii];
-
+
// unmarshal item as an array of length 1.
var item = Interop.GetItemValueCollections(ref pItem, 1, false);
if (item != null && item.Length == 1)
{
- results[ii] = item[0];
+ results[ii] = item[0];
results[ii].ServerHandle = results[ii].ClientHandle;
results[ii].ClientHandle = null;
- results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
+ results[ii].Result = Utilities.Interop.GetResultId(phrErrors[ii]);
}
}
@@ -466,10 +466,10 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Called when an asynchronous update request completes.
///
public void OnUpdateComplete(
- int dwTransactionID,
- int hrStatus,
- int dwCount,
- int[] phClients,
+ int dwTransactionID,
+ int hrStatus,
+ int dwCount,
+ int[] phClients,
int[] phrErrors)
{
try
@@ -501,7 +501,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
itemResults.ServerHandle = currentHandle;
results.Add(itemResults);
-
+
currentHandle = phClients[ii];
itemResults = new TsCHdaResultCollection();
}
@@ -583,9 +583,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
#endregion
#region Private Members
- private int m_nextID;
+ private int m_nextID;
private Hashtable m_requests = new Hashtable();
- private TsCHdaCallbackExceptionEventHandler _callbackExceptionEvent;
+ private TsCHdaCallbackExceptionEventHandler _callbackExceptionEvent;
#endregion
}
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Hda/Interop.cs b/Technosoftware/DaAeHdaClient.Com/Hda/Interop.cs
index 6fc417b..9016947 100644
--- a/Technosoftware/DaAeHdaClient.Com/Hda/Interop.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Hda/Interop.cs
@@ -32,410 +32,410 @@ using Technosoftware.DaAeHdaClient.Hda;
namespace Technosoftware.DaAeHdaClient.Com.Hda
{
- ///
+ ///
/// Contains state information for a single asynchronous Technosoftware.DaAeHdaClient.Com.Hda.Interop.
- ///
- internal class Interop
- {
- ///
- /// Converts a standard FILETIME to an OpcRcw.Da.FILETIME structure.
- ///
- internal static OpcRcw.Hda.OPCHDA_FILETIME Convert(FILETIME input)
- {
- var output = new OpcRcw.Hda.OPCHDA_FILETIME();
- output.dwLowDateTime = input.dwLowDateTime;
- output.dwHighDateTime = input.dwHighDateTime;
- return output;
- }
+ ///
+ internal class Interop
+ {
+ ///
+ /// Converts a standard FILETIME to an OpcRcw.Da.FILETIME structure.
+ ///
+ internal static OpcRcw.Hda.OPCHDA_FILETIME Convert(FILETIME input)
+ {
+ var output = new OpcRcw.Hda.OPCHDA_FILETIME();
+ output.dwLowDateTime = input.dwLowDateTime;
+ output.dwHighDateTime = input.dwHighDateTime;
+ return output;
+ }
- ///
- /// Converts an OpcRcw.Da.FILETIME to a standard FILETIME structure.
- ///
- internal static FILETIME Convert(OpcRcw.Hda.OPCHDA_FILETIME input)
- {
- var output = new FILETIME();
- output.dwLowDateTime = input.dwLowDateTime;
- output.dwHighDateTime = input.dwHighDateTime;
- return output;
- }
+ ///
+ /// Converts an OpcRcw.Da.FILETIME to a standard FILETIME structure.
+ ///
+ internal static FILETIME Convert(OpcRcw.Hda.OPCHDA_FILETIME input)
+ {
+ var output = new FILETIME();
+ output.dwLowDateTime = input.dwLowDateTime;
+ output.dwHighDateTime = input.dwHighDateTime;
+ return output;
+ }
- ///
- /// Converts a decimal value to a OpcRcw.Hda.OPCHDA_TIME structure.
- ///
- internal static OpcRcw.Hda.OPCHDA_FILETIME GetFILETIME(decimal input)
- {
- var output = new OpcRcw.Hda.OPCHDA_FILETIME();
+ ///
+ /// Converts a decimal value to a OpcRcw.Hda.OPCHDA_TIME structure.
+ ///
+ internal static OpcRcw.Hda.OPCHDA_FILETIME GetFILETIME(decimal input)
+ {
+ var output = new OpcRcw.Hda.OPCHDA_FILETIME();
- output.dwHighDateTime = (int)((((ulong)(input*10000000)) & 0xFFFFFFFF00000000)>>32);
- output.dwLowDateTime = (int)((((ulong)(input*10000000)) & 0x00000000FFFFFFFF));
+ output.dwHighDateTime = (int)((((ulong)(input * 10000000)) & 0xFFFFFFFF00000000) >> 32);
+ output.dwLowDateTime = (int)((((ulong)(input * 10000000)) & 0x00000000FFFFFFFF));
- return output;
- }
+ return output;
+ }
- ///
- /// Returns an array of FILETIMEs.
- ///
- internal static OpcRcw.Hda.OPCHDA_FILETIME[] GetFILETIMEs(DateTime[] input)
- {
+ ///
+ /// Returns an array of FILETIMEs.
+ ///
+ internal static OpcRcw.Hda.OPCHDA_FILETIME[] GetFILETIMEs(DateTime[] input)
+ {
OpcRcw.Hda.OPCHDA_FILETIME[] output = null;
- if (input != null)
- {
- output = new OpcRcw.Hda.OPCHDA_FILETIME[input.Length];
+ if (input != null)
+ {
+ output = new OpcRcw.Hda.OPCHDA_FILETIME[input.Length];
- for (var ii = 0; ii < input.Length; ii++)
- {
- output[ii] = Convert(Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(input[ii]));
- }
- }
+ for (var ii = 0; ii < input.Length; ii++)
+ {
+ output[ii] = Convert(Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(input[ii]));
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Converts a Technosoftware.DaAeHdaClient.Time object to a Technosoftware.DaAeHdaClient.Com.Hda.OPCHDA_TIME structure.
- ///
- internal static OpcRcw.Hda.OPCHDA_TIME GetTime(TsCHdaTime input)
- {
- var output = new OpcRcw.Hda.OPCHDA_TIME();
+ ///
+ /// Converts a Technosoftware.DaAeHdaClient.Time object to a Technosoftware.DaAeHdaClient.Com.Hda.OPCHDA_TIME structure.
+ ///
+ internal static OpcRcw.Hda.OPCHDA_TIME GetTime(TsCHdaTime input)
+ {
+ var output = new OpcRcw.Hda.OPCHDA_TIME();
- if (input != null)
- {
- output.ftTime = Convert(Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(input.AbsoluteTime));
- output.szTime = (input.IsRelative)?input.ToString():"";
- output.bString = (input.IsRelative)?1:0;
- }
+ if (input != null)
+ {
+ output.ftTime = Convert(Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(input.AbsoluteTime));
+ output.szTime = (input.IsRelative) ? input.ToString() : "";
+ output.bString = (input.IsRelative) ? 1 : 0;
+ }
- // create a null value for a time structure.
- else
- {
- output.ftTime = Convert(Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(DateTime.MinValue));
- output.szTime = "";
- output.bString = 1;
- }
+ // create a null value for a time structure.
+ else
+ {
+ output.ftTime = Convert(Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(DateTime.MinValue));
+ output.szTime = "";
+ output.bString = 1;
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an array of OPCHDA_ITEM structures.
- ///
- internal static TsCHdaItemValueCollection[] GetItemValueCollections(ref IntPtr pInput, int count, bool deallocate)
- {
- TsCHdaItemValueCollection[] output = null;
+ ///
+ /// Unmarshals and deallocates an array of OPCHDA_ITEM structures.
+ ///
+ internal static TsCHdaItemValueCollection[] GetItemValueCollections(ref IntPtr pInput, int count, bool deallocate)
+ {
+ TsCHdaItemValueCollection[] output = null;
- if (pInput != IntPtr.Zero && count > 0)
- {
- output = new TsCHdaItemValueCollection[count];
+ if (pInput != IntPtr.Zero && count > 0)
+ {
+ output = new TsCHdaItemValueCollection[count];
- var pos = pInput;
+ var pos = pInput;
- for (var ii = 0; ii < count; ii++)
- {
- output[ii] = GetItemValueCollection(pos, deallocate);
+ for (var ii = 0; ii < count; ii++)
+ {
+ output[ii] = GetItemValueCollection(pos, deallocate);
pos = (IntPtr)(pos.ToInt64() + Marshal.SizeOf(typeof(OpcRcw.Hda.OPCHDA_ITEM)));
- }
+ }
- if (deallocate)
- {
- Marshal.FreeCoTaskMem(pInput);
- pInput = IntPtr.Zero;
- }
- }
+ if (deallocate)
+ {
+ Marshal.FreeCoTaskMem(pInput);
+ pInput = IntPtr.Zero;
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_ITEM structure.
- ///
- internal static TsCHdaItemValueCollection GetItemValueCollection(IntPtr pInput, bool deallocate)
- {
- TsCHdaItemValueCollection output = null;
+ ///
+ /// Unmarshals and deallocates an OPCHDA_ITEM structure.
+ ///
+ internal static TsCHdaItemValueCollection GetItemValueCollection(IntPtr pInput, bool deallocate)
+ {
+ TsCHdaItemValueCollection output = null;
- if (pInput != IntPtr.Zero)
- {
- var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ITEM));
+ if (pInput != IntPtr.Zero)
+ {
+ var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ITEM));
- output = GetItemValueCollection((OpcRcw.Hda.OPCHDA_ITEM)item, deallocate);
+ output = GetItemValueCollection((OpcRcw.Hda.OPCHDA_ITEM)item, deallocate);
- if (deallocate)
- {
- Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ITEM));
- }
- }
+ if (deallocate)
+ {
+ Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ITEM));
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_ITEM structure.
- ///
- internal static TsCHdaItemValueCollection GetItemValueCollection(OpcRcw.Hda.OPCHDA_ITEM input, bool deallocate)
- {
- var output = new TsCHdaItemValueCollection();
+ ///
+ /// Unmarshals and deallocates an OPCHDA_ITEM structure.
+ ///
+ internal static TsCHdaItemValueCollection GetItemValueCollection(OpcRcw.Hda.OPCHDA_ITEM input, bool deallocate)
+ {
+ var output = new TsCHdaItemValueCollection();
- output.ClientHandle = input.hClient;
- output.Aggregate = input.haAggregate;
+ output.ClientHandle = input.hClient;
+ output.Aggregate = input.haAggregate;
var values = Com.Interop.GetVARIANTs(ref input.pvDataValues, input.dwCount, deallocate);
- var timestamps = Utilities.Interop.GetDateTimes(ref input.pftTimeStamps, input.dwCount, deallocate);
- var qualities = Utilities.Interop.GetInt32s(ref input.pdwQualities, input.dwCount, deallocate);
+ var timestamps = Utilities.Interop.GetDateTimes(ref input.pftTimeStamps, input.dwCount, deallocate);
+ var qualities = Utilities.Interop.GetInt32s(ref input.pdwQualities, input.dwCount, deallocate);
- for (var ii = 0; ii < input.dwCount; ii++)
- {
- var value = new TsCHdaItemValue();
+ for (var ii = 0; ii < input.dwCount; ii++)
+ {
+ var value = new TsCHdaItemValue();
- value.Value = values[ii];
- value.Timestamp = timestamps[ii];
+ value.Value = values[ii];
+ value.Timestamp = timestamps[ii];
value.Quality = new TsCDaQuality((short)(qualities[ii] & 0x0000FFFF));
value.HistorianQuality = (TsCHdaQuality)((int)(qualities[ii] & 0xFFFF0000));
- output.Add(value);
- }
+ output.Add(value);
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an array of OPCHDA_MODIFIEDITEM structures.
- ///
- internal static TsCHdaModifiedValueCollection[] GetModifiedValueCollections(ref IntPtr pInput, int count, bool deallocate)
- {
- TsCHdaModifiedValueCollection[] output = null;
+ ///
+ /// Unmarshals and deallocates an array of OPCHDA_MODIFIEDITEM structures.
+ ///
+ internal static TsCHdaModifiedValueCollection[] GetModifiedValueCollections(ref IntPtr pInput, int count, bool deallocate)
+ {
+ TsCHdaModifiedValueCollection[] output = null;
- if (pInput != IntPtr.Zero && count > 0)
- {
- output = new TsCHdaModifiedValueCollection[count];
+ if (pInput != IntPtr.Zero && count > 0)
+ {
+ output = new TsCHdaModifiedValueCollection[count];
- var pos = pInput;
+ var pos = pInput;
- for (var ii = 0; ii < count; ii++)
- {
- output[ii] = GetModifiedValueCollection(pos, deallocate);
+ for (var ii = 0; ii < count; ii++)
+ {
+ output[ii] = GetModifiedValueCollection(pos, deallocate);
pos = (IntPtr)(pos.ToInt64() + Marshal.SizeOf(typeof(OpcRcw.Hda.OPCHDA_MODIFIEDITEM)));
- }
+ }
- if (deallocate)
- {
- Marshal.FreeCoTaskMem(pInput);
- pInput = IntPtr.Zero;
- }
- }
+ if (deallocate)
+ {
+ Marshal.FreeCoTaskMem(pInput);
+ pInput = IntPtr.Zero;
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_MODIFIEDITEM structure.
- ///
- internal static TsCHdaModifiedValueCollection GetModifiedValueCollection(IntPtr pInput, bool deallocate)
- {
- TsCHdaModifiedValueCollection output = null;
+ ///
+ /// Unmarshals and deallocates an OPCHDA_MODIFIEDITEM structure.
+ ///
+ internal static TsCHdaModifiedValueCollection GetModifiedValueCollection(IntPtr pInput, bool deallocate)
+ {
+ TsCHdaModifiedValueCollection output = null;
- if (pInput != IntPtr.Zero)
- {
- var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_MODIFIEDITEM));
+ if (pInput != IntPtr.Zero)
+ {
+ var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_MODIFIEDITEM));
- output = GetModifiedValueCollection((OpcRcw.Hda.OPCHDA_MODIFIEDITEM)item, deallocate);
+ output = GetModifiedValueCollection((OpcRcw.Hda.OPCHDA_MODIFIEDITEM)item, deallocate);
- if (deallocate)
- {
- Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_MODIFIEDITEM));
- }
- }
+ if (deallocate)
+ {
+ Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_MODIFIEDITEM));
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_MODIFIEDITEM structure.
- ///
- internal static TsCHdaModifiedValueCollection GetModifiedValueCollection(OpcRcw.Hda.OPCHDA_MODIFIEDITEM input, bool deallocate)
- {
- var output = new TsCHdaModifiedValueCollection();
+ ///
+ /// Unmarshals and deallocates an OPCHDA_MODIFIEDITEM structure.
+ ///
+ internal static TsCHdaModifiedValueCollection GetModifiedValueCollection(OpcRcw.Hda.OPCHDA_MODIFIEDITEM input, bool deallocate)
+ {
+ var output = new TsCHdaModifiedValueCollection();
- output.ClientHandle = input.hClient;
+ output.ClientHandle = input.hClient;
var values = Com.Interop.GetVARIANTs(ref input.pvDataValues, input.dwCount, deallocate);
- var timestamps = Utilities.Interop.GetDateTimes(ref input.pftTimeStamps, input.dwCount, deallocate);
- var qualities = Utilities.Interop.GetInt32s(ref input.pdwQualities, input.dwCount, deallocate);
- var modificationTimes = Utilities.Interop.GetDateTimes(ref input.pftModificationTime, input.dwCount, deallocate);
- var editTypes = Utilities.Interop.GetInt32s(ref input.pEditType, input.dwCount, deallocate);
- var users = Utilities.Interop.GetUnicodeStrings(ref input.szUser, input.dwCount, deallocate);
+ var timestamps = Utilities.Interop.GetDateTimes(ref input.pftTimeStamps, input.dwCount, deallocate);
+ var qualities = Utilities.Interop.GetInt32s(ref input.pdwQualities, input.dwCount, deallocate);
+ var modificationTimes = Utilities.Interop.GetDateTimes(ref input.pftModificationTime, input.dwCount, deallocate);
+ var editTypes = Utilities.Interop.GetInt32s(ref input.pEditType, input.dwCount, deallocate);
+ var users = Utilities.Interop.GetUnicodeStrings(ref input.szUser, input.dwCount, deallocate);
- for (var ii = 0; ii < input.dwCount; ii++)
- {
- var value = new TsCHdaModifiedValue();
+ for (var ii = 0; ii < input.dwCount; ii++)
+ {
+ var value = new TsCHdaModifiedValue();
- value.Value = values[ii];
- value.Timestamp = timestamps[ii];
+ value.Value = values[ii];
+ value.Timestamp = timestamps[ii];
value.Quality = new TsCDaQuality((short)(qualities[ii] & 0x0000FFFF));
value.HistorianQuality = (TsCHdaQuality)((int)(qualities[ii] & 0xFFFF0000));
- value.ModificationTime = modificationTimes[ii];
- value.EditType = (TsCHdaEditType)editTypes[ii];
- value.User = users[ii];
+ value.ModificationTime = modificationTimes[ii];
+ value.EditType = (TsCHdaEditType)editTypes[ii];
+ value.User = users[ii];
- output.Add(value);
- }
+ output.Add(value);
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an array of OPCHDA_ATTRIBUTE structures.
- ///
- internal static TsCHdaAttributeValueCollection[] GetAttributeValueCollections(ref IntPtr pInput, int count, bool deallocate)
- {
- TsCHdaAttributeValueCollection[] output = null;
+ ///
+ /// Unmarshals and deallocates an array of OPCHDA_ATTRIBUTE structures.
+ ///
+ internal static TsCHdaAttributeValueCollection[] GetAttributeValueCollections(ref IntPtr pInput, int count, bool deallocate)
+ {
+ TsCHdaAttributeValueCollection[] output = null;
- if (pInput != IntPtr.Zero && count > 0)
- {
- output = new TsCHdaAttributeValueCollection[count];
+ if (pInput != IntPtr.Zero && count > 0)
+ {
+ output = new TsCHdaAttributeValueCollection[count];
- var pos = pInput;
+ var pos = pInput;
- for (var ii = 0; ii < count; ii++)
- {
- output[ii] = GetAttributeValueCollection(pos, deallocate);
+ for (var ii = 0; ii < count; ii++)
+ {
+ output[ii] = GetAttributeValueCollection(pos, deallocate);
pos = (IntPtr)(pos.ToInt64() + Marshal.SizeOf(typeof(OpcRcw.Hda.OPCHDA_ATTRIBUTE)));
- }
+ }
- if (deallocate)
- {
- Marshal.FreeCoTaskMem(pInput);
- pInput = IntPtr.Zero;
- }
- }
+ if (deallocate)
+ {
+ Marshal.FreeCoTaskMem(pInput);
+ pInput = IntPtr.Zero;
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_ATTRIBUTE structure.
- ///
- internal static TsCHdaAttributeValueCollection GetAttributeValueCollection(IntPtr pInput, bool deallocate)
- {
- TsCHdaAttributeValueCollection output = null;
+ ///
+ /// Unmarshals and deallocates an OPCHDA_ATTRIBUTE structure.
+ ///
+ internal static TsCHdaAttributeValueCollection GetAttributeValueCollection(IntPtr pInput, bool deallocate)
+ {
+ TsCHdaAttributeValueCollection output = null;
- if (pInput != IntPtr.Zero)
- {
- var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ATTRIBUTE));
+ if (pInput != IntPtr.Zero)
+ {
+ var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ATTRIBUTE));
- output = GetAttributeValueCollection((OpcRcw.Hda.OPCHDA_ATTRIBUTE)item, deallocate);
+ output = GetAttributeValueCollection((OpcRcw.Hda.OPCHDA_ATTRIBUTE)item, deallocate);
- if (deallocate)
- {
- Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ATTRIBUTE));
- }
- }
+ if (deallocate)
+ {
+ Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ATTRIBUTE));
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_ATTRIBUTE structure.
- ///
- internal static TsCHdaAttributeValueCollection GetAttributeValueCollection(OpcRcw.Hda.OPCHDA_ATTRIBUTE input, bool deallocate)
- {
- var output = new TsCHdaAttributeValueCollection();
+ ///
+ /// Unmarshals and deallocates an OPCHDA_ATTRIBUTE structure.
+ ///
+ internal static TsCHdaAttributeValueCollection GetAttributeValueCollection(OpcRcw.Hda.OPCHDA_ATTRIBUTE input, bool deallocate)
+ {
+ var output = new TsCHdaAttributeValueCollection();
- output.AttributeID = input.dwAttributeID;
+ output.AttributeID = input.dwAttributeID;
var values = Com.Interop.GetVARIANTs(ref input.vAttributeValues, input.dwNumValues, deallocate);
- var timestamps = Utilities.Interop.GetDateTimes(ref input.ftTimeStamps, input.dwNumValues, deallocate);
+ var timestamps = Utilities.Interop.GetDateTimes(ref input.ftTimeStamps, input.dwNumValues, deallocate);
- for (var ii = 0; ii < input.dwNumValues; ii++)
- {
- var value = new TsCHdaAttributeValue();
+ for (var ii = 0; ii < input.dwNumValues; ii++)
+ {
+ var value = new TsCHdaAttributeValue();
- value.Value = values[ii];
- value.Timestamp = timestamps[ii];
+ value.Value = values[ii];
+ value.Timestamp = timestamps[ii];
- output.Add(value);
- }
+ output.Add(value);
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an array of OPCHDA_ANNOTATION structures.
- ///
- internal static TsCHdaAnnotationValueCollection[] GetAnnotationValueCollections(ref IntPtr pInput, int count, bool deallocate)
- {
- TsCHdaAnnotationValueCollection[] output = null;
+ ///
+ /// Unmarshals and deallocates an array of OPCHDA_ANNOTATION structures.
+ ///
+ internal static TsCHdaAnnotationValueCollection[] GetAnnotationValueCollections(ref IntPtr pInput, int count, bool deallocate)
+ {
+ TsCHdaAnnotationValueCollection[] output = null;
- if (pInput != IntPtr.Zero && count > 0)
- {
- output = new TsCHdaAnnotationValueCollection[count];
+ if (pInput != IntPtr.Zero && count > 0)
+ {
+ output = new TsCHdaAnnotationValueCollection[count];
- var pos = pInput;
+ var pos = pInput;
- for (var ii = 0; ii < count; ii++)
- {
- output[ii] = GetAnnotationValueCollection(pos, deallocate);
+ for (var ii = 0; ii < count; ii++)
+ {
+ output[ii] = GetAnnotationValueCollection(pos, deallocate);
pos = (IntPtr)(pos.ToInt64() + Marshal.SizeOf(typeof(OpcRcw.Hda.OPCHDA_ANNOTATION)));
- }
+ }
- if (deallocate)
- {
- Marshal.FreeCoTaskMem(pInput);
- pInput = IntPtr.Zero;
- }
- }
+ if (deallocate)
+ {
+ Marshal.FreeCoTaskMem(pInput);
+ pInput = IntPtr.Zero;
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_ANNOTATION structure.
- ///
- internal static TsCHdaAnnotationValueCollection GetAnnotationValueCollection(IntPtr pInput, bool deallocate)
- {
- TsCHdaAnnotationValueCollection output = null;
+ ///
+ /// Unmarshals and deallocates an OPCHDA_ANNOTATION structure.
+ ///
+ internal static TsCHdaAnnotationValueCollection GetAnnotationValueCollection(IntPtr pInput, bool deallocate)
+ {
+ TsCHdaAnnotationValueCollection output = null;
- if (pInput != IntPtr.Zero)
- {
- var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ANNOTATION));
+ if (pInput != IntPtr.Zero)
+ {
+ var item = Marshal.PtrToStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ANNOTATION));
- output = GetAnnotationValueCollection((OpcRcw.Hda.OPCHDA_ANNOTATION)item, deallocate);
+ output = GetAnnotationValueCollection((OpcRcw.Hda.OPCHDA_ANNOTATION)item, deallocate);
- if (deallocate)
- {
- Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ANNOTATION));
- }
- }
+ if (deallocate)
+ {
+ Marshal.DestroyStructure(pInput, typeof(OpcRcw.Hda.OPCHDA_ANNOTATION));
+ }
+ }
- return output;
- }
+ return output;
+ }
- ///
- /// Unmarshals and deallocates an OPCHDA_ANNOTATION structure.
- ///
- internal static TsCHdaAnnotationValueCollection GetAnnotationValueCollection(OpcRcw.Hda.OPCHDA_ANNOTATION input, bool deallocate)
- {
- var output = new TsCHdaAnnotationValueCollection();
+ ///
+ /// Unmarshals and deallocates an OPCHDA_ANNOTATION structure.
+ ///
+ internal static TsCHdaAnnotationValueCollection GetAnnotationValueCollection(OpcRcw.Hda.OPCHDA_ANNOTATION input, bool deallocate)
+ {
+ var output = new TsCHdaAnnotationValueCollection();
- output.ClientHandle = input.hClient;
+ output.ClientHandle = input.hClient;
- var timestamps = Utilities.Interop.GetDateTimes(ref input.ftTimeStamps, input.dwNumValues, deallocate);
- var annotations = Utilities.Interop.GetUnicodeStrings(ref input.szAnnotation, input.dwNumValues, deallocate);
- var creationTimes = Utilities.Interop.GetDateTimes(ref input.ftAnnotationTime, input.dwNumValues, deallocate);
- var users = Utilities.Interop.GetUnicodeStrings(ref input.szUser, input.dwNumValues, deallocate);
+ var timestamps = Utilities.Interop.GetDateTimes(ref input.ftTimeStamps, input.dwNumValues, deallocate);
+ var annotations = Utilities.Interop.GetUnicodeStrings(ref input.szAnnotation, input.dwNumValues, deallocate);
+ var creationTimes = Utilities.Interop.GetDateTimes(ref input.ftAnnotationTime, input.dwNumValues, deallocate);
+ var users = Utilities.Interop.GetUnicodeStrings(ref input.szUser, input.dwNumValues, deallocate);
- for (var ii = 0; ii < input.dwNumValues; ii++)
- {
- var value = new TsCHdaAnnotationValue();
+ for (var ii = 0; ii < input.dwNumValues; ii++)
+ {
+ var value = new TsCHdaAnnotationValue();
- value.Timestamp = timestamps[ii];
- value.Annotation = annotations[ii];
- value.CreationTime = creationTimes[ii];
- value.User = users[ii];
+ value.Timestamp = timestamps[ii];
+ value.Annotation = annotations[ii];
+ value.CreationTime = creationTimes[ii];
+ value.User = users[ii];
- output.Add(value);
- }
+ output.Add(value);
+ }
- return output;
- }
- }
+ return output;
+ }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Hda/Request.cs b/Technosoftware/DaAeHdaClient.Com/Hda/Request.cs
index 11d16d1..9c61fbe 100644
--- a/Technosoftware/DaAeHdaClient.Com/Hda/Request.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Hda/Request.cs
@@ -58,10 +58,10 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// Initializes the object with all required information.
///
public Request(object requestHandle, Delegate callback, int requestID)
- {
- m_requestHandle = requestHandle;
- m_callback = callback;
- m_requestID = requestID;
+ {
+ m_requestHandle = requestHandle;
+ m_callback = callback;
+ m_requestID = requestID;
}
///
@@ -72,7 +72,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
lock (this)
{
// save the server assigned id.
- m_cancelID = cancelID;
+ m_cancelID = cancelID;
// create a table of items indexed by the handle returned by the server in a callback.
m_items = new Hashtable();
@@ -140,25 +140,25 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
return InvokeCallback((TsCHdaReadValuesCompleteEventHandler)m_callback, results);
}
-
+
// invoke read attributes completed callback.
if (typeof(TsCHdaReadAttributesCompleteEventHandler).IsInstanceOfType(m_callback))
{
return InvokeCallback((TsCHdaReadAttributesCompleteEventHandler)m_callback, results);
}
-
+
// invoke read annotations completed callback.
if (typeof(TsCHdaReadAnnotationsCompleteEventHandler).IsInstanceOfType(m_callback))
{
return InvokeCallback((TsCHdaReadAnnotationsCompleteEventHandler)m_callback, results);
}
-
+
// invoke update completed callback.
if (typeof(TsCHdaUpdateCompleteEventHandler).IsInstanceOfType(m_callback))
{
return InvokeCallback((TsCHdaUpdateCompleteEventHandler)m_callback, results);
}
-
+
// callback not supported.
return true;
}
@@ -227,11 +227,11 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
callback(this, values);
}
- catch
+ catch
{
// ignore exceptions in the callbacks.
}
-
+
// request never completes.
return false;
}
@@ -256,7 +256,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
callback(this, values);
}
- catch
+ catch
{
// ignore exceptions in the callbacks.
}
@@ -272,7 +272,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
// request is complete.
return true;
- }
+ }
///
/// Invokes callback for a read attributes request.
@@ -294,7 +294,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
callback(this, values);
}
- catch
+ catch
{
// ignore exceptions in the callbacks.
}
@@ -302,7 +302,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
// request always completes
return true;
}
-
+
///
/// Invokes callback for a read annotations request.
///
@@ -323,7 +323,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
callback(this, values);
}
- catch
+ catch
{
// ignore exceptions in the callbacks.
}
@@ -352,7 +352,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
{
callback(this, values);
}
- catch
+ catch
{
// ignore exceptions in the callbacks.
}
@@ -372,7 +372,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
if (typeof(ITsCHdaActualTime).IsInstanceOfType(result))
{
((ITsCHdaActualTime)result).StartTime = StartTime;
- ((ITsCHdaActualTime)result).EndTime = EndTime;
+ ((ITsCHdaActualTime)result).EndTime = EndTime;
}
// add item identifier to value collection.
@@ -380,8 +380,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
if (itemID != null)
{
- result.ItemName = itemID.ItemName;
- result.ItemPath = itemID.ItemPath;
+ result.ItemName = itemID.ItemName;
+ result.ItemPath = itemID.ItemPath;
result.ServerHandle = itemID.ServerHandle;
result.ClientHandle = itemID.ClientHandle;
}
@@ -390,9 +390,9 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
#endregion
#region Private Members
- private object m_requestHandle = null;
- private Delegate m_callback = null;
- private int m_requestID = 0;
+ private object m_requestHandle = null;
+ private Delegate m_callback = null;
+ private int m_requestID = 0;
private int m_cancelID = 0;
private DateTime m_startTime = DateTime.MinValue;
private DateTime m_endTime = DateTime.MinValue;
diff --git a/Technosoftware/DaAeHdaClient.Com/Hda/Result.cs b/Technosoftware/DaAeHdaClient.Com/Hda/Result.cs
index 161935f..eccab2a 100644
--- a/Technosoftware/DaAeHdaClient.Com/Hda/Result.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Hda/Result.cs
@@ -32,37 +32,37 @@ namespace Technosoftware.DaAeHdaClient.Com
/// Defines all well known COM HDA HRESULT codes.
///
internal struct Result
- {
+ {
///
- public const int E_MAXEXCEEDED = -0X3FFBEFFF; // 0xC0041001
+ public const int E_MAXEXCEEDED = -0X3FFBEFFF; // 0xC0041001
///
- public const int S_NODATA = +0x40041002; // 0x40041002
+ public const int S_NODATA = +0x40041002; // 0x40041002
///
- public const int S_MOREDATA = +0x40041003; // 0x40041003
+ public const int S_MOREDATA = +0x40041003; // 0x40041003
///
public const int E_INVALIDAGGREGATE = -0X3FFBEFFC; // 0xC0041004
///
- public const int S_CURRENTVALUE = +0x40041005; // 0x40041005
+ public const int S_CURRENTVALUE = +0x40041005; // 0x40041005
///
- public const int S_EXTRADATA = +0x40041006; // 0x40041006
+ public const int S_EXTRADATA = +0x40041006; // 0x40041006
///
- public const int W_NOFILTER = -0x7FFBEFF9; // 0x80041007
+ public const int W_NOFILTER = -0x7FFBEFF9; // 0x80041007
///
- public const int E_UNKNOWNATTRID = -0x3FFBEFF8; // 0xC0041008
+ public const int E_UNKNOWNATTRID = -0x3FFBEFF8; // 0xC0041008
///
- public const int E_NOT_AVAIL = -0x3FFBEFF7; // 0xC0041009
+ public const int E_NOT_AVAIL = -0x3FFBEFF7; // 0xC0041009
///
- public const int E_INVALIDDATATYPE = -0x3FFBEFF6; // 0xC004100A
+ public const int E_INVALIDDATATYPE = -0x3FFBEFF6; // 0xC004100A
///
- public const int E_DATAEXISTS = -0x3FFBEFF5; // 0xC004100B
+ public const int E_DATAEXISTS = -0x3FFBEFF5; // 0xC004100B
///
- public const int E_INVALIDATTRID = -0x3FFBEFF4; // 0xC004100C
+ public const int E_INVALIDATTRID = -0x3FFBEFF4; // 0xC004100C
///
- public const int E_NODATAEXISTS = -0x3FFBEFF3; // 0xC004100D
+ public const int E_NODATAEXISTS = -0x3FFBEFF3; // 0xC004100D
///
- public const int S_INSERTED = +0x4004100E; // 0x4004100E
+ public const int S_INSERTED = +0x4004100E; // 0x4004100E
///
- public const int S_REPLACED = +0x4004100F; // 0x4004100F
+ public const int S_REPLACED = +0x4004100F; // 0x4004100F
}
}
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Hda/Server.cs b/Technosoftware/DaAeHdaClient.Com/Hda/Server.cs
index 8f763ae..c089a20 100644
--- a/Technosoftware/DaAeHdaClient.Com/Hda/Server.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Hda/Server.cs
@@ -3175,8 +3175,8 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
OPCHDA_TIME pEndTime)
{
// unmarshal actual times from input arguments.
- var startTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Interop.Convert(pStartTime.ftTime));
- var endTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Interop.Convert(pEndTime.ftTime));
+ var startTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Interop.Convert(pStartTime.ftTime));
+ var endTime = Technosoftware.DaAeHdaClient.Com.Interop.GetFILETIME(Interop.Convert(pEndTime.ftTime));
foreach (var result in results)
{
@@ -3466,7 +3466,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Hda
/// The synchronization object for subscription access
///
private static volatile object lock_ = new object();
-
+
private bool disposed_ = false;
#endregion
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Interop.cs b/Technosoftware/DaAeHdaClient.Com/Interop.cs
index fadc18e..4d3dcab 100644
--- a/Technosoftware/DaAeHdaClient.Com/Interop.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Interop.cs
@@ -22,12 +22,11 @@
#region Using Directives
using System;
-using System.Net;
using System.Globalization;
+using System.Net;
using System.Runtime.InteropServices;
-
-using Technosoftware.DaAeHdaClient.Da;
using Technosoftware.DaAeHdaClient.Com.Utilities;
+using Technosoftware.DaAeHdaClient.Da;
#endregion
#pragma warning disable 0618
@@ -598,10 +597,10 @@ namespace Technosoftware.DaAeHdaClient.Com
clsctx,
ref coserverInfo,
1,
- results);
+ results);
}
finally
- {
+ {
if (hIID.IsAllocated) hIID.Free();
serverInfo.Deallocate();
@@ -859,7 +858,8 @@ namespace Technosoftware.DaAeHdaClient.Com
///
/// This flag suppresses the conversion to local time done during marshalling.
///
- public static bool PreserveUtc {
+ public static bool PreserveUtc
+ {
get { lock (typeof(Interop)) { return DaAeHdaClient.ApplicationInstance.TimeAsUtc; } }
set { lock (typeof(Interop)) { DaAeHdaClient.ApplicationInstance.TimeAsUtc = value; } }
}
@@ -1387,22 +1387,22 @@ namespace Technosoftware.DaAeHdaClient.Com
case Ae.Result.E_NOINFO: return new OpcResult(OpcResult.Ae.E_NOINFO, input);
default:
- {
- // check for RPC error.
- if ((input & 0x7FFF0000) == 0x00010000)
{
- return new OpcResult(OpcResult.E_NETWORK_ERROR, input);
- }
+ // check for RPC error.
+ if ((input & 0x7FFF0000) == 0x00010000)
+ {
+ return new OpcResult(OpcResult.E_NETWORK_ERROR, input);
+ }
- // chekc for success code.
- if (input >= 0)
- {
- return new OpcResult(OpcResult.S_FALSE, input);
- }
+ // chekc for success code.
+ if (input >= 0)
+ {
+ return new OpcResult(OpcResult.S_FALSE, input);
+ }
- // return generic error.
- return new OpcResult(OpcResult.E_FAIL, input);
- }
+ // return generic error.
+ return new OpcResult(OpcResult.E_FAIL, input);
+ }
}
}
@@ -1410,79 +1410,79 @@ namespace Technosoftware.DaAeHdaClient.Com
/// Converts a result id to an HRESULT.
///
internal static int GetResultID(OpcResult input)
- {
- // data access.
- if (input.Name != null && input.Name.Namespace == OpcNamespace.OPC_DATA_ACCESS)
- {
- if (input == OpcResult.S_OK) return Da.Result.S_OK;
- if (input == OpcResult.E_FAIL) return Da.Result.E_FAIL;
- if (input == OpcResult.E_INVALIDARG) return Da.Result.E_INVALIDARG;
- if (input == OpcResult.Da.E_BADTYPE) return Da.Result.E_BADTYPE;
- if (input == OpcResult.Da.E_READONLY) return Da.Result.E_BADRIGHTS;
- if (input == OpcResult.Da.E_WRITEONLY) return Da.Result.E_BADRIGHTS;
- if (input == OpcResult.Da.E_RANGE) return Da.Result.E_RANGE;
- if (input == OpcResult.E_OUTOFMEMORY) return Da.Result.E_OUTOFMEMORY;
- if (input == OpcResult.E_NOTSUPPORTED) return Da.Result.E_NOINTERFACE;
- if (input == OpcResult.Da.E_INVALIDHANDLE) return Da.Result.E_INVALIDHANDLE;
- if (input == OpcResult.Da.E_UNKNOWN_ITEM_NAME) return Da.Result.E_UNKNOWNITEMID;
- if (input == OpcResult.Da.E_INVALID_ITEM_NAME) return Da.Result.E_INVALIDITEMID;
- if (input == OpcResult.Da.E_INVALID_ITEM_PATH) return Da.Result.E_INVALIDITEMID;
- if (input == OpcResult.Da.E_UNKNOWN_ITEM_PATH) return Da.Result.E_UNKNOWNPATH;
- if (input == OpcResult.Da.E_INVALID_FILTER) return Da.Result.E_INVALIDFILTER;
- if (input == OpcResult.Da.S_UNSUPPORTEDRATE) return Da.Result.S_UNSUPPORTEDRATE;
- if (input == OpcResult.Da.S_CLAMP) return Da.Result.S_CLAMP;
- if (input == OpcResult.Da.E_INVALID_PID) return Da.Result.E_INVALID_PID;
- if (input == OpcResult.Da.E_NO_ITEM_DEADBAND) return Da.Result.E_DEADBANDNOTSUPPORTED;
- if (input == OpcResult.Da.E_NO_ITEM_BUFFERING) return Da.Result.E_NOBUFFERING;
- if (input == OpcResult.Da.E_NO_WRITEQT) return Da.Result.E_NOTSUPPORTED;
- if (input == OpcResult.Da.E_INVALIDCONTINUATIONPOINT) return Da.Result.E_INVALIDCONTINUATIONPOINT;
- if (input == OpcResult.Da.S_DATAQUEUEOVERFLOW) return Da.Result.S_DATAQUEUEOVERFLOW;
- }
+ {
+ // data access.
+ if (input.Name != null && input.Name.Namespace == OpcNamespace.OPC_DATA_ACCESS)
+ {
+ if (input == OpcResult.S_OK) return Da.Result.S_OK;
+ if (input == OpcResult.E_FAIL) return Da.Result.E_FAIL;
+ if (input == OpcResult.E_INVALIDARG) return Da.Result.E_INVALIDARG;
+ if (input == OpcResult.Da.E_BADTYPE) return Da.Result.E_BADTYPE;
+ if (input == OpcResult.Da.E_READONLY) return Da.Result.E_BADRIGHTS;
+ if (input == OpcResult.Da.E_WRITEONLY) return Da.Result.E_BADRIGHTS;
+ if (input == OpcResult.Da.E_RANGE) return Da.Result.E_RANGE;
+ if (input == OpcResult.E_OUTOFMEMORY) return Da.Result.E_OUTOFMEMORY;
+ if (input == OpcResult.E_NOTSUPPORTED) return Da.Result.E_NOINTERFACE;
+ if (input == OpcResult.Da.E_INVALIDHANDLE) return Da.Result.E_INVALIDHANDLE;
+ if (input == OpcResult.Da.E_UNKNOWN_ITEM_NAME) return Da.Result.E_UNKNOWNITEMID;
+ if (input == OpcResult.Da.E_INVALID_ITEM_NAME) return Da.Result.E_INVALIDITEMID;
+ if (input == OpcResult.Da.E_INVALID_ITEM_PATH) return Da.Result.E_INVALIDITEMID;
+ if (input == OpcResult.Da.E_UNKNOWN_ITEM_PATH) return Da.Result.E_UNKNOWNPATH;
+ if (input == OpcResult.Da.E_INVALID_FILTER) return Da.Result.E_INVALIDFILTER;
+ if (input == OpcResult.Da.S_UNSUPPORTEDRATE) return Da.Result.S_UNSUPPORTEDRATE;
+ if (input == OpcResult.Da.S_CLAMP) return Da.Result.S_CLAMP;
+ if (input == OpcResult.Da.E_INVALID_PID) return Da.Result.E_INVALID_PID;
+ if (input == OpcResult.Da.E_NO_ITEM_DEADBAND) return Da.Result.E_DEADBANDNOTSUPPORTED;
+ if (input == OpcResult.Da.E_NO_ITEM_BUFFERING) return Da.Result.E_NOBUFFERING;
+ if (input == OpcResult.Da.E_NO_WRITEQT) return Da.Result.E_NOTSUPPORTED;
+ if (input == OpcResult.Da.E_INVALIDCONTINUATIONPOINT) return Da.Result.E_INVALIDCONTINUATIONPOINT;
+ if (input == OpcResult.Da.S_DATAQUEUEOVERFLOW) return Da.Result.S_DATAQUEUEOVERFLOW;
+ }
- // complex data.
- else if (input.Name != null && input.Name.Namespace == OpcNamespace.OPC_COMPLEX_DATA)
- {
- if (input == OpcResult.Cpx.E_TYPE_CHANGED) return Cpx.Result.E_TYPE_CHANGED;
- if (input == OpcResult.Cpx.E_FILTER_DUPLICATE) return Cpx.Result.E_FILTER_DUPLICATE;
- if (input == OpcResult.Cpx.E_FILTER_INVALID) return Cpx.Result.E_FILTER_INVALID;
- if (input == OpcResult.Cpx.E_FILTER_ERROR) return Cpx.Result.E_FILTER_ERROR;
- if (input == OpcResult.Cpx.S_FILTER_NO_DATA) return Cpx.Result.S_FILTER_NO_DATA;
- }
-
- // historical data access.
- else if (input.Name != null && input.Name.Namespace == OpcNamespace.OPC_HISTORICAL_DATA_ACCESS)
- {
- if (input == OpcResult.Hda.E_MAXEXCEEDED) return Hda.Result.E_MAXEXCEEDED;
- if (input == OpcResult.Hda.S_NODATA) return Hda.Result.S_NODATA;
- if (input == OpcResult.Hda.S_MOREDATA) return Hda.Result.S_MOREDATA;
- if (input == OpcResult.Hda.E_INVALIDAGGREGATE) return Hda.Result.E_INVALIDAGGREGATE;
- if (input == OpcResult.Hda.S_CURRENTVALUE) return Hda.Result.S_CURRENTVALUE;
- if (input == OpcResult.Hda.S_EXTRADATA) return Hda.Result.S_EXTRADATA;
- if (input == OpcResult.Hda.E_UNKNOWNATTRID) return Hda.Result.E_UNKNOWNATTRID;
- if (input == OpcResult.Hda.E_NOT_AVAIL) return Hda.Result.E_NOT_AVAIL;
- if (input == OpcResult.Hda.E_INVALIDDATATYPE) return Hda.Result.E_INVALIDDATATYPE;
- if (input == OpcResult.Hda.E_DATAEXISTS) return Hda.Result.E_DATAEXISTS;
- if (input == OpcResult.Hda.E_INVALIDATTRID) return Hda.Result.E_INVALIDATTRID;
- if (input == OpcResult.Hda.E_NODATAEXISTS) return Hda.Result.E_NODATAEXISTS;
- if (input == OpcResult.Hda.S_INSERTED) return Hda.Result.S_INSERTED;
- if (input == OpcResult.Hda.S_REPLACED) return Hda.Result.S_REPLACED;
- }
+ // complex data.
+ else if (input.Name != null && input.Name.Namespace == OpcNamespace.OPC_COMPLEX_DATA)
+ {
+ if (input == OpcResult.Cpx.E_TYPE_CHANGED) return Cpx.Result.E_TYPE_CHANGED;
+ if (input == OpcResult.Cpx.E_FILTER_DUPLICATE) return Cpx.Result.E_FILTER_DUPLICATE;
+ if (input == OpcResult.Cpx.E_FILTER_INVALID) return Cpx.Result.E_FILTER_INVALID;
+ if (input == OpcResult.Cpx.E_FILTER_ERROR) return Cpx.Result.E_FILTER_ERROR;
+ if (input == OpcResult.Cpx.S_FILTER_NO_DATA) return Cpx.Result.S_FILTER_NO_DATA;
+ }
- // check for custom code.
- else if (input.Code == -1)
- {
- // default success code.
- if (input.Succeeded())
- {
- return Da.Result.S_FALSE;
- }
+ // historical data access.
+ else if (input.Name != null && input.Name.Namespace == OpcNamespace.OPC_HISTORICAL_DATA_ACCESS)
+ {
+ if (input == OpcResult.Hda.E_MAXEXCEEDED) return Hda.Result.E_MAXEXCEEDED;
+ if (input == OpcResult.Hda.S_NODATA) return Hda.Result.S_NODATA;
+ if (input == OpcResult.Hda.S_MOREDATA) return Hda.Result.S_MOREDATA;
+ if (input == OpcResult.Hda.E_INVALIDAGGREGATE) return Hda.Result.E_INVALIDAGGREGATE;
+ if (input == OpcResult.Hda.S_CURRENTVALUE) return Hda.Result.S_CURRENTVALUE;
+ if (input == OpcResult.Hda.S_EXTRADATA) return Hda.Result.S_EXTRADATA;
+ if (input == OpcResult.Hda.E_UNKNOWNATTRID) return Hda.Result.E_UNKNOWNATTRID;
+ if (input == OpcResult.Hda.E_NOT_AVAIL) return Hda.Result.E_NOT_AVAIL;
+ if (input == OpcResult.Hda.E_INVALIDDATATYPE) return Hda.Result.E_INVALIDDATATYPE;
+ if (input == OpcResult.Hda.E_DATAEXISTS) return Hda.Result.E_DATAEXISTS;
+ if (input == OpcResult.Hda.E_INVALIDATTRID) return Hda.Result.E_INVALIDATTRID;
+ if (input == OpcResult.Hda.E_NODATAEXISTS) return Hda.Result.E_NODATAEXISTS;
+ if (input == OpcResult.Hda.S_INSERTED) return Hda.Result.S_INSERTED;
+ if (input == OpcResult.Hda.S_REPLACED) return Hda.Result.S_REPLACED;
+ }
- // default error code.
- return Da.Result.E_FAIL;
- }
+ // check for custom code.
+ else if (input.Code == -1)
+ {
+ // default success code.
+ if (input.Succeeded())
+ {
+ return Da.Result.S_FALSE;
+ }
- // return custom code.
- return input.Code;
+ // default error code.
+ return Da.Result.E_FAIL;
+ }
+
+ // return custom code.
+ return input.Code;
}
///
diff --git a/Technosoftware/DaAeHdaClient.Com/SafeNativeMethods.cs b/Technosoftware/DaAeHdaClient.Com/SafeNativeMethods.cs
index 07d2bcc..230de1f 100644
--- a/Technosoftware/DaAeHdaClient.Com/SafeNativeMethods.cs
+++ b/Technosoftware/DaAeHdaClient.Com/SafeNativeMethods.cs
@@ -23,12 +23,11 @@
#region Using Directives
using System;
using System.Collections.Generic;
-using System.Reflection;
-using System.Net;
using System.Globalization;
+using System.Net;
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
-
using Technosoftware.DaAeHdaClient.Utilities;
#endregion
@@ -264,11 +263,11 @@ namespace Technosoftware.DaAeHdaClient.Com
[DllImport("ole32.dll")]
private static extern int CoQueryProxyBlanket(
[MarshalAs(UnmanagedType.IUnknown)]
- object pProxy,
+ object pProxy,
ref uint pAuthnSvc,
ref uint pAuthzSvc,
[MarshalAs(UnmanagedType.LPWStr)]
- ref string pServerPrincName,
+ ref string pServerPrincName,
ref uint pAuthnLevel,
ref uint pImpLevel,
ref IntPtr pAuthInfo,
@@ -277,7 +276,7 @@ namespace Technosoftware.DaAeHdaClient.Com
[DllImport("ole32.dll")]
private static extern int CoSetProxyBlanket(
[MarshalAs(UnmanagedType.IUnknown)]
- object pProxy,
+ object pProxy,
uint pAuthnSvc,
uint pAuthzSvc,
IntPtr pServerPrincName,
@@ -347,13 +346,13 @@ namespace Technosoftware.DaAeHdaClient.Com
private static extern int CoCreateInstanceEx(
ref Guid clsid,
[MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
+ object punkOuter,
uint dwClsCtx,
[In]
- ref COSERVERINFO pServerInfo,
+ ref COSERVERINFO pServerInfo,
uint dwCount,
[In, Out]
- MULTI_QI[] pResults);
+ MULTI_QI[] pResults);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
private struct LICINFO
@@ -372,15 +371,15 @@ namespace Technosoftware.DaAeHdaClient.Com
{
void CreateInstance(
[MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
+ object punkOuter,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
[MarshalAs(UnmanagedType.Interface)]
- [Out] out object ppvObject);
+ [Out] out object ppvObject);
void LockServer(
[MarshalAs(UnmanagedType.Bool)]
- bool fLock);
+ bool fLock);
}
[ComImport]
@@ -390,15 +389,15 @@ namespace Technosoftware.DaAeHdaClient.Com
{
void CreateInstance(
[MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
+ object punkOuter,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
[MarshalAs(UnmanagedType.Interface)]
- [Out] out object ppvObject);
+ [Out] out object ppvObject);
void LockServer(
[MarshalAs(UnmanagedType.Bool)]
- bool fLock);
+ bool fLock);
void GetLicInfo(
[In, Out] ref LICINFO pLicInfo);
@@ -406,31 +405,31 @@ namespace Technosoftware.DaAeHdaClient.Com
void RequestLicKey(
int dwReserved,
[MarshalAs(UnmanagedType.BStr)]
- string pbstrKey);
+ string pbstrKey);
void CreateInstanceLic(
[MarshalAs(UnmanagedType.IUnknown)]
- object punkOuter,
+ object punkOuter,
[MarshalAs(UnmanagedType.IUnknown)]
- object punkReserved,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
+ object punkReserved,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
[MarshalAs(UnmanagedType.BStr)]
- string bstrKey,
+ string bstrKey,
[MarshalAs(UnmanagedType.IUnknown)]
- [Out] out object ppvObject);
+ [Out] out object ppvObject);
}
[DllImport("ole32.dll")]
private static extern int CoGetClassObject(
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid clsid,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid clsid,
uint dwClsContext,
[In] ref COSERVERINFO pServerInfo,
- [MarshalAs(UnmanagedType.LPStruct)]
- Guid riid,
+ [MarshalAs(UnmanagedType.LPStruct)]
+ Guid riid,
[MarshalAs(UnmanagedType.IUnknown)]
- [Out] out object ppv);
+ [Out] out object ppv);
internal const int LOGON32_PROVIDER_DEFAULT = 0;
internal const int LOGON32_LOGON_INTERACTIVE = 2;
diff --git a/Technosoftware/DaAeHdaClient.Com/ServerEnumerator.cs b/Technosoftware/DaAeHdaClient.Com/ServerEnumerator.cs
index 3027f7a..53a8a8e 100644
--- a/Technosoftware/DaAeHdaClient.Com/ServerEnumerator.cs
+++ b/Technosoftware/DaAeHdaClient.Com/ServerEnumerator.cs
@@ -22,14 +22,12 @@
#region Using Directives
using System;
-using System.Net;
using System.Collections;
using System.Runtime.InteropServices;
-
-using Technosoftware.OpcRcw.Comn;
using Technosoftware.DaAeHdaClient.Ae;
using Technosoftware.DaAeHdaClient.Da;
using Technosoftware.DaAeHdaClient.Hda;
+using Technosoftware.OpcRcw.Comn;
#endregion
namespace Technosoftware.DaAeHdaClient.Com
@@ -38,192 +36,192 @@ namespace Technosoftware.DaAeHdaClient.Com
/// A unique identifier for the result of an operation of an item.
///
public class ServerEnumerator : IOpcDiscovery
- {
- //======================================================================
- // IDisposable
+ {
+ //======================================================================
+ // IDisposable
- ///
- /// Frees all unmanaged resources
- ///
- public void Dispose() {}
+ ///
+ /// Frees all unmanaged resources
+ ///
+ public void Dispose() { }
- //======================================================================
- // IDiscovery
+ //======================================================================
+ // IDiscovery
- ///
- /// Enumerates hosts that may be accessed for server discovery.
- ///
- public string[] EnumerateHosts()
- {
- return Interop.EnumComputers();
- }
+ ///
+ /// Enumerates hosts that may be accessed for server discovery.
+ ///
+ public string[] EnumerateHosts()
+ {
+ return Interop.EnumComputers();
+ }
- ///
- /// Returns a list of servers that support the specified interface specification.
- ///
- public OpcServer[] GetAvailableServers(OpcSpecification specification)
- {
- return GetAvailableServers(specification, null, null);
- }
+ ///
+ /// Returns a list of servers that support the specified interface specification.
+ ///
+ public OpcServer[] GetAvailableServers(OpcSpecification specification)
+ {
+ return GetAvailableServers(specification, null, null);
+ }
- ///
- /// Returns a list of servers that support the specified specification on the specified host.
- ///
- public OpcServer[] GetAvailableServers(OpcSpecification specification, string host, OpcConnectData connectData)
- {
- lock (this)
- {
- var credentials = (connectData != null)?connectData.GetCredential(null, null):null;
+ ///
+ /// Returns a list of servers that support the specified specification on the specified host.
+ ///
+ public OpcServer[] GetAvailableServers(OpcSpecification specification, string host, OpcConnectData connectData)
+ {
+ lock (this)
+ {
+ var credentials = (connectData != null) ? connectData.GetCredential(null, null) : null;
- // connect to the server.
- m_server = (IOPCServerList2)Interop.CreateInstance(CLSID, host, credentials, connectData?.UseConnectSecurity ?? false);
- m_host = host;
+ // connect to the server.
+ m_server = (IOPCServerList2)Interop.CreateInstance(CLSID, host, credentials, connectData?.UseConnectSecurity ?? false);
+ m_host = host;
- try
- {
- var servers = new ArrayList();
-
- // convert the interface version to a guid.
- var catid = new Guid(specification.Id);
-
- // get list of servers in the specified specification.
- IOPCEnumGUID enumerator = null;
+ try
+ {
+ var servers = new ArrayList();
- m_server.EnumClassesOfCategories(
- 1,
- new Guid[] { catid },
- 0,
- null,
- out enumerator);
+ // convert the interface version to a guid.
+ var catid = new Guid(specification.Id);
- // read clsids.
- var clsids = ReadClasses(enumerator);
+ // get list of servers in the specified specification.
+ IOPCEnumGUID enumerator = null;
+
+ m_server.EnumClassesOfCategories(
+ 1,
+ new Guid[] { catid },
+ 0,
+ null,
+ out enumerator);
+
+ // read clsids.
+ var clsids = ReadClasses(enumerator);
// release enumerator object.
Interop.ReleaseServer(enumerator);
- enumerator = null;
+ enumerator = null;
- // fetch class descriptions.
- foreach (var clsid in clsids)
- {
- var factory = new Factory();
+ // fetch class descriptions.
+ foreach (var clsid in clsids)
+ {
+ var factory = new Factory();
- try
- {
+ try
+ {
var url = CreateUrl(specification, clsid);
- OpcServer server = null;
+ OpcServer server = null;
- if (specification == OpcSpecification.OPC_DA_30)
- {
- server = new TsCDaServer(factory, url);
- }
+ if (specification == OpcSpecification.OPC_DA_30)
+ {
+ server = new TsCDaServer(factory, url);
+ }
- else if (specification == OpcSpecification.OPC_DA_20)
- {
- server = new TsCDaServer(factory, url);
- }
-
- else if (specification == OpcSpecification.OPC_AE_10)
- {
- server = new TsCAeServer(factory, url);
- }
+ else if (specification == OpcSpecification.OPC_DA_20)
+ {
+ server = new TsCDaServer(factory, url);
+ }
- else if (specification == OpcSpecification.OPC_HDA_10)
- {
- server = new TsCHdaServer(factory, url);
- }
-
- servers.Add(server);
- }
- catch (Exception)
- {
- // ignore bad clsids.
- }
- }
+ else if (specification == OpcSpecification.OPC_AE_10)
+ {
+ server = new TsCAeServer(factory, url);
+ }
- return (OpcServer[])servers.ToArray(typeof(OpcServer));
- }
- finally
- {
- // free the server.
- Interop.ReleaseServer(m_server);
- m_server = null;
- }
- }
- }
-
- ///
- /// Looks up the CLSID for the specified prog id on a remote host.
- ///
- public Guid CLSIDFromProgID(string progID, string host, OpcConnectData connectData)
- {
- lock (this)
- {
- var credentials = (connectData != null)?connectData.GetCredential(null, null):null;
+ else if (specification == OpcSpecification.OPC_HDA_10)
+ {
+ server = new TsCHdaServer(factory, url);
+ }
+
+ servers.Add(server);
+ }
+ catch (Exception)
+ {
+ // ignore bad clsids.
+ }
+ }
+
+ return (OpcServer[])servers.ToArray(typeof(OpcServer));
+ }
+ finally
+ {
+ // free the server.
+ Interop.ReleaseServer(m_server);
+ m_server = null;
+ }
+ }
+ }
+
+ ///
+ /// Looks up the CLSID for the specified prog id on a remote host.
+ ///
+ public Guid CLSIDFromProgID(string progID, string host, OpcConnectData connectData)
+ {
+ lock (this)
+ {
+ var credentials = (connectData != null) ? connectData.GetCredential(null, null) : null;
// connect to the server.
m_server = (IOPCServerList2)Interop.CreateInstance(CLSID, host, credentials, connectData?.UseConnectSecurity ?? false);
- m_host = host;
+ m_host = host;
- // lookup prog id.
- Guid clsid;
+ // lookup prog id.
+ Guid clsid;
- try
- {
- m_server.CLSIDFromProgID(progID, out clsid);
- }
- catch
- {
- clsid = Guid.Empty;
- }
- finally
- {
- Interop.ReleaseServer(m_server);
- m_server = null;
- }
+ try
+ {
+ m_server.CLSIDFromProgID(progID, out clsid);
+ }
+ catch
+ {
+ clsid = Guid.Empty;
+ }
+ finally
+ {
+ Interop.ReleaseServer(m_server);
+ m_server = null;
+ }
- // return empty guid if prog id not found.
- return clsid;
- }
- }
+ // return empty guid if prog id not found.
+ return clsid;
+ }
+ }
- //======================================================================
- // Private Members
+ //======================================================================
+ // Private Members
- ///
- /// The server enumerator COM server.
- ///
- private IOPCServerList2 m_server = null;
+ ///
+ /// The server enumerator COM server.
+ ///
+ private IOPCServerList2 m_server = null;
- ///
- /// The host where the servers are being enumerated.
- ///
- private string m_host = null;
+ ///
+ /// The host where the servers are being enumerated.
+ ///
+ private string m_host = null;
- ///
- /// The ProgID for the OPC Server Enumerator.
- ///
- private const string ProgID = "OPC.ServerList.1";
-
- ///
- /// The CLSID for the OPC Server Enumerator.
- ///
- private static readonly Guid CLSID = new Guid("13486D51-4821-11D2-A494-3CB306C10000");
+ ///
+ /// The ProgID for the OPC Server Enumerator.
+ ///
+ private const string ProgID = "OPC.ServerList.1";
- //======================================================================
- // Private Methods
+ ///
+ /// The CLSID for the OPC Server Enumerator.
+ ///
+ private static readonly Guid CLSID = new Guid("13486D51-4821-11D2-A494-3CB306C10000");
- ///
- /// Reads the guids from the enumerator.
- ///
- private Guid[] ReadClasses(IOPCEnumGUID enumerator)
- {
- var guids = new ArrayList();
+ //======================================================================
+ // Private Methods
+
+ ///
+ /// Reads the guids from the enumerator.
+ ///
+ private Guid[] ReadClasses(IOPCEnumGUID enumerator)
+ {
+ var guids = new ArrayList();
var count = 10;
// create buffer.
- var buffer = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(Guid))*count);
+ var buffer = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(Guid)) * count);
try
{
@@ -257,64 +255,64 @@ namespace Technosoftware.DaAeHdaClient.Com
{
Marshal.FreeCoTaskMem(buffer);
}
- }
+ }
///
/// Reads the server details from the enumerator.
///
OpcUrl CreateUrl(OpcSpecification specification, Guid clsid)
- {
+ {
// initialize the server url.
var url = new OpcUrl();
-
- url.HostName = m_host;
- url.Port = 0;
- url.Path = null;
- if (specification == OpcSpecification.OPC_DA_30) { url.Scheme = OpcUrlScheme.DA; }
- else if (specification == OpcSpecification.OPC_DA_20) { url.Scheme = OpcUrlScheme.DA; }
- else if (specification == OpcSpecification.OPC_DA_10) { url.Scheme = OpcUrlScheme.DA; }
- else if (specification == OpcSpecification.OPC_AE_10) { url.Scheme = OpcUrlScheme.AE; }
- else if (specification == OpcSpecification.OPC_HDA_10) { url.Scheme = OpcUrlScheme.HDA; }
+ url.HostName = m_host;
+ url.Port = 0;
+ url.Path = null;
- try
- {
- // fetch class details from the enumerator.
- string progID = null;
- string description = null;
- string verIndProgID = null;
+ if (specification == OpcSpecification.OPC_DA_30) { url.Scheme = OpcUrlScheme.DA; }
+ else if (specification == OpcSpecification.OPC_DA_20) { url.Scheme = OpcUrlScheme.DA; }
+ else if (specification == OpcSpecification.OPC_DA_10) { url.Scheme = OpcUrlScheme.DA; }
+ else if (specification == OpcSpecification.OPC_AE_10) { url.Scheme = OpcUrlScheme.AE; }
+ else if (specification == OpcSpecification.OPC_HDA_10) { url.Scheme = OpcUrlScheme.HDA; }
- m_server.GetClassDetails(
- ref clsid,
- out progID,
- out description,
- out verIndProgID);
-
- // create the server URL path.
- if (verIndProgID != null)
- {
- url.Path = string.Format("{0}/{1}", verIndProgID, "{" + clsid.ToString() + "}");
- }
- else if (progID != null)
- {
- url.Path = string.Format("{0}/{1}", progID, "{" + clsid.ToString() + "}");
- }
- }
- catch (Exception)
- {
- // bad value in registry.
- }
- finally
- {
- // default to the clsid if the prog is not known.
- if (url.Path == null)
- {
- url.Path = string.Format("{0}", "{" + clsid.ToString() + "}");
- }
- }
+ try
+ {
+ // fetch class details from the enumerator.
+ string progID = null;
+ string description = null;
+ string verIndProgID = null;
- // return the server url.
- return url;
- }
- }
+ m_server.GetClassDetails(
+ ref clsid,
+ out progID,
+ out description,
+ out verIndProgID);
+
+ // create the server URL path.
+ if (verIndProgID != null)
+ {
+ url.Path = string.Format("{0}/{1}", verIndProgID, "{" + clsid.ToString() + "}");
+ }
+ else if (progID != null)
+ {
+ url.Path = string.Format("{0}/{1}", progID, "{" + clsid.ToString() + "}");
+ }
+ }
+ catch (Exception)
+ {
+ // bad value in registry.
+ }
+ finally
+ {
+ // default to the clsid if the prog is not known.
+ if (url.Path == null)
+ {
+ url.Path = string.Format("{0}", "{" + clsid.ToString() + "}");
+ }
+ }
+
+ // return the server url.
+ return url;
+ }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Utilities/DCOMCallWatchdog.cs b/Technosoftware/DaAeHdaClient.Com/Utilities/DCOMCallWatchdog.cs
index 262b131..8441ead 100644
--- a/Technosoftware/DaAeHdaClient.Com/Utilities/DCOMCallWatchdog.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Utilities/DCOMCallWatchdog.cs
@@ -1,7 +1,4 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Technosoftware.DaAeHdaClient.Utilities;
@@ -47,7 +44,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
private static Task watchdogTask_;
private static DCOMWatchdogResult lastWatchdogResult_ = DCOMWatchdogResult.None;
private static DateTime setStart_;
-
+
#endregion
#region Properties
@@ -97,7 +94,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
///
public static TimeSpan Timeout
{
- get => timeout_;
+ get => timeout_;
set
{
Enable(value);
@@ -124,7 +121,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
/// The maximum time to wait for a DCOM call to succeed before it is cancelled. Note that DCOM will typically timeout
/// between 1-2 minutes, depending on the OS
public static void Enable(TimeSpan timeout)
- {
+ {
if (timeout == TimeSpan.Zero)
{
timeout = TimeSpan.FromSeconds(DEFAULT_TIMEOUT_SECONDS);
@@ -159,7 +156,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
}
}
}
-
+
///
/// Sets the watchdog timer active on the current thread. If Reset is not called within the timeout period, any current thread DCOM call will be cancelled. The
/// calling thread must be the originator of the DCOM call and must be an STA thread.
@@ -200,7 +197,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
{
setStart_ = DateTime.UtcNow;
watchDogThreadID_ = threadId;
-
+
Utils.Trace(Utils.TraceMasks.Information, $"COM call cancellation on thread [{watchDogThreadID_}] was set with timeout [{timeout_.TotalSeconds} seconds]");
}
else
@@ -289,7 +286,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
{
return false;
}
- }
+ }
///
/// Allows for manual cancellation of the current DCOM call
@@ -341,7 +338,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
/// then cancels the current DCOM call automatically if Reset is not called within the timeout period.
///
private static void WatchdogTask()
- {
+ {
while (IsEnabled)
{
try
@@ -353,7 +350,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
Utils.Trace(Utils.TraceMasks.Information, $"Sync call watchdog for thread [{watchDogThreadID_}] timed out - cancelling current call...");
Cancel(DCOMWatchdogResult.TimedOut);
- }
+ }
}
}
catch (Exception e)
@@ -367,7 +364,7 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
}
}
-
+
private static TimeSpan TimeElapsed(DateTime startTime)
{
var now = DateTime.UtcNow;
@@ -386,5 +383,5 @@ namespace Technosoftware.DaAeHdaClient.Com.Utilities
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient.Com/Utilities/Interop.cs b/Technosoftware/DaAeHdaClient.Com/Utilities/Interop.cs
index 4d72c04..22b6a51 100644
--- a/Technosoftware/DaAeHdaClient.Com/Utilities/Interop.cs
+++ b/Technosoftware/DaAeHdaClient.Com/Utilities/Interop.cs
@@ -22,10 +22,9 @@
#region Using Directives
using System;
-using System.Net;
using System.Globalization;
+using System.Net;
using System.Runtime.InteropServices;
-
using Technosoftware.DaAeHdaClient.Da;
#pragma warning disable 618
#endregion
diff --git a/Technosoftware/DaAeHdaClient/Ae/AttributeCollection.cs b/Technosoftware/DaAeHdaClient/Ae/AttributeCollection.cs
index 7db6677..ba9395f 100644
--- a/Technosoftware/DaAeHdaClient/Ae/AttributeCollection.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/AttributeCollection.cs
@@ -26,37 +26,37 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Contains a writable collection attribute ids.
- ///
- [Serializable]
- public class TsCAeAttributeCollection : OpcWriteableCollection
- {
- #region Constructors, Destructor, Initialization
+ ///
+ /// Contains a writable collection attribute ids.
+ ///
+ [Serializable]
+ public class TsCAeAttributeCollection : OpcWriteableCollection
+ {
+ #region Constructors, Destructor, Initialization
///
- /// Creates an empty collection.
- ///
- internal TsCAeAttributeCollection() : base(null, typeof(int)) { }
+ /// Creates an empty collection.
+ ///
+ internal TsCAeAttributeCollection() : base(null, typeof(int)) { }
- ///
- /// Creates a collection from an array.
- ///
- internal TsCAeAttributeCollection(int[] attributeIDs) : base(attributeIDs, typeof(int)) { }
+ ///
+ /// Creates a collection from an array.
+ ///
+ internal TsCAeAttributeCollection(int[] attributeIDs) : base(attributeIDs, typeof(int)) { }
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// An indexer for the collection.
- ///
- public new int this[int index] => (int)Array[index];
+ /// An indexer for the collection.
+ ///
+ public new int this[int index] => (int)Array[index];
///
/// Returns a copy of the collection as an array.
///
public new int[] ToArray()
- {
- return (int[])Array.ToArray(typeof(int));
- }
+ {
+ return (int[])Array.ToArray(typeof(int));
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/AttributeDictionary.cs b/Technosoftware/DaAeHdaClient/Ae/AttributeDictionary.cs
index 6ca46b1..87f5f43 100644
--- a/Technosoftware/DaAeHdaClient/Ae/AttributeDictionary.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/AttributeDictionary.cs
@@ -26,23 +26,23 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Contains multiple lists of the attributes indexed by category.
- ///
- [Serializable]
- public sealed class TsCAeAttributeDictionary : OpcWriteableDictionary
- {
- #region Constructors, Destructor, Initialization
+ ///
+ /// Contains multiple lists of the attributes indexed by category.
+ ///
+ [Serializable]
+ public sealed class TsCAeAttributeDictionary : OpcWriteableDictionary
+ {
+ #region Constructors, Destructor, Initialization
///
- /// Constructs an empty dictionary.
- ///
- public TsCAeAttributeDictionary() : base(null, typeof(int), typeof(TsCAeAttributeCollection)) { }
+ /// Constructs an empty dictionary.
+ ///
+ public TsCAeAttributeDictionary() : base(null, typeof(int), typeof(TsCAeAttributeCollection)) { }
- ///
- /// Constructs an dictionary from a set of category ids.
- ///
- public TsCAeAttributeDictionary(int[] categoryIds)
- : base(null, typeof(int), typeof(TsCAeAttributeCollection))
+ ///
+ /// Constructs an dictionary from a set of category ids.
+ ///
+ public TsCAeAttributeDictionary(int[] categoryIds)
+ : base(null, typeof(int), typeof(TsCAeAttributeCollection))
{
foreach (var categoryId in categoryIds)
{
@@ -51,41 +51,41 @@ namespace Technosoftware.DaAeHdaClient.Ae
}
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// Gets or sets the attribute collection for the specified category.
- ///
- public TsCAeAttributeCollection this[int categoryId]
- {
- get => (TsCAeAttributeCollection)base[categoryId];
+ /// Gets or sets the attribute collection for the specified category.
+ ///
+ public TsCAeAttributeCollection this[int categoryId]
+ {
+ get => (TsCAeAttributeCollection)base[categoryId];
set
- {
- if (value != null)
- {
- base[categoryId] = value;
- }
- else
- {
- base[categoryId] = new TsCAeAttributeCollection();
- }
- }
- }
+ {
+ if (value != null)
+ {
+ base[categoryId] = value;
+ }
+ else
+ {
+ base[categoryId] = new TsCAeAttributeCollection();
+ }
+ }
+ }
- ///
- /// Adds an element with the provided key and value to the IDictionary.
- ///
- public void Add(int key, int[] value)
- {
- if (value != null)
- {
- base.Add(key, new TsCAeAttributeCollection(value));
- }
- else
- {
- base.Add(key, new TsCAeAttributeCollection());
- }
- }
+ ///
+ /// Adds an element with the provided key and value to the IDictionary.
+ ///
+ public void Add(int key, int[] value)
+ {
+ if (value != null)
+ {
+ base.Add(key, new TsCAeAttributeCollection(value));
+ }
+ else
+ {
+ base.Add(key, new TsCAeAttributeCollection());
+ }
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/AttributeValue.cs b/Technosoftware/DaAeHdaClient/Ae/AttributeValue.cs
index b5fe9f1..12c829a 100644
--- a/Technosoftware/DaAeHdaClient/Ae/AttributeValue.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/AttributeValue.cs
@@ -26,54 +26,54 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The value of an attribute for an event source.
- ///
- [Serializable]
- public class TsCAeAttributeValue : ICloneable, IOpcResult
- {
- #region Fields
+ ///
+ /// The value of an attribute for an event source.
+ ///
+ [Serializable]
+ public class TsCAeAttributeValue : ICloneable, IOpcResult
+ {
+ #region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
- #region Properties
+ #region Properties
///
- /// A unique identifier for the attribute.
- ///
- public int ID { get; set; }
+ /// A unique identifier for the attribute.
+ ///
+ public int ID { get; set; }
- ///
- /// The attribute value.
- ///
- public object Value { get; set; }
+ ///
+ /// The attribute value.
+ ///
+ public object Value { get; set; }
#endregion
- #region IOpcResult Members
+ #region IOpcResult Members
///
- /// The error id for the result of an operation on an property.
- ///
- public OpcResult Result
- {
- get => result_;
+ /// The error id for the result of an operation on an property.
+ ///
+ public OpcResult Result
+ {
+ get => result_;
set => result_ = value;
}
- ///
- /// Vendor specific diagnostic information (not the localized error text).
- ///
- public string DiagnosticInfo { get; set; }
+ ///
+ /// Vendor specific diagnostic information (not the localized error text).
+ ///
+ public string DiagnosticInfo { get; set; }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- var clone = (TsCAeAttributeValue)MemberwiseClone();
- clone.Value = OpcConvert.Clone(Value);
- return clone;
- }
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ var clone = (TsCAeAttributeValue)MemberwiseClone();
+ clone.Value = OpcConvert.Clone(Value);
+ return clone;
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/BrowseElement.cs b/Technosoftware/DaAeHdaClient/Ae/BrowseElement.cs
index 350bf56..5d37800 100644
--- a/Technosoftware/DaAeHdaClient/Ae/BrowseElement.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/BrowseElement.cs
@@ -25,22 +25,22 @@ using System;
#endregion
namespace Technosoftware.DaAeHdaClient.Ae
-{
+{
///
/// Contains a description of an element in the server address space.
///
[Serializable]
public class TsCAeBrowseElement
{
- #region Fields
+ #region Fields
private TsCAeBrowseType browseType_ = TsCAeBrowseType.Area;
#endregion
- #region Properties
+ #region Properties
///
/// A descriptive name for element that is unique within a branch.
///
- public string Name { get; set; }
+ public string Name { get; set; }
///
/// The fully qualified name for the element.
@@ -57,12 +57,12 @@ namespace Technosoftware.DaAeHdaClient.Ae
}
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
/// Creates a deep copy of the object.
///
- public virtual object Clone()
- {
+ public virtual object Clone()
+ {
return MemberwiseClone();
}
#endregion
diff --git a/Technosoftware/DaAeHdaClient/Ae/BrowsePosition.cs b/Technosoftware/DaAeHdaClient/Ae/BrowsePosition.cs
index 3c0996f..084047a 100644
--- a/Technosoftware/DaAeHdaClient/Ae/BrowsePosition.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/BrowsePosition.cs
@@ -29,81 +29,81 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// Stores the state of a browse operation.
///
[Serializable]
- public class TsCAeBrowsePosition : IOpcBrowsePosition
- {
- #region Fields
+ public class TsCAeBrowsePosition : IOpcBrowsePosition
+ {
+ #region Fields
private bool disposed_;
- private string areaId_;
- private TsCAeBrowseType browseType_;
- private string browseFilter_;
+ private string areaId_;
+ private TsCAeBrowseType browseType_;
+ private string browseFilter_;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Saves the parameters for an incomplete browse information.
- ///
- public TsCAeBrowsePosition(
- string areaId,
- TsCAeBrowseType browseType,
- string browseFilter)
- {
- areaId_ = areaId;
- browseType_ = browseType;
- browseFilter_ = browseFilter;
- }
+ /// Saves the parameters for an incomplete browse information.
+ ///
+ public TsCAeBrowsePosition(
+ string areaId,
+ TsCAeBrowseType browseType,
+ string browseFilter)
+ {
+ areaId_ = areaId;
+ browseType_ = browseType;
+ browseFilter_ = browseFilter;
+ }
///
/// The finalizer implementation.
///
~TsCAeBrowsePosition()
- {
- Dispose(false);
- }
+ {
+ Dispose(false);
+ }
///
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
///
public virtual void Dispose()
- {
- Dispose(true);
- // Take yourself off the Finalization queue
- // to prevent finalization code for this object
- // from executing a second time.
- GC.SuppressFinalize(this);
- }
+ {
+ Dispose(true);
+ // Take yourself off the Finalization queue
+ // to prevent finalization code for this object
+ // from executing a second time.
+ GC.SuppressFinalize(this);
+ }
- ///
- /// Dispose(bool disposing) executes in two distinct scenarios.
- /// If disposing equals true, the method has been called directly
- /// or indirectly by a user's code. Managed and unmanaged resources
- /// can be disposed.
- /// If disposing equals false, the method has been called by the
- /// runtime from inside the finalizer and you should not reference
- /// other objects. Only unmanaged resources can be disposed.
- ///
- /// If true managed and unmanaged resources can be disposed. If false only unmanaged resources.
- protected virtual void Dispose(bool disposing)
- {
- // Check to see if Dispose has already been called.
- if(!disposed_)
- {
- // If disposing equals true, dispose all managed
- // and unmanaged resources.
- if(disposing)
- {
- }
- // Release unmanaged resources. If disposing is false,
- // only the following code is executed.
- }
- disposed_ = true;
- }
+ ///
+ /// Dispose(bool disposing) executes in two distinct scenarios.
+ /// If disposing equals true, the method has been called directly
+ /// or indirectly by a user's code. Managed and unmanaged resources
+ /// can be disposed.
+ /// If disposing equals false, the method has been called by the
+ /// runtime from inside the finalizer and you should not reference
+ /// other objects. Only unmanaged resources can be disposed.
+ ///
+ /// If true managed and unmanaged resources can be disposed. If false only unmanaged resources.
+ protected virtual void Dispose(bool disposing)
+ {
+ // Check to see if Dispose has already been called.
+ if (!disposed_)
+ {
+ // If disposing equals true, dispose all managed
+ // and unmanaged resources.
+ if (disposing)
+ {
+ }
+ // Release unmanaged resources. If disposing is false,
+ // only the following code is executed.
+ }
+ disposed_ = true;
+ }
#endregion
- #region Properties
+ #region Properties
///
- /// The fully qualified id for the area being browsed.
- ///
- public string AreaID => areaId_;
+ /// The fully qualified id for the area being browsed.
+ ///
+ public string AreaID => areaId_;
///
/// The type of child element being returned with the browse.
@@ -116,14 +116,14 @@ namespace Technosoftware.DaAeHdaClient.Ae
public string BrowseFilter => browseFilter_;
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a shallow copy of the object.
- ///
- public virtual object Clone()
- {
- return (TsCAeBrowsePosition)MemberwiseClone();
- }
+ /// Creates a shallow copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ return (TsCAeBrowsePosition)MemberwiseClone();
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/BrowseType.cs b/Technosoftware/DaAeHdaClient/Ae/BrowseType.cs
index 3048ce4..ede630a 100644
--- a/Technosoftware/DaAeHdaClient/Ae/BrowseType.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/BrowseType.cs
@@ -26,19 +26,19 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The type of nodes to return during a browse.
- ///
- public enum TsCAeBrowseType
- {
- ///
- /// Return only nodes that are process areas.
- ///
- Area,
+ ///
+ /// The type of nodes to return during a browse.
+ ///
+ public enum TsCAeBrowseType
+ {
+ ///
+ /// Return only nodes that are process areas.
+ ///
+ Area,
- ///
- /// Return only nodes that are event sources.
- ///
- Source
- }
+ ///
+ /// Return only nodes that are event sources.
+ ///
+ Source
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/Category.cs b/Technosoftware/DaAeHdaClient/Ae/Category.cs
index a138b80..419944e 100644
--- a/Technosoftware/DaAeHdaClient/Ae/Category.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/Category.cs
@@ -32,11 +32,11 @@ namespace Technosoftware.DaAeHdaClient.Ae
[Serializable]
public class TsCAeCategory : ICloneable
{
- #region Properties
+ #region Properties
///
/// A unique identifier for the category.
///
- public int ID { get; set; }
+ public int ID { get; set; }
///
/// The unique name for the category.
@@ -53,7 +53,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
}
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
/// Creates a shallow copy of the object.
///
diff --git a/Technosoftware/DaAeHdaClient/Ae/ChangeMask.cs b/Technosoftware/DaAeHdaClient/Ae/ChangeMask.cs
index 1e5a7c8..c5ea585 100644
--- a/Technosoftware/DaAeHdaClient/Ae/ChangeMask.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/ChangeMask.cs
@@ -26,50 +26,50 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The bits indicating what changes generated an event notification.
- ///
- [Flags]
- public enum TsCAeChangeMask
- {
- ///
- /// The condition’s active state has changed.
- ///
- ActiveState = 0x0001,
+ ///
+ /// The bits indicating what changes generated an event notification.
+ ///
+ [Flags]
+ public enum TsCAeChangeMask
+ {
+ ///
+ /// The condition’s active state has changed.
+ ///
+ ActiveState = 0x0001,
- ///
- /// The condition’s acknowledgment state has changed.
- ///
- AcknowledgeState = 0x0002,
+ ///
+ /// The condition’s acknowledgment state has changed.
+ ///
+ AcknowledgeState = 0x0002,
- ///
- /// The condition’s enabled state has changed.
- ///
- EnableState = 0x0004,
+ ///
+ /// The condition’s enabled state has changed.
+ ///
+ EnableState = 0x0004,
- ///
- /// The condition quality has changed.
- ///
- Quality = 0x0008,
+ ///
+ /// The condition quality has changed.
+ ///
+ Quality = 0x0008,
- ///
- /// The severity level has changed.
- ///
- Severity = 0x0010,
+ ///
+ /// The severity level has changed.
+ ///
+ Severity = 0x0010,
- ///
- /// The condition has transitioned into a new sub-condition.
- ///
- SubCondition = 0x0020,
+ ///
+ /// The condition has transitioned into a new sub-condition.
+ ///
+ SubCondition = 0x0020,
- ///
- /// The event message has changed.
- ///
- Message = 0x0040,
+ ///
+ /// The event message has changed.
+ ///
+ Message = 0x0040,
- ///
- /// One or more event attributes have changed.
- ///
- Attribute = 0x0080
- }
+ ///
+ /// One or more event attributes have changed.
+ ///
+ Attribute = 0x0080
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/Condition.cs b/Technosoftware/DaAeHdaClient/Ae/Condition.cs
index 440340e..42c8ee4 100644
--- a/Technosoftware/DaAeHdaClient/Ae/Condition.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/Condition.cs
@@ -117,8 +117,8 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// The quality associated with the condition state.
///
public TsCDaQuality Quality
- {
- get => _quality;
+ {
+ get => _quality;
set => _quality = value;
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/ConditionState.cs b/Technosoftware/DaAeHdaClient/Ae/ConditionState.cs
index 818c487..1ca8ece 100644
--- a/Technosoftware/DaAeHdaClient/Ae/ConditionState.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/ConditionState.cs
@@ -26,25 +26,25 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The possible states for a condition.
- ///
- [Flags]
- public enum TsCAeConditionState
- {
- ///
- /// The server is currently checking the state of the condition.
- ///
- Enabled = 0x0001,
+ ///
+ /// The possible states for a condition.
+ ///
+ [Flags]
+ public enum TsCAeConditionState
+ {
+ ///
+ /// The server is currently checking the state of the condition.
+ ///
+ Enabled = 0x0001,
- ///
- /// The associated object is in the state represented by the condition.
- ///
- Active = 0x0002,
+ ///
+ /// The associated object is in the state represented by the condition.
+ ///
+ Active = 0x0002,
- ///
- /// The condition has been acknowledged.
- ///
- Acknowledged = 0x0004
- }
+ ///
+ /// The condition has been acknowledged.
+ ///
+ Acknowledged = 0x0004
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/EnabledStateResult.cs b/Technosoftware/DaAeHdaClient/Ae/EnabledStateResult.cs
index db5cff6..f8e456c 100644
--- a/Technosoftware/DaAeHdaClient/Ae/EnabledStateResult.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/EnabledStateResult.cs
@@ -25,56 +25,56 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The current state of a process area or an event source.
- ///
- public class TsCAeEnabledStateResult : IOpcResult
- {
- #region Fields
+ ///
+ /// The current state of a process area or an event source.
+ ///
+ public class TsCAeEnabledStateResult : IOpcResult
+ {
+ #region Fields
private string qualifiedName_;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with default values.
- ///
- public TsCAeEnabledStateResult() { }
+ /// Initializes the object with default values.
+ ///
+ public TsCAeEnabledStateResult() { }
- ///
- /// Initializes the object with an qualified name.
- ///
- public TsCAeEnabledStateResult(string qualifiedName)
- {
- qualifiedName_ = qualifiedName;
- }
+ ///
+ /// Initializes the object with an qualified name.
+ ///
+ public TsCAeEnabledStateResult(string qualifiedName)
+ {
+ qualifiedName_ = qualifiedName;
+ }
- ///
- /// Initializes the object with an qualified name and Result.
- ///
- public TsCAeEnabledStateResult(string qualifiedName, OpcResult result)
- {
- qualifiedName_ = qualifiedName;
- Result = result;
- }
+ ///
+ /// Initializes the object with an qualified name and Result.
+ ///
+ public TsCAeEnabledStateResult(string qualifiedName, OpcResult result)
+ {
+ qualifiedName_ = qualifiedName;
+ Result = result;
+ }
#endregion
- #region Properties
+ #region Properties
///
- /// Whether if the area or source is enabled.
- ///
- public bool Enabled { get; set; }
+ /// Whether if the area or source is enabled.
+ ///
+ public bool Enabled { get; set; }
- ///
- /// Whether the area or source is enabled and all areas within the hierarchy of its containing areas are enabled.
- ///
- public bool EffectivelyEnabled { get; set; }
+ ///
+ /// Whether the area or source is enabled and all areas within the hierarchy of its containing areas are enabled.
+ ///
+ public bool EffectivelyEnabled { get; set; }
#endregion
- #region IOpcResult Members
+ #region IOpcResult Members
///
- /// The error id for the result of an operation on an item.
- ///
- public OpcResult Result { get; set; } = OpcResult.S_OK;
+ /// The error id for the result of an operation on an item.
+ ///
+ public OpcResult Result { get; set; } = OpcResult.S_OK;
///
/// Vendor specific diagnostic information (not the localized error text).
@@ -82,14 +82,14 @@ namespace Technosoftware.DaAeHdaClient.Ae
public string DiagnosticInfo { get; set; }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- return MemberwiseClone();
- }
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ return MemberwiseClone();
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/EventAcknowledgement.cs b/Technosoftware/DaAeHdaClient/Ae/EventAcknowledgement.cs
index 57d73c2..8180700 100644
--- a/Technosoftware/DaAeHdaClient/Ae/EventAcknowledgement.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/EventAcknowledgement.cs
@@ -26,68 +26,68 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Specifies the information required to acknowledge an event.
- ///
- [Serializable]
- public class TsCAeEventAcknowledgement : ICloneable
- {
- #region Fields
+ ///
+ /// Specifies the information required to acknowledge an event.
+ ///
+ [Serializable]
+ public class TsCAeEventAcknowledgement : ICloneable
+ {
+ #region Fields
private DateTime activeTime_ = DateTime.MinValue;
#endregion
- #region Properties
+ #region Properties
///
- /// The name of the source that generated the event.
- ///
- public string SourceName { get; set; }
+ /// The name of the source that generated the event.
+ ///
+ public string SourceName { get; set; }
- ///
- /// The name of the condition that is being acknowledged.
- ///
- public string ConditionName { get; set; }
+ ///
+ /// The name of the condition that is being acknowledged.
+ ///
+ public string ConditionName { get; set; }
- ///
- /// The time that the condition or sub-condition became active.
- /// The ApplicationInstance.TimeAsUtc property defines
- /// the time format (UTC or local time).
- ///
- public DateTime ActiveTime
- {
- get => activeTime_;
+ ///
+ /// The time that the condition or sub-condition became active.
+ /// The ApplicationInstance.TimeAsUtc property defines
+ /// the time format (UTC or local time).
+ ///
+ public DateTime ActiveTime
+ {
+ get => activeTime_;
set => activeTime_ = value;
}
- ///
- /// The cookie for the condition passed to client during the event notification.
- ///
- public int Cookie { get; set; }
-
- ///
- /// Constructs an acknowledgment with its default values.
- ///
- public TsCAeEventAcknowledgement() { }
-
- ///
- /// Constructs an acknowledgment from an event notification.
- ///
- public TsCAeEventAcknowledgement(TsCAeEventNotification notification)
- {
- SourceName = notification.SourceID;
- ConditionName = notification.ConditionName;
- activeTime_ = notification.ActiveTime;
- Cookie = notification.Cookie;
- }
- #endregion
-
- #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- return MemberwiseClone();
- }
+ /// The cookie for the condition passed to client during the event notification.
+ ///
+ public int Cookie { get; set; }
+
+ ///
+ /// Constructs an acknowledgment with its default values.
+ ///
+ public TsCAeEventAcknowledgement() { }
+
+ ///
+ /// Constructs an acknowledgment from an event notification.
+ ///
+ public TsCAeEventAcknowledgement(TsCAeEventNotification notification)
+ {
+ SourceName = notification.SourceID;
+ ConditionName = notification.ConditionName;
+ activeTime_ = notification.ActiveTime;
+ Cookie = notification.Cookie;
+ }
#endregion
- }
+
+ #region ICloneable Members
+ ///
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ return MemberwiseClone();
+ }
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/EventNotification.cs b/Technosoftware/DaAeHdaClient/Ae/EventNotification.cs
index 0d245c8..10dab1d 100644
--- a/Technosoftware/DaAeHdaClient/Ae/EventNotification.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/EventNotification.cs
@@ -206,8 +206,8 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// The quality associated with the condition state.
///
public TsCDaQuality Quality
- {
- get => daQuality_;
+ {
+ get => daQuality_;
set => daQuality_ = value;
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/EventType.cs b/Technosoftware/DaAeHdaClient/Ae/EventType.cs
index 173b0a4..6e35e10 100644
--- a/Technosoftware/DaAeHdaClient/Ae/EventType.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/EventType.cs
@@ -25,30 +25,30 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The types of events that could be generated by a server.
- ///
- [Flags]
- public enum TsCAeEventType
- {
- ///
- /// Events that are not tracking or condition events.
- ///
- Simple = 0x0001,
+ ///
+ /// The types of events that could be generated by a server.
+ ///
+ [Flags]
+ public enum TsCAeEventType
+ {
+ ///
+ /// Events that are not tracking or condition events.
+ ///
+ Simple = 0x0001,
- ///
- /// Events that represent occurrences which involve the interaction of the client with a target within the server.
- ///
- Tracking = 0x0002,
+ ///
+ /// Events that represent occurrences which involve the interaction of the client with a target within the server.
+ ///
+ Tracking = 0x0002,
- ///
- /// Events that are associated with transitions in and out states defined by the server.
- ///
- Condition = 0x0004,
+ ///
+ /// Events that are associated with transitions in and out states defined by the server.
+ ///
+ Condition = 0x0004,
- ///
- /// All events generated by the server.
- ///
- All = 0xFFFF
- }
+ ///
+ /// All events generated by the server.
+ ///
+ All = 0xFFFF
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/FilterType.cs b/Technosoftware/DaAeHdaClient/Ae/FilterType.cs
index 0a3a2d5..0457fcc 100644
--- a/Technosoftware/DaAeHdaClient/Ae/FilterType.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/FilterType.cs
@@ -26,40 +26,40 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The types of event filters that the server could support.
- ///
- [Flags]
- public enum TsCAeFilterType
- {
- ///
- /// The server supports filtering by event type.
- ///
- Event = 0x0001,
+ ///
+ /// The types of event filters that the server could support.
+ ///
+ [Flags]
+ public enum TsCAeFilterType
+ {
+ ///
+ /// The server supports filtering by event type.
+ ///
+ Event = 0x0001,
- ///
- /// The server supports filtering by event categories.
- ///
- Category = 0x0002,
+ ///
+ /// The server supports filtering by event categories.
+ ///
+ Category = 0x0002,
- ///
- /// The server supports filtering by severity levels.
- ///
- Severity = 0x0004,
+ ///
+ /// The server supports filtering by severity levels.
+ ///
+ Severity = 0x0004,
- ///
- /// The server supports filtering by process area.
- ///
- Area = 0x0008,
+ ///
+ /// The server supports filtering by process area.
+ ///
+ Area = 0x0008,
- ///
- /// The server supports filtering by event sources.
- ///
- Source = 0x0010,
+ ///
+ /// The server supports filtering by event sources.
+ ///
+ Source = 0x0010,
- ///
- /// All filters supported by the server.
- ///
- All = 0xFFFF
- }
+ ///
+ /// All filters supported by the server.
+ ///
+ All = 0xFFFF
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/IServer.cs b/Technosoftware/DaAeHdaClient/Ae/IServer.cs
index 13554a5..6744f18 100644
--- a/Technosoftware/DaAeHdaClient/Ae/IServer.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/IServer.cs
@@ -24,179 +24,179 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Defines functionality that is common to all OPC Alarms and Events servers.
- ///
+ ///
+ /// Defines functionality that is common to all OPC Alarms and Events servers.
+ ///
public interface ITsCAeServer : IOpcServer
- {
+ {
///
/// Returns the current server status.
///
/// The current server status.
OpcServerStatus GetServerStatus();
- ///
- /// Creates a new event subscription.
- ///
- /// The initial state for the subscription.
- /// The new subscription object.
- ITsCAeSubscription CreateSubscription(TsCAeSubscriptionState state);
+ ///
+ /// Creates a new event subscription.
+ ///
+ /// The initial state for the subscription.
+ /// The new subscription object.
+ ITsCAeSubscription CreateSubscription(TsCAeSubscriptionState state);
- ///
- /// Returns the event filters supported by the server.
- ///
- /// A bit mask of all event filters supported by the server.
- int QueryAvailableFilters();
+ ///
+ /// Returns the event filters supported by the server.
+ ///
+ /// A bit mask of all event filters supported by the server.
+ int QueryAvailableFilters();
- ///
- /// Returns the event categories supported by the server for the specified event types.
- ///
- /// A bit mask for the event types of interest.
- /// A collection of event categories.
- TsCAeCategory[] QueryEventCategories(int eventType);
+ ///
+ /// Returns the event categories supported by the server for the specified event types.
+ ///
+ /// A bit mask for the event types of interest.
+ /// A collection of event categories.
+ TsCAeCategory[] QueryEventCategories(int eventType);
- ///
- /// Returns the condition names supported by the server for the specified event categories.
- ///
- /// A bit mask for the event categories of interest.
- /// A list of condition names.
- string[] QueryConditionNames(int eventCategory);
+ ///
+ /// Returns the condition names supported by the server for the specified event categories.
+ ///
+ /// A bit mask for the event categories of interest.
+ /// A list of condition names.
+ string[] QueryConditionNames(int eventCategory);
- ///
- /// Returns the sub-condition names supported by the server for the specified event condition.
- ///
- /// The name of the condition.
- /// A list of sub-condition names.
- string[] QuerySubConditionNames(string conditionName);
+ ///
+ /// Returns the sub-condition names supported by the server for the specified event condition.
+ ///
+ /// The name of the condition.
+ /// A list of sub-condition names.
+ string[] QuerySubConditionNames(string conditionName);
- ///
- /// Returns the condition names supported by the server for the specified event source.
- ///
- /// The name of the event source.
- /// A list of condition names.
- string[] QueryConditionNames(string sourceName);
+ ///
+ /// Returns the condition names supported by the server for the specified event source.
+ ///
+ /// The name of the event source.
+ /// A list of condition names.
+ string[] QueryConditionNames(string sourceName);
- ///
- /// Returns the event attributes supported by the server for the specified event categories.
- ///
- /// The event category of interest.
- /// A collection of event attributes.
- TsCAeAttribute[] QueryEventAttributes(int eventCategory);
+ ///
+ /// Returns the event attributes supported by the server for the specified event categories.
+ ///
+ /// The event category of interest.
+ /// A collection of event attributes.
+ TsCAeAttribute[] QueryEventAttributes(int eventCategory);
- ///
- /// Returns the DA item ids for a set of attribute ids belonging to events which meet the specified filter criteria.
- ///
- /// The event source of interest.
- /// The id of the event category for the events of interest.
- /// The name of a condition within the event category.
- /// The name of a sub-condition within a multi-state condition.
- /// The ids of the attributes to return item ids for.
- /// A list of item urls for each specified attribute.
- TsCAeItemUrl[] TranslateToItemIDs(
- string sourceName,
- int eventCategory,
- string conditionName,
- string subConditionName,
- int[] attributeIDs);
+ ///
+ /// Returns the DA item ids for a set of attribute ids belonging to events which meet the specified filter criteria.
+ ///
+ /// The event source of interest.
+ /// The id of the event category for the events of interest.
+ /// The name of a condition within the event category.
+ /// The name of a sub-condition within a multi-state condition.
+ /// The ids of the attributes to return item ids for.
+ /// A list of item urls for each specified attribute.
+ TsCAeItemUrl[] TranslateToItemIDs(
+ string sourceName,
+ int eventCategory,
+ string conditionName,
+ string subConditionName,
+ int[] attributeIDs);
- ///
- /// Returns the current state information for the condition instance corresponding to the source and condition name.
- ///
- /// The source name
- /// A condition name for the source.
- /// The list of attributes to return with the condition state.
- /// The current state of the connection.
- TsCAeCondition GetConditionState(
- string sourceName,
- string conditionName,
- int[] attributeIDs);
+ ///
+ /// Returns the current state information for the condition instance corresponding to the source and condition name.
+ ///
+ /// The source name
+ /// A condition name for the source.
+ /// The list of attributes to return with the condition state.
+ /// The current state of the connection.
+ TsCAeCondition GetConditionState(
+ string sourceName,
+ string conditionName,
+ int[] attributeIDs);
- ///
- /// Places the specified process areas into the enabled state.
- ///
- /// A list of fully qualified area names.
- /// The results of the operation for each area.
- OpcResult[] EnableConditionByArea(string[] areas);
+ ///
+ /// Places the specified process areas into the enabled state.
+ ///
+ /// A list of fully qualified area names.
+ /// The results of the operation for each area.
+ OpcResult[] EnableConditionByArea(string[] areas);
- ///
- /// Places the specified process areas into the disabled state.
- ///
- /// A list of fully qualified area names.
- /// The results of the operation for each area.
- OpcResult[] DisableConditionByArea(string[] areas);
+ ///
+ /// Places the specified process areas into the disabled state.
+ ///
+ /// A list of fully qualified area names.
+ /// The results of the operation for each area.
+ OpcResult[] DisableConditionByArea(string[] areas);
- ///
- /// Places the specified process areas into the enabled state.
- ///
- /// A list of fully qualified source names.
- /// The results of the operation for each area.
- OpcResult[] EnableConditionBySource(string[] sources);
+ ///
+ /// Places the specified process areas into the enabled state.
+ ///
+ /// A list of fully qualified source names.
+ /// The results of the operation for each area.
+ OpcResult[] EnableConditionBySource(string[] sources);
- ///
- /// Places the specified process areas into the disabled state.
- ///
- /// A list of fully qualified source names.
- /// The results of the operation for each area.
- OpcResult[] DisableConditionBySource(string[] sources);
+ ///
+ /// Places the specified process areas into the disabled state.
+ ///
+ /// A list of fully qualified source names.
+ /// The results of the operation for each area.
+ OpcResult[] DisableConditionBySource(string[] sources);
- ///
- /// Returns the enabled state for the specified process areas.
- ///
- /// A list of fully qualified area names.
- TsCAeEnabledStateResult[] GetEnableStateByArea(string[] areas);
+ ///
+ /// Returns the enabled state for the specified process areas.
+ ///
+ /// A list of fully qualified area names.
+ TsCAeEnabledStateResult[] GetEnableStateByArea(string[] areas);
- ///
- /// Returns the enabled state for the specified event sources.
- ///
- /// A list of fully qualified source names.
- TsCAeEnabledStateResult[] GetEnableStateBySource(string[] sources);
+ ///
+ /// Returns the enabled state for the specified event sources.
+ ///
+ /// A list of fully qualified source names.
+ TsCAeEnabledStateResult[] GetEnableStateBySource(string[] sources);
- ///
- /// Used to acknowledge one or more conditions in the event server.
- ///
- /// The identifier for who is acknowledging the condition.
- /// A comment associated with the acknowledgment.
- /// The conditions being acknowledged.
- /// A list of result id indictaing whether each condition was successfully acknowledged.
- OpcResult[] AcknowledgeCondition(
- string acknowledgerID,
- string comment,
- TsCAeEventAcknowledgement[] conditions);
+ ///
+ /// Used to acknowledge one or more conditions in the event server.
+ ///
+ /// The identifier for who is acknowledging the condition.
+ /// A comment associated with the acknowledgment.
+ /// The conditions being acknowledged.
+ /// A list of result id indictaing whether each condition was successfully acknowledged.
+ OpcResult[] AcknowledgeCondition(
+ string acknowledgerID,
+ string comment,
+ TsCAeEventAcknowledgement[] conditions);
- ///
- /// Browses for all children of the specified area that meet the filter criteria.
- ///
- /// The full-qualified id for the area.
- /// The type of children to return.
- /// The expression used to filter the names of children returned.
- /// The set of elements that meet the filter criteria.
- TsCAeBrowseElement[] Browse(
- string areaID,
- TsCAeBrowseType browseType,
- string browseFilter);
+ ///
+ /// Browses for all children of the specified area that meet the filter criteria.
+ ///
+ /// The full-qualified id for the area.
+ /// The type of children to return.
+ /// The expression used to filter the names of children returned.
+ /// The set of elements that meet the filter criteria.
+ TsCAeBrowseElement[] Browse(
+ string areaID,
+ TsCAeBrowseType browseType,
+ string browseFilter);
- ///
- /// Browses for all children of the specified area that meet the filter criteria.
- ///
- /// The full-qualified id for the area.
- /// The type of children to return.
- /// The expression used to filter the names of children returned.
- /// The maximum number of elements to return.
- /// The object used to continue the browse if the number nodes exceeds the maximum specified.
- /// The set of elements that meet the filter criteria.
- TsCAeBrowseElement[] Browse(
- string areaID,
- TsCAeBrowseType browseType,
- string browseFilter,
- int maxElements,
- out IOpcBrowsePosition position);
+ ///
+ /// Browses for all children of the specified area that meet the filter criteria.
+ ///
+ /// The full-qualified id for the area.
+ /// The type of children to return.
+ /// The expression used to filter the names of children returned.
+ /// The maximum number of elements to return.
+ /// The object used to continue the browse if the number nodes exceeds the maximum specified.
+ /// The set of elements that meet the filter criteria.
+ TsCAeBrowseElement[] Browse(
+ string areaID,
+ TsCAeBrowseType browseType,
+ string browseFilter,
+ int maxElements,
+ out IOpcBrowsePosition position);
- ///
- /// Continues browsing the server's address space at the specified position.
- ///
- /// The maximum number of elements to return.
- /// The position object used to continue a browse operation.
- /// The set of elements that meet the filter criteria.
- TsCAeBrowseElement[] BrowseNext(int maxElements, ref IOpcBrowsePosition position);
- }
+ ///
+ /// Continues browsing the server's address space at the specified position.
+ ///
+ /// The maximum number of elements to return.
+ /// The position object used to continue a browse operation.
+ /// The set of elements that meet the filter criteria.
+ TsCAeBrowseElement[] BrowseNext(int maxElements, ref IOpcBrowsePosition position);
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/ISubscription.cs b/Technosoftware/DaAeHdaClient/Ae/ISubscription.cs
index 2bea031..f902b01 100644
--- a/Technosoftware/DaAeHdaClient/Ae/ISubscription.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/ISubscription.cs
@@ -31,20 +31,20 @@ namespace Technosoftware.DaAeHdaClient.Ae
///
public interface ITsCAeSubscription : IDisposable
{
- #region Events
+ #region Events
///
/// An event to receive event change updates.
///
event TsCAeDataChangedEventHandler DataChangedEvent;
#endregion
- #region State Management
+ #region State Management
///
/// Returns the current state of the subscription.
///
/// The current state of the subscription.
TsCAeSubscriptionState GetState();
-
+
///
/// Changes the state of a subscription.
///
@@ -54,7 +54,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
TsCAeSubscriptionState ModifyState(int masks, TsCAeSubscriptionState state);
#endregion
- #region Filter Management
+ #region Filter Management
///
/// Returns the current filters for the subscription.
///
@@ -68,7 +68,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
void SetFilters(TsCAeSubscriptionFilters filters);
#endregion
- #region Attribute Management
+ #region Attribute Management
///
/// Returns the set of attributes to return with event notifications.
///
@@ -84,7 +84,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
void SelectReturnedAttributes(int eventCategory, int[] attributeIDs);
#endregion
- #region Refresh
+ #region Refresh
///
/// Force a refresh for all active conditions and inactive, unacknowledged conditions whose event notifications match the filter of the event subscription.
///
@@ -95,9 +95,9 @@ namespace Technosoftware.DaAeHdaClient.Ae
///
void CancelRefresh();
#endregion
- }
+ }
- #region Delegate Declarations
+ #region Delegate Declarations
///
/// A delegate to receive data change updates from the server.
///
diff --git a/Technosoftware/DaAeHdaClient/Ae/ItemUrl.cs b/Technosoftware/DaAeHdaClient/Ae/ItemUrl.cs
index 9ed0f7c..6a5bf9a 100644
--- a/Technosoftware/DaAeHdaClient/Ae/ItemUrl.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/ItemUrl.cs
@@ -32,29 +32,29 @@ namespace Technosoftware.DaAeHdaClient.Ae
[Serializable]
public class TsCAeItemUrl : OpcItem
{
- #region Fields
+ #region Fields
private OpcUrl url_ = new OpcUrl();
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
/// Initializes the object with default values.
///
- public TsCAeItemUrl() {}
+ public TsCAeItemUrl() { }
///
/// Initializes the object with an ItemIdentifier object.
///
- public TsCAeItemUrl(OpcItem item) : base(item) {}
-
+ public TsCAeItemUrl(OpcItem item) : base(item) { }
+
///
/// Initializes the object with an ItemIdentifier object and url.
///
- public TsCAeItemUrl(OpcItem item, OpcUrl url)
- : base(item)
- {
- Url = url;
- }
+ public TsCAeItemUrl(OpcItem item, OpcUrl url)
+ : base(item)
+ {
+ Url = url;
+ }
///
/// Initializes object with the specified ItemResult object.
@@ -65,26 +65,26 @@ namespace Technosoftware.DaAeHdaClient.Ae
{
Url = item.Url;
}
- }
+ }
#endregion
- #region Properties
+ #region Properties
///
- /// The url of the server that contains the item.
- ///
- public OpcUrl Url
- {
- get => url_;
+ /// The url of the server that contains the item.
+ ///
+ public OpcUrl Url
+ {
+ get => url_;
set => url_ = value;
}
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
/// Creates a deep copy of the object.
///
- public override object Clone()
- {
+ public override object Clone()
+ {
return new TsCAeItemUrl(this);
}
#endregion
diff --git a/Technosoftware/DaAeHdaClient/Ae/ItemUrlCollection.cs b/Technosoftware/DaAeHdaClient/Ae/ItemUrlCollection.cs
index 86b76af..95e2cbf 100644
--- a/Technosoftware/DaAeHdaClient/Ae/ItemUrlCollection.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/ItemUrlCollection.cs
@@ -25,36 +25,36 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Contains a collection of item urls.
- ///
- internal class TsCAeItemUrlCollection : OpcReadOnlyCollection
- {
- #region Constructors, Destructor, Initialization
- ///
- /// Constructs an empty collection.
- ///
- public TsCAeItemUrlCollection() : base(new TsCAeItemUrl[0]) { }
+ ///
+ /// Contains a collection of item urls.
+ ///
+ internal class TsCAeItemUrlCollection : OpcReadOnlyCollection
+ {
+ #region Constructors, Destructor, Initialization
+ ///
+ /// Constructs an empty collection.
+ ///
+ public TsCAeItemUrlCollection() : base(new TsCAeItemUrl[0]) { }
- ///
- /// Constructs a collection from an array of item urls.
- ///
- public TsCAeItemUrlCollection(TsCAeItemUrl[] itemUrls) : base(itemUrls) { }
+ ///
+ /// Constructs a collection from an array of item urls.
+ ///
+ public TsCAeItemUrlCollection(TsCAeItemUrl[] itemUrls) : base(itemUrls) { }
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// An indexer for the collection.
- ///
- public new TsCAeItemUrl this[int index] => (TsCAeItemUrl)Array.GetValue(index);
+ /// An indexer for the collection.
+ ///
+ public new TsCAeItemUrl this[int index] => (TsCAeItemUrl)Array.GetValue(index);
///
/// Returns a copy of the collection as an array.
///
public new TsCAeItemUrl[] ToArray()
- {
- return (TsCAeItemUrl[])OpcConvert.Clone(Array);
- }
+ {
+ return (TsCAeItemUrl[])OpcConvert.Clone(Array);
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/Server.cs b/Technosoftware/DaAeHdaClient/Ae/Server.cs
index 5432323..f01402f 100644
--- a/Technosoftware/DaAeHdaClient/Ae/Server.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/Server.cs
@@ -23,7 +23,6 @@
#region Using Directives
using System;
-using System.Collections;
using System.Runtime.Serialization;
#endregion
diff --git a/Technosoftware/DaAeHdaClient/Ae/ServerState.cs b/Technosoftware/DaAeHdaClient/Ae/ServerState.cs
index 490ee13..d65e4b8 100644
--- a/Technosoftware/DaAeHdaClient/Ae/ServerState.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/ServerState.cs
@@ -25,44 +25,44 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Current Status of an OPC AE server
- ///
- public enum TsCAeServerState
- {
- ///
- /// The server state is not known.
- ///
- Unknown,
+ ///
+ /// Current Status of an OPC AE server
+ ///
+ public enum TsCAeServerState
+ {
+ ///
+ /// The server state is not known.
+ ///
+ Unknown,
- ///
- /// The server is running normally. This is the usual state for a server
- ///
- Running,
+ ///
+ /// The server is running normally. This is the usual state for a server
+ ///
+ Running,
- ///
- /// A vendor specific fatal error has occurred within the server. The server is no longer functioning. The recovery procedure from this situation is vendor specific. An error code of E_FAIL should generally be returned from any other server method.
- ///
- Failed,
+ ///
+ /// A vendor specific fatal error has occurred within the server. The server is no longer functioning. The recovery procedure from this situation is vendor specific. An error code of E_FAIL should generally be returned from any other server method.
+ ///
+ Failed,
- ///
- /// The server is running but has no configuration information loaded and thus cannot function normally. Note this state implies that the server needs configuration information in order to function. Servers which do not require configuration information should not return this state.
- ///
- NoConfig,
+ ///
+ /// The server is running but has no configuration information loaded and thus cannot function normally. Note this state implies that the server needs configuration information in order to function. Servers which do not require configuration information should not return this state.
+ ///
+ NoConfig,
- ///
- /// The server has been temporarily suspended via some vendor specific method and is not getting or sending data. Note that Quality will be returned as OPC_QUALITY_OUT_OF_SERVICE.
- ///
- Suspended,
+ ///
+ /// The server has been temporarily suspended via some vendor specific method and is not getting or sending data. Note that Quality will be returned as OPC_QUALITY_OUT_OF_SERVICE.
+ ///
+ Suspended,
- ///
- /// The server is in Test Mode. The outputs are disconnected from the real hardware but the server will otherwise behave normally. Inputs may be real or may be simulated depending on the vendor implementation. Quality will generally be returned normally.
- ///
- Test,
+ ///
+ /// The server is in Test Mode. The outputs are disconnected from the real hardware but the server will otherwise behave normally. Inputs may be real or may be simulated depending on the vendor implementation. Quality will generally be returned normally.
+ ///
+ Test,
- ///
- /// The server is in Test Mode. The outputs are disconnected from the real hardware but the server will otherwise behave normally. Inputs may be real or may be simulated depending on the vendor implementation. Quality will generally be returned normally.
- ///
- CommFault
- }
+ ///
+ /// The server is in Test Mode. The outputs are disconnected from the real hardware but the server will otherwise behave normally. Inputs may be real or may be simulated depending on the vendor implementation. Quality will generally be returned normally.
+ ///
+ CommFault
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/StateMask.cs b/Technosoftware/DaAeHdaClient/Ae/StateMask.cs
index dba0f4c..b04ae49 100644
--- a/Technosoftware/DaAeHdaClient/Ae/StateMask.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/StateMask.cs
@@ -26,45 +26,45 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Defines masks to be used when modifying the subscription or item state.
- ///
- [Flags]
- public enum TsCAeStateMask
- {
- ///
- /// A name assigned to subscription.
- ///
- Name = 0x0001,
+ ///
+ /// Defines masks to be used when modifying the subscription or item state.
+ ///
+ [Flags]
+ public enum TsCAeStateMask
+ {
+ ///
+ /// A name assigned to subscription.
+ ///
+ Name = 0x0001,
- ///
- /// The client assigned handle for the item or subscription.
- ///
- ClientHandle = 0x0002,
+ ///
+ /// The client assigned handle for the item or subscription.
+ ///
+ ClientHandle = 0x0002,
- ///
- /// Whether the subscription is active.
- ///
- Active = 0x0004,
+ ///
+ /// Whether the subscription is active.
+ ///
+ Active = 0x0004,
- ///
- /// The maximum rate at which the server send event notifications.
- ///
- BufferTime = 0x0008,
+ ///
+ /// The maximum rate at which the server send event notifications.
+ ///
+ BufferTime = 0x0008,
- ///
- /// The requested maximum number of events that will be sent in a single callback.
- ///
- MaxSize = 0x0010,
+ ///
+ /// The requested maximum number of events that will be sent in a single callback.
+ ///
+ MaxSize = 0x0010,
- ///
- /// The maximum period between updates sent to the client.
- ///
- KeepAlive = 0x0020,
+ ///
+ /// The maximum period between updates sent to the client.
+ ///
+ KeepAlive = 0x0020,
- ///
- /// All fields are valid.
- ///
- All = 0xFFFF
- }
+ ///
+ /// All fields are valid.
+ ///
+ All = 0xFFFF
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/SubCondition.cs b/Technosoftware/DaAeHdaClient/Ae/SubCondition.cs
index 3f99a5e..4127e09 100644
--- a/Technosoftware/DaAeHdaClient/Ae/SubCondition.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/SubCondition.cs
@@ -26,58 +26,58 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// The description of an item sub-condition supported by the server.
- ///
- [Serializable]
- public class TsCAeSubCondition : ICloneable
- {
- #region Fields
+ ///
+ /// The description of an item sub-condition supported by the server.
+ ///
+ [Serializable]
+ public class TsCAeSubCondition : ICloneable
+ {
+ #region Fields
private int severity_ = 1;
#endregion
- #region Properties
+ #region Properties
///
- /// The name assigned to the sub-condition.
- ///
- public string Name { get; set; }
+ /// The name assigned to the sub-condition.
+ ///
+ public string Name { get; set; }
- ///
- /// A server-specific expression which defines the sub-state represented by the sub-condition.
- ///
- public string Definition { get; set; }
+ ///
+ /// A server-specific expression which defines the sub-state represented by the sub-condition.
+ ///
+ public string Definition { get; set; }
- ///
- /// The severity of any event notifications generated on behalf of this sub-condition.
- ///
- public int Severity
- {
- get => severity_;
+ ///
+ /// The severity of any event notifications generated on behalf of this sub-condition.
+ ///
+ public int Severity
+ {
+ get => severity_;
set => severity_ = value;
}
- ///
- /// The text string to be included in any event notification generated on behalf of this sub-condition.
- ///
- public string Description { get; set; }
+ ///
+ /// The text string to be included in any event notification generated on behalf of this sub-condition.
+ ///
+ public string Description { get; set; }
#endregion
- #region Helper Methods
+ #region Helper Methods
///
- /// Returns a string that represents the current object.
- ///
- ///
- public override string ToString()
- {
- return Name;
- }
+ /// Returns a string that represents the current object.
+ ///
+ ///
+ public override string ToString()
+ {
+ return Name;
+ }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a shallow copy of the object.
- ///
- public virtual object Clone() { return MemberwiseClone(); }
+ /// Creates a shallow copy of the object.
+ ///
+ public virtual object Clone() { return MemberwiseClone(); }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/Subscription.cs b/Technosoftware/DaAeHdaClient/Ae/Subscription.cs
index fd6bdef..ac5bc18 100644
--- a/Technosoftware/DaAeHdaClient/Ae/Subscription.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/Subscription.cs
@@ -30,230 +30,230 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// An in-process object which provides access to AE subscription objects.
- ///
- [Serializable]
- public class TsCAeSubscription : ITsCAeSubscription, ISerializable, ICloneable
- {
- #region CategoryCollection Class
+ ///
+ /// An in-process object which provides access to AE subscription objects.
+ ///
+ [Serializable]
+ public class TsCAeSubscription : ITsCAeSubscription, ISerializable, ICloneable
+ {
+ #region CategoryCollection Class
///
- /// Contains a read-only collection category ids.
- ///
- public class CategoryCollection : OpcReadOnlyCollection
- {
- #region Constructors, Destructor, Initialization
+ /// Contains a read-only collection category ids.
+ ///
+ public class CategoryCollection : OpcReadOnlyCollection
+ {
+ #region Constructors, Destructor, Initialization
///
- /// Creates an empty collection.
- ///
- internal CategoryCollection() : base(new int[0]) { }
+ /// Creates an empty collection.
+ ///
+ internal CategoryCollection() : base(new int[0]) { }
- ///
- /// Creates a collection containing the list of category ids.
- ///
- internal CategoryCollection(int[] categoryIDs) : base(categoryIDs) { }
+ ///
+ /// Creates a collection containing the list of category ids.
+ ///
+ internal CategoryCollection(int[] categoryIDs) : base(categoryIDs) { }
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// An indexer for the collection.
- ///
- public new int this[int index] => (int)Array.GetValue(index);
+ /// An indexer for the collection.
+ ///
+ public new int this[int index] => (int)Array.GetValue(index);
///
/// Returns a copy of the collection as an array.
///
public new int[] ToArray()
- {
- return (int[])OpcConvert.Clone(Array);
- }
+ {
+ return (int[])OpcConvert.Clone(Array);
+ }
#endregion
- }
+ }
#endregion
- #region StringCollection Class
+ #region StringCollection Class
///
- /// Contains a read-only collection of strings.
- ///
- public class StringCollection : OpcReadOnlyCollection
- {
- #region Constructors, Destructor, Initialization
+ /// Contains a read-only collection of strings.
+ ///
+ public class StringCollection : OpcReadOnlyCollection
+ {
+ #region Constructors, Destructor, Initialization
///
- /// Creates an empty collection.
- ///
- internal StringCollection() : base(new string[0]) { }
+ /// Creates an empty collection.
+ ///
+ internal StringCollection() : base(new string[0]) { }
- ///
- /// Creates a collection containing the specified strings.
- ///
- internal StringCollection(string[] strings) : base(strings) { }
- #endregion
-
- #region Public Methods
///
- /// An indexer for the collection.
- ///
- public new string this[int index] => (string)Array.GetValue(index);
+ /// Creates a collection containing the specified strings.
+ ///
+ internal StringCollection(string[] strings) : base(strings) { }
+ #endregion
+
+ #region Public Methods
+ ///
+ /// An indexer for the collection.
+ ///
+ public new string this[int index] => (string)Array.GetValue(index);
///
/// Returns a copy of the collection as an array.
///
public new string[] ToArray()
- {
- return (string[])OpcConvert.Clone(Array);
- }
+ {
+ return (string[])OpcConvert.Clone(Array);
+ }
#endregion
- }
+ }
#endregion
- #region AttributeDictionary Class
+ #region AttributeDictionary Class
///
- /// Contains a read-only dictionary of attribute lists indexed by category id.
- ///
- [Serializable]
- public class AttributeDictionary : OpcReadOnlyDictionary
- {
- #region Constructors, Destructor, Initialization
- ///
- /// Creates an empty collection.
- ///
- internal AttributeDictionary() : base(null) { }
+ /// Contains a read-only dictionary of attribute lists indexed by category id.
+ ///
+ [Serializable]
+ public class AttributeDictionary : OpcReadOnlyDictionary
+ {
+ #region Constructors, Destructor, Initialization
+ ///
+ /// Creates an empty collection.
+ ///
+ internal AttributeDictionary() : base(null) { }
- ///
- /// Constructs an dictionary from a set of category ids.
- ///
- internal AttributeDictionary(Hashtable dictionary) : base(dictionary) { }
+ ///
+ /// Constructs an dictionary from a set of category ids.
+ ///
+ internal AttributeDictionary(Hashtable dictionary) : base(dictionary) { }
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// Gets or sets the attribute collection for the specified category.
- ///
- public AttributeCollection this[int categoryId] => (AttributeCollection)base[categoryId];
+ /// Gets or sets the attribute collection for the specified category.
+ ///
+ public AttributeCollection this[int categoryId] => (AttributeCollection)base[categoryId];
///
/// Adds or replaces the set of attributes associated with the category.
///
internal void Update(int categoryId, int[] attributeIDs)
- {
- Dictionary[categoryId] = new AttributeCollection(attributeIDs);
- }
+ {
+ Dictionary[categoryId] = new AttributeCollection(attributeIDs);
+ }
#endregion
- #region ISerializable Members
- ///
- /// Constructs an object by deserializing it from a stream.
- ///
- protected AttributeDictionary(SerializationInfo info, StreamingContext context) : base(info, context) { }
- #endregion
- }
+ #region ISerializable Members
+ ///
+ /// Constructs an object by deserializing it from a stream.
+ ///
+ protected AttributeDictionary(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ #endregion
+ }
#endregion
- #region AttributeCollection Class
+ #region AttributeCollection Class
///
- /// Contains a read-only collection attribute ids.
- ///
- [Serializable]
- public class AttributeCollection : OpcReadOnlyCollection
- {
- #region Constructors, Destructor, Initialization
- ///
- /// Creates an empty collection.
- ///
- internal AttributeCollection() : base(new int[0]) { }
+ /// Contains a read-only collection attribute ids.
+ ///
+ [Serializable]
+ public class AttributeCollection : OpcReadOnlyCollection
+ {
+ #region Constructors, Destructor, Initialization
+ ///
+ /// Creates an empty collection.
+ ///
+ internal AttributeCollection() : base(new int[0]) { }
- ///
- /// Creates a collection containing the specified attribute ids.
- ///
- internal AttributeCollection(int[] attributeIDs) : base(attributeIDs) { }
+ ///
+ /// Creates a collection containing the specified attribute ids.
+ ///
+ internal AttributeCollection(int[] attributeIDs) : base(attributeIDs) { }
#endregion
- #region Public Methods
- ///
- /// An indexer for the collection.
- ///
- public new int this[int index] => (int)Array.GetValue(index);
+ #region Public Methods
+ ///
+ /// An indexer for the collection.
+ ///
+ public new int this[int index] => (int)Array.GetValue(index);
///
/// Returns a copy of the collection as an array.
///
public new int[] ToArray()
- {
- return (int[])OpcConvert.Clone(Array);
- }
+ {
+ return (int[])OpcConvert.Clone(Array);
+ }
#endregion
- #region ISerializable Members
+ #region ISerializable Members
///
- /// Constructs an object by deserializing it from a stream.
- ///
- protected AttributeCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ /// Constructs an object by deserializing it from a stream.
+ ///
+ protected AttributeCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
- }
- #endregion
-
- #region Names Class
- ///
- /// A set of names for fields used in serialization.
- ///
- private class Names
- {
- internal const string State = "ST";
- internal const string Filters = "FT";
- internal const string Attributes = "AT";
- }
+ }
#endregion
- #region Fields
+ #region Names Class
+ ///
+ /// A set of names for fields used in serialization.
+ ///
+ private class Names
+ {
+ internal const string State = "ST";
+ internal const string Filters = "FT";
+ internal const string Attributes = "AT";
+ }
+ #endregion
+
+ #region Fields
private bool disposed_;
- private TsCAeServer server_;
- private ITsCAeSubscription subscription_;
+ private TsCAeServer server_;
+ private ITsCAeSubscription subscription_;
- // state
- private TsCAeSubscriptionState state_;
- private string name_;
+ // state
+ private TsCAeSubscriptionState state_;
+ private string name_;
- // filters
- private TsCAeSubscriptionFilters subscriptionFilters_ = new TsCAeSubscriptionFilters();
- private CategoryCollection categories_ = new CategoryCollection();
- private StringCollection areas_ = new StringCollection();
- private StringCollection sources_ = new StringCollection();
+ // filters
+ private TsCAeSubscriptionFilters subscriptionFilters_ = new TsCAeSubscriptionFilters();
+ private CategoryCollection categories_ = new CategoryCollection();
+ private StringCollection areas_ = new StringCollection();
+ private StringCollection sources_ = new StringCollection();
- // returned attributes
- private AttributeDictionary attributes_ = new AttributeDictionary();
+ // returned attributes
+ private AttributeDictionary attributes_ = new AttributeDictionary();
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes object with default values.
- ///
- public TsCAeSubscription(TsCAeServer server, ITsCAeSubscription subscription, TsCAeSubscriptionState state)
- {
+ /// Initializes object with default values.
+ ///
+ public TsCAeSubscription(TsCAeServer server, ITsCAeSubscription subscription, TsCAeSubscriptionState state)
+ {
server_ = server ?? throw new ArgumentNullException(nameof(server));
- subscription_ = subscription ?? throw new ArgumentNullException(nameof(subscription));
- state_ = (TsCAeSubscriptionState)state.Clone();
- name_ = state.Name;
- }
+ subscription_ = subscription ?? throw new ArgumentNullException(nameof(subscription));
+ state_ = (TsCAeSubscriptionState)state.Clone();
+ name_ = state.Name;
+ }
///
/// The finalizer implementation.
///
~TsCAeSubscription()
- {
- Dispose(false);
- }
+ {
+ Dispose(false);
+ }
- ///
- ///
- ///
- public virtual void Dispose()
- {
- Dispose(true);
- // Take yourself off the Finalization queue
- // to prevent finalization code for this object
- // from executing a second time.
- GC.SuppressFinalize(this);
- }
+ ///
+ ///
+ ///
+ public virtual void Dispose()
+ {
+ Dispose(true);
+ // Take yourself off the Finalization queue
+ // to prevent finalization code for this object
+ // from executing a second time.
+ GC.SuppressFinalize(this);
+ }
///
/// Dispose(bool disposing) executes in two distinct scenarios.
@@ -266,34 +266,34 @@ namespace Technosoftware.DaAeHdaClient.Ae
///
/// If true managed and unmanaged resources can be disposed. If false only unmanaged resources.
protected virtual void Dispose(bool disposing)
- {
- // Check to see if Dispose has already been called.
- if(!disposed_)
- {
- // If disposing equals true, dispose all managed
- // and unmanaged resources.
- if(disposing)
- {
- if (subscription_ != null)
- {
- server_.SubscriptionDisposed(this);
- subscription_.Dispose();
- }
- }
- // Release unmanaged resources. If disposing is false,
- // only the following code is executed.
- }
- disposed_ = true;
- }
+ {
+ // Check to see if Dispose has already been called.
+ if (!disposed_)
+ {
+ // If disposing equals true, dispose all managed
+ // and unmanaged resources.
+ if (disposing)
+ {
+ if (subscription_ != null)
+ {
+ server_.SubscriptionDisposed(this);
+ subscription_.Dispose();
+ }
+ }
+ // Release unmanaged resources. If disposing is false,
+ // only the following code is executed.
+ }
+ disposed_ = true;
+ }
- #endregion
+ #endregion
- #region Properties
+ #region Properties
- ///
- /// The server that the subscription object belongs to.
- ///
- public TsCAeServer Server => server_;
+ ///
+ /// The server that the subscription object belongs to.
+ ///
+ public TsCAeServer Server => server_;
///
/// A descriptive name for the subscription.
@@ -365,19 +365,19 @@ namespace Technosoftware.DaAeHdaClient.Ae
public AttributeDictionary Attributes => attributes_;
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// Returns a writable copy of the current attributes.
- ///
- public TsCAeAttributeDictionary GetAttributes()
- {
+ /// Returns a writable copy of the current attributes.
+ ///
+ public TsCAeAttributeDictionary GetAttributes()
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
- var attributes = new TsCAeAttributeDictionary();
+ var attributes = new TsCAeAttributeDictionary();
- var enumerator = attributes_.GetEnumerator();
+ var enumerator = attributes_.GetEnumerator();
- while (enumerator.MoveNext())
- {
+ while (enumerator.MoveNext())
+ {
if (enumerator.Key != null)
{
var categoryId = (int)enumerator.Key;
@@ -387,48 +387,48 @@ namespace Technosoftware.DaAeHdaClient.Ae
}
}
- return attributes;
- }
+ return attributes;
+ }
#endregion
- #region ISerializable Members
+ #region ISerializable Members
///
- /// Constructs a server by de-serializing its OpcUrl from the stream.
- ///
- protected TsCAeSubscription(SerializationInfo info, StreamingContext context)
- {
- state_ = (TsCAeSubscriptionState)info.GetValue(Names.State, typeof(TsCAeSubscriptionState));
- subscriptionFilters_ = (TsCAeSubscriptionFilters)info.GetValue(Names.Filters, typeof(TsCAeSubscriptionFilters));
- attributes_ = (AttributeDictionary)info.GetValue(Names.Attributes, typeof(AttributeDictionary));
+ /// Constructs a server by de-serializing its OpcUrl from the stream.
+ ///
+ protected TsCAeSubscription(SerializationInfo info, StreamingContext context)
+ {
+ state_ = (TsCAeSubscriptionState)info.GetValue(Names.State, typeof(TsCAeSubscriptionState));
+ subscriptionFilters_ = (TsCAeSubscriptionFilters)info.GetValue(Names.Filters, typeof(TsCAeSubscriptionFilters));
+ attributes_ = (AttributeDictionary)info.GetValue(Names.Attributes, typeof(AttributeDictionary));
- name_ = state_.Name;
+ name_ = state_.Name;
- categories_ = new CategoryCollection(subscriptionFilters_.Categories.ToArray());
- areas_ = new StringCollection(subscriptionFilters_.Areas.ToArray());
- sources_ = new StringCollection(subscriptionFilters_.Sources.ToArray());
- }
+ categories_ = new CategoryCollection(subscriptionFilters_.Categories.ToArray());
+ areas_ = new StringCollection(subscriptionFilters_.Areas.ToArray());
+ sources_ = new StringCollection(subscriptionFilters_.Sources.ToArray());
+ }
- ///
- /// Serializes a server into a stream.
- ///
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue(Names.State, state_);
- info.AddValue(Names.Filters, subscriptionFilters_);
- info.AddValue(Names.Attributes, attributes_);
- }
+ ///
+ /// Serializes a server into a stream.
+ ///
+ public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ info.AddValue(Names.State, state_);
+ info.AddValue(Names.Filters, subscriptionFilters_);
+ info.AddValue(Names.Attributes, attributes_);
+ }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Returns an unconnected copy of the subscription with the same items.
- ///
- public virtual object Clone()
- {
- // do a memberwise clone.
- var clone = (TsCAeSubscription)MemberwiseClone();
+ /// Returns an unconnected copy of the subscription with the same items.
+ ///
+ public virtual object Clone()
+ {
+ // do a memberwise clone.
+ var clone = (TsCAeSubscription)MemberwiseClone();
- /*
+ /*
// place clone in disconnected state.
clone.server = null;
clone.subscription = null;
@@ -454,12 +454,12 @@ namespace Technosoftware.DaAeHdaClient.Ae
}
*/
- // return clone.
- return clone;
- }
+ // return clone.
+ return clone;
+ }
#endregion
- #region ISubscription Members
+ #region ISubscription Members
///
/// An event to receive data change updates.
///
@@ -469,136 +469,136 @@ namespace Technosoftware.DaAeHdaClient.Ae
remove => subscription_.DataChangedEvent -= value;
}
- ///
- /// Returns the current state of the subscription.
- ///
- /// The current state of the subscription.
- public TsCAeSubscriptionState GetState()
- {
+ ///
+ /// Returns the current state of the subscription.
+ ///
+ /// The current state of the subscription.
+ public TsCAeSubscriptionState GetState()
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
- state_ = subscription_.GetState();
- state_.Name = name_;
+ state_ = subscription_.GetState();
+ state_.Name = name_;
- return (TsCAeSubscriptionState)state_.Clone();
- }
+ return (TsCAeSubscriptionState)state_.Clone();
+ }
- ///
- /// Changes the state of a subscription.
- ///
- /// A bit mask that indicates which elements of the subscription state are changing.
- /// The new subscription state.
- /// The actual subscription state after applying the changes.
- public TsCAeSubscriptionState ModifyState(int masks, TsCAeSubscriptionState state)
- {
+ ///
+ /// Changes the state of a subscription.
+ ///
+ /// A bit mask that indicates which elements of the subscription state are changing.
+ /// The new subscription state.
+ /// The actual subscription state after applying the changes.
+ public TsCAeSubscriptionState ModifyState(int masks, TsCAeSubscriptionState state)
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
state_ = subscription_.ModifyState(masks, state);
- if ((masks & (int)TsCAeStateMask.Name) != 0)
- {
- state_.Name = name_ = state.Name;
- }
- else
- {
- state_.Name = name_;
- }
+ if ((masks & (int)TsCAeStateMask.Name) != 0)
+ {
+ state_.Name = name_ = state.Name;
+ }
+ else
+ {
+ state_.Name = name_;
+ }
- return (TsCAeSubscriptionState)state_.Clone();
- }
+ return (TsCAeSubscriptionState)state_.Clone();
+ }
- ///
- /// Returns the current filters for the subscription.
- ///
- /// The current filters for the subscription.
- public TsCAeSubscriptionFilters GetFilters()
- {
+ ///
+ /// Returns the current filters for the subscription.
+ ///
+ /// The current filters for the subscription.
+ public TsCAeSubscriptionFilters GetFilters()
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscriptionFilters_ = subscription_.GetFilters();
- categories_ = new CategoryCollection(subscriptionFilters_.Categories.ToArray());
- areas_ = new StringCollection(subscriptionFilters_.Areas.ToArray());
- sources_ = new StringCollection(subscriptionFilters_.Sources.ToArray());
+ categories_ = new CategoryCollection(subscriptionFilters_.Categories.ToArray());
+ areas_ = new StringCollection(subscriptionFilters_.Areas.ToArray());
+ sources_ = new StringCollection(subscriptionFilters_.Sources.ToArray());
- return (TsCAeSubscriptionFilters)subscriptionFilters_.Clone();
- }
+ return (TsCAeSubscriptionFilters)subscriptionFilters_.Clone();
+ }
- ///
- /// Sets the current filters for the subscription.
- ///
- /// The new filters to use for the subscription.
- public void SetFilters(TsCAeSubscriptionFilters filters)
- {
+ ///
+ /// Sets the current filters for the subscription.
+ ///
+ /// The new filters to use for the subscription.
+ public void SetFilters(TsCAeSubscriptionFilters filters)
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscription_.SetFilters(filters);
- GetFilters();
- }
+ GetFilters();
+ }
- ///
- /// Returns the set of attributes to return with event notifications.
- ///
- /// The set of attributes to returned with event notifications.
- public int[] GetReturnedAttributes(int eventCategory)
- {
+ ///
+ /// Returns the set of attributes to return with event notifications.
+ ///
+ /// The set of attributes to returned with event notifications.
+ public int[] GetReturnedAttributes(int eventCategory)
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
var attributeIDs = subscription_.GetReturnedAttributes(eventCategory);
- attributes_.Update(eventCategory, (int[])OpcConvert.Clone(attributeIDs));
+ attributes_.Update(eventCategory, (int[])OpcConvert.Clone(attributeIDs));
- return attributeIDs;
- }
+ return attributeIDs;
+ }
- ///
- /// Selects the set of attributes to return with event notifications.
- ///
- /// The specific event category for which the attributes apply.
- /// The list of attribute ids to return.
- public void SelectReturnedAttributes(int eventCategory, int[] attributeIDs)
- {
+ ///
+ /// Selects the set of attributes to return with event notifications.
+ ///
+ /// The specific event category for which the attributes apply.
+ /// The list of attribute ids to return.
+ public void SelectReturnedAttributes(int eventCategory, int[] attributeIDs)
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscription_.SelectReturnedAttributes(eventCategory, attributeIDs);
- attributes_.Update(eventCategory, (int[])OpcConvert.Clone(attributeIDs));
- }
+ attributes_.Update(eventCategory, (int[])OpcConvert.Clone(attributeIDs));
+ }
- ///
- /// Force a refresh for all active conditions and inactive, unacknowledged conditions whose event notifications match the filter of the event subscription.
- ///
- public void Refresh()
- {
+ ///
+ /// Force a refresh for all active conditions and inactive, unacknowledged conditions whose event notifications match the filter of the event subscription.
+ ///
+ public void Refresh()
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscription_.Refresh();
- }
+ }
- ///
- /// Cancels an outstanding refresh request.
- ///
- public void CancelRefresh()
- {
+ ///
+ /// Cancels an outstanding refresh request.
+ ///
+ public void CancelRefresh()
+ {
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscription_.CancelRefresh();
- }
- #endregion
+ }
+ #endregion
- #region Internal Properties
+ #region Internal Properties
///
- /// The current state.
- ///
- internal TsCAeSubscriptionState State => state_;
+ /// The current state.
+ ///
+ internal TsCAeSubscriptionState State => state_;
///
/// The current filters.
@@ -606,5 +606,5 @@ namespace Technosoftware.DaAeHdaClient.Ae
internal TsCAeSubscriptionFilters Filters => subscriptionFilters_;
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/SubscriptionFilters.cs b/Technosoftware/DaAeHdaClient/Ae/SubscriptionFilters.cs
index 40d52aa..6783029 100644
--- a/Technosoftware/DaAeHdaClient/Ae/SubscriptionFilters.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/SubscriptionFilters.cs
@@ -27,165 +27,165 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Describes the event filters for a subscription.
- ///
- [Serializable]
- public class TsCAeSubscriptionFilters : ICloneable, ISerializable
- {
- #region CategoryCollection Class
+ ///
+ /// Describes the event filters for a subscription.
+ ///
+ [Serializable]
+ public class TsCAeSubscriptionFilters : ICloneable, ISerializable
+ {
+ #region CategoryCollection Class
///
- /// Contains a writable collection category ids.
- ///
- [Serializable]
- public class CategoryCollection : OpcWriteableCollection
- {
- #region Constructors, Destructor, Initialization
- ///
- /// Creates an empty collection.
- ///
- internal CategoryCollection() : base(null, typeof(int)) { }
-
- #region ISerializable Members
+ /// Contains a writable collection category ids.
+ ///
+ [Serializable]
+ public class CategoryCollection : OpcWriteableCollection
+ {
+ #region Constructors, Destructor, Initialization
///
- /// Constructs an object by deserializing it from a stream.
- ///
- protected CategoryCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ /// Creates an empty collection.
+ ///
+ internal CategoryCollection() : base(null, typeof(int)) { }
+
+ #region ISerializable Members
+ ///
+ /// Constructs an object by deserializing it from a stream.
+ ///
+ protected CategoryCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// An indexer for the collection.
- ///
- public new int this[int index] => (int)Array[index];
+ /// An indexer for the collection.
+ ///
+ public new int this[int index] => (int)Array[index];
///
/// Returns a copy of the collection as an array.
///
public new int[] ToArray()
- {
- return (int[])Array.ToArray(typeof(int));
- }
+ {
+ return (int[])Array.ToArray(typeof(int));
+ }
#endregion
- }
+ }
#endregion
- #region StringCollection Class
+ #region StringCollection Class
///
- /// Contains a writable collection of strings.
- ///
- [Serializable]
- public class StringCollection : OpcWriteableCollection
- {
- #region Constructors, Destructor, Initialization
- ///
- /// Creates an empty collection.
- ///
- internal StringCollection() : base(null, typeof(string)) { }
+ /// Contains a writable collection of strings.
+ ///
+ [Serializable]
+ public class StringCollection : OpcWriteableCollection
+ {
+ #region Constructors, Destructor, Initialization
+ ///
+ /// Creates an empty collection.
+ ///
+ internal StringCollection() : base(null, typeof(string)) { }
#endregion
- #region Public Methods
- ///
- /// An indexer for the collection.
- ///
- public new string this[int index] => (string)Array[index];
+ #region Public Methods
+ ///
+ /// An indexer for the collection.
+ ///
+ public new string this[int index] => (string)Array[index];
///
/// Returns a copy of the collection as an array.
///
public new string[] ToArray()
- {
- return (string[])Array.ToArray(typeof(string));
- }
+ {
+ return (string[])Array.ToArray(typeof(string));
+ }
#endregion
- #region ISerializable Members
+ #region ISerializable Members
///
- /// Constructs an object by deserializing it from a stream.
- ///
- protected StringCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ /// Constructs an object by deserializing it from a stream.
+ ///
+ protected StringCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
- }
+ }
#endregion
- #region Names Class
- ///
- /// A set of names for fields used in serialization.
- ///
- private class Names
- {
- internal const string EventTypes = "ET";
- internal const string Categories = "CT";
- internal const string HighSeverity = "HS";
- internal const string LowSeverity = "LS";
- internal const string Areas = "AR";
- internal const string Sources = "SR";
- }
- #endregion
-
- #region Fields
- private int eventTypes_ = (int)TsCAeEventType.All;
- private CategoryCollection categories_ = new CategoryCollection();
- private int highSeverity_ = 1000;
- private int lowSeverity_ = 1;
- private StringCollection areas_ = new StringCollection();
- private StringCollection sources_ = new StringCollection();
- #endregion
-
- #region Constructors, Destructor, Initialization
+ #region Names Class
///
- /// Initializes object with default values.
- ///
- public TsCAeSubscriptionFilters() { }
-
- ///
- /// Constructs a server by de-serializing its OpcUrl from the stream.
- ///
- protected TsCAeSubscriptionFilters(SerializationInfo info, StreamingContext context)
- {
- eventTypes_ = (int)info.GetValue(Names.EventTypes, typeof(int));
- categories_ = (CategoryCollection)info.GetValue(Names.Categories, typeof(CategoryCollection));
- highSeverity_ = (int)info.GetValue(Names.HighSeverity, typeof(int));
- lowSeverity_ = (int)info.GetValue(Names.LowSeverity, typeof(int));
- areas_ = (StringCollection)info.GetValue(Names.Areas, typeof(StringCollection));
- sources_ = (StringCollection)info.GetValue(Names.Sources, typeof(StringCollection));
- }
+ /// A set of names for fields used in serialization.
+ ///
+ private class Names
+ {
+ internal const string EventTypes = "ET";
+ internal const string Categories = "CT";
+ internal const string HighSeverity = "HS";
+ internal const string LowSeverity = "LS";
+ internal const string Areas = "AR";
+ internal const string Sources = "SR";
+ }
#endregion
- #region Properties
- ///
- /// A mask indicating which event types should be sent to the client.
- ///
- public int EventTypes
- {
- get => eventTypes_;
+ #region Fields
+ private int eventTypes_ = (int)TsCAeEventType.All;
+ private CategoryCollection categories_ = new CategoryCollection();
+ private int highSeverity_ = 1000;
+ private int lowSeverity_ = 1;
+ private StringCollection areas_ = new StringCollection();
+ private StringCollection sources_ = new StringCollection();
+ #endregion
+
+ #region Constructors, Destructor, Initialization
+ ///
+ /// Initializes object with default values.
+ ///
+ public TsCAeSubscriptionFilters() { }
+
+ ///
+ /// Constructs a server by de-serializing its OpcUrl from the stream.
+ ///
+ protected TsCAeSubscriptionFilters(SerializationInfo info, StreamingContext context)
+ {
+ eventTypes_ = (int)info.GetValue(Names.EventTypes, typeof(int));
+ categories_ = (CategoryCollection)info.GetValue(Names.Categories, typeof(CategoryCollection));
+ highSeverity_ = (int)info.GetValue(Names.HighSeverity, typeof(int));
+ lowSeverity_ = (int)info.GetValue(Names.LowSeverity, typeof(int));
+ areas_ = (StringCollection)info.GetValue(Names.Areas, typeof(StringCollection));
+ sources_ = (StringCollection)info.GetValue(Names.Sources, typeof(StringCollection));
+ }
+ #endregion
+
+ #region Properties
+ ///
+ /// A mask indicating which event types should be sent to the client.
+ ///
+ public int EventTypes
+ {
+ get => eventTypes_;
set => eventTypes_ = value;
}
- ///
- /// The highest severity for the events that should be sent to the client.
- ///
- public int HighSeverity
- {
- get => highSeverity_;
+ ///
+ /// The highest severity for the events that should be sent to the client.
+ ///
+ public int HighSeverity
+ {
+ get => highSeverity_;
set => highSeverity_ = value;
}
- ///
- /// The lowest severity for the events that should be sent to the client.
- ///
- public int LowSeverity
- {
- get => lowSeverity_;
+ ///
+ /// The lowest severity for the events that should be sent to the client.
+ ///
+ public int LowSeverity
+ {
+ get => lowSeverity_;
set => lowSeverity_ = value;
}
- ///
- /// The category ids for the events that should be sent to the client.
- ///
- public CategoryCollection Categories => categories_;
+ ///
+ /// The category ids for the events that should be sent to the client.
+ ///
+ public CategoryCollection Categories => categories_;
///
/// A list of full-qualified ids for process areas of interest - only events or conditions in these areas will be reported.
@@ -198,35 +198,35 @@ namespace Technosoftware.DaAeHdaClient.Ae
public StringCollection Sources => sources_;
#endregion
- #region ISerializable Members
+ #region ISerializable Members
///
- /// Serializes a server into a stream.
- ///
- public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue(Names.EventTypes, eventTypes_);
- info.AddValue(Names.Categories, categories_);
- info.AddValue(Names.HighSeverity, highSeverity_);
- info.AddValue(Names.LowSeverity, lowSeverity_);
- info.AddValue(Names.Areas, areas_);
- info.AddValue(Names.Sources, sources_);
- }
- #endregion
+ /// Serializes a server into a stream.
+ ///
+ public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ info.AddValue(Names.EventTypes, eventTypes_);
+ info.AddValue(Names.Categories, categories_);
+ info.AddValue(Names.HighSeverity, highSeverity_);
+ info.AddValue(Names.LowSeverity, lowSeverity_);
+ info.AddValue(Names.Areas, areas_);
+ info.AddValue(Names.Sources, sources_);
+ }
+ #endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- var filters = (TsCAeSubscriptionFilters)MemberwiseClone();
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ var filters = (TsCAeSubscriptionFilters)MemberwiseClone();
- filters.categories_ = (CategoryCollection)categories_.Clone();
- filters.areas_ = (StringCollection)areas_.Clone();
- filters.sources_ = (StringCollection)sources_.Clone();
+ filters.categories_ = (CategoryCollection)categories_.Clone();
+ filters.areas_ = (StringCollection)areas_.Clone();
+ filters.sources_ = (StringCollection)sources_.Clone();
- return filters;
- }
- #endregion
- }
+ return filters;
+ }
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Ae/SubscriptionState.cs b/Technosoftware/DaAeHdaClient/Ae/SubscriptionState.cs
index 36f7ad3..952f480 100644
--- a/Technosoftware/DaAeHdaClient/Ae/SubscriptionState.cs
+++ b/Technosoftware/DaAeHdaClient/Ae/SubscriptionState.cs
@@ -26,63 +26,63 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
- ///
- /// Describes the state of a subscription.
- ///
- [Serializable]
- public class TsCAeSubscriptionState : ICloneable
- {
- #region Fields
+ ///
+ /// Describes the state of a subscription.
+ ///
+ [Serializable]
+ public class TsCAeSubscriptionState : ICloneable
+ {
+ #region Fields
private bool active_ = true;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
#endregion
- #region Properties
+ #region Properties
///
- /// A descriptive name for the subscription.
- ///
- public string Name { get; set; }
+ /// A descriptive name for the subscription.
+ ///
+ public string Name { get; set; }
- ///
- /// A unique identifier for the subscription assigned by the client.
- ///
- public object ClientHandle { get; set; }
+ ///
+ /// A unique identifier for the subscription assigned by the client.
+ ///
+ public object ClientHandle { get; set; }
- ///
- /// Whether the subscription is monitoring for events to send to the client.
- ///
- public bool Active
- {
- get => active_;
+ ///
+ /// Whether the subscription is monitoring for events to send to the client.
+ ///
+ public bool Active
+ {
+ get => active_;
set => active_ = value;
}
- ///
- /// The maximum rate at which the server send event notifications.
- ///
- public int BufferTime { get; set; }
-
- ///
- /// The requested maximum number of events that will be sent in a single callback.
- ///
- public int MaxSize { get; set; }
-
- ///
- /// The maximum period between updates sent to the client.
- ///
- public int KeepAlive { get; set; }
- #endregion
-
- #region ICloneable Members
///
- /// Creates a shallow copy of the object.
- ///
- public virtual object Clone()
- {
- return MemberwiseClone();
- }
+ /// The maximum rate at which the server send event notifications.
+ ///
+ public int BufferTime { get; set; }
+
+ ///
+ /// The requested maximum number of events that will be sent in a single callback.
+ ///
+ public int MaxSize { get; set; }
+
+ ///
+ /// The maximum period between updates sent to the client.
+ ///
+ public int KeepAlive { get; set; }
#endregion
- }
+
+ #region ICloneable Members
+ ///
+ /// Creates a shallow copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ return MemberwiseClone();
+ }
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/ApplicationInstance.cs b/Technosoftware/DaAeHdaClient/ApplicationInstance.cs
index 2b83e70..5009b65 100644
--- a/Technosoftware/DaAeHdaClient/ApplicationInstance.cs
+++ b/Technosoftware/DaAeHdaClient/ApplicationInstance.cs
@@ -21,7 +21,6 @@
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
-using System;
using Technosoftware.DaAeHdaClient.Utilities;
#endregion
diff --git a/Technosoftware/DaAeHdaClient/Cpx/ComplexItem.cs b/Technosoftware/DaAeHdaClient/Cpx/ComplexItem.cs
index 20cb7c7..eabd923 100644
--- a/Technosoftware/DaAeHdaClient/Cpx/ComplexItem.cs
+++ b/Technosoftware/DaAeHdaClient/Cpx/ComplexItem.cs
@@ -23,93 +23,92 @@
#region Using Directives
using System;
using System.Collections;
-using System.Xml;
using System.IO;
-
+using System.Xml;
using Technosoftware.DaAeHdaClient.Da;
#endregion
namespace Technosoftware.DaAeHdaClient.Cpx
{
- ///
- /// A class that contains complex data related properties for an item.
- ///
- public class TsCCpxComplexItem : OpcItem
- {
- ///////////////////////////////////////////////////////////////////////
- #region Constants
+ ///
+ /// A class that contains complex data related properties for an item.
+ ///
+ public class TsCCpxComplexItem : OpcItem
+ {
+ ///////////////////////////////////////////////////////////////////////
+ #region Constants
- ///
- /// The reserved name for complex data branch in the server namespace.
- ///
- public const string CPX_BRANCH = "CPX";
+ ///
+ /// The reserved name for complex data branch in the server namespace.
+ ///
+ public const string CPX_BRANCH = "CPX";
- ///
- /// The reserved name for the data filters branch in the CPX namespace.
- ///
- public const string CPX_DATA_FILTERS = "DataFilters";
+ ///
+ /// The reserved name for the data filters branch in the CPX namespace.
+ ///
+ public const string CPX_DATA_FILTERS = "DataFilters";
- ///
- /// The set of all complex data item properties.
- ///
- public static readonly TsDaPropertyID[] CPX_PROPERTIES = new TsDaPropertyID[]
+ ///
+ /// The set of all complex data item properties.
+ ///
+ public static readonly TsDaPropertyID[] CPX_PROPERTIES = new TsDaPropertyID[]
{
- TsDaProperty.TYPE_SYSTEM_ID,
- TsDaProperty.DICTIONARY_ID,
- TsDaProperty.TYPE_ID,
- TsDaProperty.UNCONVERTED_ITEM_ID,
- TsDaProperty.UNFILTERED_ITEM_ID,
+ TsDaProperty.TYPE_SYSTEM_ID,
+ TsDaProperty.DICTIONARY_ID,
+ TsDaProperty.TYPE_ID,
+ TsDaProperty.UNCONVERTED_ITEM_ID,
+ TsDaProperty.UNFILTERED_ITEM_ID,
TsDaProperty.DATA_FILTER_VALUE
};
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region Fields
+ ///////////////////////////////////////////////////////////////////////
+ #region Fields
- private string _typeSystemID;
- private string _dictionaryID;
- private string _typeID;
- private OpcItem _dictionaryItemID;
- private OpcItem _typeItemID;
- private OpcItem _unconvertedItemID;
- private OpcItem _unfilteredItemID;
- private OpcItem _filterItem;
+ private string _typeSystemID;
+ private string _dictionaryID;
+ private string _typeID;
+ private OpcItem _dictionaryItemID;
+ private OpcItem _typeItemID;
+ private OpcItem _unconvertedItemID;
+ private OpcItem _unfilteredItemID;
+ private OpcItem _filterItem;
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region Constructors, Destructor, Initialization
+ ///////////////////////////////////////////////////////////////////////
+ #region Constructors, Destructor, Initialization
- ///
- /// Initializes the object with the default values.
- ///
- public TsCCpxComplexItem() { }
+ ///
+ /// Initializes the object with the default values.
+ ///
+ public TsCCpxComplexItem() { }
- ///
- /// Initializes the object from an item identifier.
- ///
- /// The item id.
- public TsCCpxComplexItem(OpcItem itemID)
- {
- ItemPath = itemID.ItemPath;
- ItemName = itemID.ItemName;
- }
+ ///
+ /// Initializes the object from an item identifier.
+ ///
+ /// The item id.
+ public TsCCpxComplexItem(OpcItem itemID)
+ {
+ ItemPath = itemID.ItemPath;
+ ItemName = itemID.ItemName;
+ }
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region Properties
+ ///////////////////////////////////////////////////////////////////////
+ #region Properties
- ///
- /// The name of the item in the server address space.
- ///
- public string Name { get; private set; }
+ ///
+ /// The name of the item in the server address space.
+ ///
+ public string Name { get; private set; }
- ///
- /// The type system id for the complex item.
- ///
- public string TypeSystemID => _typeSystemID;
+ ///
+ /// The type system id for the complex item.
+ ///
+ public string TypeSystemID => _typeSystemID;
///
/// The dictionary id for the complex item.
@@ -151,565 +150,565 @@ namespace Technosoftware.DaAeHdaClient.Cpx
///
public string DataFilterValue { get; set; }
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region Public Methods
+ ///////////////////////////////////////////////////////////////////////
+ #region Public Methods
- ///
- /// Returns an appropriate string representation of the object.
- ///
- public override string ToString()
- {
- if (Name != null || Name.Length != 0)
- {
- return Name;
- }
+ ///
+ /// Returns an appropriate string representation of the object.
+ ///
+ public override string ToString()
+ {
+ if (Name != null || Name.Length != 0)
+ {
+ return Name;
+ }
- return ItemName;
- }
+ return ItemName;
+ }
- ///
- /// Returns the root complex data item for the object.
- ///
- public TsCCpxComplexItem GetRootItem()
- {
- if (_unconvertedItemID != null)
- {
- return TsCCpxComplexTypeCache.GetComplexItem(_unconvertedItemID);
- }
+ ///
+ /// Returns the root complex data item for the object.
+ ///
+ public TsCCpxComplexItem GetRootItem()
+ {
+ if (_unconvertedItemID != null)
+ {
+ return TsCCpxComplexTypeCache.GetComplexItem(_unconvertedItemID);
+ }
- if (_unfilteredItemID != null)
- {
- return TsCCpxComplexTypeCache.GetComplexItem(_unfilteredItemID);
- }
+ if (_unfilteredItemID != null)
+ {
+ return TsCCpxComplexTypeCache.GetComplexItem(_unfilteredItemID);
+ }
- return this;
- }
+ return this;
+ }
- ///
- /// Reads the current complex data item properties from the server.
- ///
- /// The server object
- public void Update(TsCDaServer server)
- {
- // clear the existing state.
- Clear();
+ ///
+ /// Reads the current complex data item properties from the server.
+ ///
+ /// The server object
+ public void Update(TsCDaServer server)
+ {
+ // clear the existing state.
+ Clear();
- // check if the item supports any of the complex data properties.
- var results = server.GetProperties(
- new OpcItem[] { this },
- CPX_PROPERTIES,
- true);
+ // check if the item supports any of the complex data properties.
+ var results = server.GetProperties(
+ new OpcItem[] { this },
+ CPX_PROPERTIES,
+ true);
- // unexpected return value.
- if (results == null || results.Length != 1)
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "Unexpected results returned from server.");
- }
+ // unexpected return value.
+ if (results == null || results.Length != 1)
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "Unexpected results returned from server.");
+ }
- // update object.
- if (!Init((TsCDaItemProperty[])results[0].ToArray(typeof(TsCDaItemProperty))))
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.E_INVALIDARG.Code, OpcResult.FuncCallType.SysFuncCall, null), "Not a valid complex item.");
- }
+ // update object.
+ if (!Init((TsCDaItemProperty[])results[0].ToArray(typeof(TsCDaItemProperty))))
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.E_INVALIDARG.Code, OpcResult.FuncCallType.SysFuncCall, null), "Not a valid complex item.");
+ }
- // check if data filters are suppported for the item.
- GetDataFilterItem(server);
- }
+ // check if data filters are suppported for the item.
+ GetDataFilterItem(server);
+ }
- ///
- /// Fetches the set of type conversions from the server.
- ///
- /// The server object
- public TsCCpxComplexItem[] GetTypeConversions(TsCDaServer server)
- {
- // only the root item can have type conversions.
- if (_unconvertedItemID != null || _unfilteredItemID != null)
- {
- return null;
- }
+ ///
+ /// Fetches the set of type conversions from the server.
+ ///
+ /// The server object
+ public TsCCpxComplexItem[] GetTypeConversions(TsCDaServer server)
+ {
+ // only the root item can have type conversions.
+ if (_unconvertedItemID != null || _unfilteredItemID != null)
+ {
+ return null;
+ }
- TsCDaBrowsePosition position = null;
+ TsCDaBrowsePosition position = null;
- try
- {
- // look for the 'CPX' branch.
- var filters = new TsCDaBrowseFilters { ElementNameFilter = CPX_BRANCH, BrowseFilter = TsCDaBrowseFilter.Branch, ReturnAllProperties = false, PropertyIDs = null, ReturnPropertyValues = false };
+ try
+ {
+ // look for the 'CPX' branch.
+ var filters = new TsCDaBrowseFilters { ElementNameFilter = CPX_BRANCH, BrowseFilter = TsCDaBrowseFilter.Branch, ReturnAllProperties = false, PropertyIDs = null, ReturnPropertyValues = false };
- var elements = server.Browse(this, filters, out position);
+ var elements = server.Browse(this, filters, out position);
- // nothing found.
- if (elements == null || elements.Length == 0)
- {
- return null;
- }
+ // nothing found.
+ if (elements == null || elements.Length == 0)
+ {
+ return null;
+ }
- // release the browse position object.
- if (position != null)
- {
- position.Dispose();
- position = null;
- }
+ // release the browse position object.
+ if (position != null)
+ {
+ position.Dispose();
+ position = null;
+ }
- // browse for type conversions.
- var itemID = new OpcItem(elements[0].ItemPath, elements[0].ItemName);
+ // browse for type conversions.
+ var itemID = new OpcItem(elements[0].ItemPath, elements[0].ItemName);
- filters.ElementNameFilter = null;
- filters.BrowseFilter = TsCDaBrowseFilter.Item;
- filters.ReturnAllProperties = false;
- filters.PropertyIDs = CPX_PROPERTIES;
- filters.ReturnPropertyValues = true;
+ filters.ElementNameFilter = null;
+ filters.BrowseFilter = TsCDaBrowseFilter.Item;
+ filters.ReturnAllProperties = false;
+ filters.PropertyIDs = CPX_PROPERTIES;
+ filters.ReturnPropertyValues = true;
- elements = server.Browse(itemID, filters, out position);
+ elements = server.Browse(itemID, filters, out position);
- // nothing found.
- if (elements == null || elements.Length == 0)
- {
- return new TsCCpxComplexItem[0];
- }
+ // nothing found.
+ if (elements == null || elements.Length == 0)
+ {
+ return new TsCCpxComplexItem[0];
+ }
- // contruct an array of complex data items for each available conversion.
- var conversions = new ArrayList(elements.Length);
+ // contruct an array of complex data items for each available conversion.
+ var conversions = new ArrayList(elements.Length);
- Array.ForEach(elements, element =>
- {
- if (element.Name != CPX_DATA_FILTERS)
- {
- var item = new TsCCpxComplexItem();
- if (item.Init(element))
- {
- // check if data filters supported for type conversion.
- item.GetDataFilterItem(server);
- conversions.Add(item);
- }
- }
- });
+ Array.ForEach(elements, element =>
+ {
+ if (element.Name != CPX_DATA_FILTERS)
+ {
+ var item = new TsCCpxComplexItem();
+ if (item.Init(element))
+ {
+ // check if data filters supported for type conversion.
+ item.GetDataFilterItem(server);
+ conversions.Add(item);
+ }
+ }
+ });
- // return the set of available conversions.
- return (TsCCpxComplexItem[])conversions.ToArray(typeof(TsCCpxComplexItem));
- }
- finally
- {
- if (position != null)
- {
- position.Dispose();
- position = null;
- }
- }
- }
-
- ///
- /// Fetches the set of data filters from the server.
- ///
- /// The server object
- public TsCCpxComplexItem[] GetDataFilters(TsCDaServer server)
- {
- // not a valid operation for data filter items.
- if (_unfilteredItemID != null)
- {
- return null;
- }
-
- // data filters not supported by the item.
- if (_filterItem == null)
- {
- return null;
- }
-
- TsCDaBrowsePosition position = null;
-
- try
- {
- // browse any existing filter instances.
- var filters = new TsCDaBrowseFilters { ElementNameFilter = null, BrowseFilter = TsCDaBrowseFilter.Item, ReturnAllProperties = false, PropertyIDs = CPX_PROPERTIES, ReturnPropertyValues = true };
-
- var elements = server.Browse(_filterItem, filters, out position);
-
- // nothing found.
- if (elements == null || elements.Length == 0)
- {
- return new TsCCpxComplexItem[0];
- }
-
- // contruct an array of complex data items for each available data filter.
- var dataFilters = new ArrayList(elements.Length);
-
- Array.ForEach(elements, element =>
- {
- var item = new TsCCpxComplexItem();
- if (item.Init(element))
- dataFilters.Add(item);
- });
-
- // return the set of available data filters.
- return (TsCCpxComplexItem[])dataFilters.ToArray(typeof(TsCCpxComplexItem));
- }
- finally
- {
- if (position != null)
- {
- position.Dispose();
- position = null;
- }
- }
- }
-
- ///
- /// Creates a new data filter.
- ///
- /// The server object
- /// The name of the filter
- /// The value of the filter
- public TsCCpxComplexItem CreateDataFilter(TsCDaServer server, string filterName, string filterValue)
- {
- // not a valid operation for data filter items.
- if (_unfilteredItemID != null)
- {
- return null;
- }
-
- // data filters not supported by the item.
- if (_filterItem == null)
- {
- return null;
- }
-
- TsCDaBrowsePosition position = null;
-
- try
- {
- // write the desired filter to the server.
- var item = new TsCDaItemValue(_filterItem);
-
- // create the filter parameters document.
- using (var ostrm = new StringWriter())
- {
- using (var writer = new XmlTextWriter(ostrm))
- {
- writer.WriteStartElement("DataFilters");
- writer.WriteAttributeString("Name", filterName);
- writer.WriteString(filterValue);
- writer.WriteEndElement();
- writer.Close();
- }
- // create the value to write.
- item.Value = ostrm.ToString();
- }
- item.Quality = TsCDaQuality.Bad;
- item.QualitySpecified = false;
- item.Timestamp = DateTime.MinValue;
- item.TimestampSpecified = false;
-
- // write the value.
- var result = server.Write(new TsCDaItemValue[] { item });
-
- if (result == null || result.Length == 0)
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "Unexpected results returned from server.");
- }
-
- if (result[0].Result.Failed())
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not create new data filter.");
- }
-
- // browse for new data filter item.
- var filters = new TsCDaBrowseFilters { ElementNameFilter = filterName, BrowseFilter = TsCDaBrowseFilter.Item, ReturnAllProperties = false, PropertyIDs = CPX_PROPERTIES, ReturnPropertyValues = true };
-
- var elements = server.Browse(_filterItem, filters, out position);
-
- // nothing found.
- if (elements == null || elements.Length == 0)
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not browse to new data filter.");
- }
-
- var filterItem = new TsCCpxComplexItem();
-
- if (!filterItem.Init(elements[0]))
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not initialize to new data filter.");
- }
-
- // return the new data filter.
- return filterItem;
- }
- finally
- {
- if (position != null)
- {
- position.Dispose();
+ // return the set of available conversions.
+ return (TsCCpxComplexItem[])conversions.ToArray(typeof(TsCCpxComplexItem));
+ }
+ finally
+ {
+ if (position != null)
+ {
+ position.Dispose();
+ position = null;
}
}
- }
+ }
- ///
- /// Updates a data filter.
- ///
- /// The server object
- /// The value of the filter
- public void UpdateDataFilter(TsCDaServer server, string filterValue)
- {
- // not a valid operation for non data filter items.
- if (_unfilteredItemID == null)
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Cannot update the data filter for this item.");
- }
+ ///
+ /// Fetches the set of data filters from the server.
+ ///
+ /// The server object
+ public TsCCpxComplexItem[] GetDataFilters(TsCDaServer server)
+ {
+ // not a valid operation for data filter items.
+ if (_unfilteredItemID != null)
+ {
+ return null;
+ }
- // create the value to write.
- var item = new TsCDaItemValue(this) { Value = filterValue, Quality = TsCDaQuality.Bad, QualitySpecified = false, Timestamp = DateTime.MinValue, TimestampSpecified = false };
+ // data filters not supported by the item.
+ if (_filterItem == null)
+ {
+ return null;
+ }
- // write the value.
- var result = server.Write(new TsCDaItemValue[] { item });
+ TsCDaBrowsePosition position = null;
- if (result == null || result.Length == 0)
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "Unexpected results returned from server.");
- }
+ try
+ {
+ // browse any existing filter instances.
+ var filters = new TsCDaBrowseFilters { ElementNameFilter = null, BrowseFilter = TsCDaBrowseFilter.Item, ReturnAllProperties = false, PropertyIDs = CPX_PROPERTIES, ReturnPropertyValues = true };
- if (result[0].Result.Failed())
- {
- throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not update data filter.");
- }
+ var elements = server.Browse(_filterItem, filters, out position);
- // update locale copy of the filter value.
- DataFilterValue = filterValue;
- }
+ // nothing found.
+ if (elements == null || elements.Length == 0)
+ {
+ return new TsCCpxComplexItem[0];
+ }
- ///
- /// Fetches the type dictionary for the item.
- ///
- /// The server object
- public string GetTypeDictionary(TsCDaServer server)
- {
- var results = server.GetProperties(
- new OpcItem[] { _dictionaryItemID },
- new TsDaPropertyID[] { TsDaProperty.DICTIONARY },
- true);
+ // contruct an array of complex data items for each available data filter.
+ var dataFilters = new ArrayList(elements.Length);
- if (results == null || results.Length == 0 || results[0].Count == 0)
- {
- return null;
- }
+ Array.ForEach(elements, element =>
+ {
+ var item = new TsCCpxComplexItem();
+ if (item.Init(element))
+ dataFilters.Add(item);
+ });
- var property = results[0][0];
-
- if (!property.Result.Succeeded())
- {
- return null;
- }
-
- return (string)property.Value;
- }
-
- ///
- /// Fetches the type description for the item.
- ///
- /// The server object
- public string GetTypeDescription(TsCDaServer server)
- {
- var results = server.GetProperties(
- new OpcItem[] { _typeItemID },
- new TsDaPropertyID[] { TsDaProperty.TYPE_DESCRIPTION },
- true);
-
- if (results == null || results.Length == 0 || results[0].Count == 0)
- {
- return null;
- }
-
- var property = results[0][0];
-
- if (!property.Result.Succeeded())
- {
- return null;
- }
-
- return (string)property.Value;
- }
-
- ///
- /// Fetches the item id for the data filters items and stores it in the internal cache.
- ///
- /// The server object
- public void GetDataFilterItem(TsCDaServer server)
- {
- _filterItem = null;
-
- // not a valid operation for data filter items.
- if (_unfilteredItemID != null)
- {
- return;
- }
-
- TsCDaBrowsePosition position = null;
-
- try
- {
- var itemID = new OpcItem(this);
-
- // browse any existing filter instances.
- var filters = new TsCDaBrowseFilters { ElementNameFilter = CPX_DATA_FILTERS, BrowseFilter = TsCDaBrowseFilter.All, ReturnAllProperties = false, PropertyIDs = null, ReturnPropertyValues = false };
-
- TsCDaBrowseElement[] elements = null;
-
- // browse for the 'CPX' branch first.
- if (_unconvertedItemID == null)
- {
- filters.ElementNameFilter = CPX_BRANCH;
-
- elements = server.Browse(itemID, filters, out position);
-
- // nothing found.
- if (elements == null || elements.Length == 0)
- {
- return;
- }
-
- // release the position object.
- if (position != null)
- {
- position.Dispose();
- position = null;
- }
-
- // update the item for the next browse operation.
- itemID = new OpcItem(elements[0].ItemPath, elements[0].ItemName);
-
- filters.ElementNameFilter = CPX_DATA_FILTERS;
- }
-
- // browse for the 'DataFilters' branch.
- elements = server.Browse(itemID, filters, out position);
-
- // nothing found.
- if (elements == null || elements.Length == 0)
- {
- return;
- }
-
- _filterItem = new OpcItem(elements[0].ItemPath, elements[0].ItemName);
- }
- finally
- {
- if (position != null)
- {
- position.Dispose();
+ // return the set of available data filters.
+ return (TsCCpxComplexItem[])dataFilters.ToArray(typeof(TsCCpxComplexItem));
+ }
+ finally
+ {
+ if (position != null)
+ {
+ position.Dispose();
+ position = null;
}
}
- }
+ }
- #endregion
+ ///
+ /// Creates a new data filter.
+ ///
+ /// The server object
+ /// The name of the filter
+ /// The value of the filter
+ public TsCCpxComplexItem CreateDataFilter(TsCDaServer server, string filterName, string filterValue)
+ {
+ // not a valid operation for data filter items.
+ if (_unfilteredItemID != null)
+ {
+ return null;
+ }
- ///////////////////////////////////////////////////////////////////////
- #region Private Methods
+ // data filters not supported by the item.
+ if (_filterItem == null)
+ {
+ return null;
+ }
- ///
- /// Sets all object properties to their default values.
- ///
- private void Clear()
- {
- _typeSystemID = null;
- _dictionaryID = null;
- _typeID = null;
- _dictionaryItemID = null;
- _typeItemID = null;
- _unconvertedItemID = null;
- _unfilteredItemID = null;
- _filterItem = null;
- DataFilterValue = null;
- }
+ TsCDaBrowsePosition position = null;
- ///
- /// Initializes the object from a browse element.
- ///
- private bool Init(TsCDaBrowseElement element)
- {
- // update the item id.
- ItemPath = element.ItemPath;
- ItemName = element.ItemName;
- Name = element.Name;
+ try
+ {
+ // write the desired filter to the server.
+ var item = new TsCDaItemValue(_filterItem);
- return Init(element.Properties);
- }
+ // create the filter parameters document.
+ using (var ostrm = new StringWriter())
+ {
+ using (var writer = new XmlTextWriter(ostrm))
+ {
+ writer.WriteStartElement("DataFilters");
+ writer.WriteAttributeString("Name", filterName);
+ writer.WriteString(filterValue);
+ writer.WriteEndElement();
+ writer.Close();
+ }
+ // create the value to write.
+ item.Value = ostrm.ToString();
+ }
+ item.Quality = TsCDaQuality.Bad;
+ item.QualitySpecified = false;
+ item.Timestamp = DateTime.MinValue;
+ item.TimestampSpecified = false;
- ///
- /// Initializes the object from a list of properties.
- ///
- private bool Init(TsCDaItemProperty[] properties)
- {
- // put the object into default state.
- Clear();
+ // write the value.
+ var result = server.Write(new TsCDaItemValue[] { item });
- // must have at least three properties defined.
- if (properties == null || properties.Length < 3)
- {
- return false;
- }
+ if (result == null || result.Length == 0)
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "Unexpected results returned from server.");
+ }
- foreach (var property in properties)
- {
- // continue - ignore invalid properties.
- if (!property.Result.Succeeded())
- {
- continue;
- }
+ if (result[0].Result.Failed())
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not create new data filter.");
+ }
- // type system id.
- if (property.ID == TsDaProperty.TYPE_SYSTEM_ID)
- {
- _typeSystemID = (string)property.Value;
- continue;
- }
+ // browse for new data filter item.
+ var filters = new TsCDaBrowseFilters { ElementNameFilter = filterName, BrowseFilter = TsCDaBrowseFilter.Item, ReturnAllProperties = false, PropertyIDs = CPX_PROPERTIES, ReturnPropertyValues = true };
- // dictionary id
- if (property.ID == TsDaProperty.DICTIONARY_ID)
- {
- _dictionaryID = (string)property.Value;
- _dictionaryItemID = new OpcItem(property.ItemPath, property.ItemName);
- continue;
- }
+ var elements = server.Browse(_filterItem, filters, out position);
- // type id
- if (property.ID == TsDaProperty.TYPE_ID)
- {
- _typeID = (string)property.Value;
- _typeItemID = new OpcItem(property.ItemPath, property.ItemName);
- continue;
- }
+ // nothing found.
+ if (elements == null || elements.Length == 0)
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not browse to new data filter.");
+ }
- // unconverted item id
- if (property.ID == TsDaProperty.UNCONVERTED_ITEM_ID)
- {
- _unconvertedItemID = new OpcItem(ItemPath, (string)property.Value);
- continue;
- }
+ var filterItem = new TsCCpxComplexItem();
- // unfiltered item id
- if (property.ID == TsDaProperty.UNFILTERED_ITEM_ID)
- {
- _unfilteredItemID = new OpcItem(ItemPath, (string)property.Value);
- continue;
- }
+ if (!filterItem.Init(elements[0]))
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not initialize to new data filter.");
+ }
- // data filter value.
- if (property.ID == TsDaProperty.DATA_FILTER_VALUE)
- {
- DataFilterValue = (string)property.Value;
- continue;
- }
- }
+ // return the new data filter.
+ return filterItem;
+ }
+ finally
+ {
+ if (position != null)
+ {
+ position.Dispose();
+ }
+ }
+ }
- // validate object.
- if (_typeSystemID == null || _dictionaryID == null || _typeID == null)
- {
- return false;
- }
+ ///
+ /// Updates a data filter.
+ ///
+ /// The server object
+ /// The value of the filter
+ public void UpdateDataFilter(TsCDaServer server, string filterValue)
+ {
+ // not a valid operation for non data filter items.
+ if (_unfilteredItemID == null)
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Cannot update the data filter for this item.");
+ }
- return true;
- }
+ // create the value to write.
+ var item = new TsCDaItemValue(this) { Value = filterValue, Quality = TsCDaQuality.Bad, QualitySpecified = false, Timestamp = DateTime.MinValue, TimestampSpecified = false };
- #endregion
- }
+ // write the value.
+ var result = server.Write(new TsCDaItemValue[] { item });
+
+ if (result == null || result.Length == 0)
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.E_FAIL.Code, OpcResult.FuncCallType.SysFuncCall, null), "Unexpected results returned from server.");
+ }
+
+ if (result[0].Result.Failed())
+ {
+ throw new OpcResultException(new OpcResult((int)OpcResult.Cpx.E_FILTER_ERROR.Code, OpcResult.FuncCallType.SysFuncCall, null), "Could not update data filter.");
+ }
+
+ // update locale copy of the filter value.
+ DataFilterValue = filterValue;
+ }
+
+ ///
+ /// Fetches the type dictionary for the item.
+ ///
+ /// The server object
+ public string GetTypeDictionary(TsCDaServer server)
+ {
+ var results = server.GetProperties(
+ new OpcItem[] { _dictionaryItemID },
+ new TsDaPropertyID[] { TsDaProperty.DICTIONARY },
+ true);
+
+ if (results == null || results.Length == 0 || results[0].Count == 0)
+ {
+ return null;
+ }
+
+ var property = results[0][0];
+
+ if (!property.Result.Succeeded())
+ {
+ return null;
+ }
+
+ return (string)property.Value;
+ }
+
+ ///
+ /// Fetches the type description for the item.
+ ///
+ /// The server object
+ public string GetTypeDescription(TsCDaServer server)
+ {
+ var results = server.GetProperties(
+ new OpcItem[] { _typeItemID },
+ new TsDaPropertyID[] { TsDaProperty.TYPE_DESCRIPTION },
+ true);
+
+ if (results == null || results.Length == 0 || results[0].Count == 0)
+ {
+ return null;
+ }
+
+ var property = results[0][0];
+
+ if (!property.Result.Succeeded())
+ {
+ return null;
+ }
+
+ return (string)property.Value;
+ }
+
+ ///
+ /// Fetches the item id for the data filters items and stores it in the internal cache.
+ ///
+ /// The server object
+ public void GetDataFilterItem(TsCDaServer server)
+ {
+ _filterItem = null;
+
+ // not a valid operation for data filter items.
+ if (_unfilteredItemID != null)
+ {
+ return;
+ }
+
+ TsCDaBrowsePosition position = null;
+
+ try
+ {
+ var itemID = new OpcItem(this);
+
+ // browse any existing filter instances.
+ var filters = new TsCDaBrowseFilters { ElementNameFilter = CPX_DATA_FILTERS, BrowseFilter = TsCDaBrowseFilter.All, ReturnAllProperties = false, PropertyIDs = null, ReturnPropertyValues = false };
+
+ TsCDaBrowseElement[] elements = null;
+
+ // browse for the 'CPX' branch first.
+ if (_unconvertedItemID == null)
+ {
+ filters.ElementNameFilter = CPX_BRANCH;
+
+ elements = server.Browse(itemID, filters, out position);
+
+ // nothing found.
+ if (elements == null || elements.Length == 0)
+ {
+ return;
+ }
+
+ // release the position object.
+ if (position != null)
+ {
+ position.Dispose();
+ position = null;
+ }
+
+ // update the item for the next browse operation.
+ itemID = new OpcItem(elements[0].ItemPath, elements[0].ItemName);
+
+ filters.ElementNameFilter = CPX_DATA_FILTERS;
+ }
+
+ // browse for the 'DataFilters' branch.
+ elements = server.Browse(itemID, filters, out position);
+
+ // nothing found.
+ if (elements == null || elements.Length == 0)
+ {
+ return;
+ }
+
+ _filterItem = new OpcItem(elements[0].ItemPath, elements[0].ItemName);
+ }
+ finally
+ {
+ if (position != null)
+ {
+ position.Dispose();
+ }
+ }
+ }
+
+ #endregion
+
+ ///////////////////////////////////////////////////////////////////////
+ #region Private Methods
+
+ ///
+ /// Sets all object properties to their default values.
+ ///
+ private void Clear()
+ {
+ _typeSystemID = null;
+ _dictionaryID = null;
+ _typeID = null;
+ _dictionaryItemID = null;
+ _typeItemID = null;
+ _unconvertedItemID = null;
+ _unfilteredItemID = null;
+ _filterItem = null;
+ DataFilterValue = null;
+ }
+
+ ///
+ /// Initializes the object from a browse element.
+ ///
+ private bool Init(TsCDaBrowseElement element)
+ {
+ // update the item id.
+ ItemPath = element.ItemPath;
+ ItemName = element.ItemName;
+ Name = element.Name;
+
+ return Init(element.Properties);
+ }
+
+ ///
+ /// Initializes the object from a list of properties.
+ ///
+ private bool Init(TsCDaItemProperty[] properties)
+ {
+ // put the object into default state.
+ Clear();
+
+ // must have at least three properties defined.
+ if (properties == null || properties.Length < 3)
+ {
+ return false;
+ }
+
+ foreach (var property in properties)
+ {
+ // continue - ignore invalid properties.
+ if (!property.Result.Succeeded())
+ {
+ continue;
+ }
+
+ // type system id.
+ if (property.ID == TsDaProperty.TYPE_SYSTEM_ID)
+ {
+ _typeSystemID = (string)property.Value;
+ continue;
+ }
+
+ // dictionary id
+ if (property.ID == TsDaProperty.DICTIONARY_ID)
+ {
+ _dictionaryID = (string)property.Value;
+ _dictionaryItemID = new OpcItem(property.ItemPath, property.ItemName);
+ continue;
+ }
+
+ // type id
+ if (property.ID == TsDaProperty.TYPE_ID)
+ {
+ _typeID = (string)property.Value;
+ _typeItemID = new OpcItem(property.ItemPath, property.ItemName);
+ continue;
+ }
+
+ // unconverted item id
+ if (property.ID == TsDaProperty.UNCONVERTED_ITEM_ID)
+ {
+ _unconvertedItemID = new OpcItem(ItemPath, (string)property.Value);
+ continue;
+ }
+
+ // unfiltered item id
+ if (property.ID == TsDaProperty.UNFILTERED_ITEM_ID)
+ {
+ _unfilteredItemID = new OpcItem(ItemPath, (string)property.Value);
+ continue;
+ }
+
+ // data filter value.
+ if (property.ID == TsDaProperty.DATA_FILTER_VALUE)
+ {
+ DataFilterValue = (string)property.Value;
+ continue;
+ }
+ }
+
+ // validate object.
+ if (_typeSystemID == null || _dictionaryID == null || _typeID == null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Cpx/ComplexTypeCache.cs b/Technosoftware/DaAeHdaClient/Cpx/ComplexTypeCache.cs
index 668c874..b26fe85 100644
--- a/Technosoftware/DaAeHdaClient/Cpx/ComplexTypeCache.cs
+++ b/Technosoftware/DaAeHdaClient/Cpx/ComplexTypeCache.cs
@@ -29,179 +29,179 @@ using Technosoftware.DaAeHdaClient.Da;
namespace Technosoftware.DaAeHdaClient.Cpx
{
- ///
- /// A class that caches properties of complex data items.
- ///
- public class TsCCpxComplexTypeCache
- {
+ ///
+ /// A class that caches properties of complex data items.
+ ///
+ public class TsCCpxComplexTypeCache
+ {
- ///////////////////////////////////////////////////////////////////////
- #region Fields
+ ///////////////////////////////////////////////////////////////////////
+ #region Fields
- ///
- /// The active server for the application.
- ///
- private static TsCDaServer _server;
+ ///
+ /// The active server for the application.
+ ///
+ private static TsCDaServer _server;
- ///
- /// A cache of item properties fetched from the active server.
- ///
- private static Hashtable _items = new Hashtable();
+ ///
+ /// A cache of item properties fetched from the active server.
+ ///
+ private static Hashtable _items = new Hashtable();
- ///
- /// A cache of type dictionaries fetched from the active server.
- ///
- private static Hashtable _dictionaries = new Hashtable();
+ ///
+ /// A cache of type dictionaries fetched from the active server.
+ ///
+ private static Hashtable _dictionaries = new Hashtable();
- ///
- /// A cache of type descriptions fetched from the active server.
- ///
- private static Hashtable _descriptions = new Hashtable();
+ ///
+ /// A cache of type descriptions fetched from the active server.
+ ///
+ private static Hashtable _descriptions = new Hashtable();
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region Constructors, Destructor, Initialization
-
- ///
- /// Initializes the complex type cache with defaults.
- ///
- public TsCCpxComplexTypeCache() { }
+ ///////////////////////////////////////////////////////////////////////
+ #region Constructors, Destructor, Initialization
- #endregion
+ ///
+ /// Initializes the complex type cache with defaults.
+ ///
+ public TsCCpxComplexTypeCache() { }
- ///////////////////////////////////////////////////////////////////////
- #region Properties
+ #endregion
- ///
- /// Get or sets the server to use for the cache.
- ///
- public static TsCDaServer Server
- {
- get
- {
- lock (typeof(TsCCpxComplexTypeCache))
- {
- return _server;
- }
- }
+ ///////////////////////////////////////////////////////////////////////
+ #region Properties
- set
- {
- lock (typeof(TsCCpxComplexTypeCache))
- {
- _server = value;
- _items.Clear();
- _dictionaries.Clear();
- _descriptions.Clear();
- }
- }
- }
+ ///
+ /// Get or sets the server to use for the cache.
+ ///
+ public static TsCDaServer Server
+ {
+ get
+ {
+ lock (typeof(TsCCpxComplexTypeCache))
+ {
+ return _server;
+ }
+ }
- #endregion
+ set
+ {
+ lock (typeof(TsCCpxComplexTypeCache))
+ {
+ _server = value;
+ _items.Clear();
+ _dictionaries.Clear();
+ _descriptions.Clear();
+ }
+ }
+ }
- ///////////////////////////////////////////////////////////////////////
- #region Public Methods
+ #endregion
- ///
- /// Returns the complex item for the specified item id.
- ///
- /// The item id.
- public static TsCCpxComplexItem GetComplexItem(OpcItem itemID)
- {
- if (itemID == null) return null;
+ ///////////////////////////////////////////////////////////////////////
+ #region Public Methods
- lock (typeof(TsCCpxComplexTypeCache))
- {
- var item = new TsCCpxComplexItem(itemID);
+ ///
+ /// Returns the complex item for the specified item id.
+ ///
+ /// The item id.
+ public static TsCCpxComplexItem GetComplexItem(OpcItem itemID)
+ {
+ if (itemID == null) return null;
- try
- {
- item.Update(_server);
- }
- catch
- {
- // item is not a valid complex data item.
- item = null;
- }
+ lock (typeof(TsCCpxComplexTypeCache))
+ {
+ var item = new TsCCpxComplexItem(itemID);
- _items[itemID.Key] = item;
- return item;
- }
- }
+ try
+ {
+ item.Update(_server);
+ }
+ catch
+ {
+ // item is not a valid complex data item.
+ item = null;
+ }
- ///
- /// Returns the complex item for the specified item browse element.
- ///
- /// The item browse element.
- public static TsCCpxComplexItem GetComplexItem(TsCDaBrowseElement element)
- {
- if (element == null) return null;
+ _items[itemID.Key] = item;
+ return item;
+ }
+ }
- lock (typeof(TsCCpxComplexTypeCache))
- {
- return GetComplexItem(new OpcItem(element.ItemPath, element.ItemName));
- }
- }
+ ///
+ /// Returns the complex item for the specified item browse element.
+ ///
+ /// The item browse element.
+ public static TsCCpxComplexItem GetComplexItem(TsCDaBrowseElement element)
+ {
+ if (element == null) return null;
- ///
- /// Fetches the type dictionary for the item.
- ///
- /// The item id.
- public static string GetTypeDictionary(OpcItem itemID)
- {
- if (itemID == null) return null;
+ lock (typeof(TsCCpxComplexTypeCache))
+ {
+ return GetComplexItem(new OpcItem(element.ItemPath, element.ItemName));
+ }
+ }
- lock (typeof(TsCCpxComplexTypeCache))
- {
- var dictionary = (string)_dictionaries[itemID.Key];
+ ///
+ /// Fetches the type dictionary for the item.
+ ///
+ /// The item id.
+ public static string GetTypeDictionary(OpcItem itemID)
+ {
+ if (itemID == null) return null;
- if (dictionary != null)
- {
- return dictionary;
- }
+ lock (typeof(TsCCpxComplexTypeCache))
+ {
+ var dictionary = (string)_dictionaries[itemID.Key];
- var item = GetComplexItem(itemID);
+ if (dictionary != null)
+ {
+ return dictionary;
+ }
- if (item != null)
- {
- dictionary = item.GetTypeDictionary(_server);
- }
+ var item = GetComplexItem(itemID);
- return dictionary;
- }
- }
+ if (item != null)
+ {
+ dictionary = item.GetTypeDictionary(_server);
+ }
- ///
- /// Fetches the type description for the item.
- ///
- /// The item id.
- public static string GetTypeDescription(OpcItem itemID)
- {
- if (itemID == null) return null;
+ return dictionary;
+ }
+ }
- lock (typeof(TsCCpxComplexTypeCache))
- {
- string description = null;
+ ///
+ /// Fetches the type description for the item.
+ ///
+ /// The item id.
+ public static string GetTypeDescription(OpcItem itemID)
+ {
+ if (itemID == null) return null;
- var item = GetComplexItem(itemID);
+ lock (typeof(TsCCpxComplexTypeCache))
+ {
+ string description = null;
- if (item != null)
- {
- description = (string)_descriptions[item.TypeItemID.Key];
+ var item = GetComplexItem(itemID);
- if (description != null)
- {
- return description;
- }
+ if (item != null)
+ {
+ description = (string)_descriptions[item.TypeItemID.Key];
- _descriptions[item.TypeItemID.Key] = description = item.GetTypeDescription(_server);
- }
+ if (description != null)
+ {
+ return description;
+ }
- return description;
- }
- }
+ _descriptions[item.TypeItemID.Key] = description = item.GetTypeDescription(_server);
+ }
- #endregion
- }
+ return description;
+ }
+ }
+
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Cpx/ComplexValue.cs b/Technosoftware/DaAeHdaClient/Cpx/ComplexValue.cs
index c300386..7f05aca 100644
--- a/Technosoftware/DaAeHdaClient/Cpx/ComplexValue.cs
+++ b/Technosoftware/DaAeHdaClient/Cpx/ComplexValue.cs
@@ -26,24 +26,24 @@
namespace Technosoftware.DaAeHdaClient.Cpx
{
- ///
- /// Stores a value with an associated name and/or type.
- ///
- public class TsCCpxComplexValue
- {
- ///
- /// The name of the value.
- ///
- public string Name;
+ ///
+ /// Stores a value with an associated name and/or type.
+ ///
+ public class TsCCpxComplexValue
+ {
+ ///
+ /// The name of the value.
+ ///
+ public string Name;
- ///
- /// The complex or simple data type of the value.
- ///
- public string Type;
+ ///
+ /// The complex or simple data type of the value.
+ ///
+ public string Type;
- ///
- /// The actual value.
- ///
- public object Value;
- }
+ ///
+ /// The actual value.
+ ///
+ public object Value;
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Cpx/Context.cs b/Technosoftware/DaAeHdaClient/Cpx/Context.cs
index 1dd2fbb..61b77a8 100644
--- a/Technosoftware/DaAeHdaClient/Cpx/Context.cs
+++ b/Technosoftware/DaAeHdaClient/Cpx/Context.cs
@@ -26,46 +26,46 @@
namespace Technosoftware.DaAeHdaClient.Cpx
{
- ///
- /// Stores the current serialization context.
- ///
- internal struct TsCCpxContext
- {
- ///////////////////////////////////////////////////////////////////////
- #region Constructors, Destructor, Initialization
+ ///
+ /// Stores the current serialization context.
+ ///
+ internal struct TsCCpxContext
+ {
+ ///////////////////////////////////////////////////////////////////////
+ #region Constructors, Destructor, Initialization
- public TsCCpxContext(byte[] buffer)
- {
- Buffer = buffer;
- Index = 0;
- Dictionary = null;
- Type = null;
- BigEndian = false;
- CharWidth = 2;
- StringEncoding = STRING_ENCODING_UCS2;
- FloatFormat = FLOAT_FORMAT_IEEE754;
- }
+ public TsCCpxContext(byte[] buffer)
+ {
+ Buffer = buffer;
+ Index = 0;
+ Dictionary = null;
+ Type = null;
+ BigEndian = false;
+ CharWidth = 2;
+ StringEncoding = STRING_ENCODING_UCS2;
+ FloatFormat = FLOAT_FORMAT_IEEE754;
+ }
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region Public Fields
+ ///////////////////////////////////////////////////////////////////////
+ #region Public Fields
- public byte[] Buffer;
- public int Index;
- public TypeDictionary Dictionary;
- public TypeDescription Type;
- public bool BigEndian;
- public int CharWidth;
- public string StringEncoding;
- public string FloatFormat;
+ public byte[] Buffer;
+ public int Index;
+ public TypeDictionary Dictionary;
+ public TypeDescription Type;
+ public bool BigEndian;
+ public int CharWidth;
+ public string StringEncoding;
+ public string FloatFormat;
- public const string STRING_ENCODING_ACSII = "ASCII";
- public const string STRING_ENCODING_UCS2 = "UCS-2";
- public const string FLOAT_FORMAT_IEEE754 = "IEEE-754";
+ public const string STRING_ENCODING_ACSII = "ASCII";
+ public const string STRING_ENCODING_UCS2 = "UCS-2";
+ public const string FLOAT_FORMAT_IEEE754 = "IEEE-754";
- #endregion
+ #endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Cpx/InvalidDataInBufferException.cs b/Technosoftware/DaAeHdaClient/Cpx/InvalidDataInBufferException.cs
index faeb042..e5511f4 100644
--- a/Technosoftware/DaAeHdaClient/Cpx/InvalidDataInBufferException.cs
+++ b/Technosoftware/DaAeHdaClient/Cpx/InvalidDataInBufferException.cs
@@ -27,22 +27,22 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Cpx
{
- ///
- /// Raised if the data in buffer is not consistent with the schema.
- ///
- [Serializable]
- public class TsCCpxInvalidDataInBufferException : ApplicationException
- {
- private const string Default = "The data in the buffer cannot be read because it is not consistent with the schema.";
- ///
- public TsCCpxInvalidDataInBufferException() : base(Default) { }
- ///
- public TsCCpxInvalidDataInBufferException(string message) : base(Default + Environment.NewLine + message) { }
- ///
- public TsCCpxInvalidDataInBufferException(Exception e) : base(Default, e) { }
- ///
- public TsCCpxInvalidDataInBufferException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
- ///
- protected TsCCpxInvalidDataInBufferException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- }
+ ///
+ /// Raised if the data in buffer is not consistent with the schema.
+ ///
+ [Serializable]
+ public class TsCCpxInvalidDataInBufferException : ApplicationException
+ {
+ private const string Default = "The data in the buffer cannot be read because it is not consistent with the schema.";
+ ///
+ public TsCCpxInvalidDataInBufferException() : base(Default) { }
+ ///
+ public TsCCpxInvalidDataInBufferException(string message) : base(Default + Environment.NewLine + message) { }
+ ///
+ public TsCCpxInvalidDataInBufferException(Exception e) : base(Default, e) { }
+ ///
+ public TsCCpxInvalidDataInBufferException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
+ ///
+ protected TsCCpxInvalidDataInBufferException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Cpx/InvalidDataToWriteException.cs b/Technosoftware/DaAeHdaClient/Cpx/InvalidDataToWriteException.cs
index 8819dcd..189d534 100644
--- a/Technosoftware/DaAeHdaClient/Cpx/InvalidDataToWriteException.cs
+++ b/Technosoftware/DaAeHdaClient/Cpx/InvalidDataToWriteException.cs
@@ -27,22 +27,22 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Cpx
{
- ///
- /// Raised if the data in buffer is not consistent with the schema.
- ///
- [Serializable]
- public class TsCCpxInvalidDataToWriteException : ApplicationException
- {
- private const string Default = "The object cannot be written because it is not consistent with the schema.";
- ///
- public TsCCpxInvalidDataToWriteException() : base(Default) { }
- ///
- public TsCCpxInvalidDataToWriteException(string message) : base(Default + Environment.NewLine + message) { }
- ///
- public TsCCpxInvalidDataToWriteException(Exception e) : base(Default, e) { }
- ///
- public TsCCpxInvalidDataToWriteException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
- ///
- protected TsCCpxInvalidDataToWriteException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- }
+ ///
+ /// Raised if the data in buffer is not consistent with the schema.
+ ///
+ [Serializable]
+ public class TsCCpxInvalidDataToWriteException : ApplicationException
+ {
+ private const string Default = "The object cannot be written because it is not consistent with the schema.";
+ ///
+ public TsCCpxInvalidDataToWriteException() : base(Default) { }
+ ///
+ public TsCCpxInvalidDataToWriteException(string message) : base(Default + Environment.NewLine + message) { }
+ ///
+ public TsCCpxInvalidDataToWriteException(Exception e) : base(Default, e) { }
+ ///
+ public TsCCpxInvalidDataToWriteException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
+ ///
+ protected TsCCpxInvalidDataToWriteException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Cpx/InvalidSchemaException.cs b/Technosoftware/DaAeHdaClient/Cpx/InvalidSchemaException.cs
index 9a8567b..e79f97d 100644
--- a/Technosoftware/DaAeHdaClient/Cpx/InvalidSchemaException.cs
+++ b/Technosoftware/DaAeHdaClient/Cpx/InvalidSchemaException.cs
@@ -27,22 +27,22 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Cpx
{
- ///
- /// Raised if the schema contains errors or inconsistencies.
- ///
- [Serializable]
- public class TsCCpxInvalidSchemaException : ApplicationException
- {
- private const string Default = "The schema cannot be used because it contains errors or inconsitencies.";
- ///
- public TsCCpxInvalidSchemaException() : base(Default) { }
- ///
- public TsCCpxInvalidSchemaException(string message) : base(Default + Environment.NewLine + message) { }
- ///
- public TsCCpxInvalidSchemaException(Exception e) : base(Default, e) { }
- ///
- public TsCCpxInvalidSchemaException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
- ///
- protected TsCCpxInvalidSchemaException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- }
+ ///
+ /// Raised if the schema contains errors or inconsistencies.
+ ///
+ [Serializable]
+ public class TsCCpxInvalidSchemaException : ApplicationException
+ {
+ private const string Default = "The schema cannot be used because it contains errors or inconsitencies.";
+ ///
+ public TsCCpxInvalidSchemaException() : base(Default) { }
+ ///
+ public TsCCpxInvalidSchemaException(string message) : base(Default + Environment.NewLine + message) { }
+ ///
+ public TsCCpxInvalidSchemaException(Exception e) : base(Default, e) { }
+ ///
+ public TsCCpxInvalidSchemaException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
+ ///
+ protected TsCCpxInvalidSchemaException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/AccessRight.cs b/Technosoftware/DaAeHdaClient/Da/AccessRight.cs
index f687014..f843752 100644
--- a/Technosoftware/DaAeHdaClient/Da/AccessRight.cs
+++ b/Technosoftware/DaAeHdaClient/Da/AccessRight.cs
@@ -25,21 +25,21 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines possible item access rights.
- /// Indicates if this item is read only, write only or read/write.
- /// This is NOT related to security but rather to the nature of the underlying
- /// hardware.
- ///
- public enum TsDaAccessRights
+ ///
+ /// Defines possible item access rights.
+ /// Indicates if this item is read only, write only or read/write.
+ /// This is NOT related to security but rather to the nature of the underlying
+ /// hardware.
+ ///
+ public enum TsDaAccessRights
{
- /// The access rights for this item are server.
- Unknown = 0x00,
- /// The client can read the data item's value.
- Readable = 0x01,
- /// The client can change the data item's value.
- Writable = 0x02,
- /// The client can read and change the data item's value.
- ReadWritable = 0x03
- }
+ /// The access rights for this item are server.
+ Unknown = 0x00,
+ /// The client can read the data item's value.
+ Readable = 0x01,
+ /// The client can change the data item's value.
+ Writable = 0x02,
+ /// The client can read and change the data item's value.
+ ReadWritable = 0x03
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/Browse.cs b/Technosoftware/DaAeHdaClient/Da/Browse.cs
index 9f3655f..605daa7 100644
--- a/Technosoftware/DaAeHdaClient/Da/Browse.cs
+++ b/Technosoftware/DaAeHdaClient/Da/Browse.cs
@@ -32,33 +32,33 @@ namespace Technosoftware.DaAeHdaClient.Da
[Serializable]
public class TsCDaBrowsePosition : IOpcBrowsePosition
{
- #region Fields
+ #region Fields
private TsCDaBrowseFilters browseFilters_;
- private OpcItem itemId_;
+ private OpcItem itemId_;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Saves the parameters for an incomplete browse information.
- ///
- public TsCDaBrowsePosition(OpcItem itemId, TsCDaBrowseFilters filters)
- {
- if (filters == null) throw new ArgumentNullException(nameof(filters));
+ /// Saves the parameters for an incomplete browse information.
+ ///
+ public TsCDaBrowsePosition(OpcItem itemId, TsCDaBrowseFilters filters)
+ {
+ if (filters == null) throw new ArgumentNullException(nameof(filters));
- itemId_ = (OpcItem)itemId?.Clone();
- browseFilters_ = (TsCDaBrowseFilters)filters.Clone();
- }
+ itemId_ = (OpcItem)itemId?.Clone();
+ browseFilters_ = (TsCDaBrowseFilters)filters.Clone();
+ }
- ///
- /// Releases unmanaged resources held by the object.
- ///
- public virtual void Dispose()
- {
- // does nothing.
- }
+ ///
+ /// Releases unmanaged resources held by the object.
+ ///
+ public virtual void Dispose()
+ {
+ // does nothing.
+ }
#endregion
- #region Properties
+ #region Properties
///
/// The item identifier of the branch being browsed.
///
@@ -73,21 +73,21 @@ namespace Technosoftware.DaAeHdaClient.Da
/// The maximum number of elements that may be returned in a single browse.
///
// ReSharper disable once UnusedMember.Global
- public int MaxElementsReturned
+ public int MaxElementsReturned
{
get => browseFilters_.MaxElementsReturned;
set => browseFilters_.MaxElementsReturned = value;
}
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
/// Creates a deep copy of the object.
///
- public virtual object Clone()
- {
+ public virtual object Clone()
+ {
return (TsCDaBrowsePosition)MemberwiseClone();
}
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/BrowseElement.cs b/Technosoftware/DaAeHdaClient/Da/BrowseElement.cs
index d227a0f..b3204f9 100644
--- a/Technosoftware/DaAeHdaClient/Da/BrowseElement.cs
+++ b/Technosoftware/DaAeHdaClient/Da/BrowseElement.cs
@@ -26,62 +26,62 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Contains a description of an element in the server address space.
- ///
- [Serializable]
- public class TsCDaBrowseElement : ICloneable
- {
- #region Fields
+ ///
+ /// Contains a description of an element in the server address space.
+ ///
+ [Serializable]
+ public class TsCDaBrowseElement : ICloneable
+ {
+ #region Fields
private TsCDaItemProperty[] itemProperties_ = new TsCDaItemProperty[0];
#endregion
- #region Properties
+ #region Properties
///
- /// A descriptive name for element that is unique within a branch.
- ///
- public string Name { get; set; }
+ /// A descriptive name for element that is unique within a branch.
+ ///
+ public string Name { get; set; }
- ///
- /// The primary identifier for the element within the server namespace.
- ///
- public string ItemName { get; set; }
+ ///
+ /// The primary identifier for the element within the server namespace.
+ ///
+ public string ItemName { get; set; }
- ///
- /// An secondary identifier for the element within the server namespace.
- ///
- public string ItemPath { get; set; }
+ ///
+ /// An secondary identifier for the element within the server namespace.
+ ///
+ public string ItemPath { get; set; }
- ///
- /// Whether the element refers to an item with data that can be accessed.
- ///
- public bool IsItem { get; set; }
+ ///
+ /// Whether the element refers to an item with data that can be accessed.
+ ///
+ public bool IsItem { get; set; }
- ///
- /// Whether the element has children.
- ///
- public bool HasChildren { get; set; }
+ ///
+ /// Whether the element has children.
+ ///
+ public bool HasChildren { get; set; }
- ///
- /// The set of properties for the element.
- ///
- public TsCDaItemProperty[] Properties
- {
- get => itemProperties_;
+ ///
+ /// The set of properties for the element.
+ ///
+ public TsCDaItemProperty[] Properties
+ {
+ get => itemProperties_;
set => itemProperties_ = value;
}
- #endregion
-
- #region ICloneable Members
- ///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- var clone = (TsCDaBrowseElement)MemberwiseClone();
- clone.itemProperties_ = (TsCDaItemProperty[])OpcConvert.Clone(itemProperties_);
- return clone;
- }
#endregion
- };
+
+ #region ICloneable Members
+ ///
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ var clone = (TsCDaBrowseElement)MemberwiseClone();
+ clone.itemProperties_ = (TsCDaItemProperty[])OpcConvert.Clone(itemProperties_);
+ return clone;
+ }
+ #endregion
+ };
}
diff --git a/Technosoftware/DaAeHdaClient/Da/BrowseFilter.cs b/Technosoftware/DaAeHdaClient/Da/BrowseFilter.cs
index 1dfd5fa..444d69c 100644
--- a/Technosoftware/DaAeHdaClient/Da/BrowseFilter.cs
+++ b/Technosoftware/DaAeHdaClient/Da/BrowseFilter.cs
@@ -25,24 +25,24 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// The type of browse elements to return during a browse.
- ///
- public enum TsCDaBrowseFilter
- {
- ///
- /// Return all types of browse elements.
- ///
- All,
+ ///
+ /// The type of browse elements to return during a browse.
+ ///
+ public enum TsCDaBrowseFilter
+ {
+ ///
+ /// Return all types of browse elements.
+ ///
+ All,
- ///
- /// Return only elements that contain other elements.
- ///
- Branch,
+ ///
+ /// Return only elements that contain other elements.
+ ///
+ Branch,
- ///
- /// Return only elements that represent items.
- ///
- Item
- }
+ ///
+ /// Return only elements that represent items.
+ ///
+ Item
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/BrowseFilters.cs b/Technosoftware/DaAeHdaClient/Da/BrowseFilters.cs
index 5dec998..77a39a5 100644
--- a/Technosoftware/DaAeHdaClient/Da/BrowseFilters.cs
+++ b/Technosoftware/DaAeHdaClient/Da/BrowseFilters.cs
@@ -26,72 +26,72 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines a set of filters to apply when browsing.
- ///
- [Serializable]
- public class TsCDaBrowseFilters : ICloneable
- {
- #region Fields
+ ///
+ /// Defines a set of filters to apply when browsing.
+ ///
+ [Serializable]
+ public class TsCDaBrowseFilters : ICloneable
+ {
+ #region Fields
private TsCDaBrowseFilter browseFilter_ = TsCDaBrowseFilter.All;
- private TsDaPropertyID[] propertyIds_;
+ private TsDaPropertyID[] propertyIds_;
#endregion
- #region Properties
+ #region Properties
///
- /// The maximum number of elements to return. Zero means no limit.
- ///
- public int MaxElementsReturned { get; set; }
+ /// The maximum number of elements to return. Zero means no limit.
+ ///
+ public int MaxElementsReturned { get; set; }
- ///
- /// The type of element to return.
- ///
- public TsCDaBrowseFilter BrowseFilter
- {
- get => browseFilter_;
+ ///
+ /// The type of element to return.
+ ///
+ public TsCDaBrowseFilter BrowseFilter
+ {
+ get => browseFilter_;
set => browseFilter_ = value;
}
- ///
- /// An expression used to match the name of the element.
- ///
- public string ElementNameFilter { get; set; }
+ ///
+ /// An expression used to match the name of the element.
+ ///
+ public string ElementNameFilter { get; set; }
- ///
- /// A filter which has semantics that defined by the server.
- ///
- public string VendorFilter { get; set; }
+ ///
+ /// A filter which has semantics that defined by the server.
+ ///
+ public string VendorFilter { get; set; }
- ///
- /// Whether all supported properties to return with each element.
- ///
- public bool ReturnAllProperties { get; set; }
+ ///
+ /// Whether all supported properties to return with each element.
+ ///
+ public bool ReturnAllProperties { get; set; }
- ///
- /// A list of names of the properties to return with each element.
- ///
- public TsDaPropertyID[] PropertyIDs
- {
- get => propertyIds_;
+ ///
+ /// A list of names of the properties to return with each element.
+ ///
+ public TsDaPropertyID[] PropertyIDs
+ {
+ get => propertyIds_;
set => propertyIds_ = value;
}
- ///
- /// Whether property values should be returned with the properties.
- ///
- public bool ReturnPropertyValues { get; set; }
+ ///
+ /// Whether property values should be returned with the properties.
+ ///
+ public bool ReturnPropertyValues { get; set; }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- var clone = (TsCDaBrowseFilters)MemberwiseClone();
- clone.PropertyIDs = (TsDaPropertyID[])PropertyIDs?.Clone();
- return clone;
- }
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ var clone = (TsCDaBrowseFilters)MemberwiseClone();
+ clone.PropertyIDs = (TsDaPropertyID[])PropertyIDs?.Clone();
+ return clone;
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/EuType.cs b/Technosoftware/DaAeHdaClient/Da/EuType.cs
index 359060e..58f454a 100644
--- a/Technosoftware/DaAeHdaClient/Da/EuType.cs
+++ b/Technosoftware/DaAeHdaClient/Da/EuType.cs
@@ -25,21 +25,21 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- /// Defines possible item engineering unit types
- public enum TsDaEuType
+ /// Defines possible item engineering unit types
+ public enum TsDaEuType
{
- /// No engineering unit information available
- NoEnum = 0x01,
- ///
- /// Analog engineering unit - will contain a SAFE ARRAY of exactly two doubles
- /// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
- ///
- Analog = 0x02,
- ///
- /// Enumerated engineering unit - will contain a SAFE ARRAY of strings (VT_ARRAY |
- /// VT_BSTR) which contains a list of strings (Example: “OPEN”, “CLOSE”, “IN TRANSIT”,
- /// etc.) corresponding to sequential numeric values (0, 1, 2, etc.)
- ///
- Enumerated = 0x03
- }
+ /// No engineering unit information available
+ NoEnum = 0x01,
+ ///
+ /// Analog engineering unit - will contain a SAFE ARRAY of exactly two doubles
+ /// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
+ ///
+ Analog = 0x02,
+ ///
+ /// Enumerated engineering unit - will contain a SAFE ARRAY of strings (VT_ARRAY |
+ /// VT_BSTR) which contains a list of strings (Example: “OPEN”, “CLOSE”, “IN TRANSIT”,
+ /// etc.) corresponding to sequential numeric values (0, 1, 2, etc.)
+ ///
+ Enumerated = 0x03
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/IServer.cs b/Technosoftware/DaAeHdaClient/Da/IServer.cs
index 41bfb1e..91469a2 100644
--- a/Technosoftware/DaAeHdaClient/Da/IServer.cs
+++ b/Technosoftware/DaAeHdaClient/Da/IServer.cs
@@ -25,22 +25,22 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines functionality that is common to all OPC Data Access servers.
- ///
- public interface ITsDaServer : IOpcServer
- {
- ///
- /// Returns the filters applied by the server to any item results returned to the client.
- ///
- /// A bit mask indicating which fields should be returned in any item results.
- int GetResultFilters();
+ ///
+ /// Defines functionality that is common to all OPC Data Access servers.
+ ///
+ public interface ITsDaServer : IOpcServer
+ {
+ ///
+ /// Returns the filters applied by the server to any item results returned to the client.
+ ///
+ /// A bit mask indicating which fields should be returned in any item results.
+ int GetResultFilters();
- ///
- /// Sets the filters applied by the server to any item results returned to the client.
- ///
- /// A bit mask indicating which fields should be returned in any item results.
- void SetResultFilters(int filters);
+ ///
+ /// Sets the filters applied by the server to any item results returned to the client.
+ ///
+ /// A bit mask indicating which fields should be returned in any item results.
+ void SetResultFilters(int filters);
///
/// Returns the current server status.
@@ -48,62 +48,62 @@ namespace Technosoftware.DaAeHdaClient.Da
/// The current server status.
OpcServerStatus GetServerStatus();
- ///
- /// Reads the current values for a set of items.
- ///
- /// The set of items to read.
- /// The results of the read operation for each item.
- TsCDaItemValueResult[] Read(TsCDaItem[] items);
+ ///
+ /// Reads the current values for a set of items.
+ ///
+ /// The set of items to read.
+ /// The results of the read operation for each item.
+ TsCDaItemValueResult[] Read(TsCDaItem[] items);
- ///
- /// Writes the value, quality and timestamp for a set of items.
- ///
- /// The set of item values to write.
- /// The results of the write operation for each item.
- OpcItemResult[] Write(TsCDaItemValue[] values);
+ ///
+ /// Writes the value, quality and timestamp for a set of items.
+ ///
+ /// The set of item values to write.
+ /// The results of the write operation for each item.
+ OpcItemResult[] Write(TsCDaItemValue[] values);
- ///
- /// Creates a new subscription.
- ///
- /// The initial state of the subscription.
- /// The new subscription object.
- ITsCDaSubscription CreateSubscription(TsCDaSubscriptionState state);
+ ///
+ /// Creates a new subscription.
+ ///
+ /// The initial state of the subscription.
+ /// The new subscription object.
+ ITsCDaSubscription CreateSubscription(TsCDaSubscriptionState state);
- ///
- /// Cancels a subscription and releases all resources allocated for it.
- ///
- /// The subscription to cancel.
- void CancelSubscription(ITsCDaSubscription subscription);
+ ///
+ /// Cancels a subscription and releases all resources allocated for it.
+ ///
+ /// The subscription to cancel.
+ void CancelSubscription(ITsCDaSubscription subscription);
- ///
- /// Fetches the children of a branch that meet the filter criteria.
- ///
- /// The identifier of branch which is the target of the search.
- /// The filters to use to limit the set of child elements returned.
- /// An object used to continue a browse that could not be completed.
- /// The set of elements found.
- TsCDaBrowseElement[] Browse(
- OpcItem itemId,
- TsCDaBrowseFilters filters,
- out TsCDaBrowsePosition position);
+ ///
+ /// Fetches the children of a branch that meet the filter criteria.
+ ///
+ /// The identifier of branch which is the target of the search.
+ /// The filters to use to limit the set of child elements returned.
+ /// An object used to continue a browse that could not be completed.
+ /// The set of elements found.
+ TsCDaBrowseElement[] Browse(
+ OpcItem itemId,
+ TsCDaBrowseFilters filters,
+ out TsCDaBrowsePosition position);
- ///
- /// Continues a browse operation with previously specified search criteria.
- ///
- /// An object containing the browse operation state information.
- /// The set of elements found.
- TsCDaBrowseElement[] BrowseNext(ref TsCDaBrowsePosition position);
+ ///
+ /// Continues a browse operation with previously specified search criteria.
+ ///
+ /// An object containing the browse operation state information.
+ /// The set of elements found.
+ TsCDaBrowseElement[] BrowseNext(ref TsCDaBrowsePosition position);
- ///
- /// Returns the item properties for a set of items.
- ///
- /// A list of item identifiers.
- /// A list of properties to fetch for each item.
- /// Whether the property values should be returned with the properties.
- /// A list of properties for each item.
- TsCDaItemPropertyCollection[] GetProperties(
- OpcItem[] itemIds,
- TsDaPropertyID[] propertyIDs,
- bool returnValues);
- }
+ ///
+ /// Returns the item properties for a set of items.
+ ///
+ /// A list of item identifiers.
+ /// A list of properties to fetch for each item.
+ /// Whether the property values should be returned with the properties.
+ /// A list of properties for each item.
+ TsCDaItemPropertyCollection[] GetProperties(
+ OpcItem[] itemIds,
+ TsDaPropertyID[] propertyIDs,
+ bool returnValues);
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/ISubscription.cs b/Technosoftware/DaAeHdaClient/Da/ISubscription.cs
index 8b99595..ce08503 100644
--- a/Technosoftware/DaAeHdaClient/Da/ISubscription.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ISubscription.cs
@@ -27,89 +27,89 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// A subscription for a set of items on a single OPC server.
- ///
- public interface ITsCDaSubscription : IDisposable
- {
- #region Events
+ ///
+ /// A subscription for a set of items on a single OPC server.
+ ///
+ public interface ITsCDaSubscription : IDisposable
+ {
+ #region Events
///
/// An event to receive data change updates.
///
event TsCDaDataChangedEventHandler DataChangedEvent;
#endregion
- #region Result Filters
+ #region Result Filters
///
- /// Returns the filters applied by the server to any item results returned to the client.
- ///
- /// A bit mask indicating which fields should be returned in any item results.
- int GetResultFilters();
+ /// Returns the filters applied by the server to any item results returned to the client.
+ ///
+ /// A bit mask indicating which fields should be returned in any item results.
+ int GetResultFilters();
- ///
- /// Sets the filters applied by the server to any item results returned to the client.
- ///
- /// A bit mask indicating which fields should be returned in any item results.
- void SetResultFilters(int filters);
+ ///
+ /// Sets the filters applied by the server to any item results returned to the client.
+ ///
+ /// A bit mask indicating which fields should be returned in any item results.
+ void SetResultFilters(int filters);
#endregion
- #region State Management
+ #region State Management
///
- /// Returns the current state of the subscription.
- ///
- /// The current state of the subscription.
- TsCDaSubscriptionState GetState();
+ /// Returns the current state of the subscription.
+ ///
+ /// The current state of the subscription.
+ TsCDaSubscriptionState GetState();
- ///
- /// Changes the state of a subscription.
- ///
- /// A bit mask that indicates which elements of the subscription state are changing.
- /// The new subscription state.
- /// The actual subscription state after applying the changes.
- TsCDaSubscriptionState ModifyState(int masks, TsCDaSubscriptionState state);
+ ///
+ /// Changes the state of a subscription.
+ ///
+ /// A bit mask that indicates which elements of the subscription state are changing.
+ /// The new subscription state.
+ /// The actual subscription state after applying the changes.
+ TsCDaSubscriptionState ModifyState(int masks, TsCDaSubscriptionState state);
#endregion
- #region Item Management
+ #region Item Management
///
- /// Adds items to the subscription.
- ///
- /// The set of items to add to the subscription.
- /// The results of the add item operation for each item.
- TsCDaItemResult[] AddItems(TsCDaItem[] items);
+ /// Adds items to the subscription.
+ ///
+ /// The set of items to add to the subscription.
+ /// The results of the add item operation for each item.
+ TsCDaItemResult[] AddItems(TsCDaItem[] items);
- ///
- /// Modifies the state of items in the subscription
- ///
- /// Specifies which item state parameters are being modified.
- /// The new state for each item.
- /// The results of the modify item operation for each item.
- TsCDaItemResult[] ModifyItems(int masks, TsCDaItem[] items);
+ ///
+ /// Modifies the state of items in the subscription
+ ///
+ /// Specifies which item state parameters are being modified.
+ /// The new state for each item.
+ /// The results of the modify item operation for each item.
+ TsCDaItemResult[] ModifyItems(int masks, TsCDaItem[] items);
- ///
- /// Removes items from the subscription.
- ///
- /// The identifiers (i.e. server handles) for the items being removed.
- /// The results of the remove item operation for each item.
- OpcItemResult[] RemoveItems(OpcItem[] items);
+ ///
+ /// Removes items from the subscription.
+ ///
+ /// The identifiers (i.e. server handles) for the items being removed.
+ /// The results of the remove item operation for each item.
+ OpcItemResult[] RemoveItems(OpcItem[] items);
#endregion
- #region Synchronous I/O
+ #region Synchronous I/O
///
- /// Reads the values for a set of items in the subscription.
- ///
- /// The identifiers (i.e. server handles) for the items being read.
- /// The value for each of items.
- TsCDaItemValueResult[] Read(TsCDaItem[] items);
+ /// Reads the values for a set of items in the subscription.
+ ///
+ /// The identifiers (i.e. server handles) for the items being read.
+ /// The value for each of items.
+ TsCDaItemValueResult[] Read(TsCDaItem[] items);
- ///
- /// Writes the value, quality and timestamp for a set of items in the subscription.
- ///
- /// The item values to write.
- /// The results of the write operation for each item.
- OpcItemResult[] Write(TsCDaItemValue[] items);
+ ///
+ /// Writes the value, quality and timestamp for a set of items in the subscription.
+ ///
+ /// The item values to write.
+ /// The results of the write operation for each item.
+ OpcItemResult[] Write(TsCDaItemValue[] items);
#endregion
- #region Asynchronous I/O
+ #region Asynchronous I/O
///
/// Begins an asynchronous read operation for a set of items.
///
@@ -145,36 +145,36 @@ namespace Technosoftware.DaAeHdaClient.Da
/// The function to invoke when the cancel completes.
void Cancel(IOpcRequest request, TsCDaCancelCompleteEventHandler callback);
- ///
- /// Causes the server to send a data changed notification for all active items.
- ///
- void Refresh();
+ ///
+ /// Causes the server to send a data changed notification for all active items.
+ ///
+ void Refresh();
- ///
- /// Causes the server to send a data changed notification for all active items.
- ///
- /// An identifier for the request assigned by the caller.
- /// An object that contains the state of the request (used to cancel the request).
- /// A set of results containing any errors encountered when the server validated the items.
- void Refresh(
- object requestHandle,
- out IOpcRequest request);
+ ///
+ /// Causes the server to send a data changed notification for all active items.
+ ///
+ /// An identifier for the request assigned by the caller.
+ /// An object that contains the state of the request (used to cancel the request).
+ /// A set of results containing any errors encountered when the server validated the items.
+ void Refresh(
+ object requestHandle,
+ out IOpcRequest request);
- ///
- /// Enables or disables data change notifications from the server.
- ///
- /// Whether data change notifications are enabled.
- void SetEnabled(bool enabled);
+ ///
+ /// Enables or disables data change notifications from the server.
+ ///
+ /// Whether data change notifications are enabled.
+ void SetEnabled(bool enabled);
- ///
- /// Checks whether data change notifications from the server are enabled.
- ///
- /// Whether data change notifications are enabled.
- bool GetEnabled();
+ ///
+ /// Checks whether data change notifications from the server are enabled.
+ ///
+ /// Whether data change notifications are enabled.
+ bool GetEnabled();
#endregion
- }
+ }
- #region Delegate Declarations
+ #region Delegate Declarations
///
/// A delegate to receive data change updates from the server.
///
diff --git a/Technosoftware/DaAeHdaClient/Da/Item.cs b/Technosoftware/DaAeHdaClient/Da/Item.cs
index 4f720bb..d46a0e8 100644
--- a/Technosoftware/DaAeHdaClient/Da/Item.cs
+++ b/Technosoftware/DaAeHdaClient/Da/Item.cs
@@ -32,21 +32,21 @@ namespace Technosoftware.DaAeHdaClient.Da
[Serializable]
public class TsCDaItem : OpcItem
{
- #region Fields
+ #region Fields
private bool active_ = true;
- private float deadband_;
+ private float deadband_;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with default values.
- ///
- public TsCDaItem() { }
+ /// Initializes the object with default values.
+ ///
+ public TsCDaItem() { }
- ///
- /// Initializes object with the specified ItemIdentifier object.
- ///
- public TsCDaItem(OpcItem item)
+ ///
+ /// Initializes object with the specified ItemIdentifier object.
+ ///
+ public TsCDaItem(OpcItem item)
{
if (item == null)
{
@@ -58,11 +58,11 @@ namespace Technosoftware.DaAeHdaClient.Da
ServerHandle = item.ServerHandle;
}
- ///
- /// Initializes object with the specified Item object.
- ///
- public TsCDaItem(TsCDaItem item)
- : base(item)
+ ///
+ /// Initializes object with the specified Item object.
+ ///
+ public TsCDaItem(TsCDaItem item)
+ : base(item)
{
if (item == null)
{
@@ -80,13 +80,13 @@ namespace Technosoftware.DaAeHdaClient.Da
EnableBuffering = item.EnableBuffering;
EnableBufferingSpecified = item.EnableBufferingSpecified;
}
- #endregion
+ #endregion
- #region Properties
+ #region Properties
///
/// The data type to use when returning the item value.
///
- public Type ReqType { get; set; }
+ public Type ReqType { get; set; }
///
/// The oldest (in milliseconds) acceptable cached value when reading an item.
diff --git a/Technosoftware/DaAeHdaClient/Da/ItemCollection.cs b/Technosoftware/DaAeHdaClient/Da/ItemCollection.cs
index 0a6caab..b9a8c02 100644
--- a/Technosoftware/DaAeHdaClient/Da/ItemCollection.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ItemCollection.cs
@@ -27,26 +27,26 @@ using System.Collections;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// A collection of items.
- ///
- [Serializable]
- public class TsCDaItemCollection : ICloneable, IList
- {
- #region Fields
+ ///
+ /// A collection of items.
+ ///
+ [Serializable]
+ public class TsCDaItemCollection : ICloneable, IList
+ {
+ #region Fields
private ArrayList items_ = new ArrayList();
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes object with the default values.
- ///
- public TsCDaItemCollection() { }
+ /// Initializes object with the default values.
+ ///
+ public TsCDaItemCollection() { }
- ///
- /// Initializes object with the specified ResultCollection object.
- ///
- public TsCDaItemCollection(TsCDaItemCollection items)
+ ///
+ /// Initializes object with the specified ResultCollection object.
+ ///
+ public TsCDaItemCollection(TsCDaItemCollection items)
{
if (items == null)
{
@@ -59,59 +59,59 @@ namespace Technosoftware.DaAeHdaClient.Da
}
#endregion
- #region Properties
+ #region Properties
///
- /// Gets the item at the specified index.
- ///
- public TsCDaItem this[int index]
- {
- get => (TsCDaItem)items_[index];
+ /// Gets the item at the specified index.
+ ///
+ public TsCDaItem this[int index]
+ {
+ get => (TsCDaItem)items_[index];
set => items_[index] = value;
}
- ///
- /// Gets the first item with the specified item id.
- ///
- public TsCDaItem this[OpcItem itemId]
- {
- get
- {
- foreach (TsCDaItem item in items_)
- {
- if (itemId.Key == item.Key)
- {
- return item;
- }
- }
+ ///
+ /// Gets the first item with the specified item id.
+ ///
+ public TsCDaItem this[OpcItem itemId]
+ {
+ get
+ {
+ foreach (TsCDaItem item in items_)
+ {
+ if (itemId.Key == item.Key)
+ {
+ return item;
+ }
+ }
return null;
- }
- }
+ }
+ }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- var clone = (TsCDaItemCollection)MemberwiseClone();
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ var clone = (TsCDaItemCollection)MemberwiseClone();
- clone.items_ = new ArrayList();
+ clone.items_ = new ArrayList();
- foreach (TsCDaItem item in items_)
- {
- clone.items_.Add(item.Clone());
- }
+ foreach (TsCDaItem item in items_)
+ {
+ clone.items_.Add(item.Clone());
+ }
- return clone;
- }
+ return clone;
+ }
#endregion
- #region ICollection Members
+ #region ICollection Members
///
- /// Indicates whether access to the ICollection is synchronized (thread-safe).
- ///
- public bool IsSynchronized => false;
+ /// Indicates whether access to the ICollection is synchronized (thread-safe).
+ ///
+ public bool IsSynchronized => false;
///
/// Gets the number of objects in the collection.
@@ -128,137 +128,137 @@ namespace Technosoftware.DaAeHdaClient.Da
items_?.CopyTo(array, index);
}
- ///
- /// Copies the objects to an Array, starting at a the specified index.
- ///
- /// The one-dimensional Array that is the destination for the objects.
- /// The zero-based index in the Array at which copying begins.
- public void CopyTo(TsCDaItem[] array, int index)
- {
- CopyTo((Array)array, index);
- }
+ ///
+ /// Copies the objects to an Array, starting at a the specified index.
+ ///
+ /// The one-dimensional Array that is the destination for the objects.
+ /// The zero-based index in the Array at which copying begins.
+ public void CopyTo(TsCDaItem[] array, int index)
+ {
+ CopyTo((Array)array, index);
+ }
- ///
- /// Indicates whether access to the ICollection is synchronized (thread-safe).
- ///
- public object SyncRoot => this;
+ ///
+ /// Indicates whether access to the ICollection is synchronized (thread-safe).
+ ///
+ public object SyncRoot => this;
#endregion
- #region IEnumerable Members
+ #region IEnumerable Members
///
- /// Returns an enumerator that can iterate through a collection.
- ///
- /// An IEnumerator that can be used to iterate through the collection.
- public IEnumerator GetEnumerator()
- {
- return items_.GetEnumerator();
- }
+ /// Returns an enumerator that can iterate through a collection.
+ ///
+ /// An IEnumerator that can be used to iterate through the collection.
+ public IEnumerator GetEnumerator()
+ {
+ return items_.GetEnumerator();
+ }
#endregion
- #region IList Members
+ #region IList Members
///
- /// Gets a value indicating whether the IList is read-only.
- ///
- public bool IsReadOnly => false;
+ /// Gets a value indicating whether the IList is read-only.
+ ///
+ public bool IsReadOnly => false;
///
/// Gets or sets the element at the specified index.
///
object IList.this[int index]
- {
- get => items_[index];
+ {
+ get => items_[index];
set
- {
- if (!typeof(TsCDaItem).IsInstanceOfType(value))
- {
- throw new ArgumentException("May only add Item objects into the collection.");
- }
+ {
+ if (!typeof(TsCDaItem).IsInstanceOfType(value))
+ {
+ throw new ArgumentException("May only add Item objects into the collection.");
+ }
- items_[index] = value;
- }
- }
+ items_[index] = value;
+ }
+ }
- ///
- /// Removes the IList item at the specified index.
- ///
- /// The zero-based index of the item to remove.
- public void RemoveAt(int index)
- {
- items_.RemoveAt(index);
- }
+ ///
+ /// Removes the IList item at the specified index.
+ ///
+ /// The zero-based index of the item to remove.
+ public void RemoveAt(int index)
+ {
+ items_.RemoveAt(index);
+ }
- ///
- /// Inserts an item to the IList at the specified position.
- ///
- /// The zero-based index at which value should be inserted.
- /// The Object to insert into the IList.
- public void Insert(int index, object value)
- {
- if (!typeof(TsCDaItem).IsInstanceOfType(value))
- {
- throw new ArgumentException("May only add Item objects into the collection.");
- }
+ ///
+ /// Inserts an item to the IList at the specified position.
+ ///
+ /// The zero-based index at which value should be inserted.
+ /// The Object to insert into the IList.
+ public void Insert(int index, object value)
+ {
+ if (!typeof(TsCDaItem).IsInstanceOfType(value))
+ {
+ throw new ArgumentException("May only add Item objects into the collection.");
+ }
- items_.Insert(index, value);
- }
+ items_.Insert(index, value);
+ }
- ///
- /// Removes the first occurrence of a specific object from the IList.
- ///
- /// The Object to remove from the IList.
- public void Remove(object value)
- {
- items_.Remove(value);
- }
+ ///
+ /// Removes the first occurrence of a specific object from the IList.
+ ///
+ /// The Object to remove from the IList.
+ public void Remove(object value)
+ {
+ items_.Remove(value);
+ }
- ///
- /// Determines whether the IList contains a specific value.
- ///
- /// The Object to locate in the IList.
- /// true if the Object is found in the IList; otherwise, false.
- public bool Contains(object value)
- {
- return items_.Contains(value);
- }
+ ///
+ /// Determines whether the IList contains a specific value.
+ ///
+ /// The Object to locate in the IList.
+ /// true if the Object is found in the IList; otherwise, false.
+ public bool Contains(object value)
+ {
+ return items_.Contains(value);
+ }
- ///
- /// Removes all items from the IList.
- ///
- public void Clear()
- {
- items_.Clear();
- }
+ ///
+ /// Removes all items from the IList.
+ ///
+ public void Clear()
+ {
+ items_.Clear();
+ }
- ///
- /// Determines the index of a specific item in the IList.
- ///
- /// The Object to locate in the IList.
- /// The index of value if found in the list; otherwise, -1.
- public int IndexOf(object value)
- {
- return items_.IndexOf(value);
- }
+ ///
+ /// Determines the index of a specific item in the IList.
+ ///
+ /// The Object to locate in the IList.
+ /// The index of value if found in the list; otherwise, -1.
+ public int IndexOf(object value)
+ {
+ return items_.IndexOf(value);
+ }
- ///
- /// Adds an item to the IList.
- ///
- /// The Object to add to the IList.
- /// The position into which the new element was inserted.
- public int Add(object value)
- {
- if (!typeof(TsCDaItem).IsInstanceOfType(value))
- {
- throw new ArgumentException("May only add Item objects into the collection.");
- }
+ ///
+ /// Adds an item to the IList.
+ ///
+ /// The Object to add to the IList.
+ /// The position into which the new element was inserted.
+ public int Add(object value)
+ {
+ if (!typeof(TsCDaItem).IsInstanceOfType(value))
+ {
+ throw new ArgumentException("May only add Item objects into the collection.");
+ }
- return items_.Add(value);
- }
+ return items_.Add(value);
+ }
- ///
- /// Indicates whether the IList has a fixed size.
- ///
- public bool IsFixedSize => false;
+ ///
+ /// Indicates whether the IList has a fixed size.
+ ///
+ public bool IsFixedSize => false;
///
/// Inserts an item to the IList at the specified position.
@@ -266,48 +266,48 @@ namespace Technosoftware.DaAeHdaClient.Da
/// The zero-based index at which value should be inserted.
/// The Object to insert into the IList.
public void Insert(int index, TsCDaItem value)
- {
- Insert(index, (object)value);
- }
+ {
+ Insert(index, (object)value);
+ }
- ///
- /// Removes the first occurrence of a specific object from the IList.
- ///
- /// The Object to remove from the IList.
- public void Remove(TsCDaItem value)
- {
- Remove((object)value);
- }
+ ///
+ /// Removes the first occurrence of a specific object from the IList.
+ ///
+ /// The Object to remove from the IList.
+ public void Remove(TsCDaItem value)
+ {
+ Remove((object)value);
+ }
- ///
- /// Determines whether the IList contains a specific value.
- ///
- /// The Object to locate in the IList.
- /// true if the Object is found in the IList; otherwise, false.
- public bool Contains(TsCDaItem value)
- {
- return Contains((object)value);
- }
+ ///
+ /// Determines whether the IList contains a specific value.
+ ///
+ /// The Object to locate in the IList.
+ /// true if the Object is found in the IList; otherwise, false.
+ public bool Contains(TsCDaItem value)
+ {
+ return Contains((object)value);
+ }
- ///
- /// Determines the index of a specific item in the IList.
- ///
- /// The Object to locate in the IList.
- /// The index of value if found in the list; otherwise, -1.
- public int IndexOf(TsCDaItem value)
- {
- return IndexOf((object)value);
- }
+ ///
+ /// Determines the index of a specific item in the IList.
+ ///
+ /// The Object to locate in the IList.
+ /// The index of value if found in the list; otherwise, -1.
+ public int IndexOf(TsCDaItem value)
+ {
+ return IndexOf((object)value);
+ }
- ///
- /// Adds an item to the IList.
- ///
- /// The Object to add to the IList.
- /// The position into which the new element was inserted.
- public int Add(TsCDaItem value)
- {
- return Add((object)value);
- }
+ ///
+ /// Adds an item to the IList.
+ ///
+ /// The Object to add to the IList.
+ /// The position into which the new element was inserted.
+ public int Add(TsCDaItem value)
+ {
+ return Add((object)value);
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/ItemProperty.cs b/Technosoftware/DaAeHdaClient/Da/ItemProperty.cs
index dd65433..ca7a794 100644
--- a/Technosoftware/DaAeHdaClient/Da/ItemProperty.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ItemProperty.cs
@@ -26,75 +26,75 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Contains a description of a single item property.
- ///
- [Serializable]
- public class TsCDaItemProperty : ICloneable, IOpcResult
- {
- #region Fields
+ ///
+ /// Contains a description of a single item property.
+ ///
+ [Serializable]
+ public class TsCDaItemProperty : ICloneable, IOpcResult
+ {
+ #region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
- #region Properties
+ #region Properties
- ///
- /// The property identifier.
- ///
- public TsDaPropertyID ID { get; set; }
+ ///
+ /// The property identifier.
+ ///
+ public TsDaPropertyID ID { get; set; }
- ///
- /// A short description of the property.
- ///
- public string Description { get; set; }
+ ///
+ /// A short description of the property.
+ ///
+ public string Description { get; set; }
- ///
- /// The data type of the property.
- ///
- public Type DataType { get; set; }
+ ///
+ /// The data type of the property.
+ ///
+ public Type DataType { get; set; }
- ///
- /// The value of the property.
- ///
- public object Value { get; set; }
+ ///
+ /// The value of the property.
+ ///
+ public object Value { get; set; }
- ///
- /// The primary identifier for the property if it is directly accessible as an item.
- ///
- public string ItemName { get; set; }
+ ///
+ /// The primary identifier for the property if it is directly accessible as an item.
+ ///
+ public string ItemName { get; set; }
- ///
- /// The secondary identifier for the property if it is directly accessible as an item.
- ///
- public string ItemPath { get; set; }
+ ///
+ /// The secondary identifier for the property if it is directly accessible as an item.
+ ///
+ public string ItemPath { get; set; }
#endregion
- #region IOpcResult Members
+ #region IOpcResult Members
///
- /// The object with the result of an operation on an property.
- ///
- public OpcResult Result
- {
- get => result_;
+ /// The object with the result of an operation on an property.
+ ///
+ public OpcResult Result
+ {
+ get => result_;
set => result_ = value;
}
- ///
- /// Vendor specific diagnostic information (not the localized error text).
- ///
- public string DiagnosticInfo { get; set; }
+ ///
+ /// Vendor specific diagnostic information (not the localized error text).
+ ///
+ public string DiagnosticInfo { get; set; }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- var clone = (TsCDaItemProperty)MemberwiseClone();
- clone.Value = OpcConvert.Clone(Value);
- return clone;
- }
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ var clone = (TsCDaItemProperty)MemberwiseClone();
+ clone.Value = OpcConvert.Clone(Value);
+ return clone;
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/ItemPropertyCollection.cs b/Technosoftware/DaAeHdaClient/Da/ItemPropertyCollection.cs
index f5933bd..89d537f 100644
--- a/Technosoftware/DaAeHdaClient/Da/ItemPropertyCollection.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ItemPropertyCollection.cs
@@ -27,149 +27,149 @@ using System.Collections;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// A list of properties for a single item.
- ///
- [Serializable]
- public class TsCDaItemPropertyCollection : ArrayList, IOpcResult
- {
- #region Fields
+ ///
+ /// A list of properties for a single item.
+ ///
+ [Serializable]
+ public class TsCDaItemPropertyCollection : ArrayList, IOpcResult
+ {
+ #region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with its default values.
- ///
- public TsCDaItemPropertyCollection()
- {
- }
+ /// Initializes the object with its default values.
+ ///
+ public TsCDaItemPropertyCollection()
+ {
+ }
- ///
- /// Initializes the object with the specified item identifier.
- ///
- public TsCDaItemPropertyCollection(OpcItem itemId)
- {
- if (itemId != null)
- {
- ItemName = itemId.ItemName;
- ItemPath = itemId.ItemPath;
- }
- }
+ ///
+ /// Initializes the object with the specified item identifier.
+ ///
+ public TsCDaItemPropertyCollection(OpcItem itemId)
+ {
+ if (itemId != null)
+ {
+ ItemName = itemId.ItemName;
+ ItemPath = itemId.ItemPath;
+ }
+ }
- ///
- /// Initializes the object with the specified item identifier and result.
- ///
- public TsCDaItemPropertyCollection(OpcItem itemId, OpcResult result)
- {
- if (itemId != null)
- {
- ItemName = itemId.ItemName;
- ItemPath = itemId.ItemPath;
- }
+ ///
+ /// Initializes the object with the specified item identifier and result.
+ ///
+ public TsCDaItemPropertyCollection(OpcItem itemId, OpcResult result)
+ {
+ if (itemId != null)
+ {
+ ItemName = itemId.ItemName;
+ ItemPath = itemId.ItemPath;
+ }
- result_ = result;
- }
+ result_ = result;
+ }
#endregion
- #region Properties
+ #region Properties
///
- /// The primary identifier for the item within the server namespace.
- ///
- public string ItemName { get; set; }
+ /// The primary identifier for the item within the server namespace.
+ ///
+ public string ItemName { get; set; }
- ///
- /// An secondary identifier for the item within the server namespace.
- ///
- public string ItemPath { get; set; }
+ ///
+ /// An secondary identifier for the item within the server namespace.
+ ///
+ public string ItemPath { get; set; }
- ///
- /// Accesses the items at the specified index.
- ///
- public new TsCDaItemProperty this[int index]
- {
- get => (TsCDaItemProperty)base[index];
+ ///
+ /// Accesses the items at the specified index.
+ ///
+ public new TsCDaItemProperty this[int index]
+ {
+ get => (TsCDaItemProperty)base[index];
set => base[index] = value;
}
#endregion
- #region IOpcResult Members
+ #region IOpcResult Members
///
- /// The error id for the result of an operation on an item.
- ///
- public OpcResult Result
- {
- get => result_;
+ /// The error id for the result of an operation on an item.
+ ///
+ public OpcResult Result
+ {
+ get => result_;
set => result_ = value;
}
- ///
- /// Vendor specific diagnostic information (not the localized error text).
- ///
- public string DiagnosticInfo { get; set; }
- #endregion
-
- #region ICollection Members
///
- /// Copies the objects to an Array, starting at a the specified index.
- ///
- /// The one-dimensional Array that is the destination for the objects.
- /// The zero-based index in the Array at which copying begins.
- public void CopyTo(TsCDaItemProperty[] array, int index)
- {
- CopyTo((Array)array, index);
- }
+ /// Vendor specific diagnostic information (not the localized error text).
+ ///
+ public string DiagnosticInfo { get; set; }
#endregion
- #region IList Members
+ #region ICollection Members
///
- /// Inserts an item to the IList at the specified position.
- ///
- /// The zero-based index at which value should be inserted.
- /// The Object to insert into the IList.
- public void Insert(int index, TsCDaItemProperty value)
- {
- Insert(index, (object)value);
- }
-
- ///
- /// Removes the first occurrence of a specific object from the IList.
- ///
- /// The Object to remove from the IList.
- public void Remove(TsCDaItemProperty value)
- {
- Remove((object)value);
- }
-
- ///
- /// Determines whether the IList contains a specific value.
- ///
- /// The Object to locate in the IList.
- /// true if the Object is found in the IList; otherwise, false.
- public bool Contains(TsCDaItemProperty value)
- {
- return Contains((object)value);
- }
-
- ///
- /// Determines the index of a specific item in the IList.
- ///
- /// The Object to locate in the IList.
- /// The index of value if found in the list; otherwise, -1.
- public int IndexOf(TsCDaItemProperty value)
- {
- return IndexOf((object)value);
- }
-
- ///
- /// Adds an item to the IList.
- ///
- /// The Object to add to the IList.
- /// The position into which the new element was inserted.
- public int Add(TsCDaItemProperty value)
- {
- return Add((object)value);
- }
+ /// Copies the objects to an Array, starting at a the specified index.
+ ///
+ /// The one-dimensional Array that is the destination for the objects.
+ /// The zero-based index in the Array at which copying begins.
+ public void CopyTo(TsCDaItemProperty[] array, int index)
+ {
+ CopyTo((Array)array, index);
+ }
#endregion
- }
+
+ #region IList Members
+ ///
+ /// Inserts an item to the IList at the specified position.
+ ///
+ /// The zero-based index at which value should be inserted.
+ /// The Object to insert into the IList.
+ public void Insert(int index, TsCDaItemProperty value)
+ {
+ Insert(index, (object)value);
+ }
+
+ ///
+ /// Removes the first occurrence of a specific object from the IList.
+ ///
+ /// The Object to remove from the IList.
+ public void Remove(TsCDaItemProperty value)
+ {
+ Remove((object)value);
+ }
+
+ ///
+ /// Determines whether the IList contains a specific value.
+ ///
+ /// The Object to locate in the IList.
+ /// true if the Object is found in the IList; otherwise, false.
+ public bool Contains(TsCDaItemProperty value)
+ {
+ return Contains((object)value);
+ }
+
+ ///
+ /// Determines the index of a specific item in the IList.
+ ///
+ /// The Object to locate in the IList.
+ /// The index of value if found in the list; otherwise, -1.
+ public int IndexOf(TsCDaItemProperty value)
+ {
+ return IndexOf((object)value);
+ }
+
+ ///
+ /// Adds an item to the IList.
+ ///
+ /// The Object to add to the IList.
+ /// The position into which the new element was inserted.
+ public int Add(TsCDaItemProperty value)
+ {
+ return Add((object)value);
+ }
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/ItemResult.cs b/Technosoftware/DaAeHdaClient/Da/ItemResult.cs
index 05d6145..665b567 100644
--- a/Technosoftware/DaAeHdaClient/Da/ItemResult.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ItemResult.cs
@@ -26,79 +26,79 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// The results of an operation on a uniquely identifiable item.
- ///
- [Serializable]
- public class TsCDaItemResult : TsCDaItem, IOpcResult
- {
- #region Fields
- private OpcResult result_ = OpcResult.S_OK;
- #endregion
-
- #region Constructors, Destructor, Initialization
- ///
- /// Initializes the object with default values.
- ///
- public TsCDaItemResult() { }
-
- ///
- /// Initializes the object with an ItemIdentifier object.
- ///
- public TsCDaItemResult(OpcItem item) : base(item) { }
-
- ///
- /// Initializes the object with an ItemIdentifier object and Result.
- ///
- public TsCDaItemResult(OpcItem item, OpcResult resultId)
- : base(item)
- {
- Result = resultId;
- }
-
- ///
- /// Initializes the object with an Item object.
- ///
- public TsCDaItemResult(TsCDaItem item) : base(item) { }
-
- ///
- /// Initializes the object with an Item object and Result.
- ///
- public TsCDaItemResult(TsCDaItem item, OpcResult resultId)
- : base(item)
- {
- Result = resultId;
- }
-
- ///
- /// Initializes object with the specified ItemResult object.
- ///
- public TsCDaItemResult(TsCDaItemResult item)
- : base(item)
- {
- if (item != null)
- {
- Result = item.Result;
- DiagnosticInfo = item.DiagnosticInfo;
- }
- }
+ ///
+ /// The results of an operation on a uniquely identifiable item.
+ ///
+ [Serializable]
+ public class TsCDaItemResult : TsCDaItem, IOpcResult
+ {
+ #region Fields
+ private OpcResult result_ = OpcResult.S_OK;
#endregion
- #region IOpcResult Members
+ #region Constructors, Destructor, Initialization
+ ///
+ /// Initializes the object with default values.
+ ///
+ public TsCDaItemResult() { }
- ///
- /// The error id for the result of an operation on an property.
- ///
- public OpcResult Result
- {
- get => result_;
+ ///
+ /// Initializes the object with an ItemIdentifier object.
+ ///
+ public TsCDaItemResult(OpcItem item) : base(item) { }
+
+ ///
+ /// Initializes the object with an ItemIdentifier object and Result.
+ ///
+ public TsCDaItemResult(OpcItem item, OpcResult resultId)
+ : base(item)
+ {
+ Result = resultId;
+ }
+
+ ///
+ /// Initializes the object with an Item object.
+ ///
+ public TsCDaItemResult(TsCDaItem item) : base(item) { }
+
+ ///
+ /// Initializes the object with an Item object and Result.
+ ///
+ public TsCDaItemResult(TsCDaItem item, OpcResult resultId)
+ : base(item)
+ {
+ Result = resultId;
+ }
+
+ ///
+ /// Initializes object with the specified ItemResult object.
+ ///
+ public TsCDaItemResult(TsCDaItemResult item)
+ : base(item)
+ {
+ if (item != null)
+ {
+ Result = item.Result;
+ DiagnosticInfo = item.DiagnosticInfo;
+ }
+ }
+ #endregion
+
+ #region IOpcResult Members
+
+ ///
+ /// The error id for the result of an operation on an property.
+ ///
+ public OpcResult Result
+ {
+ get => result_;
set => result_ = value;
}
- ///
- /// Vendor specific diagnostic information (not the localized error text).
- ///
- public string DiagnosticInfo { get; set; }
+ ///
+ /// Vendor specific diagnostic information (not the localized error text).
+ ///
+ public string DiagnosticInfo { get; set; }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/ItemValue.cs b/Technosoftware/DaAeHdaClient/Da/ItemValue.cs
index c4a403e..3169a78 100644
--- a/Technosoftware/DaAeHdaClient/Da/ItemValue.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ItemValue.cs
@@ -27,27 +27,27 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Contains the value for a single item.
- ///
- [Serializable]
- public class TsCDaItemValue : OpcItem
- {
- #region Fields
+ ///
+ /// Contains the value for a single item.
+ ///
+ [Serializable]
+ public class TsCDaItemValue : OpcItem
+ {
+ #region Fields
private TsCDaQuality daQuality_ = TsCDaQuality.Bad;
- private DateTime timestamp_ = DateTime.MinValue;
+ private DateTime timestamp_ = DateTime.MinValue;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with default values.
- ///
- public TsCDaItemValue() { }
+ /// Initializes the object with default values.
+ ///
+ public TsCDaItemValue() { }
- ///
- /// Initializes the object with and ItemIdentifier object.
- ///
- public TsCDaItemValue(OpcItem item)
+ ///
+ /// Initializes the object with and ItemIdentifier object.
+ ///
+ public TsCDaItemValue(OpcItem item)
{
if (item == null)
{
@@ -59,19 +59,19 @@ namespace Technosoftware.DaAeHdaClient.Da
ServerHandle = item.ServerHandle;
}
- ///
- /// Initializes the object with the specified item name.
- ///
- public TsCDaItemValue(string itemName)
- : base(itemName)
- {
- }
+ ///
+ /// Initializes the object with the specified item name.
+ ///
+ public TsCDaItemValue(string itemName)
+ : base(itemName)
+ {
+ }
- ///
- /// Initializes object with the specified ItemValue object.
- ///
- public TsCDaItemValue(TsCDaItemValue item)
- : base(item)
+ ///
+ /// Initializes object with the specified ItemValue object.
+ ///
+ public TsCDaItemValue(TsCDaItemValue item)
+ : base(item)
{
if (item == null)
{
@@ -85,53 +85,53 @@ namespace Technosoftware.DaAeHdaClient.Da
}
#endregion
- #region Properties
+ #region Properties
///
- /// The item value.
- ///
- public object Value { get; set; }
+ /// The item value.
+ ///
+ public object Value { get; set; }
- ///
- /// The quality of the item value.
- ///
- public TsCDaQuality Quality
- {
- get => daQuality_;
+ ///
+ /// The quality of the item value.
+ ///
+ public TsCDaQuality Quality
+ {
+ get => daQuality_;
set => daQuality_ = value;
}
- ///
- /// Whether the quality is specified.
- ///
- public bool QualitySpecified { get; set; }
+ ///
+ /// Whether the quality is specified.
+ ///
+ public bool QualitySpecified { get; set; }
- ///
- /// The timestamp for the item value.
- /// The ApplicationInstance.TimeAsUtc property defines
- /// the time format (UTC or local time).
- ///
- public DateTime Timestamp
- {
- get => timestamp_;
+ ///
+ /// The timestamp for the item value.
+ /// The ApplicationInstance.TimeAsUtc property defines
+ /// the time format (UTC or local time).
+ ///
+ public DateTime Timestamp
+ {
+ get => timestamp_;
set => timestamp_ = value;
}
- ///
- /// Whether the timestamp is specified.
- ///
- public bool TimestampSpecified { get; set; }
+ ///
+ /// Whether the timestamp is specified.
+ ///
+ public bool TimestampSpecified { get; set; }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a deep copy of the object.
- ///
- public override object Clone()
- {
- var clone = (TsCDaItemValue)MemberwiseClone();
- clone.Value = OpcConvert.Clone(Value);
- return clone;
- }
+ /// Creates a deep copy of the object.
+ ///
+ public override object Clone()
+ {
+ var clone = (TsCDaItemValue)MemberwiseClone();
+ clone.Value = OpcConvert.Clone(Value);
+ return clone;
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/ItemValueResult.cs b/Technosoftware/DaAeHdaClient/Da/ItemValueResult.cs
index db97581..6740e7d 100644
--- a/Technosoftware/DaAeHdaClient/Da/ItemValueResult.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ItemValueResult.cs
@@ -26,98 +26,98 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// The results of an operation on a uniquely identifiable item value.
- ///
- [Serializable]
- public class TsCDaItemValueResult : TsCDaItemValue, IOpcResult
- {
- #region Fields
+ ///
+ /// The results of an operation on a uniquely identifiable item value.
+ ///
+ [Serializable]
+ public class TsCDaItemValueResult : TsCDaItemValue, IOpcResult
+ {
+ #region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with default values.
- ///
- public TsCDaItemValueResult() { }
+ /// Initializes the object with default values.
+ ///
+ public TsCDaItemValueResult() { }
- ///
- /// Initializes the object with an ItemIdentifier object.
- ///
- public TsCDaItemValueResult(OpcItem item) : base(item) { }
+ ///
+ /// Initializes the object with an ItemIdentifier object.
+ ///
+ public TsCDaItemValueResult(OpcItem item) : base(item) { }
- ///
- /// Initializes the object with an ItemValue object.
- ///
- public TsCDaItemValueResult(TsCDaItemValue item) : base(item) { }
+ ///
+ /// Initializes the object with an ItemValue object.
+ ///
+ public TsCDaItemValueResult(TsCDaItemValue item) : base(item) { }
- ///
- /// Initializes object with the specified ItemValueResult object.
- ///
- public TsCDaItemValueResult(TsCDaItemValueResult item)
- : base(item)
- {
- if (item != null)
- {
- Result = item.Result;
- DiagnosticInfo = item.DiagnosticInfo;
- }
- }
+ ///
+ /// Initializes object with the specified ItemValueResult object.
+ ///
+ public TsCDaItemValueResult(TsCDaItemValueResult item)
+ : base(item)
+ {
+ if (item != null)
+ {
+ Result = item.Result;
+ DiagnosticInfo = item.DiagnosticInfo;
+ }
+ }
- ///
- /// Initializes the object with the specified item name and result code.
- ///
- public TsCDaItemValueResult(string itemName, OpcResult resultId)
- : base(itemName)
- {
- Result = resultId;
- }
+ ///
+ /// Initializes the object with the specified item name and result code.
+ ///
+ public TsCDaItemValueResult(string itemName, OpcResult resultId)
+ : base(itemName)
+ {
+ Result = resultId;
+ }
- ///
- /// Initializes the object with the specified item name, result code and diagnostic info.
- ///
- public TsCDaItemValueResult(string itemName, OpcResult resultId, string diagnosticInfo)
- : base(itemName)
- {
- Result = resultId;
- DiagnosticInfo = diagnosticInfo;
- }
+ ///
+ /// Initializes the object with the specified item name, result code and diagnostic info.
+ ///
+ public TsCDaItemValueResult(string itemName, OpcResult resultId, string diagnosticInfo)
+ : base(itemName)
+ {
+ Result = resultId;
+ DiagnosticInfo = diagnosticInfo;
+ }
- ///
- /// Initialize object with the specified ItemIdentifier and result code.
- ///
- public TsCDaItemValueResult(OpcItem item, OpcResult resultId)
- : base(item)
- {
- Result = resultId;
- }
+ ///
+ /// Initialize object with the specified ItemIdentifier and result code.
+ ///
+ public TsCDaItemValueResult(OpcItem item, OpcResult resultId)
+ : base(item)
+ {
+ Result = resultId;
+ }
- ///
- /// Initializes the object with the specified ItemIdentifier, result code and diagnostic info.
- ///
- public TsCDaItemValueResult(OpcItem item, OpcResult resultId, string diagnosticInfo)
- : base(item)
- {
- Result = resultId;
- DiagnosticInfo = diagnosticInfo;
- }
+ ///
+ /// Initializes the object with the specified ItemIdentifier, result code and diagnostic info.
+ ///
+ public TsCDaItemValueResult(OpcItem item, OpcResult resultId, string diagnosticInfo)
+ : base(item)
+ {
+ Result = resultId;
+ DiagnosticInfo = diagnosticInfo;
+ }
#endregion
- #region IOpcResult Members
+ #region IOpcResult Members
///
- /// The error id for the result of an operation on an property.
- ///
- public OpcResult Result
- {
- get => result_;
+ /// The error id for the result of an operation on an property.
+ ///
+ public OpcResult Result
+ {
+ get => result_;
set => result_ = value;
}
- ///
- /// Vendor specific diagnostic information (not the localized error text).
- ///
- public string DiagnosticInfo { get; set; }
+ ///
+ /// Vendor specific diagnostic information (not the localized error text).
+ ///
+ public string DiagnosticInfo { get; set; }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/LimitBits.cs b/Technosoftware/DaAeHdaClient/Da/LimitBits.cs
index 0e79497..650624e 100644
--- a/Technosoftware/DaAeHdaClient/Da/LimitBits.cs
+++ b/Technosoftware/DaAeHdaClient/Da/LimitBits.cs
@@ -25,20 +25,20 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines the possible limit status bits.
- /// The Limit Field is valid regardless of the Quality and Substatus. In some
- /// cases such as Sensor Failure it can provide useful diagnostic information.
- ///
- public enum TsDaLimitBits
+ ///
+ /// Defines the possible limit status bits.
+ /// The Limit Field is valid regardless of the Quality and Substatus. In some
+ /// cases such as Sensor Failure it can provide useful diagnostic information.
+ ///
+ public enum TsDaLimitBits
{
- /// The value is free to move up or down
- None = 0x0,
- /// The value has ‘pegged’ at some lower limit
- Low = 0x1,
- /// The value has ‘pegged’ at some high limit
- High = 0x2,
- /// The value is a constant and cannot move
- Constant = 0x3
- }
+ /// The value is free to move up or down
+ None = 0x0,
+ /// The value has ‘pegged’ at some lower limit
+ Low = 0x1,
+ /// The value has ‘pegged’ at some high limit
+ High = 0x2,
+ /// The value is a constant and cannot move
+ Constant = 0x3
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/Property.cs b/Technosoftware/DaAeHdaClient/Da/Property.cs
index 024c02f..a1e1799 100644
--- a/Technosoftware/DaAeHdaClient/Da/Property.cs
+++ b/Technosoftware/DaAeHdaClient/Da/Property.cs
@@ -25,294 +25,294 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines identifiers for well-known properties.
- ///
- public class TsDaProperty
- {
- #region Data Access Properties
+ ///
+ /// Defines identifiers for well-known properties.
+ ///
+ public class TsDaProperty
+ {
+ #region Data Access Properties
- /// Item Canonical DataType
- public static readonly TsDaPropertyID DATATYPE = new TsDaPropertyID("dataType", 1, OpcNamespace.OPC_DATA_ACCESS);
+ /// Item Canonical DataType
+ public static readonly TsDaPropertyID DATATYPE = new TsDaPropertyID("dataType", 1, OpcNamespace.OPC_DATA_ACCESS);
- /// Item Value
- ///
- /// Note the type of value returned is as indicated by the "Item Canonical DataType"
- /// and depends on the item. This will behave like a read from DEVICE.
- ///
- public static readonly TsDaPropertyID VALUE = new TsDaPropertyID("value", 2, OpcNamespace.OPC_DATA_ACCESS);
+ /// Item Value
+ ///
+ /// Note the type of value returned is as indicated by the "Item Canonical DataType"
+ /// and depends on the item. This will behave like a read from DEVICE.
+ ///
+ public static readonly TsDaPropertyID VALUE = new TsDaPropertyID("value", 2, OpcNamespace.OPC_DATA_ACCESS);
- /// Item Quality
- /// (OPCQUALITY stored in an I2). This will behave like a read from DEVICE.
- public static readonly TsDaPropertyID QUALITY = new TsDaPropertyID("quality", 3, OpcNamespace.OPC_DATA_ACCESS);
+ /// Item Quality
+ /// (OPCQUALITY stored in an I2). This will behave like a read from DEVICE.
+ public static readonly TsDaPropertyID QUALITY = new TsDaPropertyID("quality", 3, OpcNamespace.OPC_DATA_ACCESS);
- /// Item Timestamp
- ///
- /// (will be converted from FILETIME). This will behave like a read from
- /// DEVICE.
- ///
- public static readonly TsDaPropertyID TIMESTAMP = new TsDaPropertyID("timestamp", 4, OpcNamespace.OPC_DATA_ACCESS);
+ /// Item Timestamp
+ ///
+ /// (will be converted from FILETIME). This will behave like a read from
+ /// DEVICE.
+ ///
+ public static readonly TsDaPropertyID TIMESTAMP = new TsDaPropertyID("timestamp", 4, OpcNamespace.OPC_DATA_ACCESS);
- /// Item Access Rights
- /// (OPCACCESSRIGHTS stored in an I4)
- public static readonly TsDaPropertyID ACCESSRIGHTS = new TsDaPropertyID("accessRights", 5, OpcNamespace.OPC_DATA_ACCESS);
+ /// Item Access Rights
+ /// (OPCACCESSRIGHTS stored in an I4)
+ public static readonly TsDaPropertyID ACCESSRIGHTS = new TsDaPropertyID("accessRights", 5, OpcNamespace.OPC_DATA_ACCESS);
- /// Server Scan Rate
- ///
- /// In Milliseconds. This represents the fastest rate at which the server could
- /// obtain data from the underlying data source. The nature of this source is not defined
- /// but is typically a DCS system, a SCADA system, a PLC via a COMM port or network, a
- /// Device Network, etc. This value generally represents the ‘best case’ fastest
- /// RequestedUpdateRate which could be used if this item were added to an OPCGroup.
- /// The accuracy of this value (the ability of the server to attain ‘best case’
- /// performance) can be greatly affected by system load and other factors.
- ///
- public static readonly TsDaPropertyID SCANRATE = new TsDaPropertyID("scanRate", 6, OpcNamespace.OPC_DATA_ACCESS);
+ /// Server Scan Rate
+ ///
+ /// In Milliseconds. This represents the fastest rate at which the server could
+ /// obtain data from the underlying data source. The nature of this source is not defined
+ /// but is typically a DCS system, a SCADA system, a PLC via a COMM port or network, a
+ /// Device Network, etc. This value generally represents the ‘best case’ fastest
+ /// RequestedUpdateRate which could be used if this item were added to an OPCGroup.
+ /// The accuracy of this value (the ability of the server to attain ‘best case’
+ /// performance) can be greatly affected by system load and other factors.
+ ///
+ public static readonly TsDaPropertyID SCANRATE = new TsDaPropertyID("scanRate", 6, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Indicate the type of Engineering Units (EU) information (if any) contained in
- /// EUINFO.
- ///
- /// -
- /// 0 - No EU information available (EUINFO will be VT_EMPTY).
- ///
- /// -
- /// 1 - Analog - EUINFO will contain a SAFEARRAY of exactly two doubles
- /// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
- ///
- /// - 2 - Enumerated - EUINFO will contain a SAFEARRAY of strings (VT_ARRAY |
- /// VT_BSTR) which contains a list of strings (Example: “OPEN”, “CLOSE”, “IN
- /// TRANSIT”, etc.) corresponding to sequential numeric values (0, 1, 2,
- /// etc.)
- ///
- ///
- /// Item EU Type
- public static readonly TsDaPropertyID EUTYPE = new TsDaPropertyID("euType", 7, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Indicate the type of Engineering Units (EU) information (if any) contained in
+ /// EUINFO.
+ ///
+ /// -
+ /// 0 - No EU information available (EUINFO will be VT_EMPTY).
+ ///
+ /// -
+ /// 1 - Analog - EUINFO will contain a SAFEARRAY of exactly two doubles
+ /// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
+ ///
+ /// - 2 - Enumerated - EUINFO will contain a SAFEARRAY of strings (VT_ARRAY |
+ /// VT_BSTR) which contains a list of strings (Example: “OPEN”, “CLOSE”, “IN
+ /// TRANSIT”, etc.) corresponding to sequential numeric values (0, 1, 2,
+ /// etc.)
+ ///
+ ///
+ /// Item EU Type
+ public static readonly TsDaPropertyID EUTYPE = new TsDaPropertyID("euType", 7, OpcNamespace.OPC_DATA_ACCESS);
- /// Item EUInfo
- ///
- ///
- /// If EUTYPE is “Analog” EUINFO will contain a SAFEARRAY of exactly two doubles
- /// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
- ///
- /// If EUTYPE is “Enumerated” - EUINFO will contain a SAFEARRAY of strings
- /// (VT_ARRAY | VT_BSTR) which contains a list of strings (Example: “OPEN”, “CLOSE”,
- /// “IN TRANSIT”, etc.) corresponding to sequential numeric values (0, 1, 2,
- /// etc.)
- ///
- public static readonly TsDaPropertyID EUINFO = new TsDaPropertyID("euInfo", 8, OpcNamespace.OPC_DATA_ACCESS);
+ /// Item EUInfo
+ ///
+ ///
+ /// If EUTYPE is “Analog” EUINFO will contain a SAFEARRAY of exactly two doubles
+ /// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
+ ///
+ /// If EUTYPE is “Enumerated” - EUINFO will contain a SAFEARRAY of strings
+ /// (VT_ARRAY | VT_BSTR) which contains a list of strings (Example: “OPEN”, “CLOSE”,
+ /// “IN TRANSIT”, etc.) corresponding to sequential numeric values (0, 1, 2,
+ /// etc.)
+ ///
+ public static readonly TsDaPropertyID EUINFO = new TsDaPropertyID("euInfo", 8, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// EU Units
- /// e.g. "DEGC" or "GALLONS"
- ///
- public static readonly TsDaPropertyID ENGINEERINGUINTS = new TsDaPropertyID("engineeringUnits", 100, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// EU Units
+ /// e.g. "DEGC" or "GALLONS"
+ ///
+ public static readonly TsDaPropertyID ENGINEERINGUINTS = new TsDaPropertyID("engineeringUnits", 100, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Item Description
- /// e.g. "Evaporator 6 Coolant Temp"
- ///
- public static readonly TsDaPropertyID DESCRIPTION = new TsDaPropertyID("description", 101, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Item Description
+ /// e.g. "Evaporator 6 Coolant Temp"
+ ///
+ public static readonly TsDaPropertyID DESCRIPTION = new TsDaPropertyID("description", 101, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// High EU
- /// Present only for 'analog' data. This represents the highest value likely to
- /// be obtained in normal operation and is intended for such use as automatically
- /// scaling a bargraph display.
- /// e.g. 1400.0
- ///
- public static readonly TsDaPropertyID HIGHEU = new TsDaPropertyID("highEU", 102, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// High EU
+ /// Present only for 'analog' data. This represents the highest value likely to
+ /// be obtained in normal operation and is intended for such use as automatically
+ /// scaling a bargraph display.
+ /// e.g. 1400.0
+ ///
+ public static readonly TsDaPropertyID HIGHEU = new TsDaPropertyID("highEU", 102, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Low EU
- /// Present only for 'analog' data. This represents the lowest value likely to be
- /// obtained in normal operation and is intended for such use as automatically scaling
- /// a bargraph display.
- /// e.g. -200.0
- ///
- public static readonly TsDaPropertyID LOWEU = new TsDaPropertyID("lowEU", 103, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Low EU
+ /// Present only for 'analog' data. This represents the lowest value likely to be
+ /// obtained in normal operation and is intended for such use as automatically scaling
+ /// a bargraph display.
+ /// e.g. -200.0
+ ///
+ public static readonly TsDaPropertyID LOWEU = new TsDaPropertyID("lowEU", 103, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// High Instrument Range
- /// Present only for ‘analog’ data. This represents the highest value that can be
- /// returned by the instrument.
- /// e.g. 9999.9
- ///
- public static readonly TsDaPropertyID HIGHIR = new TsDaPropertyID("highIR", 104, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// High Instrument Range
+ /// Present only for ‘analog’ data. This represents the highest value that can be
+ /// returned by the instrument.
+ /// e.g. 9999.9
+ ///
+ public static readonly TsDaPropertyID HIGHIR = new TsDaPropertyID("highIR", 104, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Low Instrument Range
- /// Present only for ‘analog’ data. This represents the lowest value that can be
- /// returned by the instrument.
- /// e.g. -9999.9
- ///
- public static readonly TsDaPropertyID LOWIR = new TsDaPropertyID("lowIR", 105, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Low Instrument Range
+ /// Present only for ‘analog’ data. This represents the lowest value that can be
+ /// returned by the instrument.
+ /// e.g. -9999.9
+ ///
+ public static readonly TsDaPropertyID LOWIR = new TsDaPropertyID("lowIR", 105, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Contact Close Label
- /// Present only for ‘discrete' data. This represents a string to be associated
- /// with this contact when it is in the closed (non-zero) state
- /// e.g. "RUN", "CLOSE", "ENABLE", "SAFE" ,etc.
- ///
- public static readonly TsDaPropertyID CLOSELABEL = new TsDaPropertyID("closeLabel", 106, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Contact Close Label
+ /// Present only for ‘discrete' data. This represents a string to be associated
+ /// with this contact when it is in the closed (non-zero) state
+ /// e.g. "RUN", "CLOSE", "ENABLE", "SAFE" ,etc.
+ ///
+ public static readonly TsDaPropertyID CLOSELABEL = new TsDaPropertyID("closeLabel", 106, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Contact Open Label
- /// Present only for ‘discrete' data. This represents a string to be associated
- /// with this contact when it is in the open (zero) state
- /// e.g. "STOP", "OPEN", "DISABLE", "UNSAFE" ,etc.
- ///
- public static readonly TsDaPropertyID OPENLABEL = new TsDaPropertyID("openLabel", 107, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Contact Open Label
+ /// Present only for ‘discrete' data. This represents a string to be associated
+ /// with this contact when it is in the open (zero) state
+ /// e.g. "STOP", "OPEN", "DISABLE", "UNSAFE" ,etc.
+ ///
+ public static readonly TsDaPropertyID OPENLABEL = new TsDaPropertyID("openLabel", 107, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Item Timezone
- /// The difference in minutes between the items UTC Timestamp and the local time
- /// in which the item value was obtained.
- ///
- ///
- /// See the OPCGroup TimeBias property. Also see the WIN32 TIME_ZONE_INFORMATION
- /// structure.
- ///
- public static readonly TsDaPropertyID TIMEZONE = new TsDaPropertyID("timeZone", 108, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Item Timezone
+ /// The difference in minutes between the items UTC Timestamp and the local time
+ /// in which the item value was obtained.
+ ///
+ ///
+ /// See the OPCGroup TimeBias property. Also see the WIN32 TIME_ZONE_INFORMATION
+ /// structure.
+ ///
+ public static readonly TsDaPropertyID TIMEZONE = new TsDaPropertyID("timeZone", 108, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Condition Status
- /// The current alarm or condition status associated with the Item
- /// e.g. "NORMAL", "ACTIVE", "HI ALARM", etc
- ///
- public static readonly TsDaPropertyID CONDITION_STATUS = new TsDaPropertyID("conditionStatus", 300, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Condition Status
+ /// The current alarm or condition status associated with the Item
+ /// e.g. "NORMAL", "ACTIVE", "HI ALARM", etc
+ ///
+ public static readonly TsDaPropertyID CONDITION_STATUS = new TsDaPropertyID("conditionStatus", 300, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Alarm Quick Help
- /// A short text string providing a brief set of instructions for the operator to
- /// follow when this alarm occurs.
- ///
- public static readonly TsDaPropertyID ALARM_QUICK_HELP = new TsDaPropertyID("alarmQuickHelp", 301, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Alarm Quick Help
+ /// A short text string providing a brief set of instructions for the operator to
+ /// follow when this alarm occurs.
+ ///
+ public static readonly TsDaPropertyID ALARM_QUICK_HELP = new TsDaPropertyID("alarmQuickHelp", 301, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Alarm Area List
- /// An array of stings indicating the plant or alarm areas which include this
- /// ItemID.
- ///
- public static readonly TsDaPropertyID ALARM_AREA_LIST = new TsDaPropertyID("alarmAreaList", 302, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Alarm Area List
+ /// An array of stings indicating the plant or alarm areas which include this
+ /// ItemID.
+ ///
+ public static readonly TsDaPropertyID ALARM_AREA_LIST = new TsDaPropertyID("alarmAreaList", 302, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Primary Alarm Area
- /// A string indicating the primary plant or alarm area including this
- /// ItemID
- ///
- public static readonly TsDaPropertyID PRIMARY_ALARM_AREA = new TsDaPropertyID("primaryAlarmArea", 303, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Primary Alarm Area
+ /// A string indicating the primary plant or alarm area including this
+ /// ItemID
+ ///
+ public static readonly TsDaPropertyID PRIMARY_ALARM_AREA = new TsDaPropertyID("primaryAlarmArea", 303, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Condition Logic
- /// An arbitrary string describing the test being performed.
- /// e.g. "High Limit Exceeded" or "TAG.PV >= TAG.HILIM"
- ///
- public static readonly TsDaPropertyID CONDITION_LOGIC = new TsDaPropertyID("conditionLogic", 304, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Condition Logic
+ /// An arbitrary string describing the test being performed.
+ /// e.g. "High Limit Exceeded" or "TAG.PV >= TAG.HILIM"
+ ///
+ public static readonly TsDaPropertyID CONDITION_LOGIC = new TsDaPropertyID("conditionLogic", 304, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Limit Exceeded
- /// For multistate alarms, the condition exceeded
- /// e.g. HIHI, HI, LO, LOLO
- ///
- public static readonly TsDaPropertyID LIMIT_EXCEEDED = new TsDaPropertyID("limitExceeded", 305, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Limit Exceeded
+ /// For multistate alarms, the condition exceeded
+ /// e.g. HIHI, HI, LO, LOLO
+ ///
+ public static readonly TsDaPropertyID LIMIT_EXCEEDED = new TsDaPropertyID("limitExceeded", 305, OpcNamespace.OPC_DATA_ACCESS);
- /// Deadband
- public static readonly TsDaPropertyID DEADBAND = new TsDaPropertyID("deadband", 306, OpcNamespace.OPC_DATA_ACCESS);
+ /// Deadband
+ public static readonly TsDaPropertyID DEADBAND = new TsDaPropertyID("deadband", 306, OpcNamespace.OPC_DATA_ACCESS);
- /// HiHi limit
- public static readonly TsDaPropertyID HIHI_LIMIT = new TsDaPropertyID("hihiLimit", 307, OpcNamespace.OPC_DATA_ACCESS);
+ /// HiHi limit
+ public static readonly TsDaPropertyID HIHI_LIMIT = new TsDaPropertyID("hihiLimit", 307, OpcNamespace.OPC_DATA_ACCESS);
- /// Hi Limit
- public static readonly TsDaPropertyID HI_LIMIT = new TsDaPropertyID("hiLimit", 308, OpcNamespace.OPC_DATA_ACCESS);
+ /// Hi Limit
+ public static readonly TsDaPropertyID HI_LIMIT = new TsDaPropertyID("hiLimit", 308, OpcNamespace.OPC_DATA_ACCESS);
- /// Lo Limit
- public static readonly TsDaPropertyID LO_LIMIT = new TsDaPropertyID("loLimit", 309, OpcNamespace.OPC_DATA_ACCESS);
+ /// Lo Limit
+ public static readonly TsDaPropertyID LO_LIMIT = new TsDaPropertyID("loLimit", 309, OpcNamespace.OPC_DATA_ACCESS);
- /// LoLo Limit
- public static readonly TsDaPropertyID LOLO_LIMIT = new TsDaPropertyID("loloLimit", 310, OpcNamespace.OPC_DATA_ACCESS);
+ /// LoLo Limit
+ public static readonly TsDaPropertyID LOLO_LIMIT = new TsDaPropertyID("loloLimit", 310, OpcNamespace.OPC_DATA_ACCESS);
- /// Rate of Change Limit
- public static readonly TsDaPropertyID RATE_CHANGE_LIMIT = new TsDaPropertyID("rangeOfChangeLimit", 311, OpcNamespace.OPC_DATA_ACCESS);
+ /// Rate of Change Limit
+ public static readonly TsDaPropertyID RATE_CHANGE_LIMIT = new TsDaPropertyID("rangeOfChangeLimit", 311, OpcNamespace.OPC_DATA_ACCESS);
- /// Deviation Limit
- public static readonly TsDaPropertyID DEVIATION_LIMIT = new TsDaPropertyID("deviationLimit", 312, OpcNamespace.OPC_DATA_ACCESS);
+ /// Deviation Limit
+ public static readonly TsDaPropertyID DEVIATION_LIMIT = new TsDaPropertyID("deviationLimit", 312, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Sound File
- /// e.g. C:\MEDIA\FIC101.WAV, or .MID
- ///
- public static readonly TsDaPropertyID SOUNDFILE = new TsDaPropertyID("soundFile", 313, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Sound File
+ /// e.g. C:\MEDIA\FIC101.WAV, or .MID
+ ///
+ public static readonly TsDaPropertyID SOUNDFILE = new TsDaPropertyID("soundFile", 313, OpcNamespace.OPC_DATA_ACCESS);
#endregion
- #region Complex Data Properties
+ #region Complex Data Properties
///
- /// Type System ID
- /// Complex Data Property
- ///
- public static readonly TsDaPropertyID TYPE_SYSTEM_ID = new TsDaPropertyID("typeSystemID", 600, OpcNamespace.OPC_DATA_ACCESS);
+ /// Type System ID
+ /// Complex Data Property
+ ///
+ public static readonly TsDaPropertyID TYPE_SYSTEM_ID = new TsDaPropertyID("typeSystemID", 600, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Dictionary ID
- /// Complex Data Property
- ///
- public static readonly TsDaPropertyID DICTIONARY_ID = new TsDaPropertyID("dictionaryID", 601, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Dictionary ID
+ /// Complex Data Property
+ ///
+ public static readonly TsDaPropertyID DICTIONARY_ID = new TsDaPropertyID("dictionaryID", 601, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Type ID
- /// Complex Data Property
- ///
- public static readonly TsDaPropertyID TYPE_ID = new TsDaPropertyID("typeID", 602, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Type ID
+ /// Complex Data Property
+ ///
+ public static readonly TsDaPropertyID TYPE_ID = new TsDaPropertyID("typeID", 602, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Dictionary
- /// Complex Data Property
- ///
- public static readonly TsDaPropertyID DICTIONARY = new TsDaPropertyID("dictionary", 603, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Dictionary
+ /// Complex Data Property
+ ///
+ public static readonly TsDaPropertyID DICTIONARY = new TsDaPropertyID("dictionary", 603, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Type description
- /// Complex Data Property
- ///
- public static readonly TsDaPropertyID TYPE_DESCRIPTION = new TsDaPropertyID("typeDescription", 604, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Type description
+ /// Complex Data Property
+ ///
+ public static readonly TsDaPropertyID TYPE_DESCRIPTION = new TsDaPropertyID("typeDescription", 604, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Consistency Window
- /// Complex Data Property
- ///
- public static readonly TsDaPropertyID CONSISTENCY_WINDOW = new TsDaPropertyID("consistencyWindow", 605, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Consistency Window
+ /// Complex Data Property
+ ///
+ public static readonly TsDaPropertyID CONSISTENCY_WINDOW = new TsDaPropertyID("consistencyWindow", 605, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Write Behaviour
- /// Complex Data Property, defaults to “All or Nothing” if the complex data item
- /// is writable. Not used for Read-Only items.
- ///
- public static readonly TsDaPropertyID WRITE_BEHAVIOR = new TsDaPropertyID("writeBehavior", 606, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Write Behaviour
+ /// Complex Data Property, defaults to “All or Nothing” if the complex data item
+ /// is writable. Not used for Read-Only items.
+ ///
+ public static readonly TsDaPropertyID WRITE_BEHAVIOR = new TsDaPropertyID("writeBehavior", 606, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Unconverted Item ID
- /// Complex Data Property, the ID of the item that exposes the same complex data
- /// value in its native format. This property is mandatory for items that implement
- /// complex data type conversions.
- ///
- public static readonly TsDaPropertyID UNCONVERTED_ITEM_ID = new TsDaPropertyID("unconvertedItemID", 607, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Unconverted Item ID
+ /// Complex Data Property, the ID of the item that exposes the same complex data
+ /// value in its native format. This property is mandatory for items that implement
+ /// complex data type conversions.
+ ///
+ public static readonly TsDaPropertyID UNCONVERTED_ITEM_ID = new TsDaPropertyID("unconvertedItemID", 607, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Unfiltered Item ID
- /// Complex Data Property, the ID the item that exposes the same complex data
- /// value without any data filter or with the default query applied to it. It is
- /// mandatory for items that implement complex data filters or queries.
- ///
- public static readonly TsDaPropertyID UNFILTERED_ITEM_ID = new TsDaPropertyID("unfilteredItemID", 608, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Unfiltered Item ID
+ /// Complex Data Property, the ID the item that exposes the same complex data
+ /// value without any data filter or with the default query applied to it. It is
+ /// mandatory for items that implement complex data filters or queries.
+ ///
+ public static readonly TsDaPropertyID UNFILTERED_ITEM_ID = new TsDaPropertyID("unfilteredItemID", 608, OpcNamespace.OPC_DATA_ACCESS);
- ///
- /// Data Filter Value
- /// Complex Data Property, the value of the filter that is currently applied to
- /// the item. It is mandatory for items that implement complex data filters or
- /// queries.
- ///
- public static readonly TsDaPropertyID DATA_FILTER_VALUE = new TsDaPropertyID("dataFilterValue", 609, OpcNamespace.OPC_DATA_ACCESS);
+ ///
+ /// Data Filter Value
+ /// Complex Data Property, the value of the filter that is currently applied to
+ /// the item. It is mandatory for items that implement complex data filters or
+ /// queries.
+ ///
+ public static readonly TsDaPropertyID DATA_FILTER_VALUE = new TsDaPropertyID("dataFilterValue", 609, OpcNamespace.OPC_DATA_ACCESS);
#endregion
#region XML Data Access Properties
@@ -324,5 +324,5 @@ namespace Technosoftware.DaAeHdaClient.Da
public static readonly TsDaPropertyID VALUE_PRECISION = new TsDaPropertyID("valuePrecision", 111, OpcNamespace.OPC_DATA_ACCESS);
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/PropertyDescription.cs b/Technosoftware/DaAeHdaClient/Da/PropertyDescription.cs
index 57701ad..576ba4c 100644
--- a/Technosoftware/DaAeHdaClient/Da/PropertyDescription.cs
+++ b/Technosoftware/DaAeHdaClient/Da/PropertyDescription.cs
@@ -28,173 +28,173 @@ using System.Reflection;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Describes an item property.
- ///
- [Serializable]
- public class TsDaPropertyDescription
- {
- #region Constructors, Destructor, Initialization
+ ///
+ /// Describes an item property.
+ ///
+ [Serializable]
+ public class TsDaPropertyDescription
+ {
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with the specified values.
- ///
- public TsDaPropertyDescription(TsDaPropertyID id, Type type, string name)
- {
- ID = id;
- Type = type;
- Name = name;
- }
+ /// Initializes the object with the specified values.
+ ///
+ public TsDaPropertyDescription(TsDaPropertyID id, Type type, string name)
+ {
+ ID = id;
+ Type = type;
+ Name = name;
+ }
#endregion
- #region Properties
+ #region Properties
///
- /// The unique identifier for the property.
- ///
- public TsDaPropertyID ID { get; set; }
+ /// The unique identifier for the property.
+ ///
+ public TsDaPropertyID ID { get; set; }
- ///
- /// The .NET data type for the property.
- ///
- public Type Type { get; set; }
+ ///
+ /// The .NET data type for the property.
+ ///
+ public Type Type { get; set; }
- ///
- /// The short description defined in the OPC specifications.
- ///
- public string Name { get; set; }
+ ///
+ /// The short description defined in the OPC specifications.
+ ///
+ public string Name { get; set; }
#endregion
- #region Data Access Properties
+ #region Data Access Properties
///
- public static readonly TsDaPropertyDescription DATATYPE = new TsDaPropertyDescription(TsDaProperty.DATATYPE, typeof(Type), "Item Canonical DataType");
- ///
- public static readonly TsDaPropertyDescription VALUE = new TsDaPropertyDescription(TsDaProperty.VALUE, typeof(object), "Item Value");
- ///
- public static readonly TsDaPropertyDescription QUALITY = new TsDaPropertyDescription(TsDaProperty.QUALITY, typeof(TsCDaQuality), "Item Quality");
- ///
- public static readonly TsDaPropertyDescription TIMESTAMP = new TsDaPropertyDescription(TsDaProperty.TIMESTAMP, typeof(DateTime), "Item Timestamp");
- ///
- public static readonly TsDaPropertyDescription ACCESSRIGHTS = new TsDaPropertyDescription(TsDaProperty.ACCESSRIGHTS, typeof(TsDaAccessRights), "Item Access Rights");
- ///
- public static readonly TsDaPropertyDescription SCANRATE = new TsDaPropertyDescription(TsDaProperty.SCANRATE, typeof(float), "Server Scan Rate");
- ///
- public static readonly TsDaPropertyDescription EUTYPE = new TsDaPropertyDescription(TsDaProperty.EUTYPE, typeof(TsDaEuType), "Item EU Type");
- ///
- public static readonly TsDaPropertyDescription EUINFO = new TsDaPropertyDescription(TsDaProperty.EUINFO, typeof(string[]), "Item EU Info");
- ///
- public static readonly TsDaPropertyDescription ENGINEERINGUINTS = new TsDaPropertyDescription(TsDaProperty.ENGINEERINGUINTS, typeof(string), "EU Units");
- ///
- public static readonly TsDaPropertyDescription DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.DESCRIPTION, typeof(string), "Item Description");
- ///
- public static readonly TsDaPropertyDescription HIGHEU = new TsDaPropertyDescription(TsDaProperty.HIGHEU, typeof(double), "High EU");
- ///
- public static readonly TsDaPropertyDescription LOWEU = new TsDaPropertyDescription(TsDaProperty.LOWEU, typeof(double), "Low EU");
- ///
- public static readonly TsDaPropertyDescription HIGHIR = new TsDaPropertyDescription(TsDaProperty.HIGHIR, typeof(double), "High Instrument Range");
- ///
- public static readonly TsDaPropertyDescription LOWIR = new TsDaPropertyDescription(TsDaProperty.LOWIR, typeof(double), "Low Instrument Range");
- ///
- public static readonly TsDaPropertyDescription CLOSELABEL = new TsDaPropertyDescription(TsDaProperty.CLOSELABEL, typeof(string), "Contact Close Label");
- ///
- public static readonly TsDaPropertyDescription OPENLABEL = new TsDaPropertyDescription(TsDaProperty.OPENLABEL, typeof(string), "Contact Open Label");
- ///
- public static readonly TsDaPropertyDescription TIMEZONE = new TsDaPropertyDescription(TsDaProperty.TIMEZONE, typeof(int), "Timezone");
- ///
- public static readonly TsDaPropertyDescription CONDITION_STATUS = new TsDaPropertyDescription(TsDaProperty.CONDITION_STATUS, typeof(string), "Condition Status");
- ///
- public static readonly TsDaPropertyDescription ALARM_QUICK_HELP = new TsDaPropertyDescription(TsDaProperty.ALARM_QUICK_HELP, typeof(string), "Alarm Quick Help");
- ///
- public static readonly TsDaPropertyDescription ALARM_AREA_LIST = new TsDaPropertyDescription(TsDaProperty.ALARM_AREA_LIST, typeof(string), "Alarm Area List");
- ///
- public static readonly TsDaPropertyDescription PRIMARY_ALARM_AREA = new TsDaPropertyDescription(TsDaProperty.PRIMARY_ALARM_AREA, typeof(string), "Primary Alarm Area");
- ///
- public static readonly TsDaPropertyDescription CONDITION_LOGIC = new TsDaPropertyDescription(TsDaProperty.CONDITION_LOGIC, typeof(string), "Condition Logic");
- ///
- public static readonly TsDaPropertyDescription LIMIT_EXCEEDED = new TsDaPropertyDescription(TsDaProperty.LIMIT_EXCEEDED, typeof(string), "Limit Exceeded");
- ///
- public static readonly TsDaPropertyDescription DEADBAND = new TsDaPropertyDescription(TsDaProperty.DEADBAND, typeof(double), "Deadband");
- ///
- public static readonly TsDaPropertyDescription HIHI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HIHI_LIMIT, typeof(double), "HiHi Limit");
- ///
- public static readonly TsDaPropertyDescription HI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HI_LIMIT, typeof(double), "Hi Limit");
- ///
- public static readonly TsDaPropertyDescription LO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LO_LIMIT, typeof(double), "Lo Limit");
- ///
- public static readonly TsDaPropertyDescription LOLO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LOLO_LIMIT, typeof(double), "LoLo Limit");
- ///
- public static readonly TsDaPropertyDescription RATE_CHANGE_LIMIT = new TsDaPropertyDescription(TsDaProperty.RATE_CHANGE_LIMIT, typeof(double), "Rate of Change Limit");
- ///
- public static readonly TsDaPropertyDescription DEVIATION_LIMIT = new TsDaPropertyDescription(TsDaProperty.DEVIATION_LIMIT, typeof(double), "Deviation Limit");
- ///
- public static readonly TsDaPropertyDescription SOUNDFILE = new TsDaPropertyDescription(TsDaProperty.SOUNDFILE, typeof(string), "Sound File");
- #endregion
-
- #region Complex Data Properties
+ public static readonly TsDaPropertyDescription DATATYPE = new TsDaPropertyDescription(TsDaProperty.DATATYPE, typeof(Type), "Item Canonical DataType");
///
- public static readonly TsDaPropertyDescription TYPE_SYSTEM_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_SYSTEM_ID, typeof(string), "Type System ID");
- ///
- public static readonly TsDaPropertyDescription DICTIONARY_ID = new TsDaPropertyDescription(TsDaProperty.DICTIONARY_ID, typeof(string), "Dictionary ID");
- ///
- public static readonly TsDaPropertyDescription TYPE_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_ID, typeof(string), "Type ID");
- ///
- public static readonly TsDaPropertyDescription DICTIONARY = new TsDaPropertyDescription(TsDaProperty.DICTIONARY, typeof(object), "Dictionary");
- ///
- public static readonly TsDaPropertyDescription TYPE_DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.TYPE_DESCRIPTION, typeof(string), "Type Description");
- ///
- public static readonly TsDaPropertyDescription CONSISTENCY_WINDOW = new TsDaPropertyDescription(TsDaProperty.CONSISTENCY_WINDOW, typeof(string), "Consistency Window");
- ///
- public static readonly TsDaPropertyDescription WRITE_BEHAVIOR = new TsDaPropertyDescription(TsDaProperty.WRITE_BEHAVIOR, typeof(string), "Write Behavior");
- ///
- public static readonly TsDaPropertyDescription UNCONVERTED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNCONVERTED_ITEM_ID, typeof(string), "Unconverted Item ID");
- ///
- public static readonly TsDaPropertyDescription UNFILTERED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNFILTERED_ITEM_ID, typeof(string), "Unfiltered Item ID");
- ///
- public static readonly TsDaPropertyDescription DATA_FILTER_VALUE = new TsDaPropertyDescription(TsDaProperty.DATA_FILTER_VALUE, typeof(string), "Data Filter Value");
+ public static readonly TsDaPropertyDescription VALUE = new TsDaPropertyDescription(TsDaProperty.VALUE, typeof(object), "Item Value");
+ ///
+ public static readonly TsDaPropertyDescription QUALITY = new TsDaPropertyDescription(TsDaProperty.QUALITY, typeof(TsCDaQuality), "Item Quality");
+ ///
+ public static readonly TsDaPropertyDescription TIMESTAMP = new TsDaPropertyDescription(TsDaProperty.TIMESTAMP, typeof(DateTime), "Item Timestamp");
+ ///
+ public static readonly TsDaPropertyDescription ACCESSRIGHTS = new TsDaPropertyDescription(TsDaProperty.ACCESSRIGHTS, typeof(TsDaAccessRights), "Item Access Rights");
+ ///
+ public static readonly TsDaPropertyDescription SCANRATE = new TsDaPropertyDescription(TsDaProperty.SCANRATE, typeof(float), "Server Scan Rate");
+ ///
+ public static readonly TsDaPropertyDescription EUTYPE = new TsDaPropertyDescription(TsDaProperty.EUTYPE, typeof(TsDaEuType), "Item EU Type");
+ ///
+ public static readonly TsDaPropertyDescription EUINFO = new TsDaPropertyDescription(TsDaProperty.EUINFO, typeof(string[]), "Item EU Info");
+ ///
+ public static readonly TsDaPropertyDescription ENGINEERINGUINTS = new TsDaPropertyDescription(TsDaProperty.ENGINEERINGUINTS, typeof(string), "EU Units");
+ ///
+ public static readonly TsDaPropertyDescription DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.DESCRIPTION, typeof(string), "Item Description");
+ ///
+ public static readonly TsDaPropertyDescription HIGHEU = new TsDaPropertyDescription(TsDaProperty.HIGHEU, typeof(double), "High EU");
+ ///
+ public static readonly TsDaPropertyDescription LOWEU = new TsDaPropertyDescription(TsDaProperty.LOWEU, typeof(double), "Low EU");
+ ///
+ public static readonly TsDaPropertyDescription HIGHIR = new TsDaPropertyDescription(TsDaProperty.HIGHIR, typeof(double), "High Instrument Range");
+ ///
+ public static readonly TsDaPropertyDescription LOWIR = new TsDaPropertyDescription(TsDaProperty.LOWIR, typeof(double), "Low Instrument Range");
+ ///
+ public static readonly TsDaPropertyDescription CLOSELABEL = new TsDaPropertyDescription(TsDaProperty.CLOSELABEL, typeof(string), "Contact Close Label");
+ ///
+ public static readonly TsDaPropertyDescription OPENLABEL = new TsDaPropertyDescription(TsDaProperty.OPENLABEL, typeof(string), "Contact Open Label");
+ ///
+ public static readonly TsDaPropertyDescription TIMEZONE = new TsDaPropertyDescription(TsDaProperty.TIMEZONE, typeof(int), "Timezone");
+ ///
+ public static readonly TsDaPropertyDescription CONDITION_STATUS = new TsDaPropertyDescription(TsDaProperty.CONDITION_STATUS, typeof(string), "Condition Status");
+ ///
+ public static readonly TsDaPropertyDescription ALARM_QUICK_HELP = new TsDaPropertyDescription(TsDaProperty.ALARM_QUICK_HELP, typeof(string), "Alarm Quick Help");
+ ///
+ public static readonly TsDaPropertyDescription ALARM_AREA_LIST = new TsDaPropertyDescription(TsDaProperty.ALARM_AREA_LIST, typeof(string), "Alarm Area List");
+ ///
+ public static readonly TsDaPropertyDescription PRIMARY_ALARM_AREA = new TsDaPropertyDescription(TsDaProperty.PRIMARY_ALARM_AREA, typeof(string), "Primary Alarm Area");
+ ///
+ public static readonly TsDaPropertyDescription CONDITION_LOGIC = new TsDaPropertyDescription(TsDaProperty.CONDITION_LOGIC, typeof(string), "Condition Logic");
+ ///
+ public static readonly TsDaPropertyDescription LIMIT_EXCEEDED = new TsDaPropertyDescription(TsDaProperty.LIMIT_EXCEEDED, typeof(string), "Limit Exceeded");
+ ///
+ public static readonly TsDaPropertyDescription DEADBAND = new TsDaPropertyDescription(TsDaProperty.DEADBAND, typeof(double), "Deadband");
+ ///
+ public static readonly TsDaPropertyDescription HIHI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HIHI_LIMIT, typeof(double), "HiHi Limit");
+ ///
+ public static readonly TsDaPropertyDescription HI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HI_LIMIT, typeof(double), "Hi Limit");
+ ///
+ public static readonly TsDaPropertyDescription LO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LO_LIMIT, typeof(double), "Lo Limit");
+ ///
+ public static readonly TsDaPropertyDescription LOLO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LOLO_LIMIT, typeof(double), "LoLo Limit");
+ ///
+ public static readonly TsDaPropertyDescription RATE_CHANGE_LIMIT = new TsDaPropertyDescription(TsDaProperty.RATE_CHANGE_LIMIT, typeof(double), "Rate of Change Limit");
+ ///
+ public static readonly TsDaPropertyDescription DEVIATION_LIMIT = new TsDaPropertyDescription(TsDaProperty.DEVIATION_LIMIT, typeof(double), "Deviation Limit");
+ ///
+ public static readonly TsDaPropertyDescription SOUNDFILE = new TsDaPropertyDescription(TsDaProperty.SOUNDFILE, typeof(string), "Sound File");
#endregion
- #region Object Member Overrides
+ #region Complex Data Properties
+ ///
+ public static readonly TsDaPropertyDescription TYPE_SYSTEM_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_SYSTEM_ID, typeof(string), "Type System ID");
+ ///
+ public static readonly TsDaPropertyDescription DICTIONARY_ID = new TsDaPropertyDescription(TsDaProperty.DICTIONARY_ID, typeof(string), "Dictionary ID");
+ ///
+ public static readonly TsDaPropertyDescription TYPE_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_ID, typeof(string), "Type ID");
+ ///
+ public static readonly TsDaPropertyDescription DICTIONARY = new TsDaPropertyDescription(TsDaProperty.DICTIONARY, typeof(object), "Dictionary");
+ ///
+ public static readonly TsDaPropertyDescription TYPE_DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.TYPE_DESCRIPTION, typeof(string), "Type Description");
+ ///
+ public static readonly TsDaPropertyDescription CONSISTENCY_WINDOW = new TsDaPropertyDescription(TsDaProperty.CONSISTENCY_WINDOW, typeof(string), "Consistency Window");
+ ///
+ public static readonly TsDaPropertyDescription WRITE_BEHAVIOR = new TsDaPropertyDescription(TsDaProperty.WRITE_BEHAVIOR, typeof(string), "Write Behavior");
+ ///
+ public static readonly TsDaPropertyDescription UNCONVERTED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNCONVERTED_ITEM_ID, typeof(string), "Unconverted Item ID");
+ ///
+ public static readonly TsDaPropertyDescription UNFILTERED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNFILTERED_ITEM_ID, typeof(string), "Unfiltered Item ID");
+ ///
+ public static readonly TsDaPropertyDescription DATA_FILTER_VALUE = new TsDaPropertyDescription(TsDaProperty.DATA_FILTER_VALUE, typeof(string), "Data Filter Value");
+ #endregion
+
+ #region Object Member Overrides
///
- /// Converts the description to a string.
- ///
- public override string ToString()
- {
- return Name;
- }
+ /// Converts the description to a string.
+ ///
+ public override string ToString()
+ {
+ return Name;
+ }
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// Returns the description for the specified property.
- ///
- public static TsDaPropertyDescription Find(TsDaPropertyID id)
- {
- var fields = typeof(TsDaPropertyDescription).GetFields(BindingFlags.Static | BindingFlags.Public);
+ /// Returns the description for the specified property.
+ ///
+ public static TsDaPropertyDescription Find(TsDaPropertyID id)
+ {
+ var fields = typeof(TsDaPropertyDescription).GetFields(BindingFlags.Static | BindingFlags.Public);
- foreach (var field in fields)
- {
- var property = (TsDaPropertyDescription)field.GetValue(typeof(TsDaPropertyDescription));
+ foreach (var field in fields)
+ {
+ var property = (TsDaPropertyDescription)field.GetValue(typeof(TsDaPropertyDescription));
- if (property.ID == id)
- {
- return property;
- }
- }
+ if (property.ID == id)
+ {
+ return property;
+ }
+ }
- return null;
- }
+ return null;
+ }
- ///
- /// Returns an array of all well-known property descriptions.
- ///
- public static TsDaPropertyDescription[] Enumerate()
- {
- var values = new ArrayList();
+ ///
+ /// Returns an array of all well-known property descriptions.
+ ///
+ public static TsDaPropertyDescription[] Enumerate()
+ {
+ var values = new ArrayList();
- var fields = typeof(TsDaPropertyDescription).GetFields(BindingFlags.Static | BindingFlags.Public);
+ var fields = typeof(TsDaPropertyDescription).GetFields(BindingFlags.Static | BindingFlags.Public);
- Array.ForEach(fields, field => values.Add(field.GetValue(typeof(TsDaPropertyDescription))));
+ Array.ForEach(fields, field => values.Add(field.GetValue(typeof(TsDaPropertyDescription))));
- return (TsDaPropertyDescription[])values.ToArray(typeof(TsDaPropertyDescription));
- }
+ return (TsDaPropertyDescription[])values.ToArray(typeof(TsDaPropertyDescription));
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/PropertyID.cs b/Technosoftware/DaAeHdaClient/Da/PropertyID.cs
index 6027bb0..781a750 100644
--- a/Technosoftware/DaAeHdaClient/Da/PropertyID.cs
+++ b/Technosoftware/DaAeHdaClient/Da/PropertyID.cs
@@ -22,91 +22,91 @@
#region Using Directives
using System;
-using System.Xml;
using System.Runtime.Serialization;
+using System.Xml;
#endregion
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Contains a unique identifier for a property.
- ///
- [Serializable]
- public struct TsDaPropertyID : ISerializable
- {
- #region Names Class
+ ///
+ /// Contains a unique identifier for a property.
+ ///
+ [Serializable]
+ public struct TsDaPropertyID : ISerializable
+ {
+ #region Names Class
///
- /// A set of names for fields used in serialization.
- ///
- private class Names
- {
- internal const string Name = "NA";
- internal const string Namespace = "NS";
- internal const string Code = "CO";
- }
+ /// A set of names for fields used in serialization.
+ ///
+ private class Names
+ {
+ internal const string Name = "NA";
+ internal const string Namespace = "NS";
+ internal const string Code = "CO";
+ }
#endregion
- #region Fields
+ #region Fields
private int code_;
- private XmlQualifiedName qualifiedName_;
- #endregion
-
- #region Constructors, Destructor, Initialization
-
- ///
- /// Initializes a property identified by a qualified name.
- ///
- public TsDaPropertyID(XmlQualifiedName name) { qualifiedName_ = name; code_ = 0; }
-
- ///
- /// Initializes a property identified by an integer.
- ///
- public TsDaPropertyID(int code) { qualifiedName_ = null; code_ = code; }
-
- ///
- /// Initializes a property identified by a property description.
- ///
- public TsDaPropertyID(string name, int code, string ns) { qualifiedName_ = new XmlQualifiedName(name, ns); code_ = code; }
-
- ///
- /// During deserialization, SerializationInfo is passed to the class using the constructor provided for this purpose. Any visibility
- /// constraints placed on the constructor are ignored when the object is deserialized; so you can mark the class as public,
- /// protected, internal, or private. However, it is best practice to make the constructor protected unless the class is sealed, in which case
- /// the constructor should be marked private. The constructor should also perform thorough input validation. To avoid misuse by malicious code,
- /// the constructor should enforce the same security checks and permissions required to obtain an instance of the class using any other
- /// constructor.
- ///
- ///
- /// Constructs a server by de-serializing its OpcUrl from the stream.
- ///
- private TsDaPropertyID(SerializationInfo info, StreamingContext context)
- {
- var enumerator = info.GetEnumerator();
- var name = "";
- var ns = "";
- enumerator.Reset();
- while (enumerator.MoveNext())
- {
- if (enumerator.Current.Name.Equals(Names.Name))
- {
- name = (string)enumerator.Current.Value;
- continue;
- }
- if (enumerator.Current.Name.Equals(Names.Namespace))
- {
- ns = (string)enumerator.Current.Value;
- }
- }
- qualifiedName_ = new XmlQualifiedName(name, ns);
- code_ = (int)info.GetValue(Names.Code, typeof(int));
- }
+ private XmlQualifiedName qualifiedName_;
#endregion
- #region Properties
+ #region Constructors, Destructor, Initialization
+
///
- /// Used for properties identified by a qualified name.
- ///
- public XmlQualifiedName Name => qualifiedName_;
+ /// Initializes a property identified by a qualified name.
+ ///
+ public TsDaPropertyID(XmlQualifiedName name) { qualifiedName_ = name; code_ = 0; }
+
+ ///
+ /// Initializes a property identified by an integer.
+ ///
+ public TsDaPropertyID(int code) { qualifiedName_ = null; code_ = code; }
+
+ ///
+ /// Initializes a property identified by a property description.
+ ///
+ public TsDaPropertyID(string name, int code, string ns) { qualifiedName_ = new XmlQualifiedName(name, ns); code_ = code; }
+
+ ///
+ /// During deserialization, SerializationInfo is passed to the class using the constructor provided for this purpose. Any visibility
+ /// constraints placed on the constructor are ignored when the object is deserialized; so you can mark the class as public,
+ /// protected, internal, or private. However, it is best practice to make the constructor protected unless the class is sealed, in which case
+ /// the constructor should be marked private. The constructor should also perform thorough input validation. To avoid misuse by malicious code,
+ /// the constructor should enforce the same security checks and permissions required to obtain an instance of the class using any other
+ /// constructor.
+ ///
+ ///
+ /// Constructs a server by de-serializing its OpcUrl from the stream.
+ ///
+ private TsDaPropertyID(SerializationInfo info, StreamingContext context)
+ {
+ var enumerator = info.GetEnumerator();
+ var name = "";
+ var ns = "";
+ enumerator.Reset();
+ while (enumerator.MoveNext())
+ {
+ if (enumerator.Current.Name.Equals(Names.Name))
+ {
+ name = (string)enumerator.Current.Value;
+ continue;
+ }
+ if (enumerator.Current.Name.Equals(Names.Namespace))
+ {
+ ns = (string)enumerator.Current.Value;
+ }
+ }
+ qualifiedName_ = new XmlQualifiedName(name, ns);
+ code_ = (int)info.GetValue(Names.Code, typeof(int));
+ }
+ #endregion
+
+ #region Properties
+ ///
+ /// Used for properties identified by a qualified name.
+ ///
+ public XmlQualifiedName Name => qualifiedName_;
///
/// Used for properties identified by a integer.
@@ -114,85 +114,85 @@ namespace Technosoftware.DaAeHdaClient.Da
public int Code => code_;
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// Returns true if the objects are equal.
- ///
- public static bool operator ==(TsDaPropertyID a, TsDaPropertyID b)
- {
- return a.Equals(b);
- }
+ /// Returns true if the objects are equal.
+ ///
+ public static bool operator ==(TsDaPropertyID a, TsDaPropertyID b)
+ {
+ return a.Equals(b);
+ }
- ///
- /// Returns true if the objects are not equal.
- ///
- public static bool operator !=(TsDaPropertyID a, TsDaPropertyID b)
- {
- return !a.Equals(b);
- }
+ ///
+ /// Returns true if the objects are not equal.
+ ///
+ public static bool operator !=(TsDaPropertyID a, TsDaPropertyID b)
+ {
+ return !a.Equals(b);
+ }
#endregion
- #region Serialization Functions
+ #region Serialization Functions
///
- /// Serializes a server into a stream.
- ///
- public void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- if (qualifiedName_ != null)
- {
- info.AddValue(Names.Name, qualifiedName_.Name);
- info.AddValue(Names.Namespace, qualifiedName_.Namespace);
- }
- info.AddValue(Names.Code, code_);
- }
+ /// Serializes a server into a stream.
+ ///
+ public void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ if (qualifiedName_ != null)
+ {
+ info.AddValue(Names.Name, qualifiedName_.Name);
+ info.AddValue(Names.Namespace, qualifiedName_.Namespace);
+ }
+ info.AddValue(Names.Code, code_);
+ }
#endregion
- #region Object Member Overrides
- ///
- /// Returns true if the target object is equal to the object.
- ///
- public override bool Equals(object target)
- {
- if (target != null && target.GetType() == typeof(TsDaPropertyID))
- {
- var propertyId = (TsDaPropertyID)target;
+ #region Object Member Overrides
+ ///
+ /// Returns true if the target object is equal to the object.
+ ///
+ public override bool Equals(object target)
+ {
+ if (target != null && target.GetType() == typeof(TsDaPropertyID))
+ {
+ var propertyId = (TsDaPropertyID)target;
- // compare by integer if both specify valid integers.
- if (propertyId.Code != 0 && Code != 0)
- {
- return (propertyId.Code == Code);
- }
+ // compare by integer if both specify valid integers.
+ if (propertyId.Code != 0 && Code != 0)
+ {
+ return (propertyId.Code == Code);
+ }
- // compare by name if both specify valid names.
- if (propertyId.Name != null && Name != null)
- {
- return (propertyId.Name == Name);
- }
- }
+ // compare by name if both specify valid names.
+ if (propertyId.Name != null && Name != null)
+ {
+ return (propertyId.Name == Name);
+ }
+ }
- return false;
- }
+ return false;
+ }
- ///
- /// Returns a useful hash code for the object.
- ///
- public override int GetHashCode()
- {
- if (Code != 0) return Code.GetHashCode();
- if (Name != null) return Name.GetHashCode();
- return base.GetHashCode();
- }
+ ///
+ /// Returns a useful hash code for the object.
+ ///
+ public override int GetHashCode()
+ {
+ if (Code != 0) return Code.GetHashCode();
+ if (Name != null) return Name.GetHashCode();
+ return base.GetHashCode();
+ }
- ///
- /// Converts the property id to a string.
- ///
- public override string ToString()
- {
- if (Name != null && Code != 0) return $"{Name.Name} ({Code})";
- if (Name != null) return Name.Name;
- if (Code != 0) return $"{Code}";
- return "";
- }
- #endregion
- }
+ ///
+ /// Converts the property id to a string.
+ ///
+ public override string ToString()
+ {
+ if (Name != null && Code != 0) return $"{Name.Name} ({Code})";
+ if (Name != null) return Name.Name;
+ if (Code != 0) return $"{Code}";
+ return "";
+ }
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/Quality.cs b/Technosoftware/DaAeHdaClient/Da/Quality.cs
index 3bbce47..cdb0009 100644
--- a/Technosoftware/DaAeHdaClient/Da/Quality.cs
+++ b/Technosoftware/DaAeHdaClient/Da/Quality.cs
@@ -27,225 +27,225 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Contains the quality field for an item value.
- ///
- [Serializable]
- public struct TsCDaQuality
- {
- #region Fields
+ ///
+ /// Contains the quality field for an item value.
+ ///
+ [Serializable]
+ public struct TsCDaQuality
+ {
+ #region Fields
private TsDaQualityBits qualityBits_;
- private TsDaLimitBits limitBits_;
- private byte vendorBits_;
+ private TsDaLimitBits limitBits_;
+ private byte vendorBits_;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with the specified quality.
- ///
- public TsCDaQuality(TsDaQualityBits quality)
- {
- qualityBits_ = quality;
- limitBits_ = TsDaLimitBits.None;
- vendorBits_ = 0;
- }
+ /// Initializes the object with the specified quality.
+ ///
+ public TsCDaQuality(TsDaQualityBits quality)
+ {
+ qualityBits_ = quality;
+ limitBits_ = TsDaLimitBits.None;
+ vendorBits_ = 0;
+ }
- ///
- /// Initializes the object from the contents of a 16 bit integer.
- ///
- public TsCDaQuality(short code)
- {
- qualityBits_ = (TsDaQualityBits)(code & (short)TsDaQualityMasks.QualityMask);
- limitBits_ = (TsDaLimitBits)(code & (short)TsDaQualityMasks.LimitMask);
- vendorBits_ = (byte)((code & (short)TsDaQualityMasks.VendorMask) >> 8);
- }
+ ///
+ /// Initializes the object from the contents of a 16 bit integer.
+ ///
+ public TsCDaQuality(short code)
+ {
+ qualityBits_ = (TsDaQualityBits)(code & (short)TsDaQualityMasks.QualityMask);
+ limitBits_ = (TsDaLimitBits)(code & (short)TsDaQualityMasks.LimitMask);
+ vendorBits_ = (byte)((code & (short)TsDaQualityMasks.VendorMask) >> 8);
+ }
#endregion
- #region Properties
+ #region Properties
///
- /// The value in the quality bits field.
- ///
- public TsDaQualityBits QualityBits
- {
- get => qualityBits_;
+ /// The value in the quality bits field.
+ ///
+ public TsDaQualityBits QualityBits
+ {
+ get => qualityBits_;
set => qualityBits_ = value;
}
- ///
- /// The value in the limit bits field.
- ///
- public TsDaLimitBits LimitBits
- {
- get => limitBits_;
+ ///
+ /// The value in the limit bits field.
+ ///
+ public TsDaLimitBits LimitBits
+ {
+ get => limitBits_;
set => limitBits_ = value;
}
- ///
- /// The value in the quality bits field.
- ///
- public byte VendorBits
- {
- get => vendorBits_;
+ ///
+ /// The value in the quality bits field.
+ ///
+ public byte VendorBits
+ {
+ get => vendorBits_;
set => vendorBits_ = value;
}
- ///
- /// A 'good' quality value.
- ///
- public static readonly TsCDaQuality Good = new TsCDaQuality(TsDaQualityBits.Good);
+ ///
+ /// A 'good' quality value.
+ ///
+ public static readonly TsCDaQuality Good = new TsCDaQuality(TsDaQualityBits.Good);
- ///
- /// An 'bad' quality value.
- ///
- public static readonly TsCDaQuality Bad = new TsCDaQuality(TsDaQualityBits.Bad);
+ ///
+ /// An 'bad' quality value.
+ ///
+ public static readonly TsCDaQuality Bad = new TsCDaQuality(TsDaQualityBits.Bad);
#endregion
- #region Public Methods
+ #region Public Methods
///
- /// Returns the quality as a 16 bit integer.
- ///
- public short GetCode()
- {
- ushort code = 0;
+ /// Returns the quality as a 16 bit integer.
+ ///
+ public short GetCode()
+ {
+ ushort code = 0;
- code |= (ushort)QualityBits;
- code |= (ushort)LimitBits;
- code |= (ushort)(VendorBits << 8);
+ code |= (ushort)QualityBits;
+ code |= (ushort)LimitBits;
+ code |= (ushort)(VendorBits << 8);
- return (code <= short.MaxValue) ? (short)code : (short)-((ushort.MaxValue + 1 - code));
- }
+ return (code <= short.MaxValue) ? (short)code : (short)-((ushort.MaxValue + 1 - code));
+ }
- ///
- /// Initializes the quality from a 16 bit integer.
- ///
- public void SetCode(short code)
- {
- qualityBits_ = (TsDaQualityBits)(code & (short)TsDaQualityMasks.QualityMask);
- limitBits_ = (TsDaLimitBits)(code & (short)TsDaQualityMasks.LimitMask);
- vendorBits_ = (byte)((code & (short)TsDaQualityMasks.VendorMask) >> 8);
- }
+ ///
+ /// Initializes the quality from a 16 bit integer.
+ ///
+ public void SetCode(short code)
+ {
+ qualityBits_ = (TsDaQualityBits)(code & (short)TsDaQualityMasks.QualityMask);
+ limitBits_ = (TsDaLimitBits)(code & (short)TsDaQualityMasks.LimitMask);
+ vendorBits_ = (byte)((code & (short)TsDaQualityMasks.VendorMask) >> 8);
+ }
- ///
- /// Returns true if the objects are equal.
- ///
- public static bool operator ==(TsCDaQuality a, TsCDaQuality b)
- {
- return a.Equals(b);
- }
+ ///
+ /// Returns true if the objects are equal.
+ ///
+ public static bool operator ==(TsCDaQuality a, TsCDaQuality b)
+ {
+ return a.Equals(b);
+ }
- ///
- /// Returns true if the objects are not equal.
- ///
- public static bool operator !=(TsCDaQuality a, TsCDaQuality b)
- {
- return !a.Equals(b);
- }
+ ///
+ /// Returns true if the objects are not equal.
+ ///
+ public static bool operator !=(TsCDaQuality a, TsCDaQuality b)
+ {
+ return !a.Equals(b);
+ }
#endregion
- #region Object Member Overrides
+ #region Object Member Overrides
///
- /// Converts a quality to a string with the format: 'quality[limit]:vendor'.
- ///
- public override string ToString()
- {
- string text = null;
+ /// Converts a quality to a string with the format: 'quality[limit]:vendor'.
+ ///
+ public override string ToString()
+ {
+ string text = null;
- switch (QualityBits)
- {
- case TsDaQualityBits.Good:
- text += "(Good";
- break;
- case TsDaQualityBits.GoodLocalOverride:
- text += "(Good:Local Override";
- break;
- case TsDaQualityBits.Bad:
- text += "(Bad";
- break;
- case TsDaQualityBits.BadConfigurationError:
- text += "(Bad:Configuration Error";
- break;
- case TsDaQualityBits.BadNotConnected:
- text += "(Bad:Not Connected";
- break;
- case TsDaQualityBits.BadDeviceFailure:
- text += "(Bad:Device Failure";
- break;
- case TsDaQualityBits.BadSensorFailure:
- text += "(Bad:Sensor Failure";
- break;
- case TsDaQualityBits.BadLastKnownValue:
- text += "(Bad:Last Known Value";
- break;
- case TsDaQualityBits.BadCommFailure:
- text += "(Bad:Communication Failure";
- break;
- case TsDaQualityBits.BadOutOfService:
- text += "(Bad:Out of Service";
- break;
- case TsDaQualityBits.BadWaitingForInitialData:
- text += "(Bad:Waiting for Initial Data";
- break;
- case TsDaQualityBits.Uncertain:
- text += "(Uncertain";
- break;
- case TsDaQualityBits.UncertainLastUsableValue:
- text += "(Uncertain:Last Usable Value";
- break;
- case TsDaQualityBits.UncertainSensorNotAccurate:
- text += "(Uncertain:Sensor not Accurate";
- break;
- case TsDaQualityBits.UncertainEUExceeded:
- text += "(Uncertain:Engineering Unit exceeded";
- break;
- case TsDaQualityBits.UncertainSubNormal:
- text += "(Uncertain:Sub Normal";
- break;
- }
+ switch (QualityBits)
+ {
+ case TsDaQualityBits.Good:
+ text += "(Good";
+ break;
+ case TsDaQualityBits.GoodLocalOverride:
+ text += "(Good:Local Override";
+ break;
+ case TsDaQualityBits.Bad:
+ text += "(Bad";
+ break;
+ case TsDaQualityBits.BadConfigurationError:
+ text += "(Bad:Configuration Error";
+ break;
+ case TsDaQualityBits.BadNotConnected:
+ text += "(Bad:Not Connected";
+ break;
+ case TsDaQualityBits.BadDeviceFailure:
+ text += "(Bad:Device Failure";
+ break;
+ case TsDaQualityBits.BadSensorFailure:
+ text += "(Bad:Sensor Failure";
+ break;
+ case TsDaQualityBits.BadLastKnownValue:
+ text += "(Bad:Last Known Value";
+ break;
+ case TsDaQualityBits.BadCommFailure:
+ text += "(Bad:Communication Failure";
+ break;
+ case TsDaQualityBits.BadOutOfService:
+ text += "(Bad:Out of Service";
+ break;
+ case TsDaQualityBits.BadWaitingForInitialData:
+ text += "(Bad:Waiting for Initial Data";
+ break;
+ case TsDaQualityBits.Uncertain:
+ text += "(Uncertain";
+ break;
+ case TsDaQualityBits.UncertainLastUsableValue:
+ text += "(Uncertain:Last Usable Value";
+ break;
+ case TsDaQualityBits.UncertainSensorNotAccurate:
+ text += "(Uncertain:Sensor not Accurate";
+ break;
+ case TsDaQualityBits.UncertainEUExceeded:
+ text += "(Uncertain:Engineering Unit exceeded";
+ break;
+ case TsDaQualityBits.UncertainSubNormal:
+ text += "(Uncertain:Sub Normal";
+ break;
+ }
- if (LimitBits != TsDaLimitBits.None)
- {
- text += $":[{LimitBits.ToString()}]";
- }
- else
- {
- text += ":Not Limited";
- }
+ if (LimitBits != TsDaLimitBits.None)
+ {
+ text += $":[{LimitBits.ToString()}]";
+ }
+ else
+ {
+ text += ":Not Limited";
+ }
- if (VendorBits != 0)
- {
- text += $":{VendorBits,0:X})";
- }
- else
- {
- text += ")";
- }
+ if (VendorBits != 0)
+ {
+ text += $":{VendorBits,0:X})";
+ }
+ else
+ {
+ text += ")";
+ }
- return text;
- }
+ return text;
+ }
- ///
- /// Determines whether the specified Object is equal to the current Quality
- ///
- public override bool Equals(object target)
- {
- if (target == null || target.GetType() != typeof(TsCDaQuality)) return false;
+ ///
+ /// Determines whether the specified Object is equal to the current Quality
+ ///
+ public override bool Equals(object target)
+ {
+ if (target == null || target.GetType() != typeof(TsCDaQuality)) return false;
- var quality = (TsCDaQuality)target;
+ var quality = (TsCDaQuality)target;
- if (QualityBits != quality.QualityBits) return false;
- if (LimitBits != quality.LimitBits) return false;
- if (VendorBits != quality.VendorBits) return false;
+ if (QualityBits != quality.QualityBits) return false;
+ if (LimitBits != quality.LimitBits) return false;
+ if (VendorBits != quality.VendorBits) return false;
- return true;
- }
+ return true;
+ }
- ///
- /// Returns hash code for the current Quality.
- ///
- public override int GetHashCode()
- {
- return GetCode();
- }
- #endregion
- }
+ ///
+ /// Returns hash code for the current Quality.
+ ///
+ public override int GetHashCode()
+ {
+ return GetCode();
+ }
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/QualityBits.cs b/Technosoftware/DaAeHdaClient/Da/QualityBits.cs
index 337b719..e229165 100644
--- a/Technosoftware/DaAeHdaClient/Da/QualityBits.cs
+++ b/Technosoftware/DaAeHdaClient/Da/QualityBits.cs
@@ -25,90 +25,90 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines the possible quality status bits.
- /// These flags represent the quality state for an item's data value. This is
- /// intended to be similar to but slightly simpler than the Field-bus Data Quality
- /// Specification (section 4.4.1 in the H1 Final Specifications). This design makes it
- /// fairly easy for both servers and client applications to determine how much
- /// functionality they want to implement.
- ///
- public enum TsDaQualityBits
+ ///
+ /// Defines the possible quality status bits.
+ /// These flags represent the quality state for an item's data value. This is
+ /// intended to be similar to but slightly simpler than the Field-bus Data Quality
+ /// Specification (section 4.4.1 in the H1 Final Specifications). This design makes it
+ /// fairly easy for both servers and client applications to determine how much
+ /// functionality they want to implement.
+ ///
+ public enum TsDaQualityBits
{
- /// The Quality of the value is Good.
- Good = 0x000000C0,
- /// The value has been Overridden. Typically this means the input has been disconnected and a manually entered value has been 'forced'.
- GoodLocalOverride = 0x000000D8,
- /// The value is bad but no specific reason is known.
- Bad = 0x00000000,
- ///
- /// There is some server specific problem with the configuration. For example the
- /// item in question has been deleted from the configuration.
- ///
- BadConfigurationError = 0x00000004,
- ///
- /// The input is required to be logically connected to something but is not. This
- /// quality may reflect that no value is available at this time, for reasons like the value
- /// may have not been provided by the data source.
- ///
- BadNotConnected = 0x00000008,
- /// A device failure has been detected.
- BadDeviceFailure = 0x0000000c,
- ///
- /// A sensor failure had been detected (the Limits field can provide additional
- /// diagnostic information in some situations).
- ///
- BadSensorFailure = 0x00000010,
- ///
- /// Communications have failed. However, the last known value is available. Note that
- /// the age of the value may be determined from the time stamp in the item state.
- ///
- BadLastKnownValue = 0x00000014,
- /// Communications have failed. There is no last known value is available.
- BadCommFailure = 0x00000018,
- ///
- /// The block is off scan or otherwise locked. This quality is also used when the
- /// active state of the item or the subscription containing the item is InActive.
- ///
- BadOutOfService = 0x0000001C,
- ///
- /// After Items are added to a subscription, it may take some time for the server to
- /// actually obtain values for these items. In such cases the client might perform a read
- /// (from cache), or establish a ConnectionPoint based subscription and/or execute a
- /// Refresh on such a subscription before the values are available. This sub-status is only
- /// available from OPC DA 3.0 or newer servers.
- ///
- BadWaitingForInitialData = 0x00000020,
- /// There is no specific reason why the value is uncertain.
- Uncertain = 0x00000040,
- ///
- /// Whatever was writing this value has stopped doing so. The returned value should
- /// be regarded as stale. Note that this differs from a BAD value with sub-status
- /// badLastKnownValue (Last Known Value). That status is associated specifically with a
- /// detectable communications error on a fetched value. This error is associated with the
- /// failure of some external source to put something into the value within an acceptable
- /// period of time. Note that the age of the value can be determined from the time stamp
- /// in the item state.
- ///
- UncertainLastUsableValue = 0x00000044,
- ///
- /// Either the value has pegged at one of the sensor limits (in which case the
- /// limit field should be set to low or high) or the sensor is otherwise known to be out of
- /// calibration via some form of internal diagnostics (in which case the limit field should
- /// be none).
- ///
- UncertainSensorNotAccurate = 0x00000050,
- ///
- /// The returned value is outside the limits defined for this parameter. Note that in
- /// this case (per the Field-bus Specification) the Limits field indicates which limit has
- /// been exceeded but does NOT necessarily imply that the value cannot move farther out of
- /// range.
- ///
- UncertainEUExceeded = 0x00000054,
- ///
- /// The value is derived from multiple sources and has less than the required number
- /// of Good sources.
- ///
- UncertainSubNormal = 0x00000058
- }
+ /// The Quality of the value is Good.
+ Good = 0x000000C0,
+ /// The value has been Overridden. Typically this means the input has been disconnected and a manually entered value has been 'forced'.
+ GoodLocalOverride = 0x000000D8,
+ /// The value is bad but no specific reason is known.
+ Bad = 0x00000000,
+ ///
+ /// There is some server specific problem with the configuration. For example the
+ /// item in question has been deleted from the configuration.
+ ///
+ BadConfigurationError = 0x00000004,
+ ///
+ /// The input is required to be logically connected to something but is not. This
+ /// quality may reflect that no value is available at this time, for reasons like the value
+ /// may have not been provided by the data source.
+ ///
+ BadNotConnected = 0x00000008,
+ /// A device failure has been detected.
+ BadDeviceFailure = 0x0000000c,
+ ///
+ /// A sensor failure had been detected (the Limits?field can provide additional
+ /// diagnostic information in some situations).
+ ///
+ BadSensorFailure = 0x00000010,
+ ///
+ /// Communications have failed. However, the last known value is available. Note that
+ /// the age?of the value may be determined from the time stamp in the item state.
+ ///
+ BadLastKnownValue = 0x00000014,
+ /// Communications have failed. There is no last known value is available.
+ BadCommFailure = 0x00000018,
+ ///
+ /// The block is off scan or otherwise locked. This quality is also used when the
+ /// active state of the item or the subscription containing the item is InActive.
+ ///
+ BadOutOfService = 0x0000001C,
+ ///
+ /// After Items are added to a subscription, it may take some time for the server to
+ /// actually obtain values for these items. In such cases the client might perform a read
+ /// (from cache), or establish a ConnectionPoint based subscription and/or execute a
+ /// Refresh on such a subscription before the values are available. This sub-status is only
+ /// available from OPC DA 3.0 or newer servers.
+ ///
+ BadWaitingForInitialData = 0x00000020,
+ /// There is no specific reason why the value is uncertain.
+ Uncertain = 0x00000040,
+ ///
+ /// Whatever was writing this value has stopped doing so. The returned value should
+ /// be regarded as stale? Note that this differs from a BAD value with sub-status
+ /// badLastKnownValue (Last Known Value). That status is associated specifically with a
+ /// detectable communications error on a fetched?value. This error is associated with the
+ /// failure of some external source to put?something into the value within an acceptable
+ /// period of time. Note that the age?of the value can be determined from the time stamp
+ /// in the item state.
+ ///
+ UncertainLastUsableValue = 0x00000044,
+ ///
+ /// Either the value has pegged?at one of the sensor limits (in which case the
+ /// limit field should be set to low or high) or the sensor is otherwise known to be out of
+ /// calibration via some form of internal diagnostics (in which case the limit field should
+ /// be none).
+ ///
+ UncertainSensorNotAccurate = 0x00000050,
+ ///
+ /// The returned value is outside the limits defined for this parameter. Note that in
+ /// this case (per the Field-bus Specification) the Limits?field indicates which limit has
+ /// been exceeded but does NOT necessarily imply that the value cannot move farther out of
+ /// range.
+ ///
+ UncertainEUExceeded = 0x00000054,
+ ///
+ /// The value is derived from multiple sources and has less than the required number
+ /// of Good sources.
+ ///
+ UncertainSubNormal = 0x00000058
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/QualityMasks.cs b/Technosoftware/DaAeHdaClient/Da/QualityMasks.cs
index 449fc3d..bf5dbad 100644
--- a/Technosoftware/DaAeHdaClient/Da/QualityMasks.cs
+++ b/Technosoftware/DaAeHdaClient/Da/QualityMasks.cs
@@ -25,16 +25,16 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines bit masks for the quality.
- ///
- public enum TsDaQualityMasks : int
- {
- /// Quality related bits
- QualityMask = +0x00FC,
- /// Limit related bits
- LimitMask = +0x0003,
- /// Vendor specific bits
- VendorMask = -0x00FD
- }
+ ///
+ /// Defines bit masks for the quality.
+ ///
+ public enum TsDaQualityMasks : int
+ {
+ /// Quality related bits
+ QualityMask = +0x00FC,
+ /// Limit related bits
+ LimitMask = +0x0003,
+ /// Vendor specific bits
+ VendorMask = -0x00FD
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/Request.cs b/Technosoftware/DaAeHdaClient/Da/Request.cs
index 9045de5..586c1d3 100644
--- a/Technosoftware/DaAeHdaClient/Da/Request.cs
+++ b/Technosoftware/DaAeHdaClient/Da/Request.cs
@@ -26,33 +26,33 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Describes the state of a subscription.
- ///
- [Serializable]
- public class TsCDaRequest : IOpcRequest
- {
- #region Fields
+ ///
+ /// Describes the state of a subscription.
+ ///
+ [Serializable]
+ public class TsCDaRequest : IOpcRequest
+ {
+ #region Fields
private ITsCDaSubscription subscription_;
- private object handle_;
+ private object handle_;
#endregion
- #region Constructors, Destructor, Initialization
+ #region Constructors, Destructor, Initialization
///
- /// Initializes the object with a subscription and a unique id.
- ///
- public TsCDaRequest(ITsCDaSubscription subscription, object handle)
- {
- subscription_ = subscription;
- handle_ = handle;
- }
+ /// Initializes the object with a subscription and a unique id.
+ ///
+ public TsCDaRequest(ITsCDaSubscription subscription, object handle)
+ {
+ subscription_ = subscription;
+ handle_ = handle;
+ }
#endregion
- #region Properties
+ #region Properties
///
- /// The subscription processing the request.
- ///
- public ITsCDaSubscription Subscription => subscription_;
+ /// The subscription processing the request.
+ ///
+ public ITsCDaSubscription Subscription => subscription_;
///
/// An unique identifier, assigned by the client, for the request.
@@ -66,5 +66,5 @@ namespace Technosoftware.DaAeHdaClient.Da
///
public void Cancel(TsCDaCancelCompleteEventHandler callback) { subscription_.Cancel(this, callback); }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/ResultFilter.cs b/Technosoftware/DaAeHdaClient/Da/ResultFilter.cs
index c9c3889..601a5a8 100644
--- a/Technosoftware/DaAeHdaClient/Da/ResultFilter.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ResultFilter.cs
@@ -26,50 +26,50 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Filters applied by the server before returning item results.
- ///
- [Flags]
- public enum TsCDaResultFilter
- {
- ///
- /// Include the ItemName in the ItemIdentifier if bit is set.
- ///
- ItemName = 0x01,
+ ///
+ /// Filters applied by the server before returning item results.
+ ///
+ [Flags]
+ public enum TsCDaResultFilter
+ {
+ ///
+ /// Include the ItemName in the ItemIdentifier if bit is set.
+ ///
+ ItemName = 0x01,
- ///
- /// Include the ItemPath in the ItemIdentifier if bit is set.
- ///
- ItemPath = 0x02,
+ ///
+ /// Include the ItemPath in the ItemIdentifier if bit is set.
+ ///
+ ItemPath = 0x02,
- ///
- /// Include the ClientHandle in the ItemIdentifier if bit is set.
- ///
- ClientHandle = 0x04,
+ ///
+ /// Include the ClientHandle in the ItemIdentifier if bit is set.
+ ///
+ ClientHandle = 0x04,
- ///
- /// Include the Timestamp in the ItemValue if bit is set.
- ///
- ItemTime = 0x08,
+ ///
+ /// Include the Timestamp in the ItemValue if bit is set.
+ ///
+ ItemTime = 0x08,
- ///
- /// Include verbose, localized error text with result if bit is set.
- ///
- ErrorText = 0x10,
+ ///
+ /// Include verbose, localized error text with result if bit is set.
+ ///
+ ErrorText = 0x10,
- ///
- /// Include additional diagnostic information with result if bit is set.
- ///
- DiagnosticInfo = 0x20,
+ ///
+ /// Include additional diagnostic information with result if bit is set.
+ ///
+ DiagnosticInfo = 0x20,
- ///
- /// Include the ItemName and Timestamp if bit is set.
- ///
- Minimal = ItemName | ItemTime,
+ ///
+ /// Include the ItemName and Timestamp if bit is set.
+ ///
+ Minimal = ItemName | ItemTime,
- ///
- /// Include all information in the results if bit is set.
- ///
- All = 0x3F
- }
+ ///
+ /// Include all information in the results if bit is set.
+ ///
+ All = 0x3F
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/Server.cs b/Technosoftware/DaAeHdaClient/Da/Server.cs
index 11f6e31..f7672e2 100644
--- a/Technosoftware/DaAeHdaClient/Da/Server.cs
+++ b/Technosoftware/DaAeHdaClient/Da/Server.cs
@@ -22,8 +22,8 @@
#region Using Directives
using System;
-using System.Runtime.Serialization;
using System.Collections.Generic;
+using System.Runtime.Serialization;
#endregion
namespace Technosoftware.DaAeHdaClient.Da
diff --git a/Technosoftware/DaAeHdaClient/Da/ServerState.cs b/Technosoftware/DaAeHdaClient/Da/ServerState.cs
index bf4d6c3..78fdf1c 100644
--- a/Technosoftware/DaAeHdaClient/Da/ServerState.cs
+++ b/Technosoftware/DaAeHdaClient/Da/ServerState.cs
@@ -25,44 +25,44 @@
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// The set of possible server states.
- ///
- public enum TsCDaServerState
- {
- ///
- /// The server state is not known.
- ///
- Unknown,
+ ///
+ /// The set of possible server states.
+ ///
+ public enum TsCDaServerState
+ {
+ ///
+ /// The server state is not known.
+ ///
+ Unknown,
- ///
- /// The server is running normally.
- ///
- Running,
+ ///
+ /// The server is running normally.
+ ///
+ Running,
- ///
- /// The server is not functioning due to a fatal error.
- ///
- Failed,
+ ///
+ /// The server is not functioning due to a fatal error.
+ ///
+ Failed,
- ///
- /// The server cannot load its configuration information.
- ///
- NoConfig,
+ ///
+ /// The server cannot load its configuration information.
+ ///
+ NoConfig,
- ///
- /// The server has halted all communication with the underlying hardware.
- ///
- Suspended,
+ ///
+ /// The server has halted all communication with the underlying hardware.
+ ///
+ Suspended,
- ///
- /// The server is disconnected from the underlying hardware.
- ///
- Test,
+ ///
+ /// The server is disconnected from the underlying hardware.
+ ///
+ Test,
- ///
- /// The server cannot communicate with the underlying hardware.
- ///
- CommFault
- }
+ ///
+ /// The server cannot communicate with the underlying hardware.
+ ///
+ CommFault
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/StateMask.cs b/Technosoftware/DaAeHdaClient/Da/StateMask.cs
index 03266c3..73b783e 100644
--- a/Technosoftware/DaAeHdaClient/Da/StateMask.cs
+++ b/Technosoftware/DaAeHdaClient/Da/StateMask.cs
@@ -26,67 +26,67 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Defines masks to be used when modifying the subscription or item state.
- ///
- [Flags]
- public enum TsCDaStateMask
- {
- ///
- /// The name of the subscription.
- ///
- Name = 0x0001,
+ ///
+ /// Defines masks to be used when modifying the subscription or item state.
+ ///
+ [Flags]
+ public enum TsCDaStateMask
+ {
+ ///
+ /// The name of the subscription.
+ ///
+ Name = 0x0001,
- ///
- /// The client assigned handle for the item or subscription.
- ///
- ClientHandle = 0x0002,
+ ///
+ /// The client assigned handle for the item or subscription.
+ ///
+ ClientHandle = 0x0002,
- ///
- /// The locale to use for results returned to the client from the subscription.
- ///
- Locale = 0x0004,
+ ///
+ /// The locale to use for results returned to the client from the subscription.
+ ///
+ Locale = 0x0004,
- ///
- /// Whether the item or subscription is active.
- ///
- Active = 0x0008,
+ ///
+ /// Whether the item or subscription is active.
+ ///
+ Active = 0x0008,
- ///
- /// The maximum rate at which data update notifications are sent.
- ///
- UpdateRate = 0x0010,
+ ///
+ /// The maximum rate at which data update notifications are sent.
+ ///
+ UpdateRate = 0x0010,
- ///
- /// The longest period between data update notifications.
- /// Note: This feature is only supported with OPC Data Access 3.0
- /// Servers.
- ///
- KeepAlive = 0x0020,
+ ///
+ /// The longest period between data update notifications.
+ /// Note: This feature is only supported with OPC Data Access 3.0
+ /// Servers.
+ ///
+ KeepAlive = 0x0020,
- ///
- /// The requested data type for the item.
- ///
- ReqType = 0x0040,
+ ///
+ /// The requested data type for the item.
+ ///
+ ReqType = 0x0040,
- ///
- /// The deadband for the item or subscription.
- ///
- Deadband = 0x0080,
+ ///
+ /// The deadband for the item or subscription.
+ ///
+ Deadband = 0x0080,
- ///
- /// The rate at which the server should check for changes to an item value.
- ///
- SamplingRate = 0x0100,
+ ///
+ /// The rate at which the server should check for changes to an item value.
+ ///
+ SamplingRate = 0x0100,
- ///
- /// Whether the server should buffer multiple changes to a single item.
- ///
- EnableBuffering = 0x0200,
+ ///
+ /// Whether the server should buffer multiple changes to a single item.
+ ///
+ EnableBuffering = 0x0200,
- ///
- /// All fields are valid.
- ///
- All = 0xFFFF
- }
+ ///
+ /// All fields are valid.
+ ///
+ All = 0xFFFF
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/Subscription.cs b/Technosoftware/DaAeHdaClient/Da/Subscription.cs
index 1b3d1ba..7ca40cb 100644
--- a/Technosoftware/DaAeHdaClient/Da/Subscription.cs
+++ b/Technosoftware/DaAeHdaClient/Da/Subscription.cs
@@ -210,8 +210,10 @@ namespace Technosoftware.DaAeHdaClient.Da
///
/// The items belonging to the subscription.
///
- public TsCDaItem[] Items {
- get {
+ public TsCDaItem[] Items
+ {
+ get
+ {
if (daItems_ == null) return new TsCDaItem[0];
var items = new TsCDaItem[daItems_.Length];
for (var ii = 0; ii < daItems_.Length; ii++) items[ii] = (TsCDaItem)daItems_[ii].Clone();
@@ -562,7 +564,8 @@ namespace Technosoftware.DaAeHdaClient.Da
///
/// An event to receive data change updates.
///
- public event TsCDaDataChangedEventHandler DataChangedEvent {
+ public event TsCDaDataChangedEventHandler DataChangedEvent
+ {
add => Subscription.DataChangedEvent += value;
remove => Subscription.DataChangedEvent -= value;
}
diff --git a/Technosoftware/DaAeHdaClient/Da/SubscriptionCollection.cs b/Technosoftware/DaAeHdaClient/Da/SubscriptionCollection.cs
index f88eccb..17c1d61 100644
--- a/Technosoftware/DaAeHdaClient/Da/SubscriptionCollection.cs
+++ b/Technosoftware/DaAeHdaClient/Da/SubscriptionCollection.cs
@@ -27,84 +27,84 @@ using System.Collections;
namespace Technosoftware.DaAeHdaClient.Da
{
- /// A collection of subscriptions.
- [Serializable]
- public class TsCDaSubscriptionCollection : ICollection, ICloneable, IList
- {
- ///////////////////////////////////////////////////////////////////////
- #region Fields
+ /// A collection of subscriptions.
+ [Serializable]
+ public class TsCDaSubscriptionCollection : ICollection, ICloneable, IList
+ {
+ ///////////////////////////////////////////////////////////////////////
+ #region Fields
- private ArrayList _subscriptions = new ArrayList();
+ private ArrayList _subscriptions = new ArrayList();
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region Constructors, Destructor, Initialization
-
- ///
- /// Initializes object with the default values.
- ///
- public TsCDaSubscriptionCollection() { }
+ ///////////////////////////////////////////////////////////////////////
+ #region Constructors, Destructor, Initialization
- ///
- /// Initializes object with the specified SubscriptionCollection object.
- ///
- public TsCDaSubscriptionCollection(TsCDaSubscriptionCollection subscriptions)
- {
- if (subscriptions != null)
- {
- foreach (TsCDaSubscription subscription in subscriptions)
- {
- Add(subscription);
- }
- }
- }
+ ///
+ /// Initializes object with the default values.
+ ///
+ public TsCDaSubscriptionCollection() { }
- #endregion
+ ///
+ /// Initializes object with the specified SubscriptionCollection object.
+ ///
+ public TsCDaSubscriptionCollection(TsCDaSubscriptionCollection subscriptions)
+ {
+ if (subscriptions != null)
+ {
+ foreach (TsCDaSubscription subscription in subscriptions)
+ {
+ Add(subscription);
+ }
+ }
+ }
- ///////////////////////////////////////////////////////////////////////
- #region Properties
+ #endregion
- ///
- /// Gets the item at the specified index.
- ///
- public TsCDaSubscription this[int index]
- {
- get => (TsCDaSubscription)_subscriptions[index];
+ ///////////////////////////////////////////////////////////////////////
+ #region Properties
+
+ ///
+ /// Gets the item at the specified index.
+ ///
+ public TsCDaSubscription this[int index]
+ {
+ get => (TsCDaSubscription)_subscriptions[index];
set => _subscriptions[index] = value;
}
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region ICloneable Members
+ ///////////////////////////////////////////////////////////////////////
+ #region ICloneable Members
- ///
- /// Creates a deep copy of the object.
- ///
- public virtual object Clone()
- {
- var clone = (TsCDaSubscriptionCollection)MemberwiseClone();
+ ///
+ /// Creates a deep copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ var clone = (TsCDaSubscriptionCollection)MemberwiseClone();
- clone._subscriptions = new ArrayList();
+ clone._subscriptions = new ArrayList();
- foreach (TsCDaSubscription subscription in _subscriptions)
- {
- clone._subscriptions.Add(subscription.Clone());
- }
+ foreach (TsCDaSubscription subscription in _subscriptions)
+ {
+ clone._subscriptions.Add(subscription.Clone());
+ }
- return clone;
- }
+ return clone;
+ }
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region ICollection Members
+ ///////////////////////////////////////////////////////////////////////
+ #region ICollection Members
- ///
- /// Indicates whether access to the ICollection is synchronized (thread-safe).
- ///
- public bool IsSynchronized => false;
+ ///
+ /// Indicates whether access to the ICollection is synchronized (thread-safe).
+ ///
+ public bool IsSynchronized => false;
///
/// Gets the number of objects in the collection.
@@ -117,150 +117,150 @@ namespace Technosoftware.DaAeHdaClient.Da
/// The one-dimensional Array that is the destination for the objects.
/// The zero-based index in the Array at which copying begins.
public void CopyTo(Array array, int index)
- {
- if (_subscriptions != null)
- {
- _subscriptions.CopyTo(array, index);
- }
- }
+ {
+ if (_subscriptions != null)
+ {
+ _subscriptions.CopyTo(array, index);
+ }
+ }
- ///
- /// Copies the objects to an Array, starting at a the specified index.
- ///
- /// The one-dimensional Array that is the destination for the objects.
- /// The zero-based index in the Array at which copying begins.
- public void CopyTo(TsCDaSubscription[] array, int index)
- {
- CopyTo((Array)array, index);
- }
+ ///
+ /// Copies the objects to an Array, starting at a the specified index.
+ ///
+ /// The one-dimensional Array that is the destination for the objects.
+ /// The zero-based index in the Array at which copying begins.
+ public void CopyTo(TsCDaSubscription[] array, int index)
+ {
+ CopyTo((Array)array, index);
+ }
- ///
- /// Indicates whether access to the ICollection is synchronized (thread-safe).
- ///
- public object SyncRoot => this;
+ ///
+ /// Indicates whether access to the ICollection is synchronized (thread-safe).
+ ///
+ public object SyncRoot => this;
#endregion
- ///////////////////////////////////////////////////////////////////////
- #region IEnumerable Members
+ ///////////////////////////////////////////////////////////////////////
+ #region IEnumerable Members
- ///
- /// Returns an enumerator that can iterate through a collection.
- ///
- /// An IEnumerator that can be used to iterate through the collection.
- public IEnumerator GetEnumerator()
- {
- return _subscriptions.GetEnumerator();
- }
+ ///
+ /// Returns an enumerator that can iterate through a collection.
+ ///
+ /// An IEnumerator that can be used to iterate through the collection.
+ public IEnumerator GetEnumerator()
+ {
+ return _subscriptions.GetEnumerator();
+ }
- #endregion
+ #endregion
- ///////////////////////////////////////////////////////////////////////
- #region IList Members
+ ///////////////////////////////////////////////////////////////////////
+ #region IList Members
- ///
- /// Gets a value indicating whether the IList is read-only.
- ///
- public bool IsReadOnly => false;
+ ///
+ /// Gets a value indicating whether the IList is read-only.
+ ///
+ public bool IsReadOnly => false;
///
/// Gets or sets the element at the specified index.
///
object IList.this[int index]
- {
- get => _subscriptions[index];
+ {
+ get => _subscriptions[index];
set
- {
- if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
- {
- throw new ArgumentException("May only add Subscription objects into the collection.");
- }
+ {
+ if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
+ {
+ throw new ArgumentException("May only add Subscription objects into the collection.");
+ }
- _subscriptions[index] = value;
- }
- }
+ _subscriptions[index] = value;
+ }
+ }
- ///
- /// Removes the IList subscription at the specified index.
- ///
- /// The zero-based index of the subscription to remove.
- public void RemoveAt(int index)
- {
- _subscriptions.RemoveAt(index);
- }
+ ///
+ /// Removes the IList subscription at the specified index.
+ ///
+ /// The zero-based index of the subscription to remove.
+ public void RemoveAt(int index)
+ {
+ _subscriptions.RemoveAt(index);
+ }
- ///
- /// Inserts an subscription to the IList at the specified position.
- ///
- /// The zero-based index at which value should be inserted.
- /// The Object to insert into the IList.
- public void Insert(int index, object value)
- {
- if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
- {
- throw new ArgumentException("May only add Subscription objects into the collection.");
- }
+ ///
+ /// Inserts an subscription to the IList at the specified position.
+ ///
+ /// The zero-based index at which value should be inserted.
+ /// The Object to insert into the IList.
+ public void Insert(int index, object value)
+ {
+ if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
+ {
+ throw new ArgumentException("May only add Subscription objects into the collection.");
+ }
- _subscriptions.Insert(index, value);
- }
+ _subscriptions.Insert(index, value);
+ }
- ///
- /// Removes the first occurrence of a specific object from the IList.
- ///
- /// The Object to remove from the IList.
- public void Remove(object value)
- {
- _subscriptions.Remove(value);
- }
+ ///
+ /// Removes the first occurrence of a specific object from the IList.
+ ///
+ /// The Object to remove from the IList.
+ public void Remove(object value)
+ {
+ _subscriptions.Remove(value);
+ }
- ///
- /// Determines whether the IList contains a specific value.
- ///
- /// The Object to locate in the IList.
- /// true if the Object is found in the IList; otherwise, false.
- public bool Contains(object value)
- {
- return _subscriptions.Contains(value);
- }
+ ///
+ /// Determines whether the IList contains a specific value.
+ ///
+ /// The Object to locate in the IList.
+ /// true if the Object is found in the IList; otherwise, false.
+ public bool Contains(object value)
+ {
+ return _subscriptions.Contains(value);
+ }
- ///
- /// Removes all subscriptions from the IList.
- ///
- public void Clear()
- {
- _subscriptions.Clear();
- }
+ ///
+ /// Removes all subscriptions from the IList.
+ ///
+ public void Clear()
+ {
+ _subscriptions.Clear();
+ }
- ///
- /// Determines the index of a specific subscription in the IList.
- ///
- /// The Object to locate in the IList.
- /// The index of value if found in the list; otherwise, -1.
- public int IndexOf(object value)
- {
- return _subscriptions.IndexOf(value);
- }
+ ///
+ /// Determines the index of a specific subscription in the IList.
+ ///
+ /// The Object to locate in the IList.
+ /// The index of value if found in the list; otherwise, -1.
+ public int IndexOf(object value)
+ {
+ return _subscriptions.IndexOf(value);
+ }
- ///
- /// Adds an subscription to the IList.
- ///
- /// The Object to add to the IList.
- /// The position into which the new element was inserted.
- public int Add(object value)
- {
- if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
- {
- throw new ArgumentException("May only add Subscription objects into the collection.");
- }
+ ///
+ /// Adds an subscription to the IList.
+ ///
+ /// The Object to add to the IList.
+ /// The position into which the new element was inserted.
+ public int Add(object value)
+ {
+ if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
+ {
+ throw new ArgumentException("May only add Subscription objects into the collection.");
+ }
- return _subscriptions.Add(value);
- }
+ return _subscriptions.Add(value);
+ }
- ///
- /// Indicates whether the IList has a fixed size.
- ///
- public bool IsFixedSize => false;
+ ///
+ /// Indicates whether the IList has a fixed size.
+ ///
+ public bool IsFixedSize => false;
///
/// Inserts an subscription to the IList at the specified position.
@@ -268,49 +268,49 @@ namespace Technosoftware.DaAeHdaClient.Da
/// The zero-based index at which value should be inserted.
/// The Object to insert into the IList.
public void Insert(int index, TsCDaSubscription value)
- {
- Insert(index, (object)value);
- }
+ {
+ Insert(index, (object)value);
+ }
- ///
- /// Removes the first occurrence of a specific object from the IList.
- ///
- /// The Object to remove from the IList.
- public void Remove(TsCDaSubscription value)
- {
- Remove((object)value);
- }
+ ///
+ /// Removes the first occurrence of a specific object from the IList.
+ ///
+ /// The Object to remove from the IList.
+ public void Remove(TsCDaSubscription value)
+ {
+ Remove((object)value);
+ }
- ///
- /// Determines whether the IList contains a specific value.
- ///
- /// The Object to locate in the IList.
- /// true if the Object is found in the IList; otherwise, false.
- public bool Contains(TsCDaSubscription value)
- {
- return Contains((object)value);
- }
+ ///
+ /// Determines whether the IList contains a specific value.
+ ///
+ /// The Object to locate in the IList.
+ /// true if the Object is found in the IList; otherwise, false.
+ public bool Contains(TsCDaSubscription value)
+ {
+ return Contains((object)value);
+ }
- ///
- /// Determines the index of a specific subscription in the IList.
- ///
- /// The Object to locate in the IList.
- /// The index of value if found in the list; otherwise, -1.
- public int IndexOf(TsCDaSubscription value)
- {
- return IndexOf((object)value);
- }
+ ///
+ /// Determines the index of a specific subscription in the IList.
+ ///
+ /// The Object to locate in the IList.
+ /// The index of value if found in the list; otherwise, -1.
+ public int IndexOf(TsCDaSubscription value)
+ {
+ return IndexOf((object)value);
+ }
- ///
- /// Adds an subscription to the IList.
- ///
- /// The Object to add to the IList.
- /// The position into which the new element was inserted.
- public int Add(TsCDaSubscription value)
- {
- return Add((object)value);
- }
+ ///
+ /// Adds an subscription to the IList.
+ ///
+ /// The Object to add to the IList.
+ /// The position into which the new element was inserted.
+ public int Add(TsCDaSubscription value)
+ {
+ return Add((object)value);
+ }
- #endregion
- }
+ #endregion
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Da/SubscriptionState.cs b/Technosoftware/DaAeHdaClient/Da/SubscriptionState.cs
index 7e12d02..63980a5 100644
--- a/Technosoftware/DaAeHdaClient/Da/SubscriptionState.cs
+++ b/Technosoftware/DaAeHdaClient/Da/SubscriptionState.cs
@@ -26,45 +26,45 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
- ///
- /// Describes the state of a subscription.
- ///
- [Serializable]
- public class TsCDaSubscriptionState : ICloneable
- {
- #region Fields
+ ///
+ /// Describes the state of a subscription.
+ ///
+ [Serializable]
+ public class TsCDaSubscriptionState : ICloneable
+ {
+ #region Fields
private bool active_ = true;
- private int updateRate_ = 500;
- private float deadband_;
+ private int updateRate_ = 500;
+ private float deadband_;
#endregion
- #region Properties
+ #region Properties
///
- /// A unique name for the subscription controlled by the client.
- ///
- public string Name { get; set; }
+ /// A unique name for the subscription controlled by the client.
+ ///
+ public string Name { get; set; }
- ///
- /// A unique identifier for the subscription assigned by the client.
- ///
- public object ClientHandle { get; set; }
+ ///
+ /// A unique identifier for the subscription assigned by the client.
+ ///
+ public object ClientHandle { get; set; }
- ///
- /// A unique subscription identifier assigned by the server.
- ///
- public object ServerHandle { get; set; }
+ ///
+ /// A unique subscription identifier assigned by the server.
+ ///
+ public object ServerHandle { get; set; }
- ///
- /// The locale used for any error messages or results returned to the client.
- ///
- public string Locale { get; set; }
+ ///
+ /// The locale used for any error messages or results returned to the client.
+ ///
+ public string Locale { get; set; }
- ///
- /// Whether the subscription is scanning for updates to send to the client.
- ///
- public bool Active
- {
- get => active_;
+ ///
+ /// Whether the subscription is scanning for updates to send to the client.
+ ///
+ public bool Active
+ {
+ get => active_;
set => active_ = value;
}
@@ -82,8 +82,8 @@ namespace Technosoftware.DaAeHdaClient.Da
/// the fastest practical rate.
///
public int UpdateRate
- {
- get => updateRate_;
+ {
+ get => updateRate_;
set => updateRate_ = value;
}
@@ -114,59 +114,59 @@ namespace Technosoftware.DaAeHdaClient.Da
///
public int KeepAlive { get; set; }
- ///
- /// The minimum percentage change from 0.0 to 100.0 required to trigger a data update
- /// for an item.
- ///
- ///
- /// The range of the Deadband is from 0.0 to 100.0 Percent. Deadband will only
- /// apply to items in the subscription that have a dwEUType of Analog available. If the
- /// EU Type is Analog, then the EU Low and EU High values for the item can be used to
- /// calculate the range for the item. This range will be multiplied with the Deadband
- /// to generate an exception limit. An exception is determined as follows:
- ///
- /// Exception if (absolute value of (last cached value - current value) >
- /// (pPercentDeadband/100.0) * (EU High - EU Low) )
- ///
- /// The PercentDeadband can be set when CreateSubscription is called, allowing
- /// the same PercentDeadband to be used for all items within that particular
- /// subscription. However, with OPC DA 3.0, it is allowable to set the PercentDeadband
- /// on a per item basis. This means that each item can potentially override the
- /// PercentDeadband set for the subscription it resides within.
- /// If the exception limit is exceeded, then the last cached value is updated
- /// with the new value and a notification will be sent to the client’s callback (if
- /// any). The PercentDeadband is an optional behavior for the server. If the client
- /// does not specify this value on a server that does support the behavior, the default
- /// value of 0 (zero) will be assumed, and all value changes will update the CACHE.
- /// Note that the timestamp will be updated regardless of whether the cached value is
- /// updated. A server which does not support deadband should return an error
- /// (OPC_E_DEADBANDNOTSUPPORTED) if the client requests a deadband other than
- /// 0.0.
- /// The UpdateRate for a subscription or the sampling rate of the item, if set,
- /// determines time between when a value is checked to see if the exception limit has
- /// been exceeded. The PercentDeadband is used to keep noisy signals from updating the
- /// client unnecessarily.
- ///
- public float Deadband
- {
- get => deadband_;
+ ///
+ /// The minimum percentage change from 0.0 to 100.0 required to trigger a data update
+ /// for an item.
+ ///
+ ///
+ /// The range of the Deadband is from 0.0 to 100.0 Percent. Deadband will only
+ /// apply to items in the subscription that have a dwEUType of Analog available. If the
+ /// EU Type is Analog, then the EU Low and EU High values for the item can be used to
+ /// calculate the range for the item. This range will be multiplied with the Deadband
+ /// to generate an exception limit. An exception is determined as follows:
+ ///
+ /// Exception if (absolute value of (last cached value - current value) >
+ /// (pPercentDeadband/100.0) * (EU High - EU Low) )
+ ///
+ /// The PercentDeadband can be set when CreateSubscription is called, allowing
+ /// the same PercentDeadband to be used for all items within that particular
+ /// subscription. However, with OPC DA 3.0, it is allowable to set the PercentDeadband
+ /// on a per item basis. This means that each item can potentially override the
+ /// PercentDeadband set for the subscription it resides within.
+ /// If the exception limit is exceeded, then the last cached value is updated
+ /// with the new value and a notification will be sent to the client’s callback (if
+ /// any). The PercentDeadband is an optional behavior for the server. If the client
+ /// does not specify this value on a server that does support the behavior, the default
+ /// value of 0 (zero) will be assumed, and all value changes will update the CACHE.
+ /// Note that the timestamp will be updated regardless of whether the cached value is
+ /// updated. A server which does not support deadband should return an error
+ /// (OPC_E_DEADBANDNOTSUPPORTED) if the client requests a deadband other than
+ /// 0.0.
+ /// The UpdateRate for a subscription or the sampling rate of the item, if set,
+ /// determines time between when a value is checked to see if the exception limit has
+ /// been exceeded. The PercentDeadband is used to keep noisy signals from updating the
+ /// client unnecessarily.
+ ///
+ public float Deadband
+ {
+ get => deadband_;
set => deadband_ = value;
}
- ///
- /// TimeZone Bias of Group (in minutes).
- ///
- public int TimeBias { get; set; }
+ ///
+ /// TimeZone Bias of Group (in minutes).
+ ///
+ public int TimeBias { get; set; }
#endregion
- #region ICloneable Members
+ #region ICloneable Members
///
- /// Creates a shallow copy of the object.
- ///
- public virtual object Clone()
- {
- return MemberwiseClone();
- }
+ /// Creates a shallow copy of the object.
+ ///
+ public virtual object Clone()
+ {
+ return MemberwiseClone();
+ }
#endregion
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Hda/IServer.cs b/Technosoftware/DaAeHdaClient/Hda/IServer.cs
index 125e284..747a39d 100644
--- a/Technosoftware/DaAeHdaClient/Hda/IServer.cs
+++ b/Technosoftware/DaAeHdaClient/Hda/IServer.cs
@@ -77,7 +77,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The identifiers for the items to validate.
/// The results for each item containing the result code.
OpcItemResult[] ValidateItems(OpcItem[] items);
-
+
///
/// Reads raw (unprocessed) data from the historian database for a set of items.
///
@@ -88,10 +88,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The set of items to read (must include the item name).
/// A set of values, qualities and timestamps within the requested time range for each item.
TsCHdaItemValueCollection[] ReadRaw(
- TsCHdaTime startTime,
- TsCHdaTime endTime,
- int maxValues,
- bool includeBounds,
+ TsCHdaTime startTime,
+ TsCHdaTime endTime,
+ int maxValues,
+ bool includeBounds,
OpcItem[] items);
///
@@ -167,10 +167,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The set of items to read (must include the item name).
/// A set of values, qualities and timestamps within the requested time range for each item.
TsCHdaItemValueCollection[] ReadProcessed(
- TsCHdaTime startTime,
- TsCHdaTime endTime,
+ TsCHdaTime startTime,
+ TsCHdaTime endTime,
decimal resampleInterval,
- TsCHdaItem[] items);
+ TsCHdaItem[] items);
///
/// Sends an asynchronous request to read processed data from the historian database for a set of items.
@@ -260,7 +260,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
TsCHdaReadValuesCompleteEventHandler callback,
out IOpcRequest request);
-
+
///
/// Reads item values that have been deleted or replaced.
///
@@ -270,10 +270,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The set of items to read (must include the item name).
/// A set of values, qualities and timestamps within the requested time range for each item.
TsCHdaModifiedValueCollection[] ReadModified(
- TsCHdaTime startTime,
- TsCHdaTime endTime,
- int maxValues,
- OpcItem[] items);
+ TsCHdaTime startTime,
+ TsCHdaTime endTime,
+ int maxValues,
+ OpcItem[] items);
///
/// Sends an asynchronous request to read item values that have been deleted or replaced.
@@ -304,11 +304,11 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The attributes to read.
/// A set of attribute values for each requested attribute.
TsCHdaItemAttributeCollection ReadAttributes(
- TsCHdaTime startTime,
- TsCHdaTime endTime,
+ TsCHdaTime startTime,
+ TsCHdaTime endTime,
OpcItem item,
- int[] attributeIDs);
-
+ int[] attributeIDs);
+
///
/// Sends an asynchronous request to read the attributes of an item.
///
@@ -337,8 +337,8 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The set of items to read (must include the item name).
/// A set of annotations within the requested time range for each item.
TsCHdaAnnotationValueCollection[] ReadAnnotations(
- TsCHdaTime startTime,
- TsCHdaTime endTime,
+ TsCHdaTime startTime,
+ TsCHdaTime endTime,
OpcItem[] items);
///
@@ -387,7 +387,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// Whether existing values should be replaced.
///
TsCHdaResultCollection[] Insert(TsCHdaItemValueCollection[] items, bool replace);
-
+
///
/// Sends an asynchronous request to inserts values for one or more items.
///
@@ -410,7 +410,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The set of values to replace.
///
TsCHdaResultCollection[] Replace(TsCHdaItemValueCollection[] items);
-
+
///
/// Sends an asynchronous request to replace values for one or more items.
///
@@ -433,10 +433,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The set of items to delete (must include the item name).
/// The results of the delete operation for each item.
OpcItemResult[] Delete(
- TsCHdaTime startTime,
- TsCHdaTime endTime,
+ TsCHdaTime startTime,
+ TsCHdaTime endTime,
OpcItem[] items);
-
+
///
/// Sends an asynchronous request to delete values for one or more items.
///
@@ -461,7 +461,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// The set of timestamps to delete for one or more items.
/// The results of the operation for each timestamp.
TsCHdaResultCollection[] DeleteAtTime(TsCHdaItemTimeCollection[] items);
-
+
///
/// Sends an asynchronous request to delete values for one or more items at a specified times.
///
@@ -481,7 +481,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
///
/// The state object for the request to cancel.
void CancelRequest(IOpcRequest request);
-
+
///
/// Cancels an asynchronous request.
///
diff --git a/Technosoftware/DaAeHdaClient/Hda/ItemValue.cs b/Technosoftware/DaAeHdaClient/Hda/ItemValue.cs
index 6780fd3..5b8b687 100644
--- a/Technosoftware/DaAeHdaClient/Hda/ItemValue.cs
+++ b/Technosoftware/DaAeHdaClient/Hda/ItemValue.cs
@@ -22,8 +22,6 @@
#region Using Directives
using System;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
#pragma warning disable 618
#endregion
diff --git a/Technosoftware/DaAeHdaClient/Hda/TimeOffsetCollection.cs b/Technosoftware/DaAeHdaClient/Hda/TimeOffsetCollection.cs
index a70361c..553d7ea 100644
--- a/Technosoftware/DaAeHdaClient/Hda/TimeOffsetCollection.cs
+++ b/Technosoftware/DaAeHdaClient/Hda/TimeOffsetCollection.cs
@@ -22,8 +22,8 @@
#region Using Directives
using System;
-using System.Text;
using System.Collections;
+using System.Text;
#endregion
namespace Technosoftware.DaAeHdaClient.Hda
diff --git a/Technosoftware/DaAeHdaClient/Interfaces/IOpcDiscovery.cs b/Technosoftware/DaAeHdaClient/Interfaces/IOpcDiscovery.cs
index 2674a96..4c2580b 100644
--- a/Technosoftware/DaAeHdaClient/Interfaces/IOpcDiscovery.cs
+++ b/Technosoftware/DaAeHdaClient/Interfaces/IOpcDiscovery.cs
@@ -27,16 +27,16 @@ using System;
namespace Technosoftware.DaAeHdaClient
{
- ///
- /// This interface is used to discover OPC servers on the network.
- ///
- public interface IOpcDiscovery : IDisposable
- {
- ///
- /// Returns a list of host names which could contain OPC servers.
- ///
- /// A array of strings that are valid network host names.
- string[] EnumerateHosts();
+ ///
+ /// This interface is used to discover OPC servers on the network.
+ ///
+ public interface IOpcDiscovery : IDisposable
+ {
+ ///
+ /// Returns a list of host names which could contain OPC servers.
+ ///
+ /// A array of strings that are valid network host names.
+ string[] EnumerateHosts();
///
/// Returns a list of servers that support an OPC specification.
@@ -53,5 +53,5 @@ namespace Technosoftware.DaAeHdaClient
/// Any necessary user authentication or protocol configuration information.
/// An array of unconnected OPC server objects.
OpcServer[] GetAvailableServers(OpcSpecification specification, string host, OpcConnectData connectData);
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/Interfaces/IOpcServer.cs b/Technosoftware/DaAeHdaClient/Interfaces/IOpcServer.cs
index cabe564..da8372b 100644
--- a/Technosoftware/DaAeHdaClient/Interfaces/IOpcServer.cs
+++ b/Technosoftware/DaAeHdaClient/Interfaces/IOpcServer.cs
@@ -26,69 +26,69 @@ using System;
namespace Technosoftware.DaAeHdaClient
{
- ///
- /// Defines functionality that is common to all OPC servers.
- ///
- public interface IOpcServer : IDisposable
- {
- ///
- /// An event to receive server shutdown notifications. This event can be used by the
- /// client so that the server can request that the client should disconnect from the
- /// server.
- ///
- ///
- /// The OpcServerShutdownEvent event will be called when the server needs to
- /// shutdown. The client should release all connections and interfaces for this
- /// server.
- /// A client which is connected to multiple OPCServers (for example Data access and/or
- /// other servers such as Alarms and events servers from one or more vendors) should
- /// maintain separate shutdown callbacks for each server since any server can shut down
- /// independently of the others.
- ///
+ ///
+ /// Defines functionality that is common to all OPC servers.
+ ///
+ public interface IOpcServer : IDisposable
+ {
+ ///
+ /// An event to receive server shutdown notifications. This event can be used by the
+ /// client so that the server can request that the client should disconnect from the
+ /// server.
+ ///
+ ///
+ /// The OpcServerShutdownEvent event will be called when the server needs to
+ /// shutdown. The client should release all connections and interfaces for this
+ /// server.
+ /// A client which is connected to multiple OPCServers (for example Data access and/or
+ /// other servers such as Alarms and events servers from one or more vendors) should
+ /// maintain separate shutdown callbacks for each server since any server can shut down
+ /// independently of the others.
+ ///
event OpcServerShutdownEventHandler ServerShutdownEvent;
- ///
- /// The locale used in any error messages or results returned to the client.
- ///
- /// The locale name in the format "[languagecode]-[country/regioncode]".
- string GetLocale();
+ ///
+ /// The locale used in any error messages or results returned to the client.
+ ///
+ /// The locale name in the format "[languagecode]-[country/regioncode]".
+ string GetLocale();
- ///
- /// Sets the locale used in any error messages or results returned to the client.
- ///
- /// The locale name in the format "[languagecode]-[country/regioncode]".
- /// A locale that the server supports and is the best match for the requested locale.
- string SetLocale(string locale);
+ ///
+ /// Sets the locale used in any error messages or results returned to the client.
+ ///
+ /// The locale name in the format "[languagecode]-[country/regioncode]".
+ /// A locale that the server supports and is the best match for the requested locale.
+ string SetLocale(string locale);
- ///
- /// Allows the client to optionally register a client name with the server. This is included primarily for debugging purposes. The recommended behavior is that the client set his Node name and EXE name here.
- ///
- void SetClientName(string clientName);
+ ///
+ /// Allows the client to optionally register a client name with the server. This is included primarily for debugging purposes. The recommended behavior is that the client set his Node name and EXE name here.
+ ///
+ void SetClientName(string clientName);
- ///
- /// Returns the locales supported by the server
- ///
- /// The first element in the array must be the default locale for the server.
- /// An array of locales with the format "[languagecode]-[country/regioncode]".
- string[] GetSupportedLocales();
+ ///
+ /// Returns the locales supported by the server
+ ///
+ /// The first element in the array must be the default locale for the server.
+ /// An array of locales with the format "[languagecode]-[country/regioncode]".
+ string[] GetSupportedLocales();
- ///
- /// Returns the localized text for the specified result code.
- ///
- /// The locale name in the format "[languagecode]-[country/regioncode]".
- /// The result code identifier.
- /// A message localized for the best match for the requested locale.
- string GetErrorText(string locale, OpcResult resultId);
+ ///
+ /// Returns the localized text for the specified result code.
+ ///
+ /// The locale name in the format "[languagecode]-[country/regioncode]".
+ /// The result code identifier.
+ /// A message localized for the best match for the requested locale.
+ string GetErrorText(string locale, OpcResult resultId);
}
- ///
- /// A delegate to receive shutdown notifications from the server. This delegate can
- /// be used by the client so that the server can request that the client should disconnect
- /// from the server.
- ///
- ///
- /// A text string provided by the server indicating the reason for the shutdown. The
- /// server may pass a null or empty string if no reason is provided.
- ///
+ ///
+ /// A delegate to receive shutdown notifications from the server. This delegate can
+ /// be used by the client so that the server can request that the client should disconnect
+ /// from the server.
+ ///
+ ///
+ /// A text string provided by the server indicating the reason for the shutdown. The
+ /// server may pass a null or empty string if no reason is provided.
+ ///
public delegate void OpcServerShutdownEventHandler(string reason);
}
diff --git a/Technosoftware/DaAeHdaClient/LicenseHandler.cs b/Technosoftware/DaAeHdaClient/LicenseHandler.cs
index 233e121..b59ffb6 100644
--- a/Technosoftware/DaAeHdaClient/LicenseHandler.cs
+++ b/Technosoftware/DaAeHdaClient/LicenseHandler.cs
@@ -22,8 +22,6 @@
#region Using Directives
using System;
-using System.Linq;
-using static System.String;
using System.Diagnostics;
using Technosoftware.DaAeHdaClient.Utilities;
#endregion
@@ -290,7 +288,7 @@ namespace Technosoftware.DaAeHdaClient
return CheckLicense(serialNumber);
}
#endregion
-
+
#region Protected Methods
///
/// Validate the license.
diff --git a/Technosoftware/DaAeHdaClient/OpcConnectData.cs b/Technosoftware/DaAeHdaClient/OpcConnectData.cs
index 168e249..445890a 100644
--- a/Technosoftware/DaAeHdaClient/OpcConnectData.cs
+++ b/Technosoftware/DaAeHdaClient/OpcConnectData.cs
@@ -81,7 +81,7 @@ namespace Technosoftware.DaAeHdaClient
}
else
{
- return new WebProxy();
+ return new WebProxy();
}
}
diff --git a/Technosoftware/DaAeHdaClient/OpcConvert.cs b/Technosoftware/DaAeHdaClient/OpcConvert.cs
index 5ee9ec9..d321e2e 100644
--- a/Technosoftware/DaAeHdaClient/OpcConvert.cs
+++ b/Technosoftware/DaAeHdaClient/OpcConvert.cs
@@ -22,9 +22,9 @@
#region Using Directives
using System;
-using System.Xml;
using System.Collections;
using System.Text;
+using System.Xml;
#endregion
namespace Technosoftware.DaAeHdaClient
@@ -161,7 +161,7 @@ namespace Technosoftware.DaAeHdaClient
// convert scalar value to an array type.
if (!type.IsArray && newType.IsArray)
{
- var array = new ArrayList(1) {ChangeType(source, newType.GetElementType())};
+ var array = new ArrayList(1) { ChangeType(source, newType.GetElementType()) };
return array.ToArray(newType.GetElementType() ?? throw new InvalidOperationException());
}
diff --git a/Technosoftware/DaAeHdaClient/OpcNamespace.cs b/Technosoftware/DaAeHdaClient/OpcNamespace.cs
index 065329f..454b8cc 100644
--- a/Technosoftware/DaAeHdaClient/OpcNamespace.cs
+++ b/Technosoftware/DaAeHdaClient/OpcNamespace.cs
@@ -32,24 +32,24 @@ namespace Technosoftware.DaAeHdaClient
public class OpcNamespace
{
/// XML Schema
- public const string XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
+ public const string XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
/// XML Schema Instance
- public const string XML_SCHEMA_INSTANCE = "http://www.w3.org/2001/XMLSchema-instance";
+ public const string XML_SCHEMA_INSTANCE = "http://www.w3.org/2001/XMLSchema-instance";
/// OPC Alarmes & Events
- public const string OPC_ALARM_AND_EVENTS = "http://opcfoundation.org/AlarmAndEvents/";
+ public const string OPC_ALARM_AND_EVENTS = "http://opcfoundation.org/AlarmAndEvents/";
/// OPC Complex Data
- public const string OPC_COMPLEX_DATA = "http://opcfoundation.org/ComplexData/";
+ public const string OPC_COMPLEX_DATA = "http://opcfoundation.org/ComplexData/";
/// OPC Data Exchange
- public const string OPC_DATA_EXCHANGE = "http://opcfoundation.org/DataExchange/";
+ public const string OPC_DATA_EXCHANGE = "http://opcfoundation.org/DataExchange/";
/// OPC Data Access
- public const string OPC_DATA_ACCESS = "http://opcfoundation.org/DataAccess/";
+ public const string OPC_DATA_ACCESS = "http://opcfoundation.org/DataAccess/";
/// OPC Historical Data Access
- public const string OPC_HISTORICAL_DATA_ACCESS = "http://opcfoundation.org/HistoricalDataAccess/";
+ public const string OPC_HISTORICAL_DATA_ACCESS = "http://opcfoundation.org/HistoricalDataAccess/";
/// OPC Binary 1.0
- public const string OPC_BINARY = "http://opcfoundation.org/OPCBinary/1.0/";
+ public const string OPC_BINARY = "http://opcfoundation.org/OPCBinary/1.0/";
/// OPC XML-DA 1.0
- public const string OPC_DATA_ACCESS_XML10 = "http://opcfoundation.org/webservices/XMLDA/1.0/";
+ public const string OPC_DATA_ACCESS_XML10 = "http://opcfoundation.org/webservices/XMLDA/1.0/";
/// OPC UA 1.0
- public const string OPC_UA10 = "http://opcfoundation.org/webservices/UA/1.0/";
+ public const string OPC_UA10 = "http://opcfoundation.org/webservices/UA/1.0/";
}
}
diff --git a/Technosoftware/DaAeHdaClient/OpcResult.cs b/Technosoftware/DaAeHdaClient/OpcResult.cs
index ee5dfdf..e63c693 100644
--- a/Technosoftware/DaAeHdaClient/OpcResult.cs
+++ b/Technosoftware/DaAeHdaClient/OpcResult.cs
@@ -22,9 +22,9 @@
#region Using Directives
using System;
-using System.Xml;
-using System.Runtime.Serialization;
using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
+using System.Xml;
#endregion
namespace Technosoftware.DaAeHdaClient
diff --git a/Technosoftware/DaAeHdaClient/OpcResultException.cs b/Technosoftware/DaAeHdaClient/OpcResultException.cs
index 7d19cc8..32c68cc 100644
--- a/Technosoftware/DaAeHdaClient/OpcResultException.cs
+++ b/Technosoftware/DaAeHdaClient/OpcResultException.cs
@@ -27,28 +27,28 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient
{
- /// Used to raise an exception associated with a specified result code.
- ///
- /// The OpcResultException includes the OPC result code within the Result
- /// property.
- ///
- /// OpcResult Structure
- [Serializable]
- public class OpcResultException : ApplicationException
- {
+ /// Used to raise an exception associated with a specified result code.
+ ///
+ /// The OpcResultException includes the OPC result code within the Result
+ /// property.
+ ///
+ /// OpcResult Structure
+ [Serializable]
+ public class OpcResultException : ApplicationException
+ {
///
- public OpcResult Result => result_;
+ public OpcResult Result => result_;
///
public OpcResultException(OpcResult result) : base(result.Description()) { result_ = result; }
- ///
- public OpcResultException(OpcResult result, string message) : base(message + ": " + result.ToString() + Environment.NewLine) { result_ = result; }
- ///
- public OpcResultException(OpcResult result, string message, Exception e) : base(message + ": " + result.ToString() + Environment.NewLine, e) { result_ = result; }
- ///
- protected OpcResultException(SerializationInfo info, StreamingContext context) : base(info, context) { }
+ ///
+ public OpcResultException(OpcResult result, string message) : base(message + ": " + result.ToString() + Environment.NewLine) { result_ = result; }
+ ///
+ public OpcResultException(OpcResult result, string message, Exception e) : base(message + ": " + result.ToString() + Environment.NewLine, e) { result_ = result; }
+ ///
+ protected OpcResultException(SerializationInfo info, StreamingContext context) : base(info, context) { }
- ///
- private OpcResult result_ = OpcResult.E_FAIL;
- }
+ ///
+ private OpcResult result_ = OpcResult.E_FAIL;
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/OpcServer.cs b/Technosoftware/DaAeHdaClient/OpcServer.cs
index 4e1c89b..afb7829 100644
--- a/Technosoftware/DaAeHdaClient/OpcServer.cs
+++ b/Technosoftware/DaAeHdaClient/OpcServer.cs
@@ -24,8 +24,8 @@
using System;
using System.Collections.Generic;
using System.Globalization;
-using System.Resources;
using System.Reflection;
+using System.Resources;
using System.Runtime.Serialization;
#endregion
diff --git a/Technosoftware/DaAeHdaClient/OpcServerDescription.cs b/Technosoftware/DaAeHdaClient/OpcServerDescription.cs
index e6bf0b7..09b4b67 100644
--- a/Technosoftware/DaAeHdaClient/OpcServerDescription.cs
+++ b/Technosoftware/DaAeHdaClient/OpcServerDescription.cs
@@ -42,10 +42,10 @@ namespace Technosoftware.DaAeHdaClient
///
public string VendorName { get; set; }
- ///
- /// Namespace for types defined by this vendor. This may or
- /// may not be the same as the VendorName. Null or empty if not used.
- ///
+ ///
+ /// Namespace for types defined by this vendor. This may or
+ /// may not be the same as the VendorName. Null or empty if not used.
+ ///
public string VendorNamespace { get; set; }
///
@@ -53,19 +53,19 @@ namespace Technosoftware.DaAeHdaClient
///
public string ServerName { get; set; }
- ///
- /// Namespace for server-specific types. Null or empty if not used.
- /// This name is typically a concatentation of the VendorNamespace
- /// and the ServerName (separated by a '/' character)
- /// (e.g "MyVendorNamespace/MyServer").
- ///
+ ///
+ /// Namespace for server-specific types. Null or empty if not used.
+ /// This name is typically a concatentation of the VendorNamespace
+ /// and the ServerName (separated by a '/' character)
+ /// (e.g "MyVendorNamespace/MyServer").
+ ///
public string ServerNamespace { get; set; }
- ///
- /// The HostName of the machine in which the server resides (runs). The
- /// HostName is used as part of the object path in InstanceIds of the
- /// server's objects.
- ///
+ ///
+ /// The HostName of the machine in which the server resides (runs). The
+ /// HostName is used as part of the object path in InstanceIds of the
+ /// server's objects.
+ ///
public string HostName { get; set; }
///
@@ -81,5 +81,5 @@ namespace Technosoftware.DaAeHdaClient
/// accessed without a client context.
///
public OpcServerDetail ServerDetails { get; set; }
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/OpcServerDetail.cs b/Technosoftware/DaAeHdaClient/OpcServerDetail.cs
index 975a985..b273473 100644
--- a/Technosoftware/DaAeHdaClient/OpcServerDetail.cs
+++ b/Technosoftware/DaAeHdaClient/OpcServerDetail.cs
@@ -26,30 +26,30 @@ using System;
namespace Technosoftware.DaAeHdaClient
{
- ///
- /// Detailed information about the server.
- /// Set to null if the ServerDescription is being accessed without a client context.
- ///
+ ///
+ /// Detailed information about the server.
+ /// Set to null if the ServerDescription is being accessed without a client context.
+ ///
public class OpcServerDetail
- {
- ///
- /// The time the server was last started.
- ///
- public DateTime StartTime;
+ {
+ ///
+ /// The time the server was last started.
+ ///
+ public DateTime StartTime;
- ///
- /// The build number of the server.
- ///
- public string BuildNumber;
+ ///
+ /// The build number of the server.
+ ///
+ public string BuildNumber;
- ///
- /// The version of the server.
- ///
- public string Version;
+ ///
+ /// The version of the server.
+ ///
+ public string Version;
- ///
- /// Vendor-specific information about the server.
- ///
- public string VendorInfo;
- }
+ ///
+ /// Vendor-specific information about the server.
+ ///
+ public string VendorInfo;
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/OpcServerState.cs b/Technosoftware/DaAeHdaClient/OpcServerState.cs
index 65d501b..c1a3931 100644
--- a/Technosoftware/DaAeHdaClient/OpcServerState.cs
+++ b/Technosoftware/DaAeHdaClient/OpcServerState.cs
@@ -26,39 +26,39 @@
namespace Technosoftware.DaAeHdaClient
{
- ///
- /// The set of possible server states.
- ///
- public enum OpcServerState
- {
- ///
- /// The server state is not known.
- ///
- Unknown,
+ ///
+ /// The set of possible server states.
+ ///
+ public enum OpcServerState
+ {
+ ///
+ /// The server state is not known.
+ ///
+ Unknown,
- ///
- /// The server is running normally. This is the usual state for a server
- ///
- Operational,
+ ///
+ /// The server is running normally. This is the usual state for a server
+ ///
+ Operational,
- ///
+ ///
/// The server is not operational due to a fault. The server is no longer functioning. The recovery procedure from this situation is vendor specific. An error code of E_FAIL should generally be returned from any other server method.
- ///
+ ///
Faulted,
- ///
- /// The server is running but has no configuration information loaded and thus cannot function normally. Note this state implies that the server needs configuration information in order to function. Servers which do not require configuration information should not return this state.
- ///
+ ///
+ /// The server is running but has no configuration information loaded and thus cannot function normally. Note this state implies that the server needs configuration information in order to function. Servers which do not require configuration information should not return this state.
+ ///
NeedsConfiguration,
- ///
- /// The server has been temporarily suspended via some vendor specific method and is not getting or sending data. Note that Quality will be returned as OPC_QUALITY_OUT_OF_SERVICE.
- ///
+ ///
+ /// The server has been temporarily suspended via some vendor specific method and is not getting or sending data. Note that Quality will be returned as OPC_QUALITY_OUT_OF_SERVICE.
+ ///
OutOfService,
- ///
+ ///
/// The server is in Diagnostics Mode. The outputs are disconnected from the real hardware but the server will otherwise behave normally. Inputs may be real or may be simulated depending on the vendor implementation. Quality will generally be returned normally.
- ///
+ ///
Diagnostics,
///
@@ -80,5 +80,5 @@ namespace Technosoftware.DaAeHdaClient
/// The server is not operational, but the reason is not known.
///
NotOperational,
- }
+ }
}
diff --git a/Technosoftware/DaAeHdaClient/OpcType.cs b/Technosoftware/DaAeHdaClient/OpcType.cs
index 6ea979d..e49cb06 100644
--- a/Technosoftware/DaAeHdaClient/OpcType.cs
+++ b/Technosoftware/DaAeHdaClient/OpcType.cs
@@ -34,81 +34,81 @@ namespace Technosoftware.DaAeHdaClient
public class OpcType
{
///
- public static Type SBYTE = typeof(sbyte);
+ public static Type SBYTE = typeof(sbyte);
///
- public static Type BYTE = typeof(byte);
+ public static Type BYTE = typeof(byte);
///
- public static Type SHORT = typeof(short);
+ public static Type SHORT = typeof(short);
///
- public static Type USHORT = typeof(ushort);
+ public static Type USHORT = typeof(ushort);
///
- public static Type INT = typeof(int);
+ public static Type INT = typeof(int);
///
- public static Type UINT = typeof(uint);
+ public static Type UINT = typeof(uint);
///
- public static Type LONG = typeof(long);
+ public static Type LONG = typeof(long);
///
- public static Type ULONG = typeof(ulong);
+ public static Type ULONG = typeof(ulong);
///
- public static Type FLOAT = typeof(float);
+ public static Type FLOAT = typeof(float);
///
- public static Type DOUBLE = typeof(double);
+ public static Type DOUBLE = typeof(double);
///
- public static Type DECIMAL = typeof(decimal);
+ public static Type DECIMAL = typeof(decimal);
///
- public static Type BOOLEAN = typeof(bool);
+ public static Type BOOLEAN = typeof(bool);
///
- public static Type DATETIME = typeof(DateTime);
+ public static Type DATETIME = typeof(DateTime);
///
- public static Type DURATION = typeof(TimeSpan);
+ public static Type DURATION = typeof(TimeSpan);
///
- public static Type STRING = typeof(string);
+ public static Type STRING = typeof(string);
///
- public static Type ANY_TYPE = typeof(object);
+ public static Type ANY_TYPE = typeof(object);
///
- public static Type BINARY = typeof(byte[]);
+ public static Type BINARY = typeof(byte[]);
///
- public static Type ARRAY_SHORT = typeof(short[]);
+ public static Type ARRAY_SHORT = typeof(short[]);
///
- public static Type ARRAY_USHORT = typeof(ushort[]);
+ public static Type ARRAY_USHORT = typeof(ushort[]);
///
- public static Type ARRAY_INT = typeof(int[]);
+ public static Type ARRAY_INT = typeof(int[]);
///
- public static Type ARRAY_UINT = typeof(uint[]);
+ public static Type ARRAY_UINT = typeof(uint[]);
///
- public static Type ARRAY_LONG = typeof(long[]);
+ public static Type ARRAY_LONG = typeof(long[]);
///
- public static Type ARRAY_ULONG = typeof(ulong[]);
+ public static Type ARRAY_ULONG = typeof(ulong[]);
///
- public static Type ARRAY_FLOAT = typeof(float[]);
+ public static Type ARRAY_FLOAT = typeof(float[]);
///
- public static Type ARRAY_DOUBLE = typeof(double[]);
+ public static Type ARRAY_DOUBLE = typeof(double[]);
///
- public static Type ARRAY_DECIMAL = typeof(decimal[]);
+ public static Type ARRAY_DECIMAL = typeof(decimal[]);
///
- public static Type ARRAY_BOOLEAN = typeof(bool[]);
+ public static Type ARRAY_BOOLEAN = typeof(bool[]);
///
public static Type ARRAY_DATETIME = typeof(DateTime[]);
///
- public static Type ARRAY_STRING = typeof(string[]);
+ public static Type ARRAY_STRING = typeof(string[]);
///
public static Type ARRAY_ANY_TYPE = typeof(object[]);
///
- public static Type ILLEGAL_TYPE = typeof(OpcType);
-
+ public static Type ILLEGAL_TYPE = typeof(OpcType);
+
///
/// Returns an array of all well-known types.
///
- public static Type[] Enumerate()
- {
- var values = new ArrayList();
+ public static Type[] Enumerate()
+ {
+ var values = new ArrayList();
- var fields = typeof(OpcType).GetFields(BindingFlags.Static | BindingFlags.Public);
+ var fields = typeof(OpcType).GetFields(BindingFlags.Static | BindingFlags.Public);
- Array.ForEach(fields, field => values.Add(field.GetValue(typeof(Type))));
+ Array.ForEach(fields, field => values.Add(field.GetValue(typeof(Type))));
- return (Type[])values.ToArray(typeof(Type));
- }
+ return (Type[])values.ToArray(typeof(Type));
+ }
}
}
diff --git a/Technosoftware/DaAeHdaClient/OpcUserIdentity.cs b/Technosoftware/DaAeHdaClient/OpcUserIdentity.cs
index 025ff4c..8e7657b 100644
--- a/Technosoftware/DaAeHdaClient/OpcUserIdentity.cs
+++ b/Technosoftware/DaAeHdaClient/OpcUserIdentity.cs
@@ -22,8 +22,8 @@
#region Using Directives
using System;
-using System.Text;
using System.Security.Cryptography;
+using System.Text;
#endregion
namespace Technosoftware.DaAeHdaClient
@@ -299,7 +299,7 @@ namespace Technosoftware.DaAeHdaClient
return null;
}
}
-
+
#endregion
///////////////////////////////////////////////////////////////////////
diff --git a/Technosoftware/DaAeHdaClient/Utilities/ConfigUtils.cs b/Technosoftware/DaAeHdaClient/Utilities/ConfigUtils.cs
index 7a53c42..78c8ed2 100644
--- a/Technosoftware/DaAeHdaClient/Utilities/ConfigUtils.cs
+++ b/Technosoftware/DaAeHdaClient/Utilities/ConfigUtils.cs
@@ -22,9 +22,6 @@
#region Using Directives
using System;
-using System.Text;
-using System.Globalization;
-using System.Diagnostics;
using System.IO;
// ReSharper disable UnusedMember.Global
diff --git a/Technosoftware/DaAeHdaClient/Utilities/HiResClock.cs b/Technosoftware/DaAeHdaClient/Utilities/HiResClock.cs
index 8aa26ea..b81dfa2 100644
--- a/Technosoftware/DaAeHdaClient/Utilities/HiResClock.cs
+++ b/Technosoftware/DaAeHdaClient/Utilities/HiResClock.cs
@@ -50,7 +50,7 @@ namespace Technosoftware.DaAeHdaClient.Utilities
return DateTime.UtcNow;
}
- var ticks = (counter - s_Default.m_baseline)*s_Default.m_ratio;
+ var ticks = (counter - s_Default.m_baseline) * s_Default.m_ratio;
return new DateTime((long)ticks + s_Default.m_offset);
}
@@ -83,7 +83,7 @@ namespace Technosoftware.DaAeHdaClient.Utilities
m_baseline = m_offset;
}
- m_ratio = ((decimal)TimeSpan.TicksPerSecond)/m_frequency;
+ m_ratio = ((decimal)TimeSpan.TicksPerSecond) / m_frequency;
}
///
diff --git a/Technosoftware/DaAeHdaClient/Utilities/Utils.cs b/Technosoftware/DaAeHdaClient/Utilities/Utils.cs
index 5b63c7d..486d427 100644
--- a/Technosoftware/DaAeHdaClient/Utilities/Utils.cs
+++ b/Technosoftware/DaAeHdaClient/Utilities/Utils.cs
@@ -22,10 +22,10 @@
#region Using Directives
using System;
-using System.Text;
-using System.Globalization;
using System.Diagnostics;
+using System.Globalization;
using System.IO;
+using System.Text;
// ReSharper disable UnusedMember.Global
#endregion
diff --git a/Technosoftware/OpcRcw/Ae/AlarmsAndEvents.cs b/Technosoftware/OpcRcw/Ae/AlarmsAndEvents.cs
index fa6a6be..f8571f4 100644
--- a/Technosoftware/OpcRcw/Ae/AlarmsAndEvents.cs
+++ b/Technosoftware/OpcRcw/Ae/AlarmsAndEvents.cs
@@ -11,8 +11,6 @@
#region Using Directives
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Runtime.InteropServices;
#endregion
@@ -22,28 +20,28 @@ namespace Technosoftware.OpcRcw.Ae
{
///
[ComImport]
- [GuidAttribute("58E13251-AC87-11d1-84D5-00608CB8A7E9")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface CATID_OPCAEServer10 {}
+ [GuidAttribute("58E13251-AC87-11d1-84D5-00608CB8A7E9")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ public interface CATID_OPCAEServer10 { }
///
- public enum OPCAEBROWSEDIRECTION
- {
- OPCAE_BROWSE_UP = 1,
- OPCAE_BROWSE_DOWN,
- OPCAE_BROWSE_TO
+ public enum OPCAEBROWSEDIRECTION
+ {
+ OPCAE_BROWSE_UP = 1,
+ OPCAE_BROWSE_DOWN,
+ OPCAE_BROWSE_TO
}
///
public enum OPCAEBROWSETYPE
- {
- OPC_AREA = 1,
- OPC_SOURCE
+ {
+ OPC_AREA = 1,
+ OPC_SOURCE
}
-
+
///
public enum OPCEVENTSERVERSTATE
- {
+ {
OPCAE_STATUS_RUNNING = 1,
OPCAE_STATUS_FAILED,
OPCAE_STATUS_NOCONFIG,
@@ -56,12 +54,12 @@ namespace Technosoftware.OpcRcw.Ae
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
- public int dwLowDateTime;
- public int dwHighDateTime;
+ public int dwLowDateTime;
+ public int dwHighDateTime;
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ONEVENTSTRUCT
{
[MarshalAs(UnmanagedType.I2)]
@@ -78,7 +76,7 @@ namespace Technosoftware.OpcRcw.Ae
[MarshalAs(UnmanagedType.I4)]
public int dwEventCategory;
[MarshalAs(UnmanagedType.I4)]
- public int dwSeverity;
+ public int dwSeverity;
[MarshalAs(UnmanagedType.LPWStr)]
public string szConditionName;
[MarshalAs(UnmanagedType.LPWStr)]
@@ -86,7 +84,7 @@ namespace Technosoftware.OpcRcw.Ae
[MarshalAs(UnmanagedType.I2)]
public short wQuality;
[MarshalAs(UnmanagedType.I2)]
- public short wReserved;
+ public short wReserved;
[MarshalAs(UnmanagedType.I4)]
public int bAckRequired;
public FILETIME ftActiveTime;
@@ -100,7 +98,7 @@ namespace Technosoftware.OpcRcw.Ae
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCEVENTSERVERSTATUS
{
public FILETIME ftStartTime;
@@ -114,31 +112,31 @@ namespace Technosoftware.OpcRcw.Ae
[MarshalAs(UnmanagedType.I2)]
public short wBuildNumber;
[MarshalAs(UnmanagedType.I2)]
- public short wReserved;
- [MarshalAs(UnmanagedType.LPWStr)]
+ public short wReserved;
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szVendorInfo;
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCCONDITIONSTATE
{
[MarshalAs(UnmanagedType.I2)]
public short wState;
[MarshalAs(UnmanagedType.I2)]
- public short wReserved1;
- [MarshalAs(UnmanagedType.LPWStr)]
+ public short wReserved1;
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szActiveSubCondition;
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szASCDefinition;
[MarshalAs(UnmanagedType.I4)]
public int dwASCSeverity;
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szASCDescription;
[MarshalAs(UnmanagedType.I2)]
public short wQuality;
[MarshalAs(UnmanagedType.I2)]
- public short wReserved2;
+ public short wReserved2;
public FILETIME ftLastAckTime;
public FILETIME ftSubCondLastActive;
public FILETIME ftCondLastActive;
@@ -153,15 +151,15 @@ namespace Technosoftware.OpcRcw.Ae
public IntPtr pszSCDefinitions;
public IntPtr pdwSCSeverities;
public IntPtr pszSCDescriptions;
- public int dwNumEventAttrs;
+ public int dwNumEventAttrs;
public IntPtr pEventAttributes;
public IntPtr pErrors;
}
///
[ComImport]
- [GuidAttribute("65168851-5783-11D1-84A0-00608CB8A7E9")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("65168851-5783-11D1-84A0-00608CB8A7E9")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCEventServer
{
void GetStatus(
@@ -171,63 +169,63 @@ namespace Technosoftware.OpcRcw.Ae
[MarshalAs(UnmanagedType.I4)]
int bActive,
[MarshalAs(UnmanagedType.I4)]
- int dwBufferTime,
+ int dwBufferTime,
[MarshalAs(UnmanagedType.I4)]
int dwMaxSize,
[MarshalAs(UnmanagedType.I4)]
int hClientSubscription,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=4)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=4)]
out object ppUnk,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedBufferTime,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedMaxSize);
-
+
void QueryAvailableFilters(
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwFilterMask);
void QueryEventCategories(
[MarshalAs(UnmanagedType.I4)]
- int dwEventType,
+ int dwEventType,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppdwEventCategories,
[Out]
out IntPtr ppszEventCategoryDescs);
-
+
[PreserveSig]
int QueryConditionNames(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
+ int dwEventCategory,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppszConditionNames);
void QuerySubConditionNames(
[MarshalAs(UnmanagedType.LPWStr)]
- string szConditionName,
+ string szConditionName,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppszSubConditionNames);
void QuerySourceConditions(
[MarshalAs(UnmanagedType.LPWStr)]
- string szSource,
+ string szSource,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppszConditionNames);
- void QueryEventAttributes(
+ void QueryEventAttributes(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
+ int dwEventCategory,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppdwAttrIDs,
[Out]
@@ -245,12 +243,12 @@ namespace Technosoftware.OpcRcw.Ae
[MarshalAs(UnmanagedType.LPWStr)]
string szSubconditionName,
[MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
- int[] pdwAssocAttrIDs,
- out IntPtr ppszAttrItemIDs,
- out IntPtr ppszNodeNames,
- out IntPtr ppCLSIDs);
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ int[] pdwAssocAttrIDs,
+ out IntPtr ppszAttrItemIDs,
+ out IntPtr ppszNodeNames,
+ out IntPtr ppCLSIDs);
void GetConditionState(
[MarshalAs(UnmanagedType.LPWStr)]
@@ -259,33 +257,33 @@ namespace Technosoftware.OpcRcw.Ae
string szConditionName,
[MarshalAs(UnmanagedType.I4)]
int dwNumEventAttrs,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] pdwAttributeIDs,
[Out]
out IntPtr ppConditionState);
void EnableConditionByArea(
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszAreas);
void EnableConditionBySource(
[MarshalAs(UnmanagedType.I4)]
- int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumSources,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszSources);
void DisableConditionByArea(
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszAreas);
void DisableConditionBySource(
[MarshalAs(UnmanagedType.I4)]
- int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumSources,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszSources);
void AckCondition(
@@ -295,82 +293,82 @@ namespace Technosoftware.OpcRcw.Ae
string szAcknowledgerID,
[MarshalAs(UnmanagedType.LPWStr)]
string szComment,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszSource,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] szConditionName,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
FILETIME[] pftActiveTime,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwCookie,
[Out]
out IntPtr ppErrors);
void CreateAreaBrowser(
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=0)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=0)]
out object ppUnk);
}
///
[ComImport]
- [GuidAttribute("65168855-5783-11D1-84A0-00608CB8A7E9")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("65168855-5783-11D1-84A0-00608CB8A7E9")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCEventSubscriptionMgt
{
- void SetFilter(
+ void SetFilter(
[MarshalAs(UnmanagedType.I4)]
- int dwEventType,
+ int dwEventType,
[MarshalAs(UnmanagedType.I4)]
- int dwNumCategories,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
- int[] pdwEventCategories,
+ int dwNumCategories,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int[] pdwEventCategories,
[MarshalAs(UnmanagedType.I4)]
int dwLowSeverity,
[MarshalAs(UnmanagedType.I4)]
int dwHighSeverity,
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=5)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=5)]
string[] pszAreaList,
[MarshalAs(UnmanagedType.I4)]
int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=7)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=7)]
string[] pszSourceList);
- void GetFilter(
+ void GetFilter(
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwEventType,
+ out int pdwEventType,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwNumCategories,
[Out]
- out IntPtr ppdwEventCategories,
+ out IntPtr ppdwEventCategories,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwLowSeverity,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwHighSeverity,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwNumAreas,
- [Out]
+ out int pdwNumAreas,
+ [Out]
out IntPtr ppszAreaList,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwNumSources,
[Out]
out IntPtr ppszSourceList);
- void SelectReturnedAttributes(
+ void SelectReturnedAttributes(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int dwEventCategory,
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] dwAttributeIDs);
- void GetReturnedAttributes(
+ void GetReturnedAttributes(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ int dwEventCategory,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pdwCount,
[Out]
out IntPtr ppdwAttributeIDs);
@@ -383,52 +381,52 @@ namespace Technosoftware.OpcRcw.Ae
int dwConnection);
void GetState(
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pbActive,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pdwBufferTime,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pbActive,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pdwBufferTime,
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwMaxSize,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int phClientSubscription);
- void SetState(
- IntPtr pbActive,
+ void SetState(
+ IntPtr pbActive,
IntPtr pdwBufferTime,
IntPtr pdwMaxSize,
[MarshalAs(UnmanagedType.I4)]
int hClientSubscription,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedBufferTime,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedMaxSize);
}
///
[ComImport]
- [GuidAttribute("65168857-5783-11D1-84A0-00608CB8A7E9")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("65168857-5783-11D1-84A0-00608CB8A7E9")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCEventAreaBrowser
{
void ChangeBrowsePosition(
- OPCAEBROWSEDIRECTION dwBrowseDirection,
+ OPCAEBROWSEDIRECTION dwBrowseDirection,
[MarshalAs(UnmanagedType.LPWStr)]
string szString);
void BrowseOPCAreas(
OPCAEBROWSETYPE dwBrowseFilterType,
[MarshalAs(UnmanagedType.LPWStr)]
- string szFilterCriteria,
- [Out]
- out OpcRcw.Comn.IEnumString ppIEnumString);
+ string szFilterCriteria,
+ [Out]
+ out OpcRcw.Comn.IEnumString ppIEnumString);
- void GetQualifiedAreaName(
+ void GetQualifiedAreaName(
[MarshalAs(UnmanagedType.LPWStr)]
string szAreaName,
[Out][MarshalAs(UnmanagedType.LPWStr)]
out string pszQualifiedAreaName);
- void GetQualifiedSourceName(
+ void GetQualifiedSourceName(
[MarshalAs(UnmanagedType.LPWStr)]
string szSourceName,
[Out][MarshalAs(UnmanagedType.LPWStr)]
@@ -437,8 +435,8 @@ namespace Technosoftware.OpcRcw.Ae
///
[ComImport]
- [GuidAttribute("6516885F-5783-11D1-84A0-00608CB8A7E9")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("6516885F-5783-11D1-84A0-00608CB8A7E9")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCEventSink
{
void OnEvent(
@@ -450,16 +448,16 @@ namespace Technosoftware.OpcRcw.Ae
int bLastRefresh,
[MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=3)]
ONEVENTSTRUCT[] pEvents);
}
///
[ComImport]
- [GuidAttribute("71BBE88E-9564-4bcd-BCFC-71C558D94F2D")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("71BBE88E-9564-4bcd-BCFC-71C558D94F2D")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCEventServer2 // : IOPCEventServer
- {
+ {
void GetStatus(
out IntPtr ppEventServerStatus);
@@ -467,28 +465,28 @@ namespace Technosoftware.OpcRcw.Ae
[MarshalAs(UnmanagedType.I4)]
int bActive,
[MarshalAs(UnmanagedType.I4)]
- int dwBufferTime,
+ int dwBufferTime,
[MarshalAs(UnmanagedType.I4)]
int dwMaxSize,
[MarshalAs(UnmanagedType.I4)]
int hClientSubscription,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=4)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=4)]
out object ppUnk,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedBufferTime,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedMaxSize);
-
+
void QueryAvailableFilters(
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwFilterMask);
void QueryEventCategories(
[MarshalAs(UnmanagedType.I4)]
- int dwEventType,
+ int dwEventType,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppdwEventCategories,
[Out]
@@ -497,33 +495,33 @@ namespace Technosoftware.OpcRcw.Ae
[PreserveSig]
int QueryConditionNames(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
+ int dwEventCategory,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppszConditionNames);
void QuerySubConditionNames(
[MarshalAs(UnmanagedType.LPWStr)]
- string szConditionName,
+ string szConditionName,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppszSubConditionNames);
void QuerySourceConditions(
[MarshalAs(UnmanagedType.LPWStr)]
- string szSource,
+ string szSource,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppszConditionNames);
- void QueryEventAttributes(
+ void QueryEventAttributes(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
+ int dwEventCategory,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ out int pdwCount,
[Out]
out IntPtr ppdwAttrIDs,
[Out]
@@ -541,12 +539,12 @@ namespace Technosoftware.OpcRcw.Ae
[MarshalAs(UnmanagedType.LPWStr)]
string szSubconditionName,
[MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
- int[] pdwAssocAttrIDs,
- out IntPtr ppszAttrItemIDs,
- out IntPtr ppszNodeNames,
- out IntPtr ppCLSIDs);
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ int[] pdwAssocAttrIDs,
+ out IntPtr ppszAttrItemIDs,
+ out IntPtr ppszNodeNames,
+ out IntPtr ppCLSIDs);
void GetConditionState(
[MarshalAs(UnmanagedType.LPWStr)]
@@ -555,33 +553,33 @@ namespace Technosoftware.OpcRcw.Ae
string szConditionName,
[MarshalAs(UnmanagedType.I4)]
int dwNumEventAttrs,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] pdwAttributeIDs,
[Out]
out IntPtr ppConditionState);
void EnableConditionByArea(
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszAreas);
void EnableConditionBySource(
[MarshalAs(UnmanagedType.I4)]
- int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumSources,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszSources);
void DisableConditionByArea(
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszAreas);
void DisableConditionBySource(
[MarshalAs(UnmanagedType.I4)]
- int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumSources,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszSources);
void AckCondition(
@@ -591,58 +589,58 @@ namespace Technosoftware.OpcRcw.Ae
string szAcknowledgerID,
[MarshalAs(UnmanagedType.LPWStr)]
string szComment,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszSource,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] szConditionName,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
FILETIME[] pftActiveTime,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwCookie,
[Out]
out IntPtr ppErrors);
void CreateAreaBrowser(
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=0)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=0)]
out object ppUnk);
void EnableConditionByArea2(
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszAreas,
[Out]
out IntPtr ppErrors);
- void EnableConditionBySource2(
+ void EnableConditionBySource2(
[MarshalAs(UnmanagedType.I4)]
- int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
- string[] pszSources,
+ int dwNumSources,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ string[] pszSources,
[Out]
- out IntPtr ppErrors);
+ out IntPtr ppErrors);
- void DisableConditionByArea2(
+ void DisableConditionByArea2(
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
- string[] pszAreas,
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ string[] pszAreas,
[Out]
- out IntPtr ppErrors);
+ out IntPtr ppErrors);
- void DisableConditionBySource2(
+ void DisableConditionBySource2(
[MarshalAs(UnmanagedType.I4)]
- int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
- string[] pszSources,
+ int dwNumSources,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ string[] pszSources,
[Out]
- out IntPtr ppErrors);
+ out IntPtr ppErrors);
void GetEnableStateByArea(
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszAreas,
[Out]
out IntPtr pbEnabled,
@@ -651,75 +649,75 @@ namespace Technosoftware.OpcRcw.Ae
[Out]
out IntPtr ppErrors);
- void GetEnableStateBySource(
+ void GetEnableStateBySource(
[MarshalAs(UnmanagedType.I4)]
- int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
- string[] pszSources,
- out IntPtr pbEnabled,
- out IntPtr pbEffectivelyEnabled,
- out IntPtr ppErrors);
+ int dwNumSources,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ string[] pszSources,
+ out IntPtr pbEnabled,
+ out IntPtr pbEffectivelyEnabled,
+ out IntPtr ppErrors);
};
///
[ComImport]
- [GuidAttribute("94C955DC-3684-4ccb-AFAB-F898CE19AAC3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("94C955DC-3684-4ccb-AFAB-F898CE19AAC3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCEventSubscriptionMgt2 // : IOPCEventSubscriptionMgt
- {
- void SetFilter(
+ {
+ void SetFilter(
[MarshalAs(UnmanagedType.I4)]
- int dwEventType,
+ int dwEventType,
[MarshalAs(UnmanagedType.I4)]
- int dwNumCategories,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
- int[] pdwEventCategories,
+ int dwNumCategories,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int[] pdwEventCategories,
[MarshalAs(UnmanagedType.I4)]
int dwLowSeverity,
[MarshalAs(UnmanagedType.I4)]
int dwHighSeverity,
[MarshalAs(UnmanagedType.I4)]
- int dwNumAreas,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=5)]
+ int dwNumAreas,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=5)]
string[] pszAreaList,
[MarshalAs(UnmanagedType.I4)]
int dwNumSources,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=7)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=7)]
string[] pszSourceList);
- void GetFilter(
+ void GetFilter(
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwEventType,
+ out int pdwEventType,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwNumCategories,
[Out]
- out IntPtr ppdwEventCategories,
+ out IntPtr ppdwEventCategories,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwLowSeverity,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwHighSeverity,
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwNumAreas,
- [Out]
+ out int pdwNumAreas,
+ [Out]
out IntPtr ppszAreaList,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwNumSources,
[Out]
out IntPtr ppszSourceList);
- void SelectReturnedAttributes(
+ void SelectReturnedAttributes(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int dwEventCategory,
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] dwAttributeIDs);
- void GetReturnedAttributes(
+ void GetReturnedAttributes(
[MarshalAs(UnmanagedType.I4)]
- int dwEventCategory,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pdwCount,
+ int dwEventCategory,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pdwCount,
[Out]
out IntPtr ppdwAttributeIDs);
@@ -732,69 +730,69 @@ namespace Technosoftware.OpcRcw.Ae
int dwConnection);
void GetState(
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pbActive,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pdwBufferTime,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pbActive,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pdwBufferTime,
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwMaxSize,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int phClientSubscription);
- void SetState(
- IntPtr pbActive,
+ void SetState(
+ IntPtr pbActive,
IntPtr pdwBufferTime,
IntPtr pdwMaxSize,
[MarshalAs(UnmanagedType.I4)]
int hClientSubscription,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedBufferTime,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedMaxSize);
- void SetKeepAlive(
+ void SetKeepAlive(
[MarshalAs(UnmanagedType.I4)]
int dwKeepAliveTime,
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedKeepAliveTime);
- void GetKeepAlive(
+ void GetKeepAlive(
[Out][MarshalAs(UnmanagedType.I4)]
- out int pdwKeepAliveTime);
+ out int pdwKeepAliveTime);
}
///
public static class Constants
- {
- // category description string.
- public const string OPC_CATEGORY_DESCRIPTION_AE10 = "OPC Alarm & Event Server Version 1.0";
+ {
+ // category description string.
+ public const string OPC_CATEGORY_DESCRIPTION_AE10 = "OPC Alarm & Event Server Version 1.0";
- // state bit masks.
- public const int CONDITION_ENABLED = 0x0001;
- public const int CONDITION_ACTIVE = 0x0002;
- public const int CONDITION_ACKED = 0x0004;
+ // state bit masks.
+ public const int CONDITION_ENABLED = 0x0001;
+ public const int CONDITION_ACTIVE = 0x0002;
+ public const int CONDITION_ACKED = 0x0004;
- // bit masks for change mask.
- public const int CHANGE_ACTIVE_STATE = 0x0001;
- public const int CHANGE_ACK_STATE = 0x0002;
- public const int CHANGE_ENABLE_STATE = 0x0004;
- public const int CHANGE_QUALITY = 0x0008;
- public const int CHANGE_SEVERITY = 0x0010;
- public const int CHANGE_SUBCONDITION = 0x0020;
- public const int CHANGE_MESSAGE = 0x0040;
- public const int CHANGE_ATTRIBUTE = 0x0080;
+ // bit masks for change mask.
+ public const int CHANGE_ACTIVE_STATE = 0x0001;
+ public const int CHANGE_ACK_STATE = 0x0002;
+ public const int CHANGE_ENABLE_STATE = 0x0004;
+ public const int CHANGE_QUALITY = 0x0008;
+ public const int CHANGE_SEVERITY = 0x0010;
+ public const int CHANGE_SUBCONDITION = 0x0020;
+ public const int CHANGE_MESSAGE = 0x0040;
+ public const int CHANGE_ATTRIBUTE = 0x0080;
- // event type.
- public const int SIMPLE_EVENT = 0x0001;
- public const int TRACKING_EVENT = 0x0002;
- public const int CONDITION_EVENT = 0x0004;
- public const int ALL_EVENTS = 0x0007;
+ // event type.
+ public const int SIMPLE_EVENT = 0x0001;
+ public const int TRACKING_EVENT = 0x0002;
+ public const int CONDITION_EVENT = 0x0004;
+ public const int ALL_EVENTS = 0x0007;
- // bit masks for QueryAvailableFilters().
- public const int FILTER_BY_EVENT = 0x0001;
- public const int FILTER_BY_CATEGORY = 0x0002;
- public const int FILTER_BY_SEVERITY = 0x0004;
- public const int FILTER_BY_AREA = 0x0008;
- public const int FILTER_BY_SOURCE = 0x0010;
- }
+ // bit masks for QueryAvailableFilters().
+ public const int FILTER_BY_EVENT = 0x0001;
+ public const int FILTER_BY_CATEGORY = 0x0002;
+ public const int FILTER_BY_SEVERITY = 0x0004;
+ public const int FILTER_BY_AREA = 0x0008;
+ public const int FILTER_BY_SOURCE = 0x0010;
+ }
}
diff --git a/Technosoftware/OpcRcw/Comn/Common.cs b/Technosoftware/OpcRcw/Comn/Common.cs
index fc8e12b..dec7d70 100644
--- a/Technosoftware/OpcRcw/Comn/Common.cs
+++ b/Technosoftware/OpcRcw/Comn/Common.cs
@@ -11,8 +11,6 @@
#region Using Directives
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Runtime.InteropServices;
/* Unmerged change from project 'Technosoftware.OpcRcw (net472)'
@@ -29,7 +27,7 @@ using Technosoftware.OpcRcw;
#pragma warning disable 1591
namespace Technosoftware.OpcRcw.Comn
-{
+{
///
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct CONNECTDATA
diff --git a/Technosoftware/OpcRcw/Da/DataAccess.cs b/Technosoftware/OpcRcw/Da/DataAccess.cs
index 041fd02..25f7609 100644
--- a/Technosoftware/OpcRcw/Da/DataAccess.cs
+++ b/Technosoftware/OpcRcw/Da/DataAccess.cs
@@ -11,8 +11,6 @@
#region Using Directives
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Runtime.InteropServices;
#endregion
@@ -22,27 +20,27 @@ namespace Technosoftware.OpcRcw.Da
{
///
[ComImport]
- [GuidAttribute("63D5F430-CFE4-11d1-B2C8-0060083BA1FB")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface CATID_OPCDAServer10 {}
+ [GuidAttribute("63D5F430-CFE4-11d1-B2C8-0060083BA1FB")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ public interface CATID_OPCDAServer10 { }
///
[ComImport]
- [GuidAttribute("63D5F432-CFE4-11d1-B2C8-0060083BA1FB")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface CATID_OPCDAServer20 {}
+ [GuidAttribute("63D5F432-CFE4-11d1-B2C8-0060083BA1FB")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ public interface CATID_OPCDAServer20 { }
///
[ComImport]
- [GuidAttribute("CC603642-66D7-48f1-B69A-B625E73652D7")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface CATID_OPCDAServer30 {}
+ [GuidAttribute("CC603642-66D7-48f1-B69A-B625E73652D7")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ public interface CATID_OPCDAServer30 { }
///
[ComImport]
- [GuidAttribute("3098EDA4-A006-48b2-A27F-247453959408")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface CATID_XMLDAServer10 {}
+ [GuidAttribute("3098EDA4-A006-48b2-A27F-247453959408")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ public interface CATID_XMLDAServer10 { }
///
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
@@ -53,68 +51,68 @@ namespace Technosoftware.OpcRcw.Da
}
///
- public enum OPCDATASOURCE
- {
- OPC_DS_CACHE = 1,
- OPC_DS_DEVICE
+ public enum OPCDATASOURCE
+ {
+ OPC_DS_CACHE = 1,
+ OPC_DS_DEVICE
}
///
- public enum OPCBROWSETYPE
- {
- OPC_BRANCH = 1,
- OPC_LEAF,
+ public enum OPCBROWSETYPE
+ {
+ OPC_BRANCH = 1,
+ OPC_LEAF,
OPC_FLAT
}
///
- public enum OPCNAMESPACETYPE
- {
- OPC_NS_HIERARCHIAL = 1,
+ public enum OPCNAMESPACETYPE
+ {
+ OPC_NS_HIERARCHIAL = 1,
OPC_NS_FLAT
}
///
- public enum OPCBROWSEDIRECTION
- {
- OPC_BROWSE_UP = 1,
- OPC_BROWSE_DOWN,
+ public enum OPCBROWSEDIRECTION
+ {
+ OPC_BROWSE_UP = 1,
+ OPC_BROWSE_DOWN,
OPC_BROWSE_TO
}
///
- public enum OPCEUTYPE
+ public enum OPCEUTYPE
{
- OPC_NOENUM = 0,
- OPC_ANALOG,
- OPC_ENUMERATED
+ OPC_NOENUM = 0,
+ OPC_ANALOG,
+ OPC_ENUMERATED
}
///
- public enum OPCSERVERSTATE
- {
- OPC_STATUS_RUNNING = 1,
- OPC_STATUS_FAILED,
- OPC_STATUS_NOCONFIG,
- OPC_STATUS_SUSPENDED,
+ public enum OPCSERVERSTATE
+ {
+ OPC_STATUS_RUNNING = 1,
+ OPC_STATUS_FAILED,
+ OPC_STATUS_NOCONFIG,
+ OPC_STATUS_SUSPENDED,
OPC_STATUS_TEST,
OPC_STATUS_COMM_FAULT
}
///
- public enum OPCENUMSCOPE
- {
- OPC_ENUM_PRIVATE_CONNECTIONS = 1,
- OPC_ENUM_PUBLIC_CONNECTIONS,
- OPC_ENUM_ALL_CONNECTIONS,
- OPC_ENUM_PRIVATE,
- OPC_ENUM_PUBLIC,
- OPC_ENUM_ALL
+ public enum OPCENUMSCOPE
+ {
+ OPC_ENUM_PRIVATE_CONNECTIONS = 1,
+ OPC_ENUM_PUBLIC_CONNECTIONS,
+ OPC_ENUM_ALL_CONNECTIONS,
+ OPC_ENUM_PRIVATE,
+ OPC_ENUM_PUBLIC,
+ OPC_ENUM_ALL
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCGROUPHEADER
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCGROUPHEADER
{
[MarshalAs(UnmanagedType.I4)]
public int dwSize;
@@ -129,8 +127,8 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCITEMHEADER1
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCITEMHEADER1
{
[MarshalAs(UnmanagedType.I4)]
public int hClient;
@@ -144,8 +142,8 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCITEMHEADER2
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCITEMHEADER2
{
[MarshalAs(UnmanagedType.I4)]
public int hClient;
@@ -158,8 +156,8 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCGROUPHEADERWRITE
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCGROUPHEADERWRITE
{
[MarshalAs(UnmanagedType.I4)]
public int dwItemCount;
@@ -172,8 +170,8 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCITEMHEADERWRITE
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCITEMHEADERWRITE
{
[MarshalAs(UnmanagedType.I4)]
public int hClient;
@@ -182,7 +180,7 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCITEMSTATE
{
[MarshalAs(UnmanagedType.I4)]
@@ -197,15 +195,15 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCSERVERSTATUS
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCSERVERSTATUS
{
public FILETIME ftStartTime;
public FILETIME ftCurrentTime;
public FILETIME ftLastUpdateTime;
public OPCSERVERSTATE dwServerState;
[MarshalAs(UnmanagedType.I4)]
- public int dwGroupCount;
+ public int dwGroupCount;
[MarshalAs(UnmanagedType.I4)]
public int dwBandWidth;
[MarshalAs(UnmanagedType.I2)]
@@ -221,8 +219,8 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCITEMDEF
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCITEMDEF
{
[MarshalAs(UnmanagedType.LPWStr)]
public string szAccessPath;
@@ -242,7 +240,7 @@ namespace Technosoftware.OpcRcw.Da
};
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCITEMATTRIBUTES
{
[MarshalAs(UnmanagedType.LPWStr)]
@@ -264,14 +262,14 @@ namespace Technosoftware.OpcRcw.Da
public short vtRequestedDataType;
[MarshalAs(UnmanagedType.I2)]
public short vtCanonicalDataType;
- public OPCEUTYPE dwEUType;
+ public OPCEUTYPE dwEUType;
[MarshalAs(UnmanagedType.Struct)]
public object vEUInfo;
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCITEMRESULT
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCITEMRESULT
{
[MarshalAs(UnmanagedType.I4)]
public int hServer;
@@ -287,7 +285,7 @@ namespace Technosoftware.OpcRcw.Da
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCITEMPROPERTY
{
[MarshalAs(UnmanagedType.I2)]
@@ -295,246 +293,246 @@ namespace Technosoftware.OpcRcw.Da
[MarshalAs(UnmanagedType.I2)]
public short wReserved;
[MarshalAs(UnmanagedType.I4)]
- public int dwPropertyID;
- [MarshalAs(UnmanagedType.LPWStr)]
+ public int dwPropertyID;
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szItemID;
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szDescription;
- [MarshalAs(UnmanagedType.Struct)]
+ [MarshalAs(UnmanagedType.Struct)]
public object vValue;
- [MarshalAs(UnmanagedType.I4)]
- public int hrErrorID;
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
+ public int hrErrorID;
+ [MarshalAs(UnmanagedType.I4)]
public int dwReserved;
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCITEMPROPERTIES
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCITEMPROPERTIES
{
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
public int hrErrorID;
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
public int dwNumProperties;
public IntPtr pItemProperties;
- [MarshalAs(UnmanagedType.I4)]
- public int dwReserved;
+ [MarshalAs(UnmanagedType.I4)]
+ public int dwReserved;
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCBROWSEELEMENT
{
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szName;
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
public string szItemID;
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
public int dwFlagValue;
- [MarshalAs(UnmanagedType.I4)]
- public int dwReserved;
+ [MarshalAs(UnmanagedType.I4)]
+ public int dwReserved;
public OPCITEMPROPERTIES ItemProperties;
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCITEMVQT
{
- [MarshalAs(UnmanagedType.Struct)]
+ [MarshalAs(UnmanagedType.Struct)]
public object vDataValue;
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
public int bQualitySpecified;
- [MarshalAs(UnmanagedType.I2)]
+ [MarshalAs(UnmanagedType.I2)]
public short wQuality;
- [MarshalAs(UnmanagedType.I2)]
+ [MarshalAs(UnmanagedType.I2)]
public short wReserved;
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
public int bTimeStampSpecified;
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
public int dwReserved;
public FILETIME ftTimeStamp;
}
///
- public enum OPCBROWSEFILTER
+ public enum OPCBROWSEFILTER
{
- OPC_BROWSE_FILTER_ALL = 1,
- OPC_BROWSE_FILTER_BRANCHES,
- OPC_BROWSE_FILTER_ITEMS,
+ OPC_BROWSE_FILTER_ALL = 1,
+ OPC_BROWSE_FILTER_BRANCHES,
+ OPC_BROWSE_FILTER_ITEMS,
}
///
[ComImport]
- [GuidAttribute("39c13a4d-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a4d-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCServer
{
void AddGroup(
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
string szName,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bActive,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwRequestedUpdateRate,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int hClientGroup,
IntPtr pTimeBias,
IntPtr pPercentDeadband,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwLCID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int phServerGroup,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pRevisedUpdateRate,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=9)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=9)]
out object ppUnk);
- void GetErrorString(
- [MarshalAs(UnmanagedType.I4)]
+ void GetErrorString(
+ [MarshalAs(UnmanagedType.I4)]
int dwError,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwLocale,
- [Out][MarshalAs(UnmanagedType.LPWStr)]
+ [Out][MarshalAs(UnmanagedType.LPWStr)]
out string ppString);
void GetGroupByName(
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
string szName,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
out object ppUnk);
- void GetStatus(
+ void GetStatus(
[Out]
out IntPtr ppServerStatus);
void RemoveGroup(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int hServerGroup,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bForce);
void CreateGroupEnumerator(
- OPCENUMSCOPE dwScope,
+ OPCENUMSCOPE dwScope,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
out object ppUnk);
}
///
[ComImport]
- [GuidAttribute("39c13a4e-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a4e-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCServerPublicGroups
{
void GetPublicGroupByName(
- [MarshalAs(UnmanagedType.LPWStr)]
- string szName,
+ [MarshalAs(UnmanagedType.LPWStr)]
+ string szName,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
out object ppUnk);
void RemovePublicGroup(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int hServerGroup,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bForce);
}
///
[ComImport]
- [GuidAttribute("39c13a4f-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a4f-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCBrowseServerAddressSpace
{
void QueryOrganization(
- [Out]
+ [Out]
out OPCNAMESPACETYPE pNameSpaceType);
void ChangeBrowsePosition(
- OPCBROWSEDIRECTION dwBrowseDirection,
- [MarshalAs(UnmanagedType.LPWStr)]
+ OPCBROWSEDIRECTION dwBrowseDirection,
+ [MarshalAs(UnmanagedType.LPWStr)]
string szString);
void BrowseOPCItemIDs(
- OPCBROWSETYPE dwBrowseFilterType,
- [MarshalAs(UnmanagedType.LPWStr)]
- string szFilterCriteria,
- [MarshalAs(UnmanagedType.I2)]
- short vtDataTypeFilter,
- [MarshalAs(UnmanagedType.I4)]
+ OPCBROWSETYPE dwBrowseFilterType,
+ [MarshalAs(UnmanagedType.LPWStr)]
+ string szFilterCriteria,
+ [MarshalAs(UnmanagedType.I2)]
+ short vtDataTypeFilter,
+ [MarshalAs(UnmanagedType.I4)]
int dwAccessRightsFilter,
- [Out]
- out OpcRcw.Comn.IEnumString ppIEnumString);
+ [Out]
+ out OpcRcw.Comn.IEnumString ppIEnumString);
void GetItemID(
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
string szItemDataID,
- [Out][MarshalAs(UnmanagedType.LPWStr)]
+ [Out][MarshalAs(UnmanagedType.LPWStr)]
out string szItemID);
void BrowseAccessPaths(
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
string szItemID,
- [Out]
+ [Out]
out OpcRcw.Comn.IEnumString pIEnumString);
}
///
[ComImport]
- [GuidAttribute("39c13a50-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a50-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCGroupStateMgt
{
void GetState(
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pUpdateRate,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pUpdateRate,
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pActive,
- [Out][MarshalAs(UnmanagedType.LPWStr)]
- out string ppName,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pTimeBias,
- [Out][MarshalAs(UnmanagedType.R4)]
+ [Out][MarshalAs(UnmanagedType.LPWStr)]
+ out string ppName,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pTimeBias,
+ [Out][MarshalAs(UnmanagedType.R4)]
out float pPercentDeadband,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pLCID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int phClientGroup,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int phServerGroup);
- void SetState(
- IntPtr pRequestedUpdateRate,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pRevisedUpdateRate,
- IntPtr pActive,
+ void SetState(
+ IntPtr pRequestedUpdateRate,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pRevisedUpdateRate,
+ IntPtr pActive,
IntPtr pTimeBias,
IntPtr pPercentDeadband,
IntPtr pLCID,
IntPtr phClientGroup);
- void SetName(
- [MarshalAs(UnmanagedType.LPWStr)]
+ void SetName(
+ [MarshalAs(UnmanagedType.LPWStr)]
string szName);
void CloneGroup(
- [MarshalAs(UnmanagedType.LPWStr)]
- string szName,
+ [MarshalAs(UnmanagedType.LPWStr)]
+ string szName,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
out object ppUnk);
}
///
[ComImport]
- [GuidAttribute("39c13a51-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a51-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCPublicGroupStateMgt
{
- void GetState(
- [Out][MarshalAs(UnmanagedType.I4)]
+ void GetState(
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pPublic);
void MoveToPublic();
@@ -542,876 +540,876 @@ namespace Technosoftware.OpcRcw.Da
///
[ComImport]
- [GuidAttribute("39c13a52-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a52-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCSyncIO
{
void Read(
- OPCDATASOURCE dwSource,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
- int[] phServer,
- [Out]
+ OPCDATASOURCE dwSource,
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int[] phServer,
+ [Out]
out IntPtr ppItemValues,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Write(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
- object[] pItemValues,
- [Out]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ object[] pItemValues,
+ [Out]
out IntPtr ppErrors);
}
///
[ComImport]
- [GuidAttribute("39c13a53-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a53-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCAsyncIO
{
void Read(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwConnection,
OPCDATASOURCE dwSource,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phServer,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pTransactionID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Write(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwConnection,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
- object[] pItemValues,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
+ object[] pItemValues,
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pTransactionID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Refresh(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwConnection,
- OPCDATASOURCE dwSource,
- [Out][MarshalAs(UnmanagedType.I4)]
+ OPCDATASOURCE dwSource,
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pTransactionID);
void Cancel(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID);
}
///
[ComImport]
- [GuidAttribute("39c13a54-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a54-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCItemMgt
{
- void AddItems(
- [MarshalAs(UnmanagedType.I4)]
+ void AddItems(
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCITEMDEF[] pItemArray,
- [Out]
+ [Out]
out IntPtr ppAddResults,
- [Out]
+ [Out]
out IntPtr ppErrors);
- void ValidateItems(
- [MarshalAs(UnmanagedType.I4)]
+ void ValidateItems(
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCITEMDEF[] pItemArray,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bBlobUpdate,
- [Out]
+ [Out]
out IntPtr ppValidationResults,
- [Out]
+ [Out]
out IntPtr ppErrors);
- void RemoveItems(
- [MarshalAs(UnmanagedType.I4)]
+ void RemoveItems(
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [Out]
+ [Out]
out IntPtr ppErrors);
void SetActiveState(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.I4)]
- int bActive,
- [Out]
+ [MarshalAs(UnmanagedType.I4)]
+ int bActive,
+ [Out]
out IntPtr ppErrors);
void SetClientHandles(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phClient,
- [Out]
+ [Out]
out IntPtr ppErrors);
void SetDatatypes(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I2, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I2, SizeParamIndex=0)]
short[] pRequestedDatatypes,
- [Out]
+ [Out]
out IntPtr ppErrors);
void CreateEnumerator(
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=0)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=0)]
out object ppUnk);
}
///
[ComImport]
- [GuidAttribute("39c13a55-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a55-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumOPCItemAttributes
{
- void Next(
- [MarshalAs(UnmanagedType.I4)]
+ void Next(
+ [MarshalAs(UnmanagedType.I4)]
int celt,
- [Out]
+ [Out]
out IntPtr ppItemArray,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pceltFetched);
- void Skip(
- [MarshalAs(UnmanagedType.I4)]
+ void Skip(
+ [MarshalAs(UnmanagedType.I4)]
int celt);
void Reset();
- void Clone(
- [Out]
+ void Clone(
+ [Out]
out IEnumOPCItemAttributes ppEnumItemAttributes);
}
///
[ComImport]
- [GuidAttribute("39c13a70-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a70-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCDataCallback
{
void OnDataChange(
- [MarshalAs(UnmanagedType.I4)]
- int dwTransid,
- [MarshalAs(UnmanagedType.I4)]
- int hGroup,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwTransid,
+ [MarshalAs(UnmanagedType.I4)]
+ int hGroup,
+ [MarshalAs(UnmanagedType.I4)]
int hrMasterquality,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int hrMastererror,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
- int[] phClientItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=4)]
- object[] pvValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I2, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ int[] phClientItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=4)]
+ object[] pvValues,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I2, SizeParamIndex=4)]
short[] pwQualities,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=4)]
FILETIME[] pftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
int[] pErrors);
void OnReadComplete(
- [MarshalAs(UnmanagedType.I4)]
- int dwTransid,
- [MarshalAs(UnmanagedType.I4)]
- int hGroup,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwTransid,
+ [MarshalAs(UnmanagedType.I4)]
+ int hGroup,
+ [MarshalAs(UnmanagedType.I4)]
int hrMasterquality,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int hrMastererror,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
- int[] phClientItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=4)]
- object[] pvValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I2, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ int[] phClientItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=4)]
+ object[] pvValues,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I2, SizeParamIndex=4)]
short[] pwQualities,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=4)]
FILETIME[] pftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
int[] pErrors);
void OnWriteComplete(
- [MarshalAs(UnmanagedType.I4)]
- int dwTransid,
- [MarshalAs(UnmanagedType.I4)]
- int hGroup,
- [MarshalAs(UnmanagedType.I4)]
- int hrMastererr,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
- int[] pClienthandles,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwTransid,
+ [MarshalAs(UnmanagedType.I4)]
+ int hGroup,
+ [MarshalAs(UnmanagedType.I4)]
+ int hrMastererr,
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ int[] pClienthandles,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] pErrors);
void OnCancelComplete(
- [MarshalAs(UnmanagedType.I4)]
- int dwTransid,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwTransid,
+ [MarshalAs(UnmanagedType.I4)]
int hGroup);
}
///
[ComImport]
- [GuidAttribute("39c13a71-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a71-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCAsyncIO2
{
void Read(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCancelID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Write(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
- object[] pItemValues,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ object[] pItemValues,
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCancelID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Refresh2(
OPCDATASOURCE dwSource,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCancelID);
void Cancel2(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCancelID);
void SetEnable(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bEnable);
void GetEnable(
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pbEnable);
}
///
[ComImport]
- [GuidAttribute("39c13a72-011e-11d0-9675-0020afd8adb3")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39c13a72-011e-11d0-9675-0020afd8adb3")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCItemProperties
{
- void QueryAvailableProperties(
- [MarshalAs(UnmanagedType.LPWStr)]
+ void QueryAvailableProperties(
+ [MarshalAs(UnmanagedType.LPWStr)]
string szItemID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCount,
- [Out]
+ [Out]
out IntPtr ppPropertyIDs,
- [Out]
+ [Out]
out IntPtr ppDescriptions,
- [Out]
+ [Out]
out IntPtr ppvtDataTypes);
- void GetItemProperties(
- [MarshalAs(UnmanagedType.LPWStr)]
+ void GetItemProperties(
+ [MarshalAs(UnmanagedType.LPWStr)]
string szItemID,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] pdwPropertyIDs,
- [Out]
+ [Out]
out IntPtr ppvData,
- [Out]
+ [Out]
out IntPtr ppErrors);
- void LookupItemIDs(
- [MarshalAs(UnmanagedType.LPWStr)]
+ void LookupItemIDs(
+ [MarshalAs(UnmanagedType.LPWStr)]
string szItemID,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] pdwPropertyIDs,
- [Out]
+ [Out]
out IntPtr ppszNewItemIDs,
- [Out]
+ [Out]
out IntPtr ppErrors);
}
///
[ComImport]
- [GuidAttribute("5946DA93-8B39-4ec8-AB3D-AA73DF5BC86F")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("5946DA93-8B39-4ec8-AB3D-AA73DF5BC86F")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCItemDeadbandMgt
{
- void SetItemDeadband(
- [MarshalAs(UnmanagedType.I4)]
+ void SetItemDeadband(
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.R4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.R4, SizeParamIndex=0)]
float[] pPercentDeadband,
- [Out]
+ [Out]
out IntPtr ppErrors);
- void GetItemDeadband(
- [MarshalAs(UnmanagedType.I4)]
+ void GetItemDeadband(
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [Out]
+ [Out]
out IntPtr ppPercentDeadband,
- [Out]
+ [Out]
out IntPtr ppErrors);
void ClearItemDeadband(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [Out]
+ [Out]
out IntPtr ppErrors);
}
///
[ComImport]
- [GuidAttribute("3E22D313-F08B-41a5-86C8-95E95CB49FFC")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("3E22D313-F08B-41a5-86C8-95E95CB49FFC")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCItemSamplingMgt
{
void SetItemSamplingRate(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwRequestedSamplingRate,
- [Out]
+ [Out]
out IntPtr ppdwRevisedSamplingRate,
- [Out]
+ [Out]
out IntPtr ppErrors);
void GetItemSamplingRate(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [Out]
+ [Out]
out IntPtr ppdwSamplingRate,
- [Out]
+ [Out]
out IntPtr ppErrors);
void ClearItemSamplingRate(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [Out]
+ [Out]
out IntPtr ppErrors);
void SetItemBufferEnable(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pbEnable,
- [Out]
+ [Out]
out IntPtr ppErrors);
void GetItemBufferEnable(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [Out]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [Out]
out IntPtr ppbEnable,
- [Out]
+ [Out]
out IntPtr ppErrors);
}
///
[ComImport]
- [GuidAttribute("39227004-A18F-4b57-8B0A-5235670F4468")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("39227004-A18F-4b57-8B0A-5235670F4468")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCBrowse
{
- void GetProperties(
- [MarshalAs(UnmanagedType.I4)]
- int dwItemCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ void GetProperties(
+ [MarshalAs(UnmanagedType.I4)]
+ int dwItemCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszItemIDs,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bReturnPropertyValues,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwPropertyCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] dwPropertyIDs,
- [Out]
+ [Out]
out IntPtr ppItemProperties);
void Browse(
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
string szItemID,
ref IntPtr pszContinuationPoint,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwMaxElementsReturned,
OPCBROWSEFILTER dwBrowseFilter,
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
string szElementNameFilter,
- [MarshalAs(UnmanagedType.LPWStr)]
+ [MarshalAs(UnmanagedType.LPWStr)]
string szVendorFilter,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bReturnAllProperties,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bReturnPropertyValues,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwPropertyCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=8)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=8)]
int[] pdwPropertyIDs,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pbMoreElements,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCount,
- [Out]
+ [Out]
out IntPtr ppBrowseElements);
}
///
[ComImport]
- [GuidAttribute("85C0B427-2893-4cbc-BD78-E5FC5146F08F")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("85C0B427-2893-4cbc-BD78-E5FC5146F08F")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCItemIO
{
void Read(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
- string[] pszItemIDs,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ string[] pszItemIDs,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwMaxAge,
- [Out]
+ [Out]
out IntPtr ppvValues,
- [Out]
+ [Out]
out IntPtr ppwQualities,
- [Out]
+ [Out]
out IntPtr ppftTimeStamps,
- [Out]
+ [Out]
out IntPtr ppErrors);
void WriteVQT(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszItemIDs,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCITEMVQT[] pItemVQT,
- [Out]
+ [Out]
out IntPtr ppErrors);
}
///
[ComImport]
- [GuidAttribute("730F5F0F-55B1-4c81-9E18-FF8A0904E1FA")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("730F5F0F-55B1-4c81-9E18-FF8A0904E1FA")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCSyncIO2 // : IOPCSyncIO
- {
+ {
void Read(
- OPCDATASOURCE dwSource,
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
- int[] phServer,
- [Out]
+ OPCDATASOURCE dwSource,
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int[] phServer,
+ [Out]
out IntPtr ppItemValues,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Write(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
- object[] pItemValues,
- [Out]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ object[] pItemValues,
+ [Out]
out IntPtr ppErrors);
void ReadMaxAge(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwMaxAge,
- [Out]
+ [Out]
out IntPtr ppvValues,
- [Out]
+ [Out]
out IntPtr ppwQualities,
- [Out]
+ [Out]
out IntPtr ppftTimeStamps,
- [Out]
+ [Out]
out IntPtr ppErrors);
void WriteVQT(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCITEMVQT[] pItemVQT,
- [Out]
+ [Out]
out IntPtr ppErrors);
}
///
[ComImport]
- [GuidAttribute("0967B97B-36EF-423e-B6F8-6BFF1E40D39D")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("0967B97B-36EF-423e-B6F8-6BFF1E40D39D")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCAsyncIO3 // : IOPCAsyncIO2
- {
+ {
void Read(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCancelID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Write(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
- object[] pItemValues,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ object[] pItemValues,
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCancelID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void Refresh2(
OPCDATASOURCE dwSource,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwCancelID);
void Cancel2(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwCancelID);
void SetEnable(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int bEnable);
void GetEnable(
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pbEnable);
void ReadMaxAge(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwMaxAge,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out]
- [MarshalAs(UnmanagedType.I4)]
+ [Out]
+ [MarshalAs(UnmanagedType.I4)]
out int pdwCancelID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void WriteVQT(
- [MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.I4)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCITEMVQT[] pItemVQT,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out]
- [MarshalAs(UnmanagedType.I4)]
+ [Out]
+ [MarshalAs(UnmanagedType.I4)]
out int pdwCancelID,
- [Out]
+ [Out]
out IntPtr ppErrors);
void RefreshMaxAge(
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwMaxAge,
- [MarshalAs(UnmanagedType.I4)]
+ [MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
- [Out]
- [MarshalAs(UnmanagedType.I4)]
+ [Out]
+ [MarshalAs(UnmanagedType.I4)]
out int pdwCancelID);
}
///
[ComImport]
- [GuidAttribute("8E368666-D72E-4f78-87ED-647611C61C9F")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("8E368666-D72E-4f78-87ED-647611C61C9F")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCGroupStateMgt2 // : IOPCGroupStateMgt
- {
+ {
void GetState(
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pUpdateRate,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pUpdateRate,
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pActive,
- [Out][MarshalAs(UnmanagedType.LPWStr)]
- out string ppName,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pTimeBias,
- [Out][MarshalAs(UnmanagedType.R4)]
+ [Out][MarshalAs(UnmanagedType.LPWStr)]
+ out string ppName,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pTimeBias,
+ [Out][MarshalAs(UnmanagedType.R4)]
out float pPercentDeadband,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pLCID,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int phClientGroup,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int phServerGroup);
- void SetState(
- IntPtr pRequestedUpdateRate,
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pRevisedUpdateRate,
- IntPtr pActive,
+ void SetState(
+ IntPtr pRequestedUpdateRate,
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pRevisedUpdateRate,
+ IntPtr pActive,
IntPtr pTimeBias,
IntPtr pPercentDeadband,
IntPtr pLCID,
IntPtr phClientGroup);
- void SetName(
- [MarshalAs(UnmanagedType.LPWStr)]
+ void SetName(
+ [MarshalAs(UnmanagedType.LPWStr)]
string szName);
void CloneGroup(
- [MarshalAs(UnmanagedType.LPWStr)]
- string szName,
+ [MarshalAs(UnmanagedType.LPWStr)]
+ string szName,
ref Guid riid,
- [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
+ [Out][MarshalAs(UnmanagedType.IUnknown, IidParameterIndex=1)]
out object ppUnk);
- void SetKeepAlive(
- [MarshalAs(UnmanagedType.I4)]
+ void SetKeepAlive(
+ [MarshalAs(UnmanagedType.I4)]
int dwKeepAliveTime,
- [Out][MarshalAs(UnmanagedType.I4)]
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwRevisedKeepAliveTime);
- void GetKeepAlive(
- [Out][MarshalAs(UnmanagedType.I4)]
+ void GetKeepAlive(
+ [Out][MarshalAs(UnmanagedType.I4)]
out int pdwKeepAliveTime);
}
///
public static class Constants
- {
- // category description strings.
- public const string OPC_CATEGORY_DESCRIPTION_DA10 = "OPC Data Access Servers Version 1.0";
- public const string OPC_CATEGORY_DESCRIPTION_DA20 = "OPC Data Access Servers Version 2.0";
- public const string OPC_CATEGORY_DESCRIPTION_DA30 = "OPC Data Access Servers Version 3.0";
- public const string OPC_CATEGORY_DESCRIPTION_XMLDA10 = "OPC XML Data Access Servers Version 1.0";
+ {
+ // category description strings.
+ public const string OPC_CATEGORY_DESCRIPTION_DA10 = "OPC Data Access Servers Version 1.0";
+ public const string OPC_CATEGORY_DESCRIPTION_DA20 = "OPC Data Access Servers Version 2.0";
+ public const string OPC_CATEGORY_DESCRIPTION_DA30 = "OPC Data Access Servers Version 3.0";
+ public const string OPC_CATEGORY_DESCRIPTION_XMLDA10 = "OPC XML Data Access Servers Version 1.0";
- // values for access rights mask.
- public const int OPC_READABLE = 0x01;
- public const int OPC_WRITEABLE = 0x02;
+ // values for access rights mask.
+ public const int OPC_READABLE = 0x01;
+ public const int OPC_WRITEABLE = 0x02;
- // values for browse element flags.
- public const int OPC_BROWSE_HASCHILDREN = 0x01;
- public const int OPC_BROWSE_ISITEM = 0x02;
+ // values for browse element flags.
+ public const int OPC_BROWSE_HASCHILDREN = 0x01;
+ public const int OPC_BROWSE_ISITEM = 0x02;
- // well known complex type description systems.
- public const string OPC_TYPE_SYSTEM_OPCBINARY = "OPCBinary";
- public const string OPC_TYPE_SYSTEM_XMLSCHEMA = "XMLSchema";
+ // well known complex type description systems.
+ public const string OPC_TYPE_SYSTEM_OPCBINARY = "OPCBinary";
+ public const string OPC_TYPE_SYSTEM_XMLSCHEMA = "XMLSchema";
- // complex data consitency window values.
- public const string OPC_CONSISTENCY_WINDOW_UNKNOWN = "Unknown";
- public const string OPC_CONSISTENCY_WINDOW_NOT_CONSISTENT = "Not Consistent";
+ // complex data consitency window values.
+ public const string OPC_CONSISTENCY_WINDOW_UNKNOWN = "Unknown";
+ public const string OPC_CONSISTENCY_WINDOW_NOT_CONSISTENT = "Not Consistent";
- // complex data write behavoir values.
- public const string OPC_WRITE_BEHAVIOR_BEST_EFFORT = "Best Effort";
- public const string OPC_WRITE_BEHAVIOR_ALL_OR_NOTHING = "All or Nothing";
- }
+ // complex data write behavoir values.
+ public const string OPC_WRITE_BEHAVIOR_BEST_EFFORT = "Best Effort";
+ public const string OPC_WRITE_BEHAVIOR_ALL_OR_NOTHING = "All or Nothing";
+ }
///
public static class Qualities
- {
- // Values for fields in the quality word
- public const short OPC_QUALITY_MASK = 0xC0;
- public const short OPC_STATUS_MASK = 0xFC;
- public const short OPC_LIMIT_MASK = 0x03;
+ {
+ // Values for fields in the quality word
+ public const short OPC_QUALITY_MASK = 0xC0;
+ public const short OPC_STATUS_MASK = 0xFC;
+ public const short OPC_LIMIT_MASK = 0x03;
- // Values for QUALITY_MASK bit field
- public const short OPC_QUALITY_BAD = 0x00;
- public const short OPC_QUALITY_UNCERTAIN = 0x40;
- public const short OPC_QUALITY_GOOD = 0xC0;
+ // Values for QUALITY_MASK bit field
+ public const short OPC_QUALITY_BAD = 0x00;
+ public const short OPC_QUALITY_UNCERTAIN = 0x40;
+ public const short OPC_QUALITY_GOOD = 0xC0;
- // STATUS_MASK Values for Quality = BAD
- public const short OPC_QUALITY_CONFIG_ERROR = 0x04;
- public const short OPC_QUALITY_NOT_CONNECTED = 0x08;
- public const short OPC_QUALITY_DEVICE_FAILURE = 0x0c;
- public const short OPC_QUALITY_SENSOR_FAILURE = 0x10;
- public const short OPC_QUALITY_LAST_KNOWN = 0x14;
- public const short OPC_QUALITY_COMM_FAILURE = 0x18;
- public const short OPC_QUALITY_OUT_OF_SERVICE = 0x1C;
- public const short OPC_QUALITY_WAITING_FOR_INITIAL_DATA = 0x20;
+ // STATUS_MASK Values for Quality = BAD
+ public const short OPC_QUALITY_CONFIG_ERROR = 0x04;
+ public const short OPC_QUALITY_NOT_CONNECTED = 0x08;
+ public const short OPC_QUALITY_DEVICE_FAILURE = 0x0c;
+ public const short OPC_QUALITY_SENSOR_FAILURE = 0x10;
+ public const short OPC_QUALITY_LAST_KNOWN = 0x14;
+ public const short OPC_QUALITY_COMM_FAILURE = 0x18;
+ public const short OPC_QUALITY_OUT_OF_SERVICE = 0x1C;
+ public const short OPC_QUALITY_WAITING_FOR_INITIAL_DATA = 0x20;
- // STATUS_MASK Values for Quality = UNCERTAIN
- public const short OPC_QUALITY_LAST_USABLE = 0x44;
- public const short OPC_QUALITY_SENSOR_CAL = 0x50;
- public const short OPC_QUALITY_EGU_EXCEEDED = 0x54;
- public const short OPC_QUALITY_SUB_NORMAL = 0x58;
+ // STATUS_MASK Values for Quality = UNCERTAIN
+ public const short OPC_QUALITY_LAST_USABLE = 0x44;
+ public const short OPC_QUALITY_SENSOR_CAL = 0x50;
+ public const short OPC_QUALITY_EGU_EXCEEDED = 0x54;
+ public const short OPC_QUALITY_SUB_NORMAL = 0x58;
- // STATUS_MASK Values for Quality = GOOD
- public const short OPC_QUALITY_LOCAL_OVERRIDE = 0xD8;
+ // STATUS_MASK Values for Quality = GOOD
+ public const short OPC_QUALITY_LOCAL_OVERRIDE = 0xD8;
- // Values for Limit Bitfield
- public const short OPC_LIMIT_OK = 0x00;
- public const short OPC_LIMIT_LOW = 0x01;
- public const short OPC_LIMIT_HIGH = 0x02;
- public const short OPC_LIMIT_CONST = 0x03;
- }
+ // Values for Limit Bitfield
+ public const short OPC_LIMIT_OK = 0x00;
+ public const short OPC_LIMIT_LOW = 0x01;
+ public const short OPC_LIMIT_HIGH = 0x02;
+ public const short OPC_LIMIT_CONST = 0x03;
+ }
- //==========================================================================
+ //==========================================================================
// Properties
///
- public static class Properties
- {
- // property ids.
- public const int OPC_PROPERTY_DATATYPE = 1;
- public const int OPC_PROPERTY_VALUE = 2;
- public const int OPC_PROPERTY_QUALITY = 3;
- public const int OPC_PROPERTY_TIMESTAMP = 4;
- public const int OPC_PROPERTY_ACCESS_RIGHTS = 5;
- public const int OPC_PROPERTY_SCAN_RATE = 6;
- public const int OPC_PROPERTY_EU_TYPE = 7;
- public const int OPC_PROPERTY_EU_INFO = 8;
- public const int OPC_PROPERTY_EU_UNITS = 100;
- public const int OPC_PROPERTY_DESCRIPTION = 101;
- public const int OPC_PROPERTY_HIGH_EU = 102;
- public const int OPC_PROPERTY_LOW_EU = 103;
- public const int OPC_PROPERTY_HIGH_IR = 104;
- public const int OPC_PROPERTY_LOW_IR = 105;
- public const int OPC_PROPERTY_CLOSE_LABEL = 106;
- public const int OPC_PROPERTY_OPEN_LABEL = 107;
- public const int OPC_PROPERTY_TIMEZONE = 108;
- public const int OPC_PROPERTY_CONDITION_STATUS = 300;
- public const int OPC_PROPERTY_ALARM_QUICK_HELP = 301;
- public const int OPC_PROPERTY_ALARM_AREA_LIST = 302;
- public const int OPC_PROPERTY_PRIMARY_ALARM_AREA = 303;
- public const int OPC_PROPERTY_CONDITION_LOGIC = 304;
- public const int OPC_PROPERTY_LIMIT_EXCEEDED = 305;
- public const int OPC_PROPERTY_DEADBAND = 306;
- public const int OPC_PROPERTY_HIHI_LIMIT = 307;
- public const int OPC_PROPERTY_HI_LIMIT = 308;
- public const int OPC_PROPERTY_LO_LIMIT = 309;
- public const int OPC_PROPERTY_LOLO_LIMIT = 310;
- public const int OPC_PROPERTY_CHANGE_RATE_LIMIT = 311;
- public const int OPC_PROPERTY_DEVIATION_LIMIT = 312;
- public const int OPC_PROPERTY_SOUND_FILE = 313;
+ public static class Properties
+ {
+ // property ids.
+ public const int OPC_PROPERTY_DATATYPE = 1;
+ public const int OPC_PROPERTY_VALUE = 2;
+ public const int OPC_PROPERTY_QUALITY = 3;
+ public const int OPC_PROPERTY_TIMESTAMP = 4;
+ public const int OPC_PROPERTY_ACCESS_RIGHTS = 5;
+ public const int OPC_PROPERTY_SCAN_RATE = 6;
+ public const int OPC_PROPERTY_EU_TYPE = 7;
+ public const int OPC_PROPERTY_EU_INFO = 8;
+ public const int OPC_PROPERTY_EU_UNITS = 100;
+ public const int OPC_PROPERTY_DESCRIPTION = 101;
+ public const int OPC_PROPERTY_HIGH_EU = 102;
+ public const int OPC_PROPERTY_LOW_EU = 103;
+ public const int OPC_PROPERTY_HIGH_IR = 104;
+ public const int OPC_PROPERTY_LOW_IR = 105;
+ public const int OPC_PROPERTY_CLOSE_LABEL = 106;
+ public const int OPC_PROPERTY_OPEN_LABEL = 107;
+ public const int OPC_PROPERTY_TIMEZONE = 108;
+ public const int OPC_PROPERTY_CONDITION_STATUS = 300;
+ public const int OPC_PROPERTY_ALARM_QUICK_HELP = 301;
+ public const int OPC_PROPERTY_ALARM_AREA_LIST = 302;
+ public const int OPC_PROPERTY_PRIMARY_ALARM_AREA = 303;
+ public const int OPC_PROPERTY_CONDITION_LOGIC = 304;
+ public const int OPC_PROPERTY_LIMIT_EXCEEDED = 305;
+ public const int OPC_PROPERTY_DEADBAND = 306;
+ public const int OPC_PROPERTY_HIHI_LIMIT = 307;
+ public const int OPC_PROPERTY_HI_LIMIT = 308;
+ public const int OPC_PROPERTY_LO_LIMIT = 309;
+ public const int OPC_PROPERTY_LOLO_LIMIT = 310;
+ public const int OPC_PROPERTY_CHANGE_RATE_LIMIT = 311;
+ public const int OPC_PROPERTY_DEVIATION_LIMIT = 312;
+ public const int OPC_PROPERTY_SOUND_FILE = 313;
- // complex data properties.
- public const int OPC_PROPERTY_TYPE_SYSTEM_ID = 600;
- public const int OPC_PROPERTY_DICTIONARY_ID = 601;
- public const int OPC_PROPERTY_TYPE_ID = 602;
- public const int OPC_PROPERTY_DICTIONARY = 603;
- public const int OPC_PROPERTY_TYPE_DESCRIPTION = 604;
- public const int OPC_PROPERTY_CONSISTENCY_WINDOW = 605;
- public const int OPC_PROPERTY_WRITE_BEHAVIOR = 606;
- public const int OPC_PROPERTY_UNCONVERTED_ITEM_ID = 607;
- public const int OPC_PROPERTY_UNFILTERED_ITEM_ID = 608;
- public const int OPC_PROPERTY_DATA_FILTER_VALUE = 609;
+ // complex data properties.
+ public const int OPC_PROPERTY_TYPE_SYSTEM_ID = 600;
+ public const int OPC_PROPERTY_DICTIONARY_ID = 601;
+ public const int OPC_PROPERTY_TYPE_ID = 602;
+ public const int OPC_PROPERTY_DICTIONARY = 603;
+ public const int OPC_PROPERTY_TYPE_DESCRIPTION = 604;
+ public const int OPC_PROPERTY_CONSISTENCY_WINDOW = 605;
+ public const int OPC_PROPERTY_WRITE_BEHAVIOR = 606;
+ public const int OPC_PROPERTY_UNCONVERTED_ITEM_ID = 607;
+ public const int OPC_PROPERTY_UNFILTERED_ITEM_ID = 608;
+ public const int OPC_PROPERTY_DATA_FILTER_VALUE = 609;
- // property descriptions.
- public const string OPC_PROPERTY_DESC_DATATYPE = "Item Canonical Data Type";
- public const string OPC_PROPERTY_DESC_VALUE = "Item Value";
- public const string OPC_PROPERTY_DESC_QUALITY = "Item Quality";
- public const string OPC_PROPERTY_DESC_TIMESTAMP = "Item Timestamp";
- public const string OPC_PROPERTY_DESC_ACCESS_RIGHTS = "Item Access Rights";
- public const string OPC_PROPERTY_DESC_SCAN_RATE = "Server Scan Rate";
- public const string OPC_PROPERTY_DESC_EU_TYPE = "Item EU Type";
- public const string OPC_PROPERTY_DESC_EU_INFO = "Item EU Info";
- public const string OPC_PROPERTY_DESC_EU_UNITS = "EU Units";
- public const string OPC_PROPERTY_DESC_DESCRIPTION = "Item Description";
- public const string OPC_PROPERTY_DESC_HIGH_EU = "High EU";
- public const string OPC_PROPERTY_DESC_LOW_EU = "Low EU";
- public const string OPC_PROPERTY_DESC_HIGH_IR = "High Instrument Range";
- public const string OPC_PROPERTY_DESC_LOW_IR = "Low Instrument Range";
- public const string OPC_PROPERTY_DESC_CLOSE_LABEL = "Contact Close Label";
- public const string OPC_PROPERTY_DESC_OPEN_LABEL = "Contact Open Label";
- public const string OPC_PROPERTY_DESC_TIMEZONE = "Item Timezone";
- public const string OPC_PROPERTY_DESC_CONDITION_STATUS = "Condition Status";
- public const string OPC_PROPERTY_DESC_ALARM_QUICK_HELP = "Alarm Quick Help";
- public const string OPC_PROPERTY_DESC_ALARM_AREA_LIST = "Alarm Area List";
- public const string OPC_PROPERTY_DESC_PRIMARY_ALARM_AREA = "Primary Alarm Area";
- public const string OPC_PROPERTY_DESC_CONDITION_LOGIC = "Condition Logic";
- public const string OPC_PROPERTY_DESC_LIMIT_EXCEEDED = "Limit Exceeded";
- public const string OPC_PROPERTY_DESC_DEADBAND = "Deadband";
- public const string OPC_PROPERTY_DESC_HIHI_LIMIT = "HiHi Limit";
- public const string OPC_PROPERTY_DESC_HI_LIMIT = "Hi Limit";
- public const string OPC_PROPERTY_DESC_LO_LIMIT = "Lo Limit";
- public const string OPC_PROPERTY_DESC_LOLO_LIMIT = "LoLo Limit";
- public const string OPC_PROPERTY_DESC_CHANGE_RATE_LIMIT = "Rate of Change Limit";
- public const string OPC_PROPERTY_DESC_DEVIATION_LIMIT = "Deviation Limit";
- public const string OPC_PROPERTY_DESC_SOUND_FILE = "Sound File";
+ // property descriptions.
+ public const string OPC_PROPERTY_DESC_DATATYPE = "Item Canonical Data Type";
+ public const string OPC_PROPERTY_DESC_VALUE = "Item Value";
+ public const string OPC_PROPERTY_DESC_QUALITY = "Item Quality";
+ public const string OPC_PROPERTY_DESC_TIMESTAMP = "Item Timestamp";
+ public const string OPC_PROPERTY_DESC_ACCESS_RIGHTS = "Item Access Rights";
+ public const string OPC_PROPERTY_DESC_SCAN_RATE = "Server Scan Rate";
+ public const string OPC_PROPERTY_DESC_EU_TYPE = "Item EU Type";
+ public const string OPC_PROPERTY_DESC_EU_INFO = "Item EU Info";
+ public const string OPC_PROPERTY_DESC_EU_UNITS = "EU Units";
+ public const string OPC_PROPERTY_DESC_DESCRIPTION = "Item Description";
+ public const string OPC_PROPERTY_DESC_HIGH_EU = "High EU";
+ public const string OPC_PROPERTY_DESC_LOW_EU = "Low EU";
+ public const string OPC_PROPERTY_DESC_HIGH_IR = "High Instrument Range";
+ public const string OPC_PROPERTY_DESC_LOW_IR = "Low Instrument Range";
+ public const string OPC_PROPERTY_DESC_CLOSE_LABEL = "Contact Close Label";
+ public const string OPC_PROPERTY_DESC_OPEN_LABEL = "Contact Open Label";
+ public const string OPC_PROPERTY_DESC_TIMEZONE = "Item Timezone";
+ public const string OPC_PROPERTY_DESC_CONDITION_STATUS = "Condition Status";
+ public const string OPC_PROPERTY_DESC_ALARM_QUICK_HELP = "Alarm Quick Help";
+ public const string OPC_PROPERTY_DESC_ALARM_AREA_LIST = "Alarm Area List";
+ public const string OPC_PROPERTY_DESC_PRIMARY_ALARM_AREA = "Primary Alarm Area";
+ public const string OPC_PROPERTY_DESC_CONDITION_LOGIC = "Condition Logic";
+ public const string OPC_PROPERTY_DESC_LIMIT_EXCEEDED = "Limit Exceeded";
+ public const string OPC_PROPERTY_DESC_DEADBAND = "Deadband";
+ public const string OPC_PROPERTY_DESC_HIHI_LIMIT = "HiHi Limit";
+ public const string OPC_PROPERTY_DESC_HI_LIMIT = "Hi Limit";
+ public const string OPC_PROPERTY_DESC_LO_LIMIT = "Lo Limit";
+ public const string OPC_PROPERTY_DESC_LOLO_LIMIT = "LoLo Limit";
+ public const string OPC_PROPERTY_DESC_CHANGE_RATE_LIMIT = "Rate of Change Limit";
+ public const string OPC_PROPERTY_DESC_DEVIATION_LIMIT = "Deviation Limit";
+ public const string OPC_PROPERTY_DESC_SOUND_FILE = "Sound File";
- // complex data properties.
- public const string OPC_PROPERTY_DESC_TYPE_SYSTEM_ID = "Type System ID";
- public const string OPC_PROPERTY_DESC_DICTIONARY_ID = "Dictionary ID";
- public const string OPC_PROPERTY_DESC_TYPE_ID = "Type ID";
- public const string OPC_PROPERTY_DESC_DICTIONARY = "Dictionary";
- public const string OPC_PROPERTY_DESC_TYPE_DESCRIPTION = "Type Description";
- public const string OPC_PROPERTY_DESC_CONSISTENCY_WINDOW = "Consistency Window";
- public const string OPC_PROPERTY_DESC_WRITE_BEHAVIOR = "Write Behavior";
- public const string OPC_PROPERTY_DESC_UNCONVERTED_ITEM_ID = "Unconverted Item ID";
- public const string OPC_PROPERTY_DESC_UNFILTERED_ITEM_ID = "Unfiltered Item ID";
- public const string OPC_PROPERTY_DESC_DATA_FILTER_VALUE = "Data Filter Value";
- }
+ // complex data properties.
+ public const string OPC_PROPERTY_DESC_TYPE_SYSTEM_ID = "Type System ID";
+ public const string OPC_PROPERTY_DESC_DICTIONARY_ID = "Dictionary ID";
+ public const string OPC_PROPERTY_DESC_TYPE_ID = "Type ID";
+ public const string OPC_PROPERTY_DESC_DICTIONARY = "Dictionary";
+ public const string OPC_PROPERTY_DESC_TYPE_DESCRIPTION = "Type Description";
+ public const string OPC_PROPERTY_DESC_CONSISTENCY_WINDOW = "Consistency Window";
+ public const string OPC_PROPERTY_DESC_WRITE_BEHAVIOR = "Write Behavior";
+ public const string OPC_PROPERTY_DESC_UNCONVERTED_ITEM_ID = "Unconverted Item ID";
+ public const string OPC_PROPERTY_DESC_UNFILTERED_ITEM_ID = "Unfiltered Item ID";
+ public const string OPC_PROPERTY_DESC_DATA_FILTER_VALUE = "Data Filter Value";
+ }
}
diff --git a/Technosoftware/OpcRcw/Hda/HistoricalDataAccess.cs b/Technosoftware/OpcRcw/Hda/HistoricalDataAccess.cs
index 6a403d7..9643ec3 100644
--- a/Technosoftware/OpcRcw/Hda/HistoricalDataAccess.cs
+++ b/Technosoftware/OpcRcw/Hda/HistoricalDataAccess.cs
@@ -11,8 +11,6 @@
#region Using Directives
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Runtime.InteropServices;
#endregion
@@ -23,9 +21,9 @@ namespace Technosoftware.OpcRcw.Hda
///
[ComImport]
- [GuidAttribute("7DE5B060-E089-11d2-A5E6-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
- public interface CATID_OPCHDAServer10 {}
+ [GuidAttribute("7DE5B060-E089-11d2-A5E6-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ public interface CATID_OPCHDAServer10 { }
///
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
@@ -36,101 +34,101 @@ namespace Technosoftware.OpcRcw.Hda
}
///
- public enum OPCHDA_SERVERSTATUS
- {
+ public enum OPCHDA_SERVERSTATUS
+ {
OPCHDA_UP = 1,
- OPCHDA_DOWN,
- OPCHDA_INDETERMINATE
+ OPCHDA_DOWN,
+ OPCHDA_INDETERMINATE
}
///
- public enum OPCHDA_BROWSEDIRECTION
+ public enum OPCHDA_BROWSEDIRECTION
{
- OPCHDA_BROWSE_UP = 1,
- OPCHDA_BROWSE_DOWN,
- OPCHDA_BROWSE_DIRECT
+ OPCHDA_BROWSE_UP = 1,
+ OPCHDA_BROWSE_DOWN,
+ OPCHDA_BROWSE_DIRECT
}
///
- public enum OPCHDA_BROWSETYPE
+ public enum OPCHDA_BROWSETYPE
{
- OPCHDA_BRANCH = 1,
- OPCHDA_LEAF,
- OPCHDA_FLAT,
- OPCHDA_ITEMS
+ OPCHDA_BRANCH = 1,
+ OPCHDA_LEAF,
+ OPCHDA_FLAT,
+ OPCHDA_ITEMS
}
///
- public enum OPCHDA_ANNOTATIONCAPABILITIES
- {
- OPCHDA_READANNOTATIONCAP = 0x01,
- OPCHDA_INSERTANNOTATIONCAP = 0x02
- }
-
- ///
- public enum OPCHDA_UPDATECAPABILITIES
+ public enum OPCHDA_ANNOTATIONCAPABILITIES
{
- OPCHDA_INSERTCAP = 0x01,
- OPCHDA_REPLACECAP = 0x02,
- OPCHDA_INSERTREPLACECAP = 0x04,
- OPCHDA_DELETERAWCAP = 0x08,
- OPCHDA_DELETEATTIMECAP = 0x10
+ OPCHDA_READANNOTATIONCAP = 0x01,
+ OPCHDA_INSERTANNOTATIONCAP = 0x02
}
///
- public enum OPCHDA_OPERATORCODES
+ public enum OPCHDA_UPDATECAPABILITIES
{
- OPCHDA_EQUAL = 1,
- OPCHDA_LESS,
- OPCHDA_LESSEQUAL,
- OPCHDA_GREATER,
- OPCHDA_GREATEREQUAL,
- OPCHDA_NOTEQUAL
+ OPCHDA_INSERTCAP = 0x01,
+ OPCHDA_REPLACECAP = 0x02,
+ OPCHDA_INSERTREPLACECAP = 0x04,
+ OPCHDA_DELETERAWCAP = 0x08,
+ OPCHDA_DELETEATTIMECAP = 0x10
}
///
- public enum OPCHDA_EDITTYPE
+ public enum OPCHDA_OPERATORCODES
{
- OPCHDA_INSERT = 1,
- OPCHDA_REPLACE,
- OPCHDA_INSERTREPLACE,
- OPCHDA_DELETE
+ OPCHDA_EQUAL = 1,
+ OPCHDA_LESS,
+ OPCHDA_LESSEQUAL,
+ OPCHDA_GREATER,
+ OPCHDA_GREATEREQUAL,
+ OPCHDA_NOTEQUAL
}
///
- public enum OPCHDA_AGGREGATE
+ public enum OPCHDA_EDITTYPE
{
- OPCHDA_NOAGGREGATE = 0,
- OPCHDA_INTERPOLATIVE,
- OPCHDA_TOTAL,
- OPCHDA_AVERAGE,
- OPCHDA_TIMEAVERAGE,
- OPCHDA_COUNT,
- OPCHDA_STDEV,
- OPCHDA_MINIMUMACTUALTIME,
- OPCHDA_MINIMUM,
- OPCHDA_MAXIMUMACTUALTIME,
- OPCHDA_MAXIMUM,
- OPCHDA_START,
- OPCHDA_END,
- OPCHDA_DELTA,
- OPCHDA_REGSLOPE,
- OPCHDA_REGCONST,
- OPCHDA_REGDEV,
- OPCHDA_VARIANCE,
- OPCHDA_RANGE,
- OPCHDA_DURATIONGOOD,
- OPCHDA_DURATIONBAD,
- OPCHDA_PERCENTGOOD,
- OPCHDA_PERCENTBAD,
- OPCHDA_WORSTQUALITY,
- OPCHDA_ANNOTATIONS
+ OPCHDA_INSERT = 1,
+ OPCHDA_REPLACE,
+ OPCHDA_INSERTREPLACE,
+ OPCHDA_DELETE
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCHDA_ANNOTATION
- {
+ public enum OPCHDA_AGGREGATE
+ {
+ OPCHDA_NOAGGREGATE = 0,
+ OPCHDA_INTERPOLATIVE,
+ OPCHDA_TOTAL,
+ OPCHDA_AVERAGE,
+ OPCHDA_TIMEAVERAGE,
+ OPCHDA_COUNT,
+ OPCHDA_STDEV,
+ OPCHDA_MINIMUMACTUALTIME,
+ OPCHDA_MINIMUM,
+ OPCHDA_MAXIMUMACTUALTIME,
+ OPCHDA_MAXIMUM,
+ OPCHDA_START,
+ OPCHDA_END,
+ OPCHDA_DELTA,
+ OPCHDA_REGSLOPE,
+ OPCHDA_REGCONST,
+ OPCHDA_REGDEV,
+ OPCHDA_VARIANCE,
+ OPCHDA_RANGE,
+ OPCHDA_DURATIONGOOD,
+ OPCHDA_DURATIONBAD,
+ OPCHDA_PERCENTGOOD,
+ OPCHDA_PERCENTBAD,
+ OPCHDA_WORSTQUALITY,
+ OPCHDA_ANNOTATIONS
+ }
+
+ ///
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCHDA_ANNOTATION
+ {
[MarshalAs(UnmanagedType.I4)]
public int hClient;
[MarshalAs(UnmanagedType.I4)]
@@ -142,8 +140,8 @@ namespace Technosoftware.OpcRcw.Hda
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCHDA_MODIFIEDITEM
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCHDA_MODIFIEDITEM
{
[MarshalAs(UnmanagedType.I4)]
public int hClient;
@@ -158,7 +156,7 @@ namespace Technosoftware.OpcRcw.Hda
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCHDA_ATTRIBUTE
{
[MarshalAs(UnmanagedType.I4)]
@@ -172,18 +170,18 @@ namespace Technosoftware.OpcRcw.Hda
};
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
- public struct OPCHDA_TIME
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct OPCHDA_TIME
{
[MarshalAs(UnmanagedType.I4)]
public int bString;
[MarshalAs(UnmanagedType.LPWStr)]
- public string szTime;
- public OPCHDA_FILETIME ftTime;
+ public string szTime;
+ public OPCHDA_FILETIME ftTime;
}
///
- [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OPCHDA_ITEM
{
[MarshalAs(UnmanagedType.I4)]
@@ -199,19 +197,19 @@ namespace Technosoftware.OpcRcw.Hda
///
[ComImport]
- [GuidAttribute("1F1217B1-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B1-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_Browser
{
void GetEnum(
OPCHDA_BROWSETYPE dwBrowseType,
- [Out]
- out OpcRcw.Comn.IEnumString ppIEnumString);
+ [Out]
+ out OpcRcw.Comn.IEnumString ppIEnumString);
- void ChangeBrowsePosition(
+ void ChangeBrowsePosition(
OPCHDA_BROWSEDIRECTION dwBrowseDirection,
[MarshalAs(UnmanagedType.LPWStr)]
- string szString);
+ string szString);
void GetItemID(
[MarshalAs(UnmanagedType.LPWStr)]
@@ -226,11 +224,11 @@ namespace Technosoftware.OpcRcw.Hda
///
[ComImport]
- [GuidAttribute("1F1217B0-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B0-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_Server
{
- void GetItemAttributes(
+ void GetItemAttributes(
[Out][MarshalAs(UnmanagedType.I4)]
out int pdwCount,
[Out]
@@ -275,27 +273,27 @@ namespace Technosoftware.OpcRcw.Hda
void GetItemHandles(
[MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszItemID,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phClient,
[Out]
out IntPtr pphServer,
[Out]
out IntPtr ppErrors);
- void ReleaseItemHandles(
+ void ReleaseItemHandles(
[MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
[Out]
out IntPtr ppErrors);
void ValidateItemIDs(
[MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPWStr, SizeParamIndex=0)]
string[] pszItemID,
[Out]
out IntPtr ppErrors);
@@ -303,11 +301,11 @@ namespace Technosoftware.OpcRcw.Hda
void CreateBrowse(
[MarshalAs(UnmanagedType.I4)]
int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwAttrID,
- [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)]
OPCHDA_OPERATORCODES[] pOperator,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
object[] vFilter,
out IOPCHDA_Browser pphBrowser,
[Out]
@@ -316,8 +314,8 @@ namespace Technosoftware.OpcRcw.Hda
///
[ComImport]
- [GuidAttribute("1F1217B2-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B2-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_SyncRead
{
void ReadRaw(
@@ -329,7 +327,7 @@ namespace Technosoftware.OpcRcw.Hda
int bBounds,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
int[] phServer,
[Out]
out IntPtr ppItemValues,
@@ -342,9 +340,9 @@ namespace Technosoftware.OpcRcw.Hda
OPCHDA_FILETIME ftResampleInterval,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] haAggregate,
[Out]
out IntPtr ppItemValues,
@@ -354,11 +352,11 @@ namespace Technosoftware.OpcRcw.Hda
void ReadAtTime(
[MarshalAs(UnmanagedType.I4)]
int dwNumTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCHDA_FILETIME[] ftTimeStamps,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phServer,
[Out]
out IntPtr ppItemValues,
@@ -372,7 +370,7 @@ namespace Technosoftware.OpcRcw.Hda
int dwNumValues,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] phServer,
[Out]
out IntPtr ppItemValues,
@@ -383,10 +381,10 @@ namespace Technosoftware.OpcRcw.Hda
ref OPCHDA_TIME htStartTime,
ref OPCHDA_TIME htEndTime,
[MarshalAs(UnmanagedType.I4)]
- int hServer,
+ int hServer,
[MarshalAs(UnmanagedType.I4)]
int dwNumAttributes,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] pdwAttributeIDs,
[Out]
out IntPtr ppAttributeValues,
@@ -396,38 +394,38 @@ namespace Technosoftware.OpcRcw.Hda
///
[ComImport]
- [GuidAttribute("1F1217B3-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B3-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_SyncUpdate
{
- void QueryCapabilities(
+ void QueryCapabilities(
[Out]
- out OPCHDA_UPDATECAPABILITIES pCapabilities);
+ out OPCHDA_UPDATECAPABILITIES pCapabilities);
void Insert(
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
object[] vDataValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwQualities,
[Out]
out IntPtr ppErrors);
void Replace(
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
object[] vDataValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwQualities,
[Out]
out IntPtr ppErrors);
@@ -435,13 +433,13 @@ namespace Technosoftware.OpcRcw.Hda
void InsertReplace(
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=0)]
object[] vDataValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] pdwQualities,
[Out]
out IntPtr ppErrors);
@@ -451,7 +449,7 @@ namespace Technosoftware.OpcRcw.Hda
ref OPCHDA_TIME htEndTime,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phServer,
[Out]
out IntPtr ppErrors);
@@ -459,9 +457,9 @@ namespace Technosoftware.OpcRcw.Hda
void DeleteAtTime(
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
- int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int[] phServer,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCHDA_FILETIME[] ftTimeStamps,
[Out]
out IntPtr ppErrors);
@@ -469,43 +467,43 @@ namespace Technosoftware.OpcRcw.Hda
///
[ComImport]
- [GuidAttribute("1F1217B4-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B4-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_SyncAnnotations
{
- void QueryCapabilities(
+ void QueryCapabilities(
[Out]
- out OPCHDA_ANNOTATIONCAPABILITIES pCapabilities);
+ out OPCHDA_ANNOTATIONCAPABILITIES pCapabilities);
void Read(
ref OPCHDA_TIME htStartTime,
ref OPCHDA_TIME htEndTime,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phServer,
[Out]
out IntPtr ppAnnotationValues,
[Out]
out IntPtr ppErrors);
- void Insert(
+ void Insert(
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=0)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
- OPCHDA_ANNOTATION[] pAnnotationValues,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=0)]
+ OPCHDA_ANNOTATION[] pAnnotationValues,
[Out]
out IntPtr ppErrors);
}
///
[ComImport]
- [GuidAttribute("1F1217B5-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B5-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_AsyncRead
{
void ReadRaw(
@@ -519,7 +517,7 @@ namespace Technosoftware.OpcRcw.Hda
int bBounds,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=5)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=5)]
int[] phServer,
[Out]
out int pdwCancelID,
@@ -530,10 +528,10 @@ namespace Technosoftware.OpcRcw.Hda
[MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
ref OPCHDA_TIME htStartTime,
- OPCHDA_FILETIME ftUpdateInterval,
+ OPCHDA_FILETIME ftUpdateInterval,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] phServer,
[Out]
out int pdwCancelID,
@@ -548,9 +546,9 @@ namespace Technosoftware.OpcRcw.Hda
OPCHDA_FILETIME ftResampleInterval,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
int[] haAggregate,
[Out]
out int pdwCancelID,
@@ -564,9 +562,9 @@ namespace Technosoftware.OpcRcw.Hda
OPCHDA_FILETIME ftResampleInterval,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] haAggregate,
[MarshalAs(UnmanagedType.I4)]
int dwNumIntervals,
@@ -580,11 +578,11 @@ namespace Technosoftware.OpcRcw.Hda
int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int dwNumTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
OPCHDA_FILETIME[] ftTimeStamps,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] phServer,
[Out]
out int pdwCancelID,
@@ -600,7 +598,7 @@ namespace Technosoftware.OpcRcw.Hda
int dwNumValues,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
int[] phServer,
[Out]
out int pdwCancelID,
@@ -613,79 +611,79 @@ namespace Technosoftware.OpcRcw.Hda
ref OPCHDA_TIME htStartTime,
ref OPCHDA_TIME htEndTime,
[MarshalAs(UnmanagedType.I4)]
- int hServer,
+ int hServer,
[MarshalAs(UnmanagedType.I4)]
int dwNumAttributes,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=4)]
int[] dwAttributeIDs,
[Out]
out int pdwCancelID,
[Out]
out IntPtr ppErrors);
- void Cancel(
+ void Cancel(
[MarshalAs(UnmanagedType.I4)]
- int dwCancelID);
+ int dwCancelID);
}
///
[ComImport]
- [GuidAttribute("1F1217B6-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B6-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_AsyncUpdate
{
- void QueryCapabilities(
- out OPCHDA_UPDATECAPABILITIES pCapabilities
- );
+ void QueryCapabilities(
+ out OPCHDA_UPDATECAPABILITIES pCapabilities
+ );
void Insert(
[MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
object[] vDataValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] pdwQualities,
[Out]
out int pdwCancelID,
[Out]
out IntPtr ppErrors);
- void Replace(
+ void Replace(
[MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
object[] vDataValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] pdwQualities,
[Out]
out int pdwCancelID,
[Out]
out IntPtr ppErrors);
- void InsertReplace(
+ void InsertReplace(
[MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct, SizeParamIndex=1)]
object[] vDataValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] pdwQualities,
[Out]
out int pdwCancelID,
@@ -699,7 +697,7 @@ namespace Technosoftware.OpcRcw.Hda
ref OPCHDA_TIME htEndTime,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] phServer,
[Out]
out int pdwCancelID,
@@ -711,28 +709,28 @@ namespace Technosoftware.OpcRcw.Hda
int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
OPCHDA_FILETIME[] ftTimeStamps,
[Out]
out int pdwCancelID,
[Out]
out IntPtr ppErrors);
- void Cancel(
+ void Cancel(
[MarshalAs(UnmanagedType.I4)]
- int dwCancelID);
+ int dwCancelID);
}
///
[ComImport]
- [GuidAttribute("1F1217B7-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B7-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_AsyncAnnotations
{
- void QueryCapabilities(
- out OPCHDA_ANNOTATIONCAPABILITIES pCapabilities);
+ void QueryCapabilities(
+ out OPCHDA_ANNOTATIONCAPABILITIES pCapabilities);
void Read(
[MarshalAs(UnmanagedType.I4)]
@@ -741,7 +739,7 @@ namespace Technosoftware.OpcRcw.Hda
ref OPCHDA_TIME htEndTime,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] phServer,
[Out]
out int pdwCancelID,
@@ -752,27 +750,27 @@ namespace Technosoftware.OpcRcw.Hda
[MarshalAs(UnmanagedType.I4)]
int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=1)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
OPCHDA_FILETIME[] ftTimeStamps,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=1)]
OPCHDA_ANNOTATION[] pAnnotationValues,
[Out]
out int pdwCancelID,
[Out]
out IntPtr ppErrors);
- void Cancel(
+ void Cancel(
[MarshalAs(UnmanagedType.I4)]
- int dwCancelID);
+ int dwCancelID);
}
///
[ComImport]
- [GuidAttribute("1F1217B8-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B8-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_Playback
{
void ReadRawWithUpdate(
@@ -786,7 +784,7 @@ namespace Technosoftware.OpcRcw.Hda
OPCHDA_FILETIME ftUpdateInterval,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=6)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=6)]
int[] phServer,
[Out]
out int pdwCancelID,
@@ -804,121 +802,121 @@ namespace Technosoftware.OpcRcw.Hda
OPCHDA_FILETIME ftUpdateInterval,
[MarshalAs(UnmanagedType.I4)]
int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=6)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=6)]
int[] phServer,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=6)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=6)]
int[] haAggregate,
[Out]
out int pdwCancelID,
[Out]
out IntPtr ppErrors);
- void Cancel(
+ void Cancel(
[MarshalAs(UnmanagedType.I4)]
- int dwCancelID);
+ int dwCancelID);
}
///
[ComImport]
- [GuidAttribute("1F1217B9-DEE0-11d2-A5E5-000086339399")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("1F1217B9-DEE0-11d2-A5E5-000086339399")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCHDA_DataCallback
{
void OnDataChange(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
OPCHDA_ITEM[] pItemValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phrErrors);
void OnReadComplete(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
OPCHDA_ITEM[] pItemValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phrErrors);
void OnReadModifiedComplete(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
OPCHDA_MODIFIEDITEM[] pItemValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phrErrors);
void OnReadAttributeComplete(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int hClient,
+ int hClient,
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=3)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=3)]
OPCHDA_ATTRIBUTE[] pAttributeValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=3)]
int[] phrErrors);
void OnReadAnnotations(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
+ int dwNumItems,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStruct, SizeParamIndex=2)]
OPCHDA_ANNOTATION[] pAnnotationValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phrErrors);
- void OnInsertAnnotations (
+ void OnInsertAnnotations(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
- int[] phClients,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ int[] phClients,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phrErrors);
- void OnPlayback (
+ void OnPlayback(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int dwNumItems,
- IntPtr ppItemValues,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ int dwNumItems,
+ IntPtr ppItemValues,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phrErrors);
- void OnUpdateComplete (
+ void OnUpdateComplete(
[MarshalAs(UnmanagedType.I4)]
- int dwTransactionID,
+ int dwTransactionID,
[MarshalAs(UnmanagedType.I4)]
int hrStatus,
[MarshalAs(UnmanagedType.I4)]
- int dwCount,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
- int[] phClients,
- [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ int dwCount,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
+ int[] phClients,
+ [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.I4, SizeParamIndex=2)]
int[] phrErrors);
void OnCancelComplete(
@@ -928,87 +926,87 @@ namespace Technosoftware.OpcRcw.Hda
///
public static class Constants
- {
- // category description.
- public const string OPC_CATEGORY_DESCRIPTION_HDA10 = "OPC History Data Access Servers Version 1.0";
+ {
+ // category description.
+ public const string OPC_CATEGORY_DESCRIPTION_HDA10 = "OPC History Data Access Servers Version 1.0";
- // attribute ids.
- public const int OPCHDA_DATA_TYPE = 0x01;
- public const int OPCHDA_DESCRIPTION = 0x02;
- public const int OPCHDA_ENG_UNITS = 0x03;
- public const int OPCHDA_STEPPED = 0x04;
- public const int OPCHDA_ARCHIVING = 0x05;
- public const int OPCHDA_DERIVE_EQUATION = 0x06;
- public const int OPCHDA_NODE_NAME = 0x07;
- public const int OPCHDA_PROCESS_NAME = 0x08;
- public const int OPCHDA_SOURCE_NAME = 0x09;
- public const int OPCHDA_SOURCE_TYPE = 0x0a;
- public const int OPCHDA_NORMAL_MAXIMUM = 0x0b;
- public const int OPCHDA_NORMAL_MINIMUM = 0x0c;
- public const int OPCHDA_ITEMID = 0x0d;
- public const int OPCHDA_MAX_TIME_INT = 0x0e;
- public const int OPCHDA_MIN_TIME_INT = 0x0f;
- public const int OPCHDA_EXCEPTION_DEV = 0x10;
- public const int OPCHDA_EXCEPTION_DEV_TYPE = 0x11;
- public const int OPCHDA_HIGH_ENTRY_LIMIT = 0x12;
- public const int OPCHDA_LOW_ENTRY_LIMIT = 0x13;
+ // attribute ids.
+ public const int OPCHDA_DATA_TYPE = 0x01;
+ public const int OPCHDA_DESCRIPTION = 0x02;
+ public const int OPCHDA_ENG_UNITS = 0x03;
+ public const int OPCHDA_STEPPED = 0x04;
+ public const int OPCHDA_ARCHIVING = 0x05;
+ public const int OPCHDA_DERIVE_EQUATION = 0x06;
+ public const int OPCHDA_NODE_NAME = 0x07;
+ public const int OPCHDA_PROCESS_NAME = 0x08;
+ public const int OPCHDA_SOURCE_NAME = 0x09;
+ public const int OPCHDA_SOURCE_TYPE = 0x0a;
+ public const int OPCHDA_NORMAL_MAXIMUM = 0x0b;
+ public const int OPCHDA_NORMAL_MINIMUM = 0x0c;
+ public const int OPCHDA_ITEMID = 0x0d;
+ public const int OPCHDA_MAX_TIME_INT = 0x0e;
+ public const int OPCHDA_MIN_TIME_INT = 0x0f;
+ public const int OPCHDA_EXCEPTION_DEV = 0x10;
+ public const int OPCHDA_EXCEPTION_DEV_TYPE = 0x11;
+ public const int OPCHDA_HIGH_ENTRY_LIMIT = 0x12;
+ public const int OPCHDA_LOW_ENTRY_LIMIT = 0x13;
- // attribute names.
- public const string OPCHDA_ATTRNAME_DATA_TYPE = "Data Type";
- public const string OPCHDA_ATTRNAME_DESCRIPTION = "Description";
- public const string OPCHDA_ATTRNAME_ENG_UNITS = "Eng Units";
- public const string OPCHDA_ATTRNAME_STEPPED = "Stepped";
- public const string OPCHDA_ATTRNAME_ARCHIVING = "Archiving";
- public const string OPCHDA_ATTRNAME_DERIVE_EQUATION = "Derive Equation";
- public const string OPCHDA_ATTRNAME_NODE_NAME = "Node Name";
- public const string OPCHDA_ATTRNAME_PROCESS_NAME = "Process Name";
- public const string OPCHDA_ATTRNAME_SOURCE_NAME = "Source Name";
- public const string OPCHDA_ATTRNAME_SOURCE_TYPE = "Source Type";
- public const string OPCHDA_ATTRNAME_NORMAL_MAXIMUM = "Normal Maximum";
- public const string OPCHDA_ATTRNAME_NORMAL_MINIMUM = "Normal Minimum";
- public const string OPCHDA_ATTRNAME_ITEMID = "ItemID";
- public const string OPCHDA_ATTRNAME_MAX_TIME_INT = "Max Time Interval";
- public const string OPCHDA_ATTRNAME_MIN_TIME_INT = "Min Time Interval";
- public const string OPCHDA_ATTRNAME_EXCEPTION_DEV = "Exception Deviation";
- public const string OPCHDA_ATTRNAME_EXCEPTION_DEV_TYPE = "Exception Dev Type";
- public const string OPCHDA_ATTRNAME_HIGH_ENTRY_LIMIT = "High Entry Limit";
- public const string OPCHDA_ATTRNAME_LOW_ENTRY_LIMIT = "Low Entry Limit";
+ // attribute names.
+ public const string OPCHDA_ATTRNAME_DATA_TYPE = "Data Type";
+ public const string OPCHDA_ATTRNAME_DESCRIPTION = "Description";
+ public const string OPCHDA_ATTRNAME_ENG_UNITS = "Eng Units";
+ public const string OPCHDA_ATTRNAME_STEPPED = "Stepped";
+ public const string OPCHDA_ATTRNAME_ARCHIVING = "Archiving";
+ public const string OPCHDA_ATTRNAME_DERIVE_EQUATION = "Derive Equation";
+ public const string OPCHDA_ATTRNAME_NODE_NAME = "Node Name";
+ public const string OPCHDA_ATTRNAME_PROCESS_NAME = "Process Name";
+ public const string OPCHDA_ATTRNAME_SOURCE_NAME = "Source Name";
+ public const string OPCHDA_ATTRNAME_SOURCE_TYPE = "Source Type";
+ public const string OPCHDA_ATTRNAME_NORMAL_MAXIMUM = "Normal Maximum";
+ public const string OPCHDA_ATTRNAME_NORMAL_MINIMUM = "Normal Minimum";
+ public const string OPCHDA_ATTRNAME_ITEMID = "ItemID";
+ public const string OPCHDA_ATTRNAME_MAX_TIME_INT = "Max Time Interval";
+ public const string OPCHDA_ATTRNAME_MIN_TIME_INT = "Min Time Interval";
+ public const string OPCHDA_ATTRNAME_EXCEPTION_DEV = "Exception Deviation";
+ public const string OPCHDA_ATTRNAME_EXCEPTION_DEV_TYPE = "Exception Dev Type";
+ public const string OPCHDA_ATTRNAME_HIGH_ENTRY_LIMIT = "High Entry Limit";
+ public const string OPCHDA_ATTRNAME_LOW_ENTRY_LIMIT = "Low Entry Limit";
- // aggregate names.
- public const string OPCHDA_AGGRNAME_INTERPOLATIVE = "Interpolative";
- public const string OPCHDA_AGGRNAME_TOTAL = "Total";
- public const string OPCHDA_AGGRNAME_AVERAGE = "Average";
- public const string OPCHDA_AGGRNAME_TIMEAVERAGE = "Time Average";
- public const string OPCHDA_AGGRNAME_COUNT = "Count";
- public const string OPCHDA_AGGRNAME_STDEV = "Standard Deviation";
- public const string OPCHDA_AGGRNAME_MINIMUMACTUALTIME = "Minimum Actual Time";
- public const string OPCHDA_AGGRNAME_MINIMUM = "Minimum";
- public const string OPCHDA_AGGRNAME_MAXIMUMACTUALTIME = "Maximum Actual Time";
- public const string OPCHDA_AGGRNAME_MAXIMUM = "Maximum";
- public const string OPCHDA_AGGRNAME_START = "Start";
- public const string OPCHDA_AGGRNAME_END = "End";
- public const string OPCHDA_AGGRNAME_DELTA = "Delta";
- public const string OPCHDA_AGGRNAME_REGSLOPE = "Regression Line Slope";
- public const string OPCHDA_AGGRNAME_REGCONST = "Regression Line Constant";
- public const string OPCHDA_AGGRNAME_REGDEV = "Regression Line Error";
- public const string OPCHDA_AGGRNAME_VARIANCE = "Variance";
- public const string OPCHDA_AGGRNAME_RANGE = "Range";
- public const string OPCHDA_AGGRNAME_DURATIONGOOD = "Duration Good";
- public const string OPCHDA_AGGRNAME_DURATIONBAD = "Duration Bad";
- public const string OPCHDA_AGGRNAME_PERCENTGOOD = "Percent Good";
- public const string OPCHDA_AGGRNAME_PERCENTBAD = "Percent Bad";
- public const string OPCHDA_AGGRNAME_WORSTQUALITY = "Worst Quality";
- public const string OPCHDA_AGGRNAME_ANNOTATIONS = "Annotations";
+ // aggregate names.
+ public const string OPCHDA_AGGRNAME_INTERPOLATIVE = "Interpolative";
+ public const string OPCHDA_AGGRNAME_TOTAL = "Total";
+ public const string OPCHDA_AGGRNAME_AVERAGE = "Average";
+ public const string OPCHDA_AGGRNAME_TIMEAVERAGE = "Time Average";
+ public const string OPCHDA_AGGRNAME_COUNT = "Count";
+ public const string OPCHDA_AGGRNAME_STDEV = "Standard Deviation";
+ public const string OPCHDA_AGGRNAME_MINIMUMACTUALTIME = "Minimum Actual Time";
+ public const string OPCHDA_AGGRNAME_MINIMUM = "Minimum";
+ public const string OPCHDA_AGGRNAME_MAXIMUMACTUALTIME = "Maximum Actual Time";
+ public const string OPCHDA_AGGRNAME_MAXIMUM = "Maximum";
+ public const string OPCHDA_AGGRNAME_START = "Start";
+ public const string OPCHDA_AGGRNAME_END = "End";
+ public const string OPCHDA_AGGRNAME_DELTA = "Delta";
+ public const string OPCHDA_AGGRNAME_REGSLOPE = "Regression Line Slope";
+ public const string OPCHDA_AGGRNAME_REGCONST = "Regression Line Constant";
+ public const string OPCHDA_AGGRNAME_REGDEV = "Regression Line Error";
+ public const string OPCHDA_AGGRNAME_VARIANCE = "Variance";
+ public const string OPCHDA_AGGRNAME_RANGE = "Range";
+ public const string OPCHDA_AGGRNAME_DURATIONGOOD = "Duration Good";
+ public const string OPCHDA_AGGRNAME_DURATIONBAD = "Duration Bad";
+ public const string OPCHDA_AGGRNAME_PERCENTGOOD = "Percent Good";
+ public const string OPCHDA_AGGRNAME_PERCENTBAD = "Percent Bad";
+ public const string OPCHDA_AGGRNAME_WORSTQUALITY = "Worst Quality";
+ public const string OPCHDA_AGGRNAME_ANNOTATIONS = "Annotations";
- // OPCHDA_QUALITY -- these are the high-order 16 bits, OPC DA Quality occupies low-order 16 bits.
- public const int OPCHDA_EXTRADATA = 0x00010000;
- public const int OPCHDA_INTERPOLATED = 0x00020000;
- public const int OPCHDA_RAW = 0x00040000;
- public const int OPCHDA_CALCULATED = 0x00080000;
- public const int OPCHDA_NOBOUND = 0x00100000;
- public const int OPCHDA_NODATA = 0x00200000;
- public const int OPCHDA_DATALOST = 0x00400000;
- public const int OPCHDA_CONVERSION = 0x00800000;
- public const int OPCHDA_PARTIAL = 0x01000000;
- }
+ // OPCHDA_QUALITY -- these are the high-order 16 bits, OPC DA Quality occupies low-order 16 bits.
+ public const int OPCHDA_EXTRADATA = 0x00010000;
+ public const int OPCHDA_INTERPOLATED = 0x00020000;
+ public const int OPCHDA_RAW = 0x00040000;
+ public const int OPCHDA_CALCULATED = 0x00080000;
+ public const int OPCHDA_NOBOUND = 0x00100000;
+ public const int OPCHDA_NODATA = 0x00200000;
+ public const int OPCHDA_DATALOST = 0x00400000;
+ public const int OPCHDA_CONVERSION = 0x00800000;
+ public const int OPCHDA_PARTIAL = 0x01000000;
+ }
}
diff --git a/Technosoftware/OpcRcw/Security/Security.cs b/Technosoftware/OpcRcw/Security/Security.cs
index fe66aa9..c288a71 100644
--- a/Technosoftware/OpcRcw/Security/Security.cs
+++ b/Technosoftware/OpcRcw/Security/Security.cs
@@ -17,39 +17,39 @@ using System.Runtime.InteropServices;
#pragma warning disable 1591
namespace Technosoftware.OpcRcw.Security
-{
+{
///
- [ComImport]
- [GuidAttribute("7AA83A01-6C77-11d3-84F9-00008630A38B")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [ComImport]
+ [GuidAttribute("7AA83A01-6C77-11d3-84F9-00008630A38B")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCSecurityNT
{
- void IsAvailableNT(
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pbAvailable);
+ void IsAvailableNT(
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pbAvailable);
- void QueryMinImpersonationLevel(
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pdwMinImpLevel);
+ void QueryMinImpersonationLevel(
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pdwMinImpLevel);
- void ChangeUser();
+ void ChangeUser();
};
///
[ComImport]
- [GuidAttribute("7AA83A02-6C77-11d3-84F9-00008630A38B")]
- [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
+ [GuidAttribute("7AA83A02-6C77-11d3-84F9-00008630A38B")]
+ [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOPCSecurityPrivate
{
void IsAvailablePriv(
- [Out][MarshalAs(UnmanagedType.I4)]
- out int pbAvailable);
+ [Out][MarshalAs(UnmanagedType.I4)]
+ out int pbAvailable);
void Logon(
- [MarshalAs(UnmanagedType.LPWStr)]
- string szUserID,
- [MarshalAs(UnmanagedType.LPWStr)]
- string szPassword);
+ [MarshalAs(UnmanagedType.LPWStr)]
+ string szUserID,
+ [MarshalAs(UnmanagedType.LPWStr)]
+ string szPassword);
void Logoff();
};