This commit is contained in:
luosheng
2023-07-16 08:17:03 +08:00
parent 6d655b24d1
commit 2055c10c59
127 changed files with 7414 additions and 7470 deletions

View File

@@ -26,37 +26,37 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Contains a writable collection attribute ids.
/// </summary>
[Serializable]
public class TsCAeAttributeCollection : OpcWriteableCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Contains a writable collection attribute ids.
/// </summary>
[Serializable]
public class TsCAeAttributeCollection : OpcWriteableCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal TsCAeAttributeCollection() : base(null, typeof(int)) { }
/// Creates an empty collection.
/// </summary>
internal TsCAeAttributeCollection() : base(null, typeof(int)) { }
/// <summary>
/// Creates a collection from an array.
/// </summary>
internal TsCAeAttributeCollection(int[] attributeIDs) : base(attributeIDs, typeof(int)) { }
/// <summary>
/// Creates a collection from an array.
/// </summary>
internal TsCAeAttributeCollection(int[] attributeIDs) : base(attributeIDs, typeof(int)) { }
#endregion
#region Public Methods
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array[index];
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array[index];
/// <summary>
/// Returns a copy of the collection as an array.
/// </summary>
public new int[] ToArray()
{
return (int[])Array.ToArray(typeof(int));
}
{
return (int[])Array.ToArray(typeof(int));
}
#endregion
}
}
}

View File

@@ -26,23 +26,23 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Contains multiple lists of the attributes indexed by category.
/// </summary>
[Serializable]
public sealed class TsCAeAttributeDictionary : OpcWriteableDictionary
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Contains multiple lists of the attributes indexed by category.
/// </summary>
[Serializable]
public sealed class TsCAeAttributeDictionary : OpcWriteableDictionary
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Constructs an empty dictionary.
/// </summary>
public TsCAeAttributeDictionary() : base(null, typeof(int), typeof(TsCAeAttributeCollection)) { }
/// Constructs an empty dictionary.
/// </summary>
public TsCAeAttributeDictionary() : base(null, typeof(int), typeof(TsCAeAttributeCollection)) { }
/// <summary>
/// Constructs an dictionary from a set of category ids.
/// </summary>
public TsCAeAttributeDictionary(int[] categoryIds)
: base(null, typeof(int), typeof(TsCAeAttributeCollection))
/// <summary>
/// Constructs an dictionary from a set of category ids.
/// </summary>
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
/// <summary>
/// Gets or sets the attribute collection for the specified category.
/// </summary>
public TsCAeAttributeCollection this[int categoryId]
{
get => (TsCAeAttributeCollection)base[categoryId];
/// Gets or sets the attribute collection for the specified category.
/// </summary>
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();
}
}
}
/// <summary>
/// Adds an element with the provided key and value to the IDictionary.
/// </summary>
public void Add(int key, int[] value)
{
if (value != null)
{
base.Add(key, new TsCAeAttributeCollection(value));
}
else
{
base.Add(key, new TsCAeAttributeCollection());
}
}
/// <summary>
/// Adds an element with the provided key and value to the IDictionary.
/// </summary>
public void Add(int key, int[] value)
{
if (value != null)
{
base.Add(key, new TsCAeAttributeCollection(value));
}
else
{
base.Add(key, new TsCAeAttributeCollection());
}
}
#endregion
}
}
}

View File

@@ -26,54 +26,54 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The value of an attribute for an event source.
/// </summary>
[Serializable]
public class TsCAeAttributeValue : ICloneable, IOpcResult
{
#region Fields
/// <summary>
/// The value of an attribute for an event source.
/// </summary>
[Serializable]
public class TsCAeAttributeValue : ICloneable, IOpcResult
{
#region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
#region Properties
#region Properties
/// <summary>
/// A unique identifier for the attribute.
/// </summary>
public int ID { get; set; }
/// A unique identifier for the attribute.
/// </summary>
public int ID { get; set; }
/// <summary>
/// The attribute value.
/// </summary>
public object Value { get; set; }
/// <summary>
/// The attribute value.
/// </summary>
public object Value { get; set; }
#endregion
#region IOpcResult Members
#region IOpcResult Members
/// <summary>
/// The error id for the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
/// The error id for the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
set => result_ = value;
}
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCAeAttributeValue)MemberwiseClone();
clone.Value = OpcConvert.Clone(Value);
return clone;
}
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCAeAttributeValue)MemberwiseClone();
clone.Value = OpcConvert.Clone(Value);
return clone;
}
#endregion
}
}
}

View File

@@ -25,22 +25,22 @@ using System;
#endregion
namespace Technosoftware.DaAeHdaClient.Ae
{
{
/// <summary>
/// Contains a description of an element in the server address space.
/// </summary>
[Serializable]
public class TsCAeBrowseElement
{
#region Fields
#region Fields
private TsCAeBrowseType browseType_ = TsCAeBrowseType.Area;
#endregion
#region Properties
#region Properties
/// <summary>
/// A descriptive name for element that is unique within a branch.
/// </summary>
public string Name { get; set; }
public string Name { get; set; }
/// <summary>
/// The fully qualified name for the element.
@@ -57,12 +57,12 @@ namespace Technosoftware.DaAeHdaClient.Ae
}
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
public virtual object Clone()
{
return MemberwiseClone();
}
#endregion

View File

@@ -29,81 +29,81 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// Stores the state of a browse operation.
/// </summary>
[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
/// <summary>
/// Saves the parameters for an incomplete browse information.
/// </summary>
public TsCAeBrowsePosition(
string areaId,
TsCAeBrowseType browseType,
string browseFilter)
{
areaId_ = areaId;
browseType_ = browseType;
browseFilter_ = browseFilter;
}
/// Saves the parameters for an incomplete browse information.
/// </summary>
public TsCAeBrowsePosition(
string areaId,
TsCAeBrowseType browseType,
string browseFilter)
{
areaId_ = areaId;
browseType_ = browseType;
browseFilter_ = browseFilter;
}
/// <summary>
/// The finalizer implementation.
/// </summary>
~TsCAeBrowsePosition()
{
Dispose(false);
}
{
Dispose(false);
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
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);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="disposing">If true managed and unmanaged resources can be disposed. If false only unmanaged resources.</param>
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;
}
/// <summary>
/// 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.
/// </summary>
/// <param name="disposing">If true managed and unmanaged resources can be disposed. If false only unmanaged resources.</param>
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
/// <summary>
/// The fully qualified id for the area being browsed.
/// </summary>
public string AreaID => areaId_;
/// The fully qualified id for the area being browsed.
/// </summary>
public string AreaID => areaId_;
/// <summary>
/// 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
/// <summary>
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone()
{
return (TsCAeBrowsePosition)MemberwiseClone();
}
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone()
{
return (TsCAeBrowsePosition)MemberwiseClone();
}
#endregion
}
}
}

View File

@@ -26,19 +26,19 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The type of nodes to return during a browse.
/// </summary>
public enum TsCAeBrowseType
{
/// <summary>
/// Return only nodes that are process areas.
/// </summary>
Area,
/// <summary>
/// The type of nodes to return during a browse.
/// </summary>
public enum TsCAeBrowseType
{
/// <summary>
/// Return only nodes that are process areas.
/// </summary>
Area,
/// <summary>
/// Return only nodes that are event sources.
/// </summary>
Source
}
/// <summary>
/// Return only nodes that are event sources.
/// </summary>
Source
}
}

View File

@@ -32,11 +32,11 @@ namespace Technosoftware.DaAeHdaClient.Ae
[Serializable]
public class TsCAeCategory : ICloneable
{
#region Properties
#region Properties
/// <summary>
/// A unique identifier for the category.
/// </summary>
public int ID { get; set; }
public int ID { get; set; }
/// <summary>
/// The unique name for the category.
@@ -53,7 +53,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
}
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a shallow copy of the object.
/// </summary>

View File

@@ -26,50 +26,50 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The bits indicating what changes generated an event notification.
/// </summary>
[Flags]
public enum TsCAeChangeMask
{
/// <summary>
/// The conditions active state has changed.
/// </summary>
ActiveState = 0x0001,
/// <summary>
/// The bits indicating what changes generated an event notification.
/// </summary>
[Flags]
public enum TsCAeChangeMask
{
/// <summary>
/// The conditions active state has changed.
/// </summary>
ActiveState = 0x0001,
/// <summary>
/// The conditions acknowledgment state has changed.
/// </summary>
AcknowledgeState = 0x0002,
/// <summary>
/// The conditions acknowledgment state has changed.
/// </summary>
AcknowledgeState = 0x0002,
/// <summary>
/// The conditions enabled state has changed.
/// </summary>
EnableState = 0x0004,
/// <summary>
/// The conditions enabled state has changed.
/// </summary>
EnableState = 0x0004,
/// <summary>
/// The condition quality has changed.
/// </summary>
Quality = 0x0008,
/// <summary>
/// The condition quality has changed.
/// </summary>
Quality = 0x0008,
/// <summary>
/// The severity level has changed.
/// </summary>
Severity = 0x0010,
/// <summary>
/// The severity level has changed.
/// </summary>
Severity = 0x0010,
/// <summary>
/// The condition has transitioned into a new sub-condition.
/// </summary>
SubCondition = 0x0020,
/// <summary>
/// The condition has transitioned into a new sub-condition.
/// </summary>
SubCondition = 0x0020,
/// <summary>
/// The event message has changed.
/// </summary>
Message = 0x0040,
/// <summary>
/// The event message has changed.
/// </summary>
Message = 0x0040,
/// <summary>
/// One or more event attributes have changed.
/// </summary>
Attribute = 0x0080
}
/// <summary>
/// One or more event attributes have changed.
/// </summary>
Attribute = 0x0080
}
}

View File

@@ -117,8 +117,8 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// The quality associated with the condition state.
/// </summary>
public TsCDaQuality Quality
{
get => _quality;
{
get => _quality;
set => _quality = value;
}

View File

@@ -26,25 +26,25 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The possible states for a condition.
/// </summary>
[Flags]
public enum TsCAeConditionState
{
/// <summary>
/// The server is currently checking the state of the condition.
/// </summary>
Enabled = 0x0001,
/// <summary>
/// The possible states for a condition.
/// </summary>
[Flags]
public enum TsCAeConditionState
{
/// <summary>
/// The server is currently checking the state of the condition.
/// </summary>
Enabled = 0x0001,
/// <summary>
/// The associated object is in the state represented by the condition.
/// </summary>
Active = 0x0002,
/// <summary>
/// The associated object is in the state represented by the condition.
/// </summary>
Active = 0x0002,
/// <summary>
/// The condition has been acknowledged.
/// </summary>
Acknowledged = 0x0004
}
/// <summary>
/// The condition has been acknowledged.
/// </summary>
Acknowledged = 0x0004
}
}

View File

@@ -25,56 +25,56 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The current state of a process area or an event source.
/// </summary>
public class TsCAeEnabledStateResult : IOpcResult
{
#region Fields
/// <summary>
/// The current state of a process area or an event source.
/// </summary>
public class TsCAeEnabledStateResult : IOpcResult
{
#region Fields
private string qualifiedName_;
#endregion
#region Constructors, Destructor, Initialization
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes the object with default values.
/// </summary>
public TsCAeEnabledStateResult() { }
/// Initializes the object with default values.
/// </summary>
public TsCAeEnabledStateResult() { }
/// <summary>
/// Initializes the object with an qualified name.
/// </summary>
public TsCAeEnabledStateResult(string qualifiedName)
{
qualifiedName_ = qualifiedName;
}
/// <summary>
/// Initializes the object with an qualified name.
/// </summary>
public TsCAeEnabledStateResult(string qualifiedName)
{
qualifiedName_ = qualifiedName;
}
/// <summary>
/// Initializes the object with an qualified name and Result.
/// </summary>
public TsCAeEnabledStateResult(string qualifiedName, OpcResult result)
{
qualifiedName_ = qualifiedName;
Result = result;
}
/// <summary>
/// Initializes the object with an qualified name and Result.
/// </summary>
public TsCAeEnabledStateResult(string qualifiedName, OpcResult result)
{
qualifiedName_ = qualifiedName;
Result = result;
}
#endregion
#region Properties
#region Properties
/// <summary>
/// Whether if the area or source is enabled.
/// </summary>
public bool Enabled { get; set; }
/// Whether if the area or source is enabled.
/// </summary>
public bool Enabled { get; set; }
/// <summary>
/// Whether the area or source is enabled and all areas within the hierarchy of its containing areas are enabled.
/// </summary>
public bool EffectivelyEnabled { get; set; }
/// <summary>
/// Whether the area or source is enabled and all areas within the hierarchy of its containing areas are enabled.
/// </summary>
public bool EffectivelyEnabled { get; set; }
#endregion
#region IOpcResult Members
#region IOpcResult Members
/// <summary>
/// The error id for the result of an operation on an item.
/// </summary>
public OpcResult Result { get; set; } = OpcResult.S_OK;
/// The error id for the result of an operation on an item.
/// </summary>
public OpcResult Result { get; set; } = OpcResult.S_OK;
/// <summary>
/// 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
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
#endregion
}
}
}

View File

@@ -26,68 +26,68 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Specifies the information required to acknowledge an event.
/// </summary>
[Serializable]
public class TsCAeEventAcknowledgement : ICloneable
{
#region Fields
/// <summary>
/// Specifies the information required to acknowledge an event.
/// </summary>
[Serializable]
public class TsCAeEventAcknowledgement : ICloneable
{
#region Fields
private DateTime activeTime_ = DateTime.MinValue;
#endregion
#region Properties
#region Properties
/// <summary>
/// The name of the source that generated the event.
/// </summary>
public string SourceName { get; set; }
/// The name of the source that generated the event.
/// </summary>
public string SourceName { get; set; }
/// <summary>
/// The name of the condition that is being acknowledged.
/// </summary>
public string ConditionName { get; set; }
/// <summary>
/// The name of the condition that is being acknowledged.
/// </summary>
public string ConditionName { get; set; }
/// <summary>
/// The time that the condition or sub-condition became active.
/// The <see cref="ApplicationInstance.TimeAsUtc">ApplicationInstance.TimeAsUtc</see> property defines
/// the time format (UTC or local time).
/// </summary>
public DateTime ActiveTime
{
get => activeTime_;
/// <summary>
/// The time that the condition or sub-condition became active.
/// The <see cref="ApplicationInstance.TimeAsUtc">ApplicationInstance.TimeAsUtc</see> property defines
/// the time format (UTC or local time).
/// </summary>
public DateTime ActiveTime
{
get => activeTime_;
set => activeTime_ = value;
}
/// <summary>
/// The cookie for the condition passed to client during the event notification.
/// </summary>
public int Cookie { get; set; }
/// <summary>
/// Constructs an acknowledgment with its default values.
/// </summary>
public TsCAeEventAcknowledgement() { }
/// <summary>
/// Constructs an acknowledgment from an event notification.
/// </summary>
public TsCAeEventAcknowledgement(TsCAeEventNotification notification)
{
SourceName = notification.SourceID;
ConditionName = notification.ConditionName;
activeTime_ = notification.ActiveTime;
Cookie = notification.Cookie;
}
#endregion
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
/// The cookie for the condition passed to client during the event notification.
/// </summary>
public int Cookie { get; set; }
/// <summary>
/// Constructs an acknowledgment with its default values.
/// </summary>
public TsCAeEventAcknowledgement() { }
/// <summary>
/// Constructs an acknowledgment from an event notification.
/// </summary>
public TsCAeEventAcknowledgement(TsCAeEventNotification notification)
{
SourceName = notification.SourceID;
ConditionName = notification.ConditionName;
activeTime_ = notification.ActiveTime;
Cookie = notification.Cookie;
}
#endregion
}
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
#endregion
}
}

View File

@@ -206,8 +206,8 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// The quality associated with the condition state.
/// </summary>
public TsCDaQuality Quality
{
get => daQuality_;
{
get => daQuality_;
set => daQuality_ = value;
}

View File

@@ -25,30 +25,30 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The types of events that could be generated by a server.
/// </summary>
[Flags]
public enum TsCAeEventType
{
/// <summary>
/// Events that are not tracking or condition events.
/// </summary>
Simple = 0x0001,
/// <summary>
/// The types of events that could be generated by a server.
/// </summary>
[Flags]
public enum TsCAeEventType
{
/// <summary>
/// Events that are not tracking or condition events.
/// </summary>
Simple = 0x0001,
/// <summary>
/// Events that represent occurrences which involve the interaction of the client with a target within the server.
/// </summary>
Tracking = 0x0002,
/// <summary>
/// Events that represent occurrences which involve the interaction of the client with a target within the server.
/// </summary>
Tracking = 0x0002,
/// <summary>
/// Events that are associated with transitions in and out states defined by the server.
/// </summary>
Condition = 0x0004,
/// <summary>
/// Events that are associated with transitions in and out states defined by the server.
/// </summary>
Condition = 0x0004,
/// <summary>
/// All events generated by the server.
/// </summary>
All = 0xFFFF
}
/// <summary>
/// All events generated by the server.
/// </summary>
All = 0xFFFF
}
}

View File

@@ -26,40 +26,40 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The types of event filters that the server could support.
/// </summary>
[Flags]
public enum TsCAeFilterType
{
/// <summary>
/// The server supports filtering by event type.
/// </summary>
Event = 0x0001,
/// <summary>
/// The types of event filters that the server could support.
/// </summary>
[Flags]
public enum TsCAeFilterType
{
/// <summary>
/// The server supports filtering by event type.
/// </summary>
Event = 0x0001,
/// <summary>
/// The server supports filtering by event categories.
/// </summary>
Category = 0x0002,
/// <summary>
/// The server supports filtering by event categories.
/// </summary>
Category = 0x0002,
/// <summary>
/// The server supports filtering by severity levels.
/// </summary>
Severity = 0x0004,
/// <summary>
/// The server supports filtering by severity levels.
/// </summary>
Severity = 0x0004,
/// <summary>
/// The server supports filtering by process area.
/// </summary>
Area = 0x0008,
/// <summary>
/// The server supports filtering by process area.
/// </summary>
Area = 0x0008,
/// <summary>
/// The server supports filtering by event sources.
/// </summary>
Source = 0x0010,
/// <summary>
/// The server supports filtering by event sources.
/// </summary>
Source = 0x0010,
/// <summary>
/// All filters supported by the server.
/// </summary>
All = 0xFFFF
}
/// <summary>
/// All filters supported by the server.
/// </summary>
All = 0xFFFF
}
}

View File

@@ -24,179 +24,179 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Defines functionality that is common to all OPC Alarms and Events servers.
/// </summary>
/// <summary>
/// Defines functionality that is common to all OPC Alarms and Events servers.
/// </summary>
public interface ITsCAeServer : IOpcServer
{
{
/// <summary>
/// Returns the current server status.
/// </summary>
/// <returns>The current server status.</returns>
OpcServerStatus GetServerStatus();
/// <summary>
/// Creates a new event subscription.
/// </summary>
/// <param name="state">The initial state for the subscription.</param>
/// <returns>The new subscription object.</returns>
ITsCAeSubscription CreateSubscription(TsCAeSubscriptionState state);
/// <summary>
/// Creates a new event subscription.
/// </summary>
/// <param name="state">The initial state for the subscription.</param>
/// <returns>The new subscription object.</returns>
ITsCAeSubscription CreateSubscription(TsCAeSubscriptionState state);
/// <summary>
/// Returns the event filters supported by the server.
/// </summary>
/// <returns>A bit mask of all event filters supported by the server.</returns>
int QueryAvailableFilters();
/// <summary>
/// Returns the event filters supported by the server.
/// </summary>
/// <returns>A bit mask of all event filters supported by the server.</returns>
int QueryAvailableFilters();
/// <summary>
/// Returns the event categories supported by the server for the specified event types.
/// </summary>
/// <param name="eventType">A bit mask for the event types of interest.</param>
/// <returns>A collection of event categories.</returns>
TsCAeCategory[] QueryEventCategories(int eventType);
/// <summary>
/// Returns the event categories supported by the server for the specified event types.
/// </summary>
/// <param name="eventType">A bit mask for the event types of interest.</param>
/// <returns>A collection of event categories.</returns>
TsCAeCategory[] QueryEventCategories(int eventType);
/// <summary>
/// Returns the condition names supported by the server for the specified event categories.
/// </summary>
/// <param name="eventCategory">A bit mask for the event categories of interest.</param>
/// <returns>A list of condition names.</returns>
string[] QueryConditionNames(int eventCategory);
/// <summary>
/// Returns the condition names supported by the server for the specified event categories.
/// </summary>
/// <param name="eventCategory">A bit mask for the event categories of interest.</param>
/// <returns>A list of condition names.</returns>
string[] QueryConditionNames(int eventCategory);
/// <summary>
/// Returns the sub-condition names supported by the server for the specified event condition.
/// </summary>
/// <param name="conditionName">The name of the condition.</param>
/// <returns>A list of sub-condition names.</returns>
string[] QuerySubConditionNames(string conditionName);
/// <summary>
/// Returns the sub-condition names supported by the server for the specified event condition.
/// </summary>
/// <param name="conditionName">The name of the condition.</param>
/// <returns>A list of sub-condition names.</returns>
string[] QuerySubConditionNames(string conditionName);
/// <summary>
/// Returns the condition names supported by the server for the specified event source.
/// </summary>
/// <param name="sourceName">The name of the event source.</param>
/// <returns>A list of condition names.</returns>
string[] QueryConditionNames(string sourceName);
/// <summary>
/// Returns the condition names supported by the server for the specified event source.
/// </summary>
/// <param name="sourceName">The name of the event source.</param>
/// <returns>A list of condition names.</returns>
string[] QueryConditionNames(string sourceName);
/// <summary>
/// Returns the event attributes supported by the server for the specified event categories.
/// </summary>
/// <param name="eventCategory">The event category of interest.</param>
/// <returns>A collection of event attributes.</returns>
TsCAeAttribute[] QueryEventAttributes(int eventCategory);
/// <summary>
/// Returns the event attributes supported by the server for the specified event categories.
/// </summary>
/// <param name="eventCategory">The event category of interest.</param>
/// <returns>A collection of event attributes.</returns>
TsCAeAttribute[] QueryEventAttributes(int eventCategory);
/// <summary>
/// Returns the DA item ids for a set of attribute ids belonging to events which meet the specified filter criteria.
/// </summary>
/// <param name="sourceName">The event source of interest.</param>
/// <param name="eventCategory">The id of the event category for the events of interest.</param>
/// <param name="conditionName">The name of a condition within the event category.</param>
/// <param name="subConditionName">The name of a sub-condition within a multi-state condition.</param>
/// <param name="attributeIDs">The ids of the attributes to return item ids for.</param>
/// <returns>A list of item urls for each specified attribute.</returns>
TsCAeItemUrl[] TranslateToItemIDs(
string sourceName,
int eventCategory,
string conditionName,
string subConditionName,
int[] attributeIDs);
/// <summary>
/// Returns the DA item ids for a set of attribute ids belonging to events which meet the specified filter criteria.
/// </summary>
/// <param name="sourceName">The event source of interest.</param>
/// <param name="eventCategory">The id of the event category for the events of interest.</param>
/// <param name="conditionName">The name of a condition within the event category.</param>
/// <param name="subConditionName">The name of a sub-condition within a multi-state condition.</param>
/// <param name="attributeIDs">The ids of the attributes to return item ids for.</param>
/// <returns>A list of item urls for each specified attribute.</returns>
TsCAeItemUrl[] TranslateToItemIDs(
string sourceName,
int eventCategory,
string conditionName,
string subConditionName,
int[] attributeIDs);
/// <summary>
/// Returns the current state information for the condition instance corresponding to the source and condition name.
/// </summary>
/// <param name="sourceName">The source name</param>
/// <param name="conditionName">A condition name for the source.</param>
/// <param name="attributeIDs">The list of attributes to return with the condition state.</param>
/// <returns>The current state of the connection.</returns>
TsCAeCondition GetConditionState(
string sourceName,
string conditionName,
int[] attributeIDs);
/// <summary>
/// Returns the current state information for the condition instance corresponding to the source and condition name.
/// </summary>
/// <param name="sourceName">The source name</param>
/// <param name="conditionName">A condition name for the source.</param>
/// <param name="attributeIDs">The list of attributes to return with the condition state.</param>
/// <returns>The current state of the connection.</returns>
TsCAeCondition GetConditionState(
string sourceName,
string conditionName,
int[] attributeIDs);
/// <summary>
/// Places the specified process areas into the enabled state.
/// </summary>
/// <param name="areas">A list of fully qualified area names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] EnableConditionByArea(string[] areas);
/// <summary>
/// Places the specified process areas into the enabled state.
/// </summary>
/// <param name="areas">A list of fully qualified area names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] EnableConditionByArea(string[] areas);
/// <summary>
/// Places the specified process areas into the disabled state.
/// </summary>
/// <param name="areas">A list of fully qualified area names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] DisableConditionByArea(string[] areas);
/// <summary>
/// Places the specified process areas into the disabled state.
/// </summary>
/// <param name="areas">A list of fully qualified area names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] DisableConditionByArea(string[] areas);
/// <summary>
/// Places the specified process areas into the enabled state.
/// </summary>
/// <param name="sources">A list of fully qualified source names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] EnableConditionBySource(string[] sources);
/// <summary>
/// Places the specified process areas into the enabled state.
/// </summary>
/// <param name="sources">A list of fully qualified source names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] EnableConditionBySource(string[] sources);
/// <summary>
/// Places the specified process areas into the disabled state.
/// </summary>
/// <param name="sources">A list of fully qualified source names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] DisableConditionBySource(string[] sources);
/// <summary>
/// Places the specified process areas into the disabled state.
/// </summary>
/// <param name="sources">A list of fully qualified source names.</param>
/// <returns>The results of the operation for each area.</returns>
OpcResult[] DisableConditionBySource(string[] sources);
/// <summary>
/// Returns the enabled state for the specified process areas.
/// </summary>
/// <param name="areas">A list of fully qualified area names.</param>
TsCAeEnabledStateResult[] GetEnableStateByArea(string[] areas);
/// <summary>
/// Returns the enabled state for the specified process areas.
/// </summary>
/// <param name="areas">A list of fully qualified area names.</param>
TsCAeEnabledStateResult[] GetEnableStateByArea(string[] areas);
/// <summary>
/// Returns the enabled state for the specified event sources.
/// </summary>
/// <param name="sources">A list of fully qualified source names.</param>
TsCAeEnabledStateResult[] GetEnableStateBySource(string[] sources);
/// <summary>
/// Returns the enabled state for the specified event sources.
/// </summary>
/// <param name="sources">A list of fully qualified source names.</param>
TsCAeEnabledStateResult[] GetEnableStateBySource(string[] sources);
/// <summary>
/// Used to acknowledge one or more conditions in the event server.
/// </summary>
/// <param name="acknowledgerID">The identifier for who is acknowledging the condition.</param>
/// <param name="comment">A comment associated with the acknowledgment.</param>
/// <param name="conditions">The conditions being acknowledged.</param>
/// <returns>A list of result id indictaing whether each condition was successfully acknowledged.</returns>
OpcResult[] AcknowledgeCondition(
string acknowledgerID,
string comment,
TsCAeEventAcknowledgement[] conditions);
/// <summary>
/// Used to acknowledge one or more conditions in the event server.
/// </summary>
/// <param name="acknowledgerID">The identifier for who is acknowledging the condition.</param>
/// <param name="comment">A comment associated with the acknowledgment.</param>
/// <param name="conditions">The conditions being acknowledged.</param>
/// <returns>A list of result id indictaing whether each condition was successfully acknowledged.</returns>
OpcResult[] AcknowledgeCondition(
string acknowledgerID,
string comment,
TsCAeEventAcknowledgement[] conditions);
/// <summary>
/// Browses for all children of the specified area that meet the filter criteria.
/// </summary>
/// <param name="areaID">The full-qualified id for the area.</param>
/// <param name="browseType">The type of children to return.</param>
/// <param name="browseFilter">The expression used to filter the names of children returned.</param>
/// <returns>The set of elements that meet the filter criteria.</returns>
TsCAeBrowseElement[] Browse(
string areaID,
TsCAeBrowseType browseType,
string browseFilter);
/// <summary>
/// Browses for all children of the specified area that meet the filter criteria.
/// </summary>
/// <param name="areaID">The full-qualified id for the area.</param>
/// <param name="browseType">The type of children to return.</param>
/// <param name="browseFilter">The expression used to filter the names of children returned.</param>
/// <returns>The set of elements that meet the filter criteria.</returns>
TsCAeBrowseElement[] Browse(
string areaID,
TsCAeBrowseType browseType,
string browseFilter);
/// <summary>
/// Browses for all children of the specified area that meet the filter criteria.
/// </summary>
/// <param name="areaID">The full-qualified id for the area.</param>
/// <param name="browseType">The type of children to return.</param>
/// <param name="browseFilter">The expression used to filter the names of children returned.</param>
/// <param name="maxElements">The maximum number of elements to return.</param>
/// <param name="position">The object used to continue the browse if the number nodes exceeds the maximum specified.</param>
/// <returns>The set of elements that meet the filter criteria.</returns>
TsCAeBrowseElement[] Browse(
string areaID,
TsCAeBrowseType browseType,
string browseFilter,
int maxElements,
out IOpcBrowsePosition position);
/// <summary>
/// Browses for all children of the specified area that meet the filter criteria.
/// </summary>
/// <param name="areaID">The full-qualified id for the area.</param>
/// <param name="browseType">The type of children to return.</param>
/// <param name="browseFilter">The expression used to filter the names of children returned.</param>
/// <param name="maxElements">The maximum number of elements to return.</param>
/// <param name="position">The object used to continue the browse if the number nodes exceeds the maximum specified.</param>
/// <returns>The set of elements that meet the filter criteria.</returns>
TsCAeBrowseElement[] Browse(
string areaID,
TsCAeBrowseType browseType,
string browseFilter,
int maxElements,
out IOpcBrowsePosition position);
/// <summary>
/// Continues browsing the server's address space at the specified position.
/// </summary>
/// <param name="maxElements">The maximum number of elements to return.</param>
/// <param name="position">The position object used to continue a browse operation.</param>
/// <returns>The set of elements that meet the filter criteria.</returns>
TsCAeBrowseElement[] BrowseNext(int maxElements, ref IOpcBrowsePosition position);
}
/// <summary>
/// Continues browsing the server's address space at the specified position.
/// </summary>
/// <param name="maxElements">The maximum number of elements to return.</param>
/// <param name="position">The position object used to continue a browse operation.</param>
/// <returns>The set of elements that meet the filter criteria.</returns>
TsCAeBrowseElement[] BrowseNext(int maxElements, ref IOpcBrowsePosition position);
}
}

View File

@@ -31,20 +31,20 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// </summary>
public interface ITsCAeSubscription : IDisposable
{
#region Events
#region Events
/// <summary>
/// An event to receive event change updates.
/// </summary>
event TsCAeDataChangedEventHandler DataChangedEvent;
#endregion
#region State Management
#region State Management
/// <summary>
/// Returns the current state of the subscription.
/// </summary>
/// <returns>The current state of the subscription.</returns>
TsCAeSubscriptionState GetState();
/// <summary>
/// Changes the state of a subscription.
/// </summary>
@@ -54,7 +54,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
TsCAeSubscriptionState ModifyState(int masks, TsCAeSubscriptionState state);
#endregion
#region Filter Management
#region Filter Management
/// <summary>
/// Returns the current filters for the subscription.
/// </summary>
@@ -68,7 +68,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
void SetFilters(TsCAeSubscriptionFilters filters);
#endregion
#region Attribute Management
#region Attribute Management
/// <summary>
/// Returns the set of attributes to return with event notifications.
/// </summary>
@@ -84,7 +84,7 @@ namespace Technosoftware.DaAeHdaClient.Ae
void SelectReturnedAttributes(int eventCategory, int[] attributeIDs);
#endregion
#region Refresh
#region Refresh
/// <summary>
/// Force a refresh for all active conditions and inactive, unacknowledged conditions whose event notifications match the filter of the event subscription.
/// </summary>
@@ -95,9 +95,9 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// </summary>
void CancelRefresh();
#endregion
}
}
#region Delegate Declarations
#region Delegate Declarations
/// <summary>
/// A delegate to receive data change updates from the server.
/// </summary>

View File

@@ -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
/// <summary>
/// Initializes the object with default values.
/// </summary>
public TsCAeItemUrl() {}
public TsCAeItemUrl() { }
/// <summary>
/// Initializes the object with an ItemIdentifier object.
/// </summary>
public TsCAeItemUrl(OpcItem item) : base(item) {}
public TsCAeItemUrl(OpcItem item) : base(item) { }
/// <summary>
/// Initializes the object with an ItemIdentifier object and url.
/// </summary>
public TsCAeItemUrl(OpcItem item, OpcUrl url)
: base(item)
{
Url = url;
}
public TsCAeItemUrl(OpcItem item, OpcUrl url)
: base(item)
{
Url = url;
}
/// <summary>
/// Initializes object with the specified ItemResult object.
@@ -65,26 +65,26 @@ namespace Technosoftware.DaAeHdaClient.Ae
{
Url = item.Url;
}
}
}
#endregion
#region Properties
#region Properties
/// <summary>
/// The url of the server that contains the item.
/// </summary>
public OpcUrl Url
{
get => url_;
/// The url of the server that contains the item.
/// </summary>
public OpcUrl Url
{
get => url_;
set => url_ = value;
}
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public override object Clone()
{
public override object Clone()
{
return new TsCAeItemUrl(this);
}
#endregion

View File

@@ -25,36 +25,36 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Contains a collection of item urls.
/// </summary>
internal class TsCAeItemUrlCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Constructs an empty collection.
/// </summary>
public TsCAeItemUrlCollection() : base(new TsCAeItemUrl[0]) { }
/// <summary>
/// Contains a collection of item urls.
/// </summary>
internal class TsCAeItemUrlCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Constructs an empty collection.
/// </summary>
public TsCAeItemUrlCollection() : base(new TsCAeItemUrl[0]) { }
/// <summary>
/// Constructs a collection from an array of item urls.
/// </summary>
public TsCAeItemUrlCollection(TsCAeItemUrl[] itemUrls) : base(itemUrls) { }
/// <summary>
/// Constructs a collection from an array of item urls.
/// </summary>
public TsCAeItemUrlCollection(TsCAeItemUrl[] itemUrls) : base(itemUrls) { }
#endregion
#region Public Methods
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new TsCAeItemUrl this[int index] => (TsCAeItemUrl)Array.GetValue(index);
/// An indexer for the collection.
/// </summary>
public new TsCAeItemUrl this[int index] => (TsCAeItemUrl)Array.GetValue(index);
/// <summary>
/// Returns a copy of the collection as an array.
/// </summary>
public new TsCAeItemUrl[] ToArray()
{
return (TsCAeItemUrl[])OpcConvert.Clone(Array);
}
{
return (TsCAeItemUrl[])OpcConvert.Clone(Array);
}
#endregion
}
}
}

View File

@@ -23,7 +23,6 @@
#region Using Directives
using System;
using System.Collections;
using System.Runtime.Serialization;
#endregion

View File

@@ -25,44 +25,44 @@
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Current Status of an OPC AE server
/// </summary>
public enum TsCAeServerState
{
/// <summary>
/// The server state is not known.
/// </summary>
Unknown,
/// <summary>
/// Current Status of an OPC AE server
/// </summary>
public enum TsCAeServerState
{
/// <summary>
/// The server state is not known.
/// </summary>
Unknown,
/// <summary>
/// The server is running normally. This is the usual state for a server
/// </summary>
Running,
/// <summary>
/// The server is running normally. This is the usual state for a server
/// </summary>
Running,
/// <summary>
/// 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.
/// </summary>
Failed,
/// <summary>
/// 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.
/// </summary>
Failed,
/// <summary>
/// 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.
/// </summary>
NoConfig,
/// <summary>
/// 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.
/// </summary>
NoConfig,
/// <summary>
/// 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.
/// </summary>
Suspended,
/// <summary>
/// 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.
/// </summary>
Suspended,
/// <summary>
/// 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.
/// </summary>
Test,
/// <summary>
/// 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.
/// </summary>
Test,
/// <summary>
/// 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.
/// </summary>
CommFault
}
/// <summary>
/// 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.
/// </summary>
CommFault
}
}

View File

@@ -26,45 +26,45 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Defines masks to be used when modifying the subscription or item state.
/// </summary>
[Flags]
public enum TsCAeStateMask
{
/// <summary>
/// A name assigned to subscription.
/// </summary>
Name = 0x0001,
/// <summary>
/// Defines masks to be used when modifying the subscription or item state.
/// </summary>
[Flags]
public enum TsCAeStateMask
{
/// <summary>
/// A name assigned to subscription.
/// </summary>
Name = 0x0001,
/// <summary>
/// The client assigned handle for the item or subscription.
/// </summary>
ClientHandle = 0x0002,
/// <summary>
/// The client assigned handle for the item or subscription.
/// </summary>
ClientHandle = 0x0002,
/// <summary>
/// Whether the subscription is active.
/// </summary>
Active = 0x0004,
/// <summary>
/// Whether the subscription is active.
/// </summary>
Active = 0x0004,
/// <summary>
/// The maximum rate at which the server send event notifications.
/// </summary>
BufferTime = 0x0008,
/// <summary>
/// The maximum rate at which the server send event notifications.
/// </summary>
BufferTime = 0x0008,
/// <summary>
/// The requested maximum number of events that will be sent in a single callback.
/// </summary>
MaxSize = 0x0010,
/// <summary>
/// The requested maximum number of events that will be sent in a single callback.
/// </summary>
MaxSize = 0x0010,
/// <summary>
/// The maximum period between updates sent to the client.
/// </summary>
KeepAlive = 0x0020,
/// <summary>
/// The maximum period between updates sent to the client.
/// </summary>
KeepAlive = 0x0020,
/// <summary>
/// All fields are valid.
/// </summary>
All = 0xFFFF
}
/// <summary>
/// All fields are valid.
/// </summary>
All = 0xFFFF
}
}

View File

@@ -26,58 +26,58 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// The description of an item sub-condition supported by the server.
/// </summary>
[Serializable]
public class TsCAeSubCondition : ICloneable
{
#region Fields
/// <summary>
/// The description of an item sub-condition supported by the server.
/// </summary>
[Serializable]
public class TsCAeSubCondition : ICloneable
{
#region Fields
private int severity_ = 1;
#endregion
#region Properties
#region Properties
/// <summary>
/// The name assigned to the sub-condition.
/// </summary>
public string Name { get; set; }
/// The name assigned to the sub-condition.
/// </summary>
public string Name { get; set; }
/// <summary>
/// A server-specific expression which defines the sub-state represented by the sub-condition.
/// </summary>
public string Definition { get; set; }
/// <summary>
/// A server-specific expression which defines the sub-state represented by the sub-condition.
/// </summary>
public string Definition { get; set; }
/// <summary>
/// The severity of any event notifications generated on behalf of this sub-condition.
/// </summary>
public int Severity
{
get => severity_;
/// <summary>
/// The severity of any event notifications generated on behalf of this sub-condition.
/// </summary>
public int Severity
{
get => severity_;
set => severity_ = value;
}
/// <summary>
/// The text string to be included in any event notification generated on behalf of this sub-condition.
/// </summary>
public string Description { get; set; }
/// <summary>
/// The text string to be included in any event notification generated on behalf of this sub-condition.
/// </summary>
public string Description { get; set; }
#endregion
#region Helper Methods
#region Helper Methods
/// <summary>
/// Returns a string that represents the current object.
/// </summary>
/// <returns></returns>
public override string ToString()
{
return Name;
}
/// Returns a string that represents the current object.
/// </summary>
/// <returns></returns>
public override string ToString()
{
return Name;
}
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone() { return MemberwiseClone(); }
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone() { return MemberwiseClone(); }
#endregion
}
}
}

View File

@@ -30,230 +30,230 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// An in-process object which provides access to AE subscription objects.
/// </summary>
[Serializable]
public class TsCAeSubscription : ITsCAeSubscription, ISerializable, ICloneable
{
#region CategoryCollection Class
/// <summary>
/// An in-process object which provides access to AE subscription objects.
/// </summary>
[Serializable]
public class TsCAeSubscription : ITsCAeSubscription, ISerializable, ICloneable
{
#region CategoryCollection Class
/// <summary>
/// Contains a read-only collection category ids.
/// </summary>
public class CategoryCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// Contains a read-only collection category ids.
/// </summary>
public class CategoryCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal CategoryCollection() : base(new int[0]) { }
/// Creates an empty collection.
/// </summary>
internal CategoryCollection() : base(new int[0]) { }
/// <summary>
/// Creates a collection containing the list of category ids.
/// </summary>
internal CategoryCollection(int[] categoryIDs) : base(categoryIDs) { }
/// <summary>
/// Creates a collection containing the list of category ids.
/// </summary>
internal CategoryCollection(int[] categoryIDs) : base(categoryIDs) { }
#endregion
#region Public Methods
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array.GetValue(index);
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array.GetValue(index);
/// <summary>
/// Returns a copy of the collection as an array.
/// </summary>
public new int[] ToArray()
{
return (int[])OpcConvert.Clone(Array);
}
{
return (int[])OpcConvert.Clone(Array);
}
#endregion
}
}
#endregion
#region StringCollection Class
#region StringCollection Class
/// <summary>
/// Contains a read-only collection of strings.
/// </summary>
public class StringCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// Contains a read-only collection of strings.
/// </summary>
public class StringCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal StringCollection() : base(new string[0]) { }
/// Creates an empty collection.
/// </summary>
internal StringCollection() : base(new string[0]) { }
/// <summary>
/// Creates a collection containing the specified strings.
/// </summary>
internal StringCollection(string[] strings) : base(strings) { }
#endregion
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new string this[int index] => (string)Array.GetValue(index);
/// Creates a collection containing the specified strings.
/// </summary>
internal StringCollection(string[] strings) : base(strings) { }
#endregion
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new string this[int index] => (string)Array.GetValue(index);
/// <summary>
/// Returns a copy of the collection as an array.
/// </summary>
public new string[] ToArray()
{
return (string[])OpcConvert.Clone(Array);
}
{
return (string[])OpcConvert.Clone(Array);
}
#endregion
}
}
#endregion
#region AttributeDictionary Class
#region AttributeDictionary Class
/// <summary>
/// Contains a read-only dictionary of attribute lists indexed by category id.
/// </summary>
[Serializable]
public class AttributeDictionary : OpcReadOnlyDictionary
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal AttributeDictionary() : base(null) { }
/// Contains a read-only dictionary of attribute lists indexed by category id.
/// </summary>
[Serializable]
public class AttributeDictionary : OpcReadOnlyDictionary
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal AttributeDictionary() : base(null) { }
/// <summary>
/// Constructs an dictionary from a set of category ids.
/// </summary>
internal AttributeDictionary(Hashtable dictionary) : base(dictionary) { }
/// <summary>
/// Constructs an dictionary from a set of category ids.
/// </summary>
internal AttributeDictionary(Hashtable dictionary) : base(dictionary) { }
#endregion
#region Public Methods
#region Public Methods
/// <summary>
/// Gets or sets the attribute collection for the specified category.
/// </summary>
public AttributeCollection this[int categoryId] => (AttributeCollection)base[categoryId];
/// Gets or sets the attribute collection for the specified category.
/// </summary>
public AttributeCollection this[int categoryId] => (AttributeCollection)base[categoryId];
/// <summary>
/// Adds or replaces the set of attributes associated with the category.
/// </summary>
internal void Update(int categoryId, int[] attributeIDs)
{
Dictionary[categoryId] = new AttributeCollection(attributeIDs);
}
{
Dictionary[categoryId] = new AttributeCollection(attributeIDs);
}
#endregion
#region ISerializable Members
/// <summary>
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected AttributeDictionary(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
}
#region ISerializable Members
/// <summary>
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected AttributeDictionary(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
}
#endregion
#region AttributeCollection Class
#region AttributeCollection Class
/// <summary>
/// Contains a read-only collection attribute ids.
/// </summary>
[Serializable]
public class AttributeCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal AttributeCollection() : base(new int[0]) { }
/// Contains a read-only collection attribute ids.
/// </summary>
[Serializable]
public class AttributeCollection : OpcReadOnlyCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal AttributeCollection() : base(new int[0]) { }
/// <summary>
/// Creates a collection containing the specified attribute ids.
/// </summary>
internal AttributeCollection(int[] attributeIDs) : base(attributeIDs) { }
/// <summary>
/// Creates a collection containing the specified attribute ids.
/// </summary>
internal AttributeCollection(int[] attributeIDs) : base(attributeIDs) { }
#endregion
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array.GetValue(index);
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array.GetValue(index);
/// <summary>
/// Returns a copy of the collection as an array.
/// </summary>
public new int[] ToArray()
{
return (int[])OpcConvert.Clone(Array);
}
{
return (int[])OpcConvert.Clone(Array);
}
#endregion
#region ISerializable Members
#region ISerializable Members
/// <summary>
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected AttributeCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected AttributeCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
}
#endregion
#region Names Class
/// <summary>
/// A set of names for fields used in serialization.
/// </summary>
private class Names
{
internal const string State = "ST";
internal const string Filters = "FT";
internal const string Attributes = "AT";
}
}
#endregion
#region Fields
#region Names Class
/// <summary>
/// A set of names for fields used in serialization.
/// </summary>
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
/// <summary>
/// Initializes object with default values.
/// </summary>
public TsCAeSubscription(TsCAeServer server, ITsCAeSubscription subscription, TsCAeSubscriptionState state)
{
/// Initializes object with default values.
/// </summary>
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;
}
/// <summary>
/// The finalizer implementation.
/// </summary>
~TsCAeSubscription()
{
Dispose(false);
}
{
Dispose(false);
}
/// <summary>
///
/// </summary>
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);
}
/// <summary>
///
/// </summary>
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);
}
/// <summary>
/// Dispose(bool disposing) executes in two distinct scenarios.
@@ -266,34 +266,34 @@ namespace Technosoftware.DaAeHdaClient.Ae
/// </summary>
/// <param name="disposing">If true managed and unmanaged resources can be disposed. If false only unmanaged resources.</param>
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
/// <summary>
/// The server that the subscription object belongs to.
/// </summary>
public TsCAeServer Server => server_;
/// <summary>
/// The server that the subscription object belongs to.
/// </summary>
public TsCAeServer Server => server_;
/// <summary>
/// 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
/// <summary>
/// Returns a writable copy of the current attributes.
/// </summary>
public TsCAeAttributeDictionary GetAttributes()
{
/// Returns a writable copy of the current attributes.
/// </summary>
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
/// <summary>
/// Constructs a server by de-serializing its OpcUrl from the stream.
/// </summary>
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.
/// </summary>
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());
}
/// <summary>
/// Serializes a server into a stream.
/// </summary>
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue(Names.State, state_);
info.AddValue(Names.Filters, subscriptionFilters_);
info.AddValue(Names.Attributes, attributes_);
}
/// <summary>
/// Serializes a server into a stream.
/// </summary>
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
/// <summary>
/// Returns an unconnected copy of the subscription with the same items.
/// </summary>
public virtual object Clone()
{
// do a memberwise clone.
var clone = (TsCAeSubscription)MemberwiseClone();
/// Returns an unconnected copy of the subscription with the same items.
/// </summary>
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
/// <summary>
/// An event to receive data change updates.
/// </summary>
@@ -469,136 +469,136 @@ namespace Technosoftware.DaAeHdaClient.Ae
remove => subscription_.DataChangedEvent -= value;
}
/// <summary>
/// Returns the current state of the subscription.
/// </summary>
/// <returns>The current state of the subscription.</returns>
public TsCAeSubscriptionState GetState()
{
/// <summary>
/// Returns the current state of the subscription.
/// </summary>
/// <returns>The current state of the subscription.</returns>
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();
}
/// <summary>
/// Changes the state of a subscription.
/// </summary>
/// <param name="masks">A bit mask that indicates which elements of the subscription state are changing.</param>
/// <param name="state">The new subscription state.</param>
/// <returns>The actual subscription state after applying the changes.</returns>
public TsCAeSubscriptionState ModifyState(int masks, TsCAeSubscriptionState state)
{
/// <summary>
/// Changes the state of a subscription.
/// </summary>
/// <param name="masks">A bit mask that indicates which elements of the subscription state are changing.</param>
/// <param name="state">The new subscription state.</param>
/// <returns>The actual subscription state after applying the changes.</returns>
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();
}
/// <summary>
/// Returns the current filters for the subscription.
/// </summary>
/// <returns>The current filters for the subscription.</returns>
public TsCAeSubscriptionFilters GetFilters()
{
/// <summary>
/// Returns the current filters for the subscription.
/// </summary>
/// <returns>The current filters for the subscription.</returns>
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();
}
/// <summary>
/// Sets the current filters for the subscription.
/// </summary>
/// <param name="filters">The new filters to use for the subscription.</param>
public void SetFilters(TsCAeSubscriptionFilters filters)
{
/// <summary>
/// Sets the current filters for the subscription.
/// </summary>
/// <param name="filters">The new filters to use for the subscription.</param>
public void SetFilters(TsCAeSubscriptionFilters filters)
{
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscription_.SetFilters(filters);
GetFilters();
}
GetFilters();
}
/// <summary>
/// Returns the set of attributes to return with event notifications.
/// </summary>
/// <returns>The set of attributes to returned with event notifications.</returns>
public int[] GetReturnedAttributes(int eventCategory)
{
/// <summary>
/// Returns the set of attributes to return with event notifications.
/// </summary>
/// <returns>The set of attributes to returned with event notifications.</returns>
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;
}
/// <summary>
/// Selects the set of attributes to return with event notifications.
/// </summary>
/// <param name="eventCategory">The specific event category for which the attributes apply.</param>
/// <param name="attributeIDs">The list of attribute ids to return.</param>
public void SelectReturnedAttributes(int eventCategory, int[] attributeIDs)
{
/// <summary>
/// Selects the set of attributes to return with event notifications.
/// </summary>
/// <param name="eventCategory">The specific event category for which the attributes apply.</param>
/// <param name="attributeIDs">The list of attribute ids to return.</param>
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));
}
/// <summary>
/// Force a refresh for all active conditions and inactive, unacknowledged conditions whose event notifications match the filter of the event subscription.
/// </summary>
public void Refresh()
{
/// <summary>
/// Force a refresh for all active conditions and inactive, unacknowledged conditions whose event notifications match the filter of the event subscription.
/// </summary>
public void Refresh()
{
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscription_.Refresh();
}
}
/// <summary>
/// Cancels an outstanding refresh request.
/// </summary>
public void CancelRefresh()
{
/// <summary>
/// Cancels an outstanding refresh request.
/// </summary>
public void CancelRefresh()
{
LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions);
if (subscription_ == null) throw new NotConnectedException();
subscription_.CancelRefresh();
}
#endregion
}
#endregion
#region Internal Properties
#region Internal Properties
/// <summary>
/// The current state.
/// </summary>
internal TsCAeSubscriptionState State => state_;
/// The current state.
/// </summary>
internal TsCAeSubscriptionState State => state_;
/// <summary>
/// The current filters.
@@ -606,5 +606,5 @@ namespace Technosoftware.DaAeHdaClient.Ae
internal TsCAeSubscriptionFilters Filters => subscriptionFilters_;
#endregion
}
}
}

View File

@@ -27,165 +27,165 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Describes the event filters for a subscription.
/// </summary>
[Serializable]
public class TsCAeSubscriptionFilters : ICloneable, ISerializable
{
#region CategoryCollection Class
/// <summary>
/// Describes the event filters for a subscription.
/// </summary>
[Serializable]
public class TsCAeSubscriptionFilters : ICloneable, ISerializable
{
#region CategoryCollection Class
/// <summary>
/// Contains a writable collection category ids.
/// </summary>
[Serializable]
public class CategoryCollection : OpcWriteableCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal CategoryCollection() : base(null, typeof(int)) { }
#region ISerializable Members
/// Contains a writable collection category ids.
/// </summary>
[Serializable]
public class CategoryCollection : OpcWriteableCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected CategoryCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
/// Creates an empty collection.
/// </summary>
internal CategoryCollection() : base(null, typeof(int)) { }
#region ISerializable Members
/// <summary>
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected CategoryCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
#endregion
#region Public Methods
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array[index];
/// An indexer for the collection.
/// </summary>
public new int this[int index] => (int)Array[index];
/// <summary>
/// Returns a copy of the collection as an array.
/// </summary>
public new int[] ToArray()
{
return (int[])Array.ToArray(typeof(int));
}
{
return (int[])Array.ToArray(typeof(int));
}
#endregion
}
}
#endregion
#region StringCollection Class
#region StringCollection Class
/// <summary>
/// Contains a writable collection of strings.
/// </summary>
[Serializable]
public class StringCollection : OpcWriteableCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal StringCollection() : base(null, typeof(string)) { }
/// Contains a writable collection of strings.
/// </summary>
[Serializable]
public class StringCollection : OpcWriteableCollection
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Creates an empty collection.
/// </summary>
internal StringCollection() : base(null, typeof(string)) { }
#endregion
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new string this[int index] => (string)Array[index];
#region Public Methods
/// <summary>
/// An indexer for the collection.
/// </summary>
public new string this[int index] => (string)Array[index];
/// <summary>
/// Returns a copy of the collection as an array.
/// </summary>
public new string[] ToArray()
{
return (string[])Array.ToArray(typeof(string));
}
{
return (string[])Array.ToArray(typeof(string));
}
#endregion
#region ISerializable Members
#region ISerializable Members
/// <summary>
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected StringCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
/// Constructs an object by deserializing it from a stream.
/// </summary>
protected StringCollection(SerializationInfo info, StreamingContext context) : base(info, context) { }
#endregion
}
}
#endregion
#region Names Class
/// <summary>
/// A set of names for fields used in serialization.
/// </summary>
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
/// <summary>
/// Initializes object with default values.
/// </summary>
public TsCAeSubscriptionFilters() { }
/// <summary>
/// Constructs a server by de-serializing its OpcUrl from the stream.
/// </summary>
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.
/// </summary>
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
/// <summary>
/// A mask indicating which event types should be sent to the client.
/// </summary>
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
/// <summary>
/// Initializes object with default values.
/// </summary>
public TsCAeSubscriptionFilters() { }
/// <summary>
/// Constructs a server by de-serializing its OpcUrl from the stream.
/// </summary>
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
/// <summary>
/// A mask indicating which event types should be sent to the client.
/// </summary>
public int EventTypes
{
get => eventTypes_;
set => eventTypes_ = value;
}
/// <summary>
/// The highest severity for the events that should be sent to the client.
/// </summary>
public int HighSeverity
{
get => highSeverity_;
/// <summary>
/// The highest severity for the events that should be sent to the client.
/// </summary>
public int HighSeverity
{
get => highSeverity_;
set => highSeverity_ = value;
}
/// <summary>
/// The lowest severity for the events that should be sent to the client.
/// </summary>
public int LowSeverity
{
get => lowSeverity_;
/// <summary>
/// The lowest severity for the events that should be sent to the client.
/// </summary>
public int LowSeverity
{
get => lowSeverity_;
set => lowSeverity_ = value;
}
/// <summary>
/// The category ids for the events that should be sent to the client.
/// </summary>
public CategoryCollection Categories => categories_;
/// <summary>
/// The category ids for the events that should be sent to the client.
/// </summary>
public CategoryCollection Categories => categories_;
/// <summary>
/// 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
/// <summary>
/// Serializes a server into a stream.
/// </summary>
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.
/// </summary>
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
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var filters = (TsCAeSubscriptionFilters)MemberwiseClone();
/// Creates a deep copy of the object.
/// </summary>
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
}
}

View File

@@ -26,63 +26,63 @@ using System;
namespace Technosoftware.DaAeHdaClient.Ae
{
/// <summary>
/// Describes the state of a subscription.
/// </summary>
[Serializable]
public class TsCAeSubscriptionState : ICloneable
{
#region Fields
/// <summary>
/// Describes the state of a subscription.
/// </summary>
[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
/// <summary>
/// A descriptive name for the subscription.
/// </summary>
public string Name { get; set; }
/// A descriptive name for the subscription.
/// </summary>
public string Name { get; set; }
/// <summary>
/// A unique identifier for the subscription assigned by the client.
/// </summary>
public object ClientHandle { get; set; }
/// <summary>
/// A unique identifier for the subscription assigned by the client.
/// </summary>
public object ClientHandle { get; set; }
/// <summary>
/// Whether the subscription is monitoring for events to send to the client.
/// </summary>
public bool Active
{
get => active_;
/// <summary>
/// Whether the subscription is monitoring for events to send to the client.
/// </summary>
public bool Active
{
get => active_;
set => active_ = value;
}
/// <summary>
/// The maximum rate at which the server send event notifications.
/// </summary>
public int BufferTime { get; set; }
/// <summary>
/// The requested maximum number of events that will be sent in a single callback.
/// </summary>
public int MaxSize { get; set; }
/// <summary>
/// The maximum period between updates sent to the client.
/// </summary>
public int KeepAlive { get; set; }
#endregion
#region ICloneable Members
/// <summary>
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
/// The maximum rate at which the server send event notifications.
/// </summary>
public int BufferTime { get; set; }
/// <summary>
/// The requested maximum number of events that will be sent in a single callback.
/// </summary>
public int MaxSize { get; set; }
/// <summary>
/// The maximum period between updates sent to the client.
/// </summary>
public int KeepAlive { get; set; }
#endregion
}
#region ICloneable Members
/// <summary>
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
#endregion
}
}

View File

@@ -21,7 +21,6 @@
#endregion Copyright (c) 2011-2023 Technosoftware GmbH. All rights reserved
#region Using Directives
using System;
using Technosoftware.DaAeHdaClient.Utilities;
#endregion

File diff suppressed because it is too large Load Diff

View File

@@ -29,179 +29,179 @@ using Technosoftware.DaAeHdaClient.Da;
namespace Technosoftware.DaAeHdaClient.Cpx
{
/// <summary>
/// A class that caches properties of complex data items.
/// </summary>
public class TsCCpxComplexTypeCache
{
/// <summary>
/// A class that caches properties of complex data items.
/// </summary>
public class TsCCpxComplexTypeCache
{
///////////////////////////////////////////////////////////////////////
#region Fields
///////////////////////////////////////////////////////////////////////
#region Fields
/// <summary>
/// The active server for the application.
/// </summary>
private static TsCDaServer _server;
/// <summary>
/// The active server for the application.
/// </summary>
private static TsCDaServer _server;
/// <summary>
/// A cache of item properties fetched from the active server.
/// </summary>
private static Hashtable _items = new Hashtable();
/// <summary>
/// A cache of item properties fetched from the active server.
/// </summary>
private static Hashtable _items = new Hashtable();
/// <summary>
/// A cache of type dictionaries fetched from the active server.
/// </summary>
private static Hashtable _dictionaries = new Hashtable();
/// <summary>
/// A cache of type dictionaries fetched from the active server.
/// </summary>
private static Hashtable _dictionaries = new Hashtable();
/// <summary>
/// A cache of type descriptions fetched from the active server.
/// </summary>
private static Hashtable _descriptions = new Hashtable();
/// <summary>
/// A cache of type descriptions fetched from the active server.
/// </summary>
private static Hashtable _descriptions = new Hashtable();
#endregion
#endregion
///////////////////////////////////////////////////////////////////////
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes the complex type cache with defaults.
/// </summary>
public TsCCpxComplexTypeCache() { }
///////////////////////////////////////////////////////////////////////
#region Constructors, Destructor, Initialization
#endregion
/// <summary>
/// Initializes the complex type cache with defaults.
/// </summary>
public TsCCpxComplexTypeCache() { }
///////////////////////////////////////////////////////////////////////
#region Properties
#endregion
/// <summary>
/// Get or sets the server to use for the cache.
/// </summary>
public static TsCDaServer Server
{
get
{
lock (typeof(TsCCpxComplexTypeCache))
{
return _server;
}
}
///////////////////////////////////////////////////////////////////////
#region Properties
set
{
lock (typeof(TsCCpxComplexTypeCache))
{
_server = value;
_items.Clear();
_dictionaries.Clear();
_descriptions.Clear();
}
}
}
/// <summary>
/// Get or sets the server to use for the cache.
/// </summary>
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
/// <summary>
/// Returns the complex item for the specified item id.
/// </summary>
/// <param name="itemID">The item id.</param>
public static TsCCpxComplexItem GetComplexItem(OpcItem itemID)
{
if (itemID == null) return null;
///////////////////////////////////////////////////////////////////////
#region Public Methods
lock (typeof(TsCCpxComplexTypeCache))
{
var item = new TsCCpxComplexItem(itemID);
/// <summary>
/// Returns the complex item for the specified item id.
/// </summary>
/// <param name="itemID">The item id.</param>
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;
}
/// <summary>
/// Returns the complex item for the specified item browse element.
/// </summary>
/// <param name="element">The item browse element.</param>
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));
}
}
/// <summary>
/// Returns the complex item for the specified item browse element.
/// </summary>
/// <param name="element">The item browse element.</param>
public static TsCCpxComplexItem GetComplexItem(TsCDaBrowseElement element)
{
if (element == null) return null;
/// <summary>
/// Fetches the type dictionary for the item.
/// </summary>
/// <param name="itemID">The item id.</param>
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];
/// <summary>
/// Fetches the type dictionary for the item.
/// </summary>
/// <param name="itemID">The item id.</param>
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);
}
/// <summary>
/// Fetches the type description for the item.
/// </summary>
/// <param name="itemID">The item id.</param>
public static string GetTypeDescription(OpcItem itemID)
{
if (itemID == null) return null;
return dictionary;
}
}
lock (typeof(TsCCpxComplexTypeCache))
{
string description = null;
/// <summary>
/// Fetches the type description for the item.
/// </summary>
/// <param name="itemID">The item id.</param>
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
}
}

View File

@@ -26,24 +26,24 @@
namespace Technosoftware.DaAeHdaClient.Cpx
{
/// <summary>
/// Stores a value with an associated name and/or type.
/// </summary>
public class TsCCpxComplexValue
{
/// <summary>
/// The name of the value.
/// </summary>
public string Name;
/// <summary>
/// Stores a value with an associated name and/or type.
/// </summary>
public class TsCCpxComplexValue
{
/// <summary>
/// The name of the value.
/// </summary>
public string Name;
/// <summary>
/// The complex or simple data type of the value.
/// </summary>
public string Type;
/// <summary>
/// The complex or simple data type of the value.
/// </summary>
public string Type;
/// <summary>
/// The actual value.
/// </summary>
public object Value;
}
/// <summary>
/// The actual value.
/// </summary>
public object Value;
}
}

View File

@@ -26,46 +26,46 @@
namespace Technosoftware.DaAeHdaClient.Cpx
{
/// <summary>
/// Stores the current serialization context.
/// </summary>
internal struct TsCCpxContext
{
///////////////////////////////////////////////////////////////////////
#region Constructors, Destructor, Initialization
/// <summary>
/// Stores the current serialization context.
/// </summary>
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
}
}
}

View File

@@ -27,22 +27,22 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Cpx
{
/// <summary>
/// Raised if the data in buffer is not consistent with the schema.
/// </summary>
[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.";
/// <remarks/>
public TsCCpxInvalidDataInBufferException() : base(Default) { }
/// <remarks/>
public TsCCpxInvalidDataInBufferException(string message) : base(Default + Environment.NewLine + message) { }
/// <remarks/>
public TsCCpxInvalidDataInBufferException(Exception e) : base(Default, e) { }
/// <remarks/>
public TsCCpxInvalidDataInBufferException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
/// <remarks/>
protected TsCCpxInvalidDataInBufferException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
/// <summary>
/// Raised if the data in buffer is not consistent with the schema.
/// </summary>
[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.";
/// <remarks/>
public TsCCpxInvalidDataInBufferException() : base(Default) { }
/// <remarks/>
public TsCCpxInvalidDataInBufferException(string message) : base(Default + Environment.NewLine + message) { }
/// <remarks/>
public TsCCpxInvalidDataInBufferException(Exception e) : base(Default, e) { }
/// <remarks/>
public TsCCpxInvalidDataInBufferException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
/// <remarks/>
protected TsCCpxInvalidDataInBufferException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}

View File

@@ -27,22 +27,22 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Cpx
{
/// <summary>
/// Raised if the data in buffer is not consistent with the schema.
/// </summary>
[Serializable]
public class TsCCpxInvalidDataToWriteException : ApplicationException
{
private const string Default = "The object cannot be written because it is not consistent with the schema.";
/// <remarks/>
public TsCCpxInvalidDataToWriteException() : base(Default) { }
/// <remarks/>
public TsCCpxInvalidDataToWriteException(string message) : base(Default + Environment.NewLine + message) { }
/// <remarks/>
public TsCCpxInvalidDataToWriteException(Exception e) : base(Default, e) { }
/// <remarks/>
public TsCCpxInvalidDataToWriteException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
/// <remarks/>
protected TsCCpxInvalidDataToWriteException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
/// <summary>
/// Raised if the data in buffer is not consistent with the schema.
/// </summary>
[Serializable]
public class TsCCpxInvalidDataToWriteException : ApplicationException
{
private const string Default = "The object cannot be written because it is not consistent with the schema.";
/// <remarks/>
public TsCCpxInvalidDataToWriteException() : base(Default) { }
/// <remarks/>
public TsCCpxInvalidDataToWriteException(string message) : base(Default + Environment.NewLine + message) { }
/// <remarks/>
public TsCCpxInvalidDataToWriteException(Exception e) : base(Default, e) { }
/// <remarks/>
public TsCCpxInvalidDataToWriteException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
/// <remarks/>
protected TsCCpxInvalidDataToWriteException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}

View File

@@ -27,22 +27,22 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient.Cpx
{
/// <summary>
/// Raised if the schema contains errors or inconsistencies.
/// </summary>
[Serializable]
public class TsCCpxInvalidSchemaException : ApplicationException
{
private const string Default = "The schema cannot be used because it contains errors or inconsitencies.";
/// <remarks/>
public TsCCpxInvalidSchemaException() : base(Default) { }
/// <remarks/>
public TsCCpxInvalidSchemaException(string message) : base(Default + Environment.NewLine + message) { }
/// <remarks/>
public TsCCpxInvalidSchemaException(Exception e) : base(Default, e) { }
/// <remarks/>
public TsCCpxInvalidSchemaException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
/// <remarks/>
protected TsCCpxInvalidSchemaException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
/// <summary>
/// Raised if the schema contains errors or inconsistencies.
/// </summary>
[Serializable]
public class TsCCpxInvalidSchemaException : ApplicationException
{
private const string Default = "The schema cannot be used because it contains errors or inconsitencies.";
/// <remarks/>
public TsCCpxInvalidSchemaException() : base(Default) { }
/// <remarks/>
public TsCCpxInvalidSchemaException(string message) : base(Default + Environment.NewLine + message) { }
/// <remarks/>
public TsCCpxInvalidSchemaException(Exception e) : base(Default, e) { }
/// <remarks/>
public TsCCpxInvalidSchemaException(string message, Exception innerException) : base(Default + Environment.NewLine + message, innerException) { }
/// <remarks/>
protected TsCCpxInvalidSchemaException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}

View File

@@ -25,21 +25,21 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// <para>Defines possible item access rights.</para>
/// <para align="left">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.</para>
/// </summary>
public enum TsDaAccessRights
/// <summary>
/// <para>Defines possible item access rights.</para>
/// <para align="left">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.</para>
/// </summary>
public enum TsDaAccessRights
{
/// <summary>The access rights for this item are server.</summary>
Unknown = 0x00,
/// <summary>The client can read the data item's value.</summary>
Readable = 0x01,
/// <summary>The client can change the data item's value.</summary>
Writable = 0x02,
/// <summary>The client can read and change the data item's value.</summary>
ReadWritable = 0x03
}
/// <summary>The access rights for this item are server.</summary>
Unknown = 0x00,
/// <summary>The client can read the data item's value.</summary>
Readable = 0x01,
/// <summary>The client can change the data item's value.</summary>
Writable = 0x02,
/// <summary>The client can read and change the data item's value.</summary>
ReadWritable = 0x03
}
}

View File

@@ -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
/// <summary>
/// Saves the parameters for an incomplete browse information.
/// </summary>
public TsCDaBrowsePosition(OpcItem itemId, TsCDaBrowseFilters filters)
{
if (filters == null) throw new ArgumentNullException(nameof(filters));
/// Saves the parameters for an incomplete browse information.
/// </summary>
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();
}
/// <summary>
/// Releases unmanaged resources held by the object.
/// </summary>
public virtual void Dispose()
{
// does nothing.
}
/// <summary>
/// Releases unmanaged resources held by the object.
/// </summary>
public virtual void Dispose()
{
// does nothing.
}
#endregion
#region Properties
#region Properties
/// <summary>
/// The item identifier of the branch being browsed.
/// </summary>
@@ -73,21 +73,21 @@ namespace Technosoftware.DaAeHdaClient.Da
/// The maximum number of elements that may be returned in a single browse.
/// </summary>
// 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
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
public virtual object Clone()
{
return (TsCDaBrowsePosition)MemberwiseClone();
}
#endregion
}
}
}

View File

@@ -26,62 +26,62 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Contains a description of an element in the server address space.
/// </summary>
[Serializable]
public class TsCDaBrowseElement : ICloneable
{
#region Fields
/// <summary>
/// Contains a description of an element in the server address space.
/// </summary>
[Serializable]
public class TsCDaBrowseElement : ICloneable
{
#region Fields
private TsCDaItemProperty[] itemProperties_ = new TsCDaItemProperty[0];
#endregion
#region Properties
#region Properties
/// <summary>
/// A descriptive name for element that is unique within a branch.
/// </summary>
public string Name { get; set; }
/// A descriptive name for element that is unique within a branch.
/// </summary>
public string Name { get; set; }
/// <summary>
/// The primary identifier for the element within the server namespace.
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// The primary identifier for the element within the server namespace.
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// An secondary identifier for the element within the server namespace.
/// </summary>
public string ItemPath { get; set; }
/// <summary>
/// An secondary identifier for the element within the server namespace.
/// </summary>
public string ItemPath { get; set; }
/// <summary>
/// Whether the element refers to an item with data that can be accessed.
/// </summary>
public bool IsItem { get; set; }
/// <summary>
/// Whether the element refers to an item with data that can be accessed.
/// </summary>
public bool IsItem { get; set; }
/// <summary>
/// Whether the element has children.
/// </summary>
public bool HasChildren { get; set; }
/// <summary>
/// Whether the element has children.
/// </summary>
public bool HasChildren { get; set; }
/// <summary>
/// The set of properties for the element.
/// </summary>
public TsCDaItemProperty[] Properties
{
get => itemProperties_;
/// <summary>
/// The set of properties for the element.
/// </summary>
public TsCDaItemProperty[] Properties
{
get => itemProperties_;
set => itemProperties_ = value;
}
#endregion
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaBrowseElement)MemberwiseClone();
clone.itemProperties_ = (TsCDaItemProperty[])OpcConvert.Clone(itemProperties_);
return clone;
}
#endregion
};
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaBrowseElement)MemberwiseClone();
clone.itemProperties_ = (TsCDaItemProperty[])OpcConvert.Clone(itemProperties_);
return clone;
}
#endregion
};
}

View File

@@ -25,24 +25,24 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// The type of browse elements to return during a browse.
/// </summary>
public enum TsCDaBrowseFilter
{
/// <summary>
/// Return all types of browse elements.
/// </summary>
All,
/// <summary>
/// The type of browse elements to return during a browse.
/// </summary>
public enum TsCDaBrowseFilter
{
/// <summary>
/// Return all types of browse elements.
/// </summary>
All,
/// <summary>
/// Return only elements that contain other elements.
/// </summary>
Branch,
/// <summary>
/// Return only elements that contain other elements.
/// </summary>
Branch,
/// <summary>
/// Return only elements that represent items.
/// </summary>
Item
}
/// <summary>
/// Return only elements that represent items.
/// </summary>
Item
}
}

View File

@@ -26,72 +26,72 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Defines a set of filters to apply when browsing.
/// </summary>
[Serializable]
public class TsCDaBrowseFilters : ICloneable
{
#region Fields
/// <summary>
/// Defines a set of filters to apply when browsing.
/// </summary>
[Serializable]
public class TsCDaBrowseFilters : ICloneable
{
#region Fields
private TsCDaBrowseFilter browseFilter_ = TsCDaBrowseFilter.All;
private TsDaPropertyID[] propertyIds_;
private TsDaPropertyID[] propertyIds_;
#endregion
#region Properties
#region Properties
/// <summary>
/// The maximum number of elements to return. Zero means no limit.
/// </summary>
public int MaxElementsReturned { get; set; }
/// The maximum number of elements to return. Zero means no limit.
/// </summary>
public int MaxElementsReturned { get; set; }
/// <summary>
/// The type of element to return.
/// </summary>
public TsCDaBrowseFilter BrowseFilter
{
get => browseFilter_;
/// <summary>
/// The type of element to return.
/// </summary>
public TsCDaBrowseFilter BrowseFilter
{
get => browseFilter_;
set => browseFilter_ = value;
}
/// <summary>
/// An expression used to match the name of the element.
/// </summary>
public string ElementNameFilter { get; set; }
/// <summary>
/// An expression used to match the name of the element.
/// </summary>
public string ElementNameFilter { get; set; }
/// <summary>
/// A filter which has semantics that defined by the server.
/// </summary>
public string VendorFilter { get; set; }
/// <summary>
/// A filter which has semantics that defined by the server.
/// </summary>
public string VendorFilter { get; set; }
/// <summary>
/// Whether all supported properties to return with each element.
/// </summary>
public bool ReturnAllProperties { get; set; }
/// <summary>
/// Whether all supported properties to return with each element.
/// </summary>
public bool ReturnAllProperties { get; set; }
/// <summary>
/// A list of names of the properties to return with each element.
/// </summary>
public TsDaPropertyID[] PropertyIDs
{
get => propertyIds_;
/// <summary>
/// A list of names of the properties to return with each element.
/// </summary>
public TsDaPropertyID[] PropertyIDs
{
get => propertyIds_;
set => propertyIds_ = value;
}
/// <summary>
/// Whether property values should be returned with the properties.
/// </summary>
public bool ReturnPropertyValues { get; set; }
/// <summary>
/// Whether property values should be returned with the properties.
/// </summary>
public bool ReturnPropertyValues { get; set; }
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaBrowseFilters)MemberwiseClone();
clone.PropertyIDs = (TsDaPropertyID[])PropertyIDs?.Clone();
return clone;
}
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaBrowseFilters)MemberwiseClone();
clone.PropertyIDs = (TsDaPropertyID[])PropertyIDs?.Clone();
return clone;
}
#endregion
}
}
}

View File

@@ -25,21 +25,21 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary><para>Defines possible item engineering unit types</para></summary>
public enum TsDaEuType
/// <summary><para>Defines possible item engineering unit types</para></summary>
public enum TsDaEuType
{
/// <summary>No engineering unit information available</summary>
NoEnum = 0x01,
/// <summary>
/// Analog engineering unit - will contain a SAFE ARRAY of exactly two doubles
/// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
/// </summary>
Analog = 0x02,
/// <summary>
/// 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.)
/// </summary>
Enumerated = 0x03
}
/// <summary>No engineering unit information available</summary>
NoEnum = 0x01,
/// <summary>
/// Analog engineering unit - will contain a SAFE ARRAY of exactly two doubles
/// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
/// </summary>
Analog = 0x02,
/// <summary>
/// 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.)
/// </summary>
Enumerated = 0x03
}
}

View File

@@ -25,22 +25,22 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Defines functionality that is common to all OPC Data Access servers.
/// </summary>
public interface ITsDaServer : IOpcServer
{
/// <summary>
/// Returns the filters applied by the server to any item results returned to the client.
/// </summary>
/// <returns>A bit mask indicating which fields should be returned in any item results.</returns>
int GetResultFilters();
/// <summary>
/// Defines functionality that is common to all OPC Data Access servers.
/// </summary>
public interface ITsDaServer : IOpcServer
{
/// <summary>
/// Returns the filters applied by the server to any item results returned to the client.
/// </summary>
/// <returns>A bit mask indicating which fields should be returned in any item results.</returns>
int GetResultFilters();
/// <summary>
/// Sets the filters applied by the server to any item results returned to the client.
/// </summary>
/// <param name="filters">A bit mask indicating which fields should be returned in any item results.</param>
void SetResultFilters(int filters);
/// <summary>
/// Sets the filters applied by the server to any item results returned to the client.
/// </summary>
/// <param name="filters">A bit mask indicating which fields should be returned in any item results.</param>
void SetResultFilters(int filters);
/// <summary>
/// Returns the current server status.
@@ -48,62 +48,62 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <returns>The current server status.</returns>
OpcServerStatus GetServerStatus();
/// <summary>
/// Reads the current values for a set of items.
/// </summary>
/// <param name="items">The set of items to read.</param>
/// <returns>The results of the read operation for each item.</returns>
TsCDaItemValueResult[] Read(TsCDaItem[] items);
/// <summary>
/// Reads the current values for a set of items.
/// </summary>
/// <param name="items">The set of items to read.</param>
/// <returns>The results of the read operation for each item.</returns>
TsCDaItemValueResult[] Read(TsCDaItem[] items);
/// <summary>
/// Writes the value, quality and timestamp for a set of items.
/// </summary>
/// <param name="values">The set of item values to write.</param>
/// <returns>The results of the write operation for each item.</returns>
OpcItemResult[] Write(TsCDaItemValue[] values);
/// <summary>
/// Writes the value, quality and timestamp for a set of items.
/// </summary>
/// <param name="values">The set of item values to write.</param>
/// <returns>The results of the write operation for each item.</returns>
OpcItemResult[] Write(TsCDaItemValue[] values);
/// <summary>
/// Creates a new subscription.
/// </summary>
/// <param name="state">The initial state of the subscription.</param>
/// <returns>The new subscription object.</returns>
ITsCDaSubscription CreateSubscription(TsCDaSubscriptionState state);
/// <summary>
/// Creates a new subscription.
/// </summary>
/// <param name="state">The initial state of the subscription.</param>
/// <returns>The new subscription object.</returns>
ITsCDaSubscription CreateSubscription(TsCDaSubscriptionState state);
/// <summary>
/// Cancels a subscription and releases all resources allocated for it.
/// </summary>
/// <param name="subscription">The subscription to cancel.</param>
void CancelSubscription(ITsCDaSubscription subscription);
/// <summary>
/// Cancels a subscription and releases all resources allocated for it.
/// </summary>
/// <param name="subscription">The subscription to cancel.</param>
void CancelSubscription(ITsCDaSubscription subscription);
/// <summary>
/// Fetches the children of a branch that meet the filter criteria.
/// </summary>
/// <param name="itemId">The identifier of branch which is the target of the search.</param>
/// <param name="filters">The filters to use to limit the set of child elements returned.</param>
/// <param name="position">An object used to continue a browse that could not be completed.</param>
/// <returns>The set of elements found.</returns>
TsCDaBrowseElement[] Browse(
OpcItem itemId,
TsCDaBrowseFilters filters,
out TsCDaBrowsePosition position);
/// <summary>
/// Fetches the children of a branch that meet the filter criteria.
/// </summary>
/// <param name="itemId">The identifier of branch which is the target of the search.</param>
/// <param name="filters">The filters to use to limit the set of child elements returned.</param>
/// <param name="position">An object used to continue a browse that could not be completed.</param>
/// <returns>The set of elements found.</returns>
TsCDaBrowseElement[] Browse(
OpcItem itemId,
TsCDaBrowseFilters filters,
out TsCDaBrowsePosition position);
/// <summary>
/// Continues a browse operation with previously specified search criteria.
/// </summary>
/// <param name="position">An object containing the browse operation state information.</param>
/// <returns>The set of elements found.</returns>
TsCDaBrowseElement[] BrowseNext(ref TsCDaBrowsePosition position);
/// <summary>
/// Continues a browse operation with previously specified search criteria.
/// </summary>
/// <param name="position">An object containing the browse operation state information.</param>
/// <returns>The set of elements found.</returns>
TsCDaBrowseElement[] BrowseNext(ref TsCDaBrowsePosition position);
/// <summary>
/// Returns the item properties for a set of items.
/// </summary>
/// <param name="itemIds">A list of item identifiers.</param>
/// <param name="propertyIDs">A list of properties to fetch for each item.</param>
/// <param name="returnValues">Whether the property values should be returned with the properties.</param>
/// <returns>A list of properties for each item.</returns>
TsCDaItemPropertyCollection[] GetProperties(
OpcItem[] itemIds,
TsDaPropertyID[] propertyIDs,
bool returnValues);
}
/// <summary>
/// Returns the item properties for a set of items.
/// </summary>
/// <param name="itemIds">A list of item identifiers.</param>
/// <param name="propertyIDs">A list of properties to fetch for each item.</param>
/// <param name="returnValues">Whether the property values should be returned with the properties.</param>
/// <returns>A list of properties for each item.</returns>
TsCDaItemPropertyCollection[] GetProperties(
OpcItem[] itemIds,
TsDaPropertyID[] propertyIDs,
bool returnValues);
}
}

View File

@@ -27,89 +27,89 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// A subscription for a set of items on a single OPC server.
/// </summary>
public interface ITsCDaSubscription : IDisposable
{
#region Events
/// <summary>
/// A subscription for a set of items on a single OPC server.
/// </summary>
public interface ITsCDaSubscription : IDisposable
{
#region Events
/// <summary>
/// An event to receive data change updates.
/// </summary>
event TsCDaDataChangedEventHandler DataChangedEvent;
#endregion
#region Result Filters
#region Result Filters
/// <summary>
/// Returns the filters applied by the server to any item results returned to the client.
/// </summary>
/// <returns>A bit mask indicating which fields should be returned in any item results.</returns>
int GetResultFilters();
/// Returns the filters applied by the server to any item results returned to the client.
/// </summary>
/// <returns>A bit mask indicating which fields should be returned in any item results.</returns>
int GetResultFilters();
/// <summary>
/// Sets the filters applied by the server to any item results returned to the client.
/// </summary>
/// <param name="filters">A bit mask indicating which fields should be returned in any item results.</param>
void SetResultFilters(int filters);
/// <summary>
/// Sets the filters applied by the server to any item results returned to the client.
/// </summary>
/// <param name="filters">A bit mask indicating which fields should be returned in any item results.</param>
void SetResultFilters(int filters);
#endregion
#region State Management
#region State Management
/// <summary>
/// Returns the current state of the subscription.
/// </summary>
/// <returns>The current state of the subscription.</returns>
TsCDaSubscriptionState GetState();
/// Returns the current state of the subscription.
/// </summary>
/// <returns>The current state of the subscription.</returns>
TsCDaSubscriptionState GetState();
/// <summary>
/// Changes the state of a subscription.
/// </summary>
/// <param name="masks">A bit mask that indicates which elements of the subscription state are changing.</param>
/// <param name="state">The new subscription state.</param>
/// <returns>The actual subscription state after applying the changes.</returns>
TsCDaSubscriptionState ModifyState(int masks, TsCDaSubscriptionState state);
/// <summary>
/// Changes the state of a subscription.
/// </summary>
/// <param name="masks">A bit mask that indicates which elements of the subscription state are changing.</param>
/// <param name="state">The new subscription state.</param>
/// <returns>The actual subscription state after applying the changes.</returns>
TsCDaSubscriptionState ModifyState(int masks, TsCDaSubscriptionState state);
#endregion
#region Item Management
#region Item Management
/// <summary>
/// Adds items to the subscription.
/// </summary>
/// <param name="items">The set of items to add to the subscription.</param>
/// <returns>The results of the add item operation for each item.</returns>
TsCDaItemResult[] AddItems(TsCDaItem[] items);
/// Adds items to the subscription.
/// </summary>
/// <param name="items">The set of items to add to the subscription.</param>
/// <returns>The results of the add item operation for each item.</returns>
TsCDaItemResult[] AddItems(TsCDaItem[] items);
/// <summary>
/// Modifies the state of items in the subscription
/// </summary>
/// <param name="masks">Specifies which item state parameters are being modified.</param>
/// <param name="items">The new state for each item.</param>
/// <returns>The results of the modify item operation for each item.</returns>
TsCDaItemResult[] ModifyItems(int masks, TsCDaItem[] items);
/// <summary>
/// Modifies the state of items in the subscription
/// </summary>
/// <param name="masks">Specifies which item state parameters are being modified.</param>
/// <param name="items">The new state for each item.</param>
/// <returns>The results of the modify item operation for each item.</returns>
TsCDaItemResult[] ModifyItems(int masks, TsCDaItem[] items);
/// <summary>
/// Removes items from the subscription.
/// </summary>
/// <param name="items">The identifiers (i.e. server handles) for the items being removed.</param>
/// <returns>The results of the remove item operation for each item.</returns>
OpcItemResult[] RemoveItems(OpcItem[] items);
/// <summary>
/// Removes items from the subscription.
/// </summary>
/// <param name="items">The identifiers (i.e. server handles) for the items being removed.</param>
/// <returns>The results of the remove item operation for each item.</returns>
OpcItemResult[] RemoveItems(OpcItem[] items);
#endregion
#region Synchronous I/O
#region Synchronous I/O
/// <summary>
/// Reads the values for a set of items in the subscription.
/// </summary>
/// <param name="items">The identifiers (i.e. server handles) for the items being read.</param>
/// <returns>The value for each of items.</returns>
TsCDaItemValueResult[] Read(TsCDaItem[] items);
/// Reads the values for a set of items in the subscription.
/// </summary>
/// <param name="items">The identifiers (i.e. server handles) for the items being read.</param>
/// <returns>The value for each of items.</returns>
TsCDaItemValueResult[] Read(TsCDaItem[] items);
/// <summary>
/// Writes the value, quality and timestamp for a set of items in the subscription.
/// </summary>
/// <param name="items">The item values to write.</param>
/// <returns>The results of the write operation for each item.</returns>
OpcItemResult[] Write(TsCDaItemValue[] items);
/// <summary>
/// Writes the value, quality and timestamp for a set of items in the subscription.
/// </summary>
/// <param name="items">The item values to write.</param>
/// <returns>The results of the write operation for each item.</returns>
OpcItemResult[] Write(TsCDaItemValue[] items);
#endregion
#region Asynchronous I/O
#region Asynchronous I/O
/// <summary>
/// Begins an asynchronous read operation for a set of items.
/// </summary>
@@ -145,36 +145,36 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <param name="callback">The function to invoke when the cancel completes.</param>
void Cancel(IOpcRequest request, TsCDaCancelCompleteEventHandler callback);
/// <summary>
/// Causes the server to send a data changed notification for all active items.
/// </summary>
void Refresh();
/// <summary>
/// Causes the server to send a data changed notification for all active items.
/// </summary>
void Refresh();
/// <summary>
/// Causes the server to send a data changed notification for all active items.
/// </summary>
/// <param name="requestHandle">An identifier for the request assigned by the caller.</param>
/// <param name="request">An object that contains the state of the request (used to cancel the request).</param>
/// <returns>A set of results containing any errors encountered when the server validated the items.</returns>
void Refresh(
object requestHandle,
out IOpcRequest request);
/// <summary>
/// Causes the server to send a data changed notification for all active items.
/// </summary>
/// <param name="requestHandle">An identifier for the request assigned by the caller.</param>
/// <param name="request">An object that contains the state of the request (used to cancel the request).</param>
/// <returns>A set of results containing any errors encountered when the server validated the items.</returns>
void Refresh(
object requestHandle,
out IOpcRequest request);
/// <summary>
/// Enables or disables data change notifications from the server.
/// </summary>
/// <param name="enabled">Whether data change notifications are enabled.</param>
void SetEnabled(bool enabled);
/// <summary>
/// Enables or disables data change notifications from the server.
/// </summary>
/// <param name="enabled">Whether data change notifications are enabled.</param>
void SetEnabled(bool enabled);
/// <summary>
/// Checks whether data change notifications from the server are enabled.
/// </summary>
/// <returns>Whether data change notifications are enabled.</returns>
bool GetEnabled();
/// <summary>
/// Checks whether data change notifications from the server are enabled.
/// </summary>
/// <returns>Whether data change notifications are enabled.</returns>
bool GetEnabled();
#endregion
}
}
#region Delegate Declarations
#region Delegate Declarations
/// <summary>
/// A delegate to receive data change updates from the server.
/// </summary>

View File

@@ -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
/// <summary>
/// Initializes the object with default values.
/// </summary>
public TsCDaItem() { }
/// Initializes the object with default values.
/// </summary>
public TsCDaItem() { }
/// <summary>
/// Initializes object with the specified ItemIdentifier object.
/// </summary>
public TsCDaItem(OpcItem item)
/// <summary>
/// Initializes object with the specified ItemIdentifier object.
/// </summary>
public TsCDaItem(OpcItem item)
{
if (item == null)
{
@@ -58,11 +58,11 @@ namespace Technosoftware.DaAeHdaClient.Da
ServerHandle = item.ServerHandle;
}
/// <summary>
/// Initializes object with the specified Item object.
/// </summary>
public TsCDaItem(TsCDaItem item)
: base(item)
/// <summary>
/// Initializes object with the specified Item object.
/// </summary>
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
/// <summary>
/// The data type to use when returning the item value.
/// </summary>
public Type ReqType { get; set; }
public Type ReqType { get; set; }
/// <summary>
/// The oldest (in milliseconds) acceptable cached value when reading an item.

View File

@@ -27,26 +27,26 @@ using System.Collections;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// A collection of items.
/// </summary>
[Serializable]
public class TsCDaItemCollection : ICloneable, IList
{
#region Fields
/// <summary>
/// A collection of items.
/// </summary>
[Serializable]
public class TsCDaItemCollection : ICloneable, IList
{
#region Fields
private ArrayList items_ = new ArrayList();
#endregion
#region Constructors, Destructor, Initialization
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes object with the default values.
/// </summary>
public TsCDaItemCollection() { }
/// Initializes object with the default values.
/// </summary>
public TsCDaItemCollection() { }
/// <summary>
/// Initializes object with the specified ResultCollection object.
/// </summary>
public TsCDaItemCollection(TsCDaItemCollection items)
/// <summary>
/// Initializes object with the specified ResultCollection object.
/// </summary>
public TsCDaItemCollection(TsCDaItemCollection items)
{
if (items == null)
{
@@ -59,59 +59,59 @@ namespace Technosoftware.DaAeHdaClient.Da
}
#endregion
#region Properties
#region Properties
/// <summary>
/// Gets the item at the specified index.
/// </summary>
public TsCDaItem this[int index]
{
get => (TsCDaItem)items_[index];
/// Gets the item at the specified index.
/// </summary>
public TsCDaItem this[int index]
{
get => (TsCDaItem)items_[index];
set => items_[index] = value;
}
/// <summary>
/// Gets the first item with the specified item id.
/// </summary>
public TsCDaItem this[OpcItem itemId]
{
get
{
foreach (TsCDaItem item in items_)
{
if (itemId.Key == item.Key)
{
return item;
}
}
/// <summary>
/// Gets the first item with the specified item id.
/// </summary>
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
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaItemCollection)MemberwiseClone();
/// Creates a deep copy of the object.
/// </summary>
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
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public bool IsSynchronized => false;
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public bool IsSynchronized => false;
/// <summary>
/// Gets the number of objects in the collection.
@@ -128,137 +128,137 @@ namespace Technosoftware.DaAeHdaClient.Da
items_?.CopyTo(array, index);
}
/// <summary>
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaItem[] array, int index)
{
CopyTo((Array)array, index);
}
/// <summary>
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaItem[] array, int index)
{
CopyTo((Array)array, index);
}
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public object SyncRoot => this;
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public object SyncRoot => this;
#endregion
#region IEnumerable Members
#region IEnumerable Members
/// <summary>
/// Returns an enumerator that can iterate through a collection.
/// </summary>
/// <returns>An IEnumerator that can be used to iterate through the collection.</returns>
public IEnumerator GetEnumerator()
{
return items_.GetEnumerator();
}
/// Returns an enumerator that can iterate through a collection.
/// </summary>
/// <returns>An IEnumerator that can be used to iterate through the collection.</returns>
public IEnumerator GetEnumerator()
{
return items_.GetEnumerator();
}
#endregion
#region IList Members
#region IList Members
/// <summary>
/// Gets a value indicating whether the IList is read-only.
/// </summary>
public bool IsReadOnly => false;
/// Gets a value indicating whether the IList is read-only.
/// </summary>
public bool IsReadOnly => false;
/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
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;
}
}
/// <summary>
/// Removes the IList item at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the item to remove.</param>
public void RemoveAt(int index)
{
items_.RemoveAt(index);
}
/// <summary>
/// Removes the IList item at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the item to remove.</param>
public void RemoveAt(int index)
{
items_.RemoveAt(index);
}
/// <summary>
/// Inserts an item to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, object value)
{
if (!typeof(TsCDaItem).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Item objects into the collection.");
}
/// <summary>
/// Inserts an item to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
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);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(object value)
{
items_.Remove(value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(object value)
{
items_.Remove(value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(object value)
{
return items_.Contains(value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(object value)
{
return items_.Contains(value);
}
/// <summary>
/// Removes all items from the IList.
/// </summary>
public void Clear()
{
items_.Clear();
}
/// <summary>
/// Removes all items from the IList.
/// </summary>
public void Clear()
{
items_.Clear();
}
/// <summary>
/// Determines the index of a specific item in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(object value)
{
return items_.IndexOf(value);
}
/// <summary>
/// Determines the index of a specific item in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(object value)
{
return items_.IndexOf(value);
}
/// <summary>
/// Adds an item to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(object value)
{
if (!typeof(TsCDaItem).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Item objects into the collection.");
}
/// <summary>
/// Adds an item to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
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);
}
/// <summary>
/// Indicates whether the IList has a fixed size.
/// </summary>
public bool IsFixedSize => false;
/// <summary>
/// Indicates whether the IList has a fixed size.
/// </summary>
public bool IsFixedSize => false;
/// <summary>
/// Inserts an item to the IList at the specified position.
@@ -266,48 +266,48 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, TsCDaItem value)
{
Insert(index, (object)value);
}
{
Insert(index, (object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaItem value)
{
Remove((object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaItem value)
{
Remove((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaItem value)
{
return Contains((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaItem value)
{
return Contains((object)value);
}
/// <summary>
/// Determines the index of a specific item in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaItem value)
{
return IndexOf((object)value);
}
/// <summary>
/// Determines the index of a specific item in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaItem value)
{
return IndexOf((object)value);
}
/// <summary>
/// Adds an item to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaItem value)
{
return Add((object)value);
}
/// <summary>
/// Adds an item to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaItem value)
{
return Add((object)value);
}
#endregion
}
}
}

View File

@@ -26,75 +26,75 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Contains a description of a single item property.
/// </summary>
[Serializable]
public class TsCDaItemProperty : ICloneable, IOpcResult
{
#region Fields
/// <summary>
/// Contains a description of a single item property.
/// </summary>
[Serializable]
public class TsCDaItemProperty : ICloneable, IOpcResult
{
#region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
#region Properties
#region Properties
/// <summary>
/// The property identifier.
/// </summary>
public TsDaPropertyID ID { get; set; }
/// <summary>
/// The property identifier.
/// </summary>
public TsDaPropertyID ID { get; set; }
/// <summary>
/// A short description of the property.
/// </summary>
public string Description { get; set; }
/// <summary>
/// A short description of the property.
/// </summary>
public string Description { get; set; }
/// <summary>
/// The data type of the property.
/// </summary>
public Type DataType { get; set; }
/// <summary>
/// The data type of the property.
/// </summary>
public Type DataType { get; set; }
/// <summary>
/// The value of the property.
/// </summary>
public object Value { get; set; }
/// <summary>
/// The value of the property.
/// </summary>
public object Value { get; set; }
/// <summary>
/// The primary identifier for the property if it is directly accessible as an item.
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// The primary identifier for the property if it is directly accessible as an item.
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// The secondary identifier for the property if it is directly accessible as an item.
/// </summary>
public string ItemPath { get; set; }
/// <summary>
/// The secondary identifier for the property if it is directly accessible as an item.
/// </summary>
public string ItemPath { get; set; }
#endregion
#region IOpcResult Members
#region IOpcResult Members
/// <summary>
/// The <see cref="OpcResult" /> object with the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
/// The <see cref="OpcResult" /> object with the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
set => result_ = value;
}
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaItemProperty)MemberwiseClone();
clone.Value = OpcConvert.Clone(Value);
return clone;
}
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaItemProperty)MemberwiseClone();
clone.Value = OpcConvert.Clone(Value);
return clone;
}
#endregion
}
}
}

View File

@@ -27,149 +27,149 @@ using System.Collections;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// A list of properties for a single item.
/// </summary>
[Serializable]
public class TsCDaItemPropertyCollection : ArrayList, IOpcResult
{
#region Fields
/// <summary>
/// A list of properties for a single item.
/// </summary>
[Serializable]
public class TsCDaItemPropertyCollection : ArrayList, IOpcResult
{
#region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
#region Constructors, Destructor, Initialization
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes the object with its default values.
/// </summary>
public TsCDaItemPropertyCollection()
{
}
/// Initializes the object with its default values.
/// </summary>
public TsCDaItemPropertyCollection()
{
}
/// <summary>
/// Initializes the object with the specified item identifier.
/// </summary>
public TsCDaItemPropertyCollection(OpcItem itemId)
{
if (itemId != null)
{
ItemName = itemId.ItemName;
ItemPath = itemId.ItemPath;
}
}
/// <summary>
/// Initializes the object with the specified item identifier.
/// </summary>
public TsCDaItemPropertyCollection(OpcItem itemId)
{
if (itemId != null)
{
ItemName = itemId.ItemName;
ItemPath = itemId.ItemPath;
}
}
/// <summary>
/// Initializes the object with the specified item identifier and result.
/// </summary>
public TsCDaItemPropertyCollection(OpcItem itemId, OpcResult result)
{
if (itemId != null)
{
ItemName = itemId.ItemName;
ItemPath = itemId.ItemPath;
}
/// <summary>
/// Initializes the object with the specified item identifier and result.
/// </summary>
public TsCDaItemPropertyCollection(OpcItem itemId, OpcResult result)
{
if (itemId != null)
{
ItemName = itemId.ItemName;
ItemPath = itemId.ItemPath;
}
result_ = result;
}
result_ = result;
}
#endregion
#region Properties
#region Properties
/// <summary>
/// The primary identifier for the item within the server namespace.
/// </summary>
public string ItemName { get; set; }
/// The primary identifier for the item within the server namespace.
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// An secondary identifier for the item within the server namespace.
/// </summary>
public string ItemPath { get; set; }
/// <summary>
/// An secondary identifier for the item within the server namespace.
/// </summary>
public string ItemPath { get; set; }
/// <summary>
/// Accesses the items at the specified index.
/// </summary>
public new TsCDaItemProperty this[int index]
{
get => (TsCDaItemProperty)base[index];
/// <summary>
/// Accesses the items at the specified index.
/// </summary>
public new TsCDaItemProperty this[int index]
{
get => (TsCDaItemProperty)base[index];
set => base[index] = value;
}
#endregion
#region IOpcResult Members
#region IOpcResult Members
/// <summary>
/// The error id for the result of an operation on an item.
/// </summary>
public OpcResult Result
{
get => result_;
/// The error id for the result of an operation on an item.
/// </summary>
public OpcResult Result
{
get => result_;
set => result_ = value;
}
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
#endregion
#region ICollection Members
/// <summary>
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaItemProperty[] array, int index)
{
CopyTo((Array)array, index);
}
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
#endregion
#region IList Members
#region ICollection Members
/// <summary>
/// Inserts an item to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, TsCDaItemProperty value)
{
Insert(index, (object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaItemProperty value)
{
Remove((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaItemProperty value)
{
return Contains((object)value);
}
/// <summary>
/// Determines the index of a specific item in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaItemProperty value)
{
return IndexOf((object)value);
}
/// <summary>
/// Adds an item to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaItemProperty value)
{
return Add((object)value);
}
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaItemProperty[] array, int index)
{
CopyTo((Array)array, index);
}
#endregion
}
#region IList Members
/// <summary>
/// Inserts an item to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, TsCDaItemProperty value)
{
Insert(index, (object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaItemProperty value)
{
Remove((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaItemProperty value)
{
return Contains((object)value);
}
/// <summary>
/// Determines the index of a specific item in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaItemProperty value)
{
return IndexOf((object)value);
}
/// <summary>
/// Adds an item to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaItemProperty value)
{
return Add((object)value);
}
#endregion
}
}

View File

@@ -26,79 +26,79 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// The results of an operation on a uniquely identifiable item.
/// </summary>
[Serializable]
public class TsCDaItemResult : TsCDaItem, IOpcResult
{
#region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes the object with default values.
/// </summary>
public TsCDaItemResult() { }
/// <summary>
/// Initializes the object with an ItemIdentifier object.
/// </summary>
public TsCDaItemResult(OpcItem item) : base(item) { }
/// <summary>
/// Initializes the object with an ItemIdentifier object and Result.
/// </summary>
public TsCDaItemResult(OpcItem item, OpcResult resultId)
: base(item)
{
Result = resultId;
}
/// <summary>
/// Initializes the object with an Item object.
/// </summary>
public TsCDaItemResult(TsCDaItem item) : base(item) { }
/// <summary>
/// Initializes the object with an Item object and Result.
/// </summary>
public TsCDaItemResult(TsCDaItem item, OpcResult resultId)
: base(item)
{
Result = resultId;
}
/// <summary>
/// Initializes object with the specified ItemResult object.
/// </summary>
public TsCDaItemResult(TsCDaItemResult item)
: base(item)
{
if (item != null)
{
Result = item.Result;
DiagnosticInfo = item.DiagnosticInfo;
}
}
/// <summary>
/// The results of an operation on a uniquely identifiable item.
/// </summary>
[Serializable]
public class TsCDaItemResult : TsCDaItem, IOpcResult
{
#region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
#region IOpcResult Members
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes the object with default values.
/// </summary>
public TsCDaItemResult() { }
/// <summary>
/// The error id for the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
/// <summary>
/// Initializes the object with an ItemIdentifier object.
/// </summary>
public TsCDaItemResult(OpcItem item) : base(item) { }
/// <summary>
/// Initializes the object with an ItemIdentifier object and Result.
/// </summary>
public TsCDaItemResult(OpcItem item, OpcResult resultId)
: base(item)
{
Result = resultId;
}
/// <summary>
/// Initializes the object with an Item object.
/// </summary>
public TsCDaItemResult(TsCDaItem item) : base(item) { }
/// <summary>
/// Initializes the object with an Item object and Result.
/// </summary>
public TsCDaItemResult(TsCDaItem item, OpcResult resultId)
: base(item)
{
Result = resultId;
}
/// <summary>
/// Initializes object with the specified ItemResult object.
/// </summary>
public TsCDaItemResult(TsCDaItemResult item)
: base(item)
{
if (item != null)
{
Result = item.Result;
DiagnosticInfo = item.DiagnosticInfo;
}
}
#endregion
#region IOpcResult Members
/// <summary>
/// The error id for the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
set => result_ = value;
}
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
#endregion
}
}
}

View File

@@ -27,27 +27,27 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Contains the value for a single item.
/// </summary>
[Serializable]
public class TsCDaItemValue : OpcItem
{
#region Fields
/// <summary>
/// Contains the value for a single item.
/// </summary>
[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
/// <summary>
/// Initializes the object with default values.
/// </summary>
public TsCDaItemValue() { }
/// Initializes the object with default values.
/// </summary>
public TsCDaItemValue() { }
/// <summary>
/// Initializes the object with and ItemIdentifier object.
/// </summary>
public TsCDaItemValue(OpcItem item)
/// <summary>
/// Initializes the object with and ItemIdentifier object.
/// </summary>
public TsCDaItemValue(OpcItem item)
{
if (item == null)
{
@@ -59,19 +59,19 @@ namespace Technosoftware.DaAeHdaClient.Da
ServerHandle = item.ServerHandle;
}
/// <summary>
/// Initializes the object with the specified item name.
/// </summary>
public TsCDaItemValue(string itemName)
: base(itemName)
{
}
/// <summary>
/// Initializes the object with the specified item name.
/// </summary>
public TsCDaItemValue(string itemName)
: base(itemName)
{
}
/// <summary>
/// Initializes object with the specified ItemValue object.
/// </summary>
public TsCDaItemValue(TsCDaItemValue item)
: base(item)
/// <summary>
/// Initializes object with the specified ItemValue object.
/// </summary>
public TsCDaItemValue(TsCDaItemValue item)
: base(item)
{
if (item == null)
{
@@ -85,53 +85,53 @@ namespace Technosoftware.DaAeHdaClient.Da
}
#endregion
#region Properties
#region Properties
/// <summary>
/// The item value.
/// </summary>
public object Value { get; set; }
/// The item value.
/// </summary>
public object Value { get; set; }
/// <summary>
/// The quality of the item value.
/// </summary>
public TsCDaQuality Quality
{
get => daQuality_;
/// <summary>
/// The quality of the item value.
/// </summary>
public TsCDaQuality Quality
{
get => daQuality_;
set => daQuality_ = value;
}
/// <summary>
/// Whether the quality is specified.
/// </summary>
public bool QualitySpecified { get; set; }
/// <summary>
/// Whether the quality is specified.
/// </summary>
public bool QualitySpecified { get; set; }
/// <summary>
/// The timestamp for the item value.
/// The <see cref="ApplicationInstance.TimeAsUtc">ApplicationInstance.TimeAsUtc</see> property defines
/// the time format (UTC or local time).
/// </summary>
public DateTime Timestamp
{
get => timestamp_;
/// <summary>
/// The timestamp for the item value.
/// The <see cref="ApplicationInstance.TimeAsUtc">ApplicationInstance.TimeAsUtc</see> property defines
/// the time format (UTC or local time).
/// </summary>
public DateTime Timestamp
{
get => timestamp_;
set => timestamp_ = value;
}
/// <summary>
/// Whether the timestamp is specified.
/// </summary>
public bool TimestampSpecified { get; set; }
/// <summary>
/// Whether the timestamp is specified.
/// </summary>
public bool TimestampSpecified { get; set; }
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public override object Clone()
{
var clone = (TsCDaItemValue)MemberwiseClone();
clone.Value = OpcConvert.Clone(Value);
return clone;
}
/// Creates a deep copy of the object.
/// </summary>
public override object Clone()
{
var clone = (TsCDaItemValue)MemberwiseClone();
clone.Value = OpcConvert.Clone(Value);
return clone;
}
#endregion
}
}
}

View File

@@ -26,98 +26,98 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// The results of an operation on a uniquely identifiable item value.
/// </summary>
[Serializable]
public class TsCDaItemValueResult : TsCDaItemValue, IOpcResult
{
#region Fields
/// <summary>
/// The results of an operation on a uniquely identifiable item value.
/// </summary>
[Serializable]
public class TsCDaItemValueResult : TsCDaItemValue, IOpcResult
{
#region Fields
private OpcResult result_ = OpcResult.S_OK;
#endregion
#region Constructors, Destructor, Initialization
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes the object with default values.
/// </summary>
public TsCDaItemValueResult() { }
/// Initializes the object with default values.
/// </summary>
public TsCDaItemValueResult() { }
/// <summary>
/// Initializes the object with an ItemIdentifier object.
/// </summary>
public TsCDaItemValueResult(OpcItem item) : base(item) { }
/// <summary>
/// Initializes the object with an ItemIdentifier object.
/// </summary>
public TsCDaItemValueResult(OpcItem item) : base(item) { }
/// <summary>
/// Initializes the object with an ItemValue object.
/// </summary>
public TsCDaItemValueResult(TsCDaItemValue item) : base(item) { }
/// <summary>
/// Initializes the object with an ItemValue object.
/// </summary>
public TsCDaItemValueResult(TsCDaItemValue item) : base(item) { }
/// <summary>
/// Initializes object with the specified ItemValueResult object.
/// </summary>
public TsCDaItemValueResult(TsCDaItemValueResult item)
: base(item)
{
if (item != null)
{
Result = item.Result;
DiagnosticInfo = item.DiagnosticInfo;
}
}
/// <summary>
/// Initializes object with the specified ItemValueResult object.
/// </summary>
public TsCDaItemValueResult(TsCDaItemValueResult item)
: base(item)
{
if (item != null)
{
Result = item.Result;
DiagnosticInfo = item.DiagnosticInfo;
}
}
/// <summary>
/// Initializes the object with the specified item name and result code.
/// </summary>
public TsCDaItemValueResult(string itemName, OpcResult resultId)
: base(itemName)
{
Result = resultId;
}
/// <summary>
/// Initializes the object with the specified item name and result code.
/// </summary>
public TsCDaItemValueResult(string itemName, OpcResult resultId)
: base(itemName)
{
Result = resultId;
}
/// <summary>
/// Initializes the object with the specified item name, result code and diagnostic info.
/// </summary>
public TsCDaItemValueResult(string itemName, OpcResult resultId, string diagnosticInfo)
: base(itemName)
{
Result = resultId;
DiagnosticInfo = diagnosticInfo;
}
/// <summary>
/// Initializes the object with the specified item name, result code and diagnostic info.
/// </summary>
public TsCDaItemValueResult(string itemName, OpcResult resultId, string diagnosticInfo)
: base(itemName)
{
Result = resultId;
DiagnosticInfo = diagnosticInfo;
}
/// <summary>
/// Initialize object with the specified ItemIdentifier and result code.
/// </summary>
public TsCDaItemValueResult(OpcItem item, OpcResult resultId)
: base(item)
{
Result = resultId;
}
/// <summary>
/// Initialize object with the specified ItemIdentifier and result code.
/// </summary>
public TsCDaItemValueResult(OpcItem item, OpcResult resultId)
: base(item)
{
Result = resultId;
}
/// <summary>
/// Initializes the object with the specified ItemIdentifier, result code and diagnostic info.
/// </summary>
public TsCDaItemValueResult(OpcItem item, OpcResult resultId, string diagnosticInfo)
: base(item)
{
Result = resultId;
DiagnosticInfo = diagnosticInfo;
}
/// <summary>
/// Initializes the object with the specified ItemIdentifier, result code and diagnostic info.
/// </summary>
public TsCDaItemValueResult(OpcItem item, OpcResult resultId, string diagnosticInfo)
: base(item)
{
Result = resultId;
DiagnosticInfo = diagnosticInfo;
}
#endregion
#region IOpcResult Members
#region IOpcResult Members
/// <summary>
/// The error id for the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
/// The error id for the result of an operation on an property.
/// </summary>
public OpcResult Result
{
get => result_;
set => result_ = value;
}
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
/// <summary>
/// Vendor specific diagnostic information (not the localized error text).
/// </summary>
public string DiagnosticInfo { get; set; }
#endregion
}
}
}

View File

@@ -25,20 +25,20 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// <para>Defines the possible limit status bits.</para>
/// <para>The Limit Field is valid regardless of the Quality and Substatus. In some
/// cases such as Sensor Failure it can provide useful diagnostic information.</para>
/// </summary>
public enum TsDaLimitBits
/// <summary>
/// <para>Defines the possible limit status bits.</para>
/// <para>The Limit Field is valid regardless of the Quality and Substatus. In some
/// cases such as Sensor Failure it can provide useful diagnostic information.</para>
/// </summary>
public enum TsDaLimitBits
{
/// <summary>The value is free to move up or down</summary>
None = 0x0,
/// <summary>The value has pegged at some lower limit</summary>
Low = 0x1,
/// <summary>The value has pegged at some high limit</summary>
High = 0x2,
/// <summary>The value is a constant and cannot move</summary>
Constant = 0x3
}
/// <summary>The value is free to move up or down</summary>
None = 0x0,
/// <summary>The value has pegged at some lower limit</summary>
Low = 0x1,
/// <summary>The value has pegged at some high limit</summary>
High = 0x2,
/// <summary>The value is a constant and cannot move</summary>
Constant = 0x3
}
}

View File

@@ -25,294 +25,294 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Defines identifiers for well-known properties.
/// </summary>
public class TsDaProperty
{
#region Data Access Properties
/// <summary>
/// Defines identifiers for well-known properties.
/// </summary>
public class TsDaProperty
{
#region Data Access Properties
/// <summary><para>Item Canonical DataType</para></summary>
public static readonly TsDaPropertyID DATATYPE = new TsDaPropertyID("dataType", 1, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Canonical DataType</para></summary>
public static readonly TsDaPropertyID DATATYPE = new TsDaPropertyID("dataType", 1, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Value</para></summary>
/// <remarks>
/// 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.
/// </remarks>
public static readonly TsDaPropertyID VALUE = new TsDaPropertyID("value", 2, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Value</para></summary>
/// <remarks>
/// 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.
/// </remarks>
public static readonly TsDaPropertyID VALUE = new TsDaPropertyID("value", 2, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Quality</para></summary>
/// <remarks>(OPCQUALITY stored in an I2). This will behave like a read from DEVICE.</remarks>
public static readonly TsDaPropertyID QUALITY = new TsDaPropertyID("quality", 3, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Quality</para></summary>
/// <remarks>(OPCQUALITY stored in an I2). This will behave like a read from DEVICE.</remarks>
public static readonly TsDaPropertyID QUALITY = new TsDaPropertyID("quality", 3, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Timestamp</para></summary>
/// <remarks>
/// (will be converted from FILETIME). This will behave like a read from
/// DEVICE.
/// </remarks>
public static readonly TsDaPropertyID TIMESTAMP = new TsDaPropertyID("timestamp", 4, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Timestamp</para></summary>
/// <remarks>
/// (will be converted from FILETIME). This will behave like a read from
/// DEVICE.
/// </remarks>
public static readonly TsDaPropertyID TIMESTAMP = new TsDaPropertyID("timestamp", 4, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Access Rights</para></summary>
/// <remarks>(OPCACCESSRIGHTS stored in an I4)</remarks>
public static readonly TsDaPropertyID ACCESSRIGHTS = new TsDaPropertyID("accessRights", 5, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item Access Rights</para></summary>
/// <remarks>(OPCACCESSRIGHTS stored in an I4)</remarks>
public static readonly TsDaPropertyID ACCESSRIGHTS = new TsDaPropertyID("accessRights", 5, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Server Scan Rate</para></summary>
/// <remarks>
/// 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.<br/>
/// 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.
/// </remarks>
public static readonly TsDaPropertyID SCANRATE = new TsDaPropertyID("scanRate", 6, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Server Scan Rate</para></summary>
/// <remarks>
/// 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.<br/>
/// 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.
/// </remarks>
public static readonly TsDaPropertyID SCANRATE = new TsDaPropertyID("scanRate", 6, OpcNamespace.OPC_DATA_ACCESS);
/// <remarks>
/// <para>Indicate the type of Engineering Units (EU) information (if any) contained in
/// EUINFO.</para>
/// <list type="bullet">
/// <item>
/// 0 - No EU information available (EUINFO will be VT_EMPTY).
/// </item>
/// <item>
/// 1 - Analog - EUINFO will contain a SAFEARRAY of exactly two doubles
/// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
/// </item>
/// <item>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>
/// </list>
/// </remarks>
/// <summary><para>Item EU Type</para></summary>
public static readonly TsDaPropertyID EUTYPE = new TsDaPropertyID("euType", 7, OpcNamespace.OPC_DATA_ACCESS);
/// <remarks>
/// <para>Indicate the type of Engineering Units (EU) information (if any) contained in
/// EUINFO.</para>
/// <list type="bullet">
/// <item>
/// 0 - No EU information available (EUINFO will be VT_EMPTY).
/// </item>
/// <item>
/// 1 - Analog - EUINFO will contain a SAFEARRAY of exactly two doubles
/// (VT_ARRAY | VT_R8) corresponding to the LOW and HI EU range.
/// </item>
/// <item>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>
/// </list>
/// </remarks>
/// <summary><para>Item EU Type</para></summary>
public static readonly TsDaPropertyID EUTYPE = new TsDaPropertyID("euType", 7, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item EUInfo</para></summary>
/// <value>
/// <para>
/// 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.
/// </para>
/// <para>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.)</para>
/// </value>
public static readonly TsDaPropertyID EUINFO = new TsDaPropertyID("euInfo", 8, OpcNamespace.OPC_DATA_ACCESS);
/// <summary><para>Item EUInfo</para></summary>
/// <value>
/// <para>
/// 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.
/// </para>
/// <para>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.)</para>
/// </value>
public static readonly TsDaPropertyID EUINFO = new TsDaPropertyID("euInfo", 8, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>EU Units</para>
/// <para>e.g. "DEGC" or "GALLONS"</para>
/// </summary>
public static readonly TsDaPropertyID ENGINEERINGUINTS = new TsDaPropertyID("engineeringUnits", 100, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>EU Units</para>
/// <para>e.g. "DEGC" or "GALLONS"</para>
/// </summary>
public static readonly TsDaPropertyID ENGINEERINGUINTS = new TsDaPropertyID("engineeringUnits", 100, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Item Description</para>
/// <para>e.g. "Evaporator 6 Coolant Temp"</para>
/// </summary>
public static readonly TsDaPropertyID DESCRIPTION = new TsDaPropertyID("description", 101, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Item Description</para>
/// <para>e.g. "Evaporator 6 Coolant Temp"</para>
/// </summary>
public static readonly TsDaPropertyID DESCRIPTION = new TsDaPropertyID("description", 101, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>High EU</para>
/// <para>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.</para>
/// <para>e.g. 1400.0</para>
/// </summary>
public static readonly TsDaPropertyID HIGHEU = new TsDaPropertyID("highEU", 102, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>High EU</para>
/// <para>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.</para>
/// <para>e.g. 1400.0</para>
/// </summary>
public static readonly TsDaPropertyID HIGHEU = new TsDaPropertyID("highEU", 102, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Low EU</para>
/// <para>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.</para>
/// <para>e.g. -200.0</para>
/// </summary>
public static readonly TsDaPropertyID LOWEU = new TsDaPropertyID("lowEU", 103, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Low EU</para>
/// <para>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.</para>
/// <para>e.g. -200.0</para>
/// </summary>
public static readonly TsDaPropertyID LOWEU = new TsDaPropertyID("lowEU", 103, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>High Instrument Range</para>
/// <para>Present only for analog data. This represents the highest value that can be
/// returned by the instrument.</para>
/// <para>e.g. 9999.9</para>
/// </summary>
public static readonly TsDaPropertyID HIGHIR = new TsDaPropertyID("highIR", 104, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>High Instrument Range</para>
/// <para>Present only for analog data. This represents the highest value that can be
/// returned by the instrument.</para>
/// <para>e.g. 9999.9</para>
/// </summary>
public static readonly TsDaPropertyID HIGHIR = new TsDaPropertyID("highIR", 104, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Low Instrument Range</para>
/// <para>Present only for analog data. This represents the lowest value that can be
/// returned by the instrument.</para>
/// <para>e.g. -9999.9</para>
/// </summary>
public static readonly TsDaPropertyID LOWIR = new TsDaPropertyID("lowIR", 105, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Low Instrument Range</para>
/// <para>Present only for analog data. This represents the lowest value that can be
/// returned by the instrument.</para>
/// <para>e.g. -9999.9</para>
/// </summary>
public static readonly TsDaPropertyID LOWIR = new TsDaPropertyID("lowIR", 105, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Contact Close Label</para>
/// <para>Present only for discrete' data. This represents a string to be associated
/// with this contact when it is in the closed (non-zero) state</para>
/// <para>e.g. "RUN", "CLOSE", "ENABLE", "SAFE" ,etc.</para>
/// </summary>
public static readonly TsDaPropertyID CLOSELABEL = new TsDaPropertyID("closeLabel", 106, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Contact Close Label</para>
/// <para>Present only for discrete' data. This represents a string to be associated
/// with this contact when it is in the closed (non-zero) state</para>
/// <para>e.g. "RUN", "CLOSE", "ENABLE", "SAFE" ,etc.</para>
/// </summary>
public static readonly TsDaPropertyID CLOSELABEL = new TsDaPropertyID("closeLabel", 106, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Contact Open Label</para>
/// <para>Present only for discrete' data. This represents a string to be associated
/// with this contact when it is in the open (zero) state</para>
/// <para>e.g. "STOP", "OPEN", "DISABLE", "UNSAFE" ,etc.</para>
/// </summary>
public static readonly TsDaPropertyID OPENLABEL = new TsDaPropertyID("openLabel", 107, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Contact Open Label</para>
/// <para>Present only for discrete' data. This represents a string to be associated
/// with this contact when it is in the open (zero) state</para>
/// <para>e.g. "STOP", "OPEN", "DISABLE", "UNSAFE" ,etc.</para>
/// </summary>
public static readonly TsDaPropertyID OPENLABEL = new TsDaPropertyID("openLabel", 107, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Item Timezone</para>
/// <para>The difference in minutes between the items UTC Timestamp and the local time
/// in which the item value was obtained.</para>
/// </summary>
/// <remarks>
/// See the OPCGroup TimeBias property. Also see the WIN32 TIME_ZONE_INFORMATION
/// structure.
/// </remarks>
public static readonly TsDaPropertyID TIMEZONE = new TsDaPropertyID("timeZone", 108, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Item Timezone</para>
/// <para>The difference in minutes between the items UTC Timestamp and the local time
/// in which the item value was obtained.</para>
/// </summary>
/// <remarks>
/// See the OPCGroup TimeBias property. Also see the WIN32 TIME_ZONE_INFORMATION
/// structure.
/// </remarks>
public static readonly TsDaPropertyID TIMEZONE = new TsDaPropertyID("timeZone", 108, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Condition Status</para>
/// <para>The current alarm or condition status associated with the Item<br/>
/// e.g. "NORMAL", "ACTIVE", "HI ALARM", etc</para>
/// </summary>
public static readonly TsDaPropertyID CONDITION_STATUS = new TsDaPropertyID("conditionStatus", 300, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Condition Status</para>
/// <para>The current alarm or condition status associated with the Item<br/>
/// e.g. "NORMAL", "ACTIVE", "HI ALARM", etc</para>
/// </summary>
public static readonly TsDaPropertyID CONDITION_STATUS = new TsDaPropertyID("conditionStatus", 300, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Alarm Quick Help</para>
/// <para>A short text string providing a brief set of instructions for the operator to
/// follow when this alarm occurs.</para>
/// </summary>
public static readonly TsDaPropertyID ALARM_QUICK_HELP = new TsDaPropertyID("alarmQuickHelp", 301, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Alarm Quick Help</para>
/// <para>A short text string providing a brief set of instructions for the operator to
/// follow when this alarm occurs.</para>
/// </summary>
public static readonly TsDaPropertyID ALARM_QUICK_HELP = new TsDaPropertyID("alarmQuickHelp", 301, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Alarm Area List</para>
/// <para>An array of stings indicating the plant or alarm areas which include this
/// ItemID.</para>
/// </summary>
public static readonly TsDaPropertyID ALARM_AREA_LIST = new TsDaPropertyID("alarmAreaList", 302, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Alarm Area List</para>
/// <para>An array of stings indicating the plant or alarm areas which include this
/// ItemID.</para>
/// </summary>
public static readonly TsDaPropertyID ALARM_AREA_LIST = new TsDaPropertyID("alarmAreaList", 302, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Primary Alarm Area</para>
/// <para>A string indicating the primary plant or alarm area including this
/// ItemID</para>
/// </summary>
public static readonly TsDaPropertyID PRIMARY_ALARM_AREA = new TsDaPropertyID("primaryAlarmArea", 303, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Primary Alarm Area</para>
/// <para>A string indicating the primary plant or alarm area including this
/// ItemID</para>
/// </summary>
public static readonly TsDaPropertyID PRIMARY_ALARM_AREA = new TsDaPropertyID("primaryAlarmArea", 303, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Condition Logic</para>
/// <para>An arbitrary string describing the test being performed.</para>
/// <para>e.g. "High Limit Exceeded" or "TAG.PV &gt;= TAG.HILIM"</para>
/// </summary>
public static readonly TsDaPropertyID CONDITION_LOGIC = new TsDaPropertyID("conditionLogic", 304, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Condition Logic</para>
/// <para>An arbitrary string describing the test being performed.</para>
/// <para>e.g. "High Limit Exceeded" or "TAG.PV &gt;= TAG.HILIM"</para>
/// </summary>
public static readonly TsDaPropertyID CONDITION_LOGIC = new TsDaPropertyID("conditionLogic", 304, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Limit Exceeded</para>
/// <para>For multistate alarms, the condition exceeded</para>
/// <para>e.g. HIHI, HI, LO, LOLO</para>
/// </summary>
public static readonly TsDaPropertyID LIMIT_EXCEEDED = new TsDaPropertyID("limitExceeded", 305, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Limit Exceeded</para>
/// <para>For multistate alarms, the condition exceeded</para>
/// <para>e.g. HIHI, HI, LO, LOLO</para>
/// </summary>
public static readonly TsDaPropertyID LIMIT_EXCEEDED = new TsDaPropertyID("limitExceeded", 305, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Deadband</summary>
public static readonly TsDaPropertyID DEADBAND = new TsDaPropertyID("deadband", 306, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Deadband</summary>
public static readonly TsDaPropertyID DEADBAND = new TsDaPropertyID("deadband", 306, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>HiHi limit</summary>
public static readonly TsDaPropertyID HIHI_LIMIT = new TsDaPropertyID("hihiLimit", 307, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>HiHi limit</summary>
public static readonly TsDaPropertyID HIHI_LIMIT = new TsDaPropertyID("hihiLimit", 307, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Hi Limit</summary>
public static readonly TsDaPropertyID HI_LIMIT = new TsDaPropertyID("hiLimit", 308, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Hi Limit</summary>
public static readonly TsDaPropertyID HI_LIMIT = new TsDaPropertyID("hiLimit", 308, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Lo Limit</summary>
public static readonly TsDaPropertyID LO_LIMIT = new TsDaPropertyID("loLimit", 309, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Lo Limit</summary>
public static readonly TsDaPropertyID LO_LIMIT = new TsDaPropertyID("loLimit", 309, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>LoLo Limit</summary>
public static readonly TsDaPropertyID LOLO_LIMIT = new TsDaPropertyID("loloLimit", 310, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>LoLo Limit</summary>
public static readonly TsDaPropertyID LOLO_LIMIT = new TsDaPropertyID("loloLimit", 310, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Rate of Change Limit</summary>
public static readonly TsDaPropertyID RATE_CHANGE_LIMIT = new TsDaPropertyID("rangeOfChangeLimit", 311, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Rate of Change Limit</summary>
public static readonly TsDaPropertyID RATE_CHANGE_LIMIT = new TsDaPropertyID("rangeOfChangeLimit", 311, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Deviation Limit</summary>
public static readonly TsDaPropertyID DEVIATION_LIMIT = new TsDaPropertyID("deviationLimit", 312, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>Deviation Limit</summary>
public static readonly TsDaPropertyID DEVIATION_LIMIT = new TsDaPropertyID("deviationLimit", 312, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Sound File</para>
/// <para>e.g. C:\MEDIA\FIC101.WAV, or .MID</para>
/// </summary>
public static readonly TsDaPropertyID SOUNDFILE = new TsDaPropertyID("soundFile", 313, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Sound File</para>
/// <para>e.g. C:\MEDIA\FIC101.WAV, or .MID</para>
/// </summary>
public static readonly TsDaPropertyID SOUNDFILE = new TsDaPropertyID("soundFile", 313, OpcNamespace.OPC_DATA_ACCESS);
#endregion
#region Complex Data Properties
#region Complex Data Properties
/// <summary>
/// <para>Type System ID</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID TYPE_SYSTEM_ID = new TsDaPropertyID("typeSystemID", 600, OpcNamespace.OPC_DATA_ACCESS);
/// <para>Type System ID</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID TYPE_SYSTEM_ID = new TsDaPropertyID("typeSystemID", 600, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Dictionary ID</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID DICTIONARY_ID = new TsDaPropertyID("dictionaryID", 601, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Dictionary ID</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID DICTIONARY_ID = new TsDaPropertyID("dictionaryID", 601, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Type ID</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID TYPE_ID = new TsDaPropertyID("typeID", 602, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Type ID</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID TYPE_ID = new TsDaPropertyID("typeID", 602, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Dictionary</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID DICTIONARY = new TsDaPropertyID("dictionary", 603, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Dictionary</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID DICTIONARY = new TsDaPropertyID("dictionary", 603, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Type description</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID TYPE_DESCRIPTION = new TsDaPropertyID("typeDescription", 604, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Type description</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID TYPE_DESCRIPTION = new TsDaPropertyID("typeDescription", 604, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Consistency Window</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID CONSISTENCY_WINDOW = new TsDaPropertyID("consistencyWindow", 605, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Consistency Window</para>
/// <para>Complex Data Property</para>
/// </summary>
public static readonly TsDaPropertyID CONSISTENCY_WINDOW = new TsDaPropertyID("consistencyWindow", 605, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Write Behaviour</para>
/// <para>Complex Data Property, defaults to “All or Nothing” if the complex data item
/// is writable. Not used for Read-Only items.</para>
/// </summary>
public static readonly TsDaPropertyID WRITE_BEHAVIOR = new TsDaPropertyID("writeBehavior", 606, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Write Behaviour</para>
/// <para>Complex Data Property, defaults to “All or Nothing” if the complex data item
/// is writable. Not used for Read-Only items.</para>
/// </summary>
public static readonly TsDaPropertyID WRITE_BEHAVIOR = new TsDaPropertyID("writeBehavior", 606, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Unconverted Item ID</para>
/// <para>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.</para>
/// </summary>
public static readonly TsDaPropertyID UNCONVERTED_ITEM_ID = new TsDaPropertyID("unconvertedItemID", 607, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Unconverted Item ID</para>
/// <para>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.</para>
/// </summary>
public static readonly TsDaPropertyID UNCONVERTED_ITEM_ID = new TsDaPropertyID("unconvertedItemID", 607, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Unfiltered Item ID</para>
/// <para>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.</para>
/// </summary>
public static readonly TsDaPropertyID UNFILTERED_ITEM_ID = new TsDaPropertyID("unfilteredItemID", 608, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Unfiltered Item ID</para>
/// <para>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.</para>
/// </summary>
public static readonly TsDaPropertyID UNFILTERED_ITEM_ID = new TsDaPropertyID("unfilteredItemID", 608, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Data Filter Value</para>
/// <para>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.</para>
/// </summary>
public static readonly TsDaPropertyID DATA_FILTER_VALUE = new TsDaPropertyID("dataFilterValue", 609, OpcNamespace.OPC_DATA_ACCESS);
/// <summary>
/// <para>Data Filter Value</para>
/// <para>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.</para>
/// </summary>
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
}
}
}

View File

@@ -28,173 +28,173 @@ using System.Reflection;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Describes an item property.
/// </summary>
[Serializable]
public class TsDaPropertyDescription
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Describes an item property.
/// </summary>
[Serializable]
public class TsDaPropertyDescription
{
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes the object with the specified values.
/// </summary>
public TsDaPropertyDescription(TsDaPropertyID id, Type type, string name)
{
ID = id;
Type = type;
Name = name;
}
/// Initializes the object with the specified values.
/// </summary>
public TsDaPropertyDescription(TsDaPropertyID id, Type type, string name)
{
ID = id;
Type = type;
Name = name;
}
#endregion
#region Properties
#region Properties
/// <summary>
/// The unique identifier for the property.
/// </summary>
public TsDaPropertyID ID { get; set; }
/// The unique identifier for the property.
/// </summary>
public TsDaPropertyID ID { get; set; }
/// <summary>
/// The .NET data type for the property.
/// </summary>
public Type Type { get; set; }
/// <summary>
/// The .NET data type for the property.
/// </summary>
public Type Type { get; set; }
/// <summary>
/// The short description defined in the OPC specifications.
/// </summary>
public string Name { get; set; }
/// <summary>
/// The short description defined in the OPC specifications.
/// </summary>
public string Name { get; set; }
#endregion
#region Data Access Properties
#region Data Access Properties
/// <remarks/>
public static readonly TsDaPropertyDescription DATATYPE = new TsDaPropertyDescription(TsDaProperty.DATATYPE, typeof(Type), "Item Canonical DataType");
/// <remarks/>
public static readonly TsDaPropertyDescription VALUE = new TsDaPropertyDescription(TsDaProperty.VALUE, typeof(object), "Item Value");
/// <remarks/>
public static readonly TsDaPropertyDescription QUALITY = new TsDaPropertyDescription(TsDaProperty.QUALITY, typeof(TsCDaQuality), "Item Quality");
/// <remarks/>
public static readonly TsDaPropertyDescription TIMESTAMP = new TsDaPropertyDescription(TsDaProperty.TIMESTAMP, typeof(DateTime), "Item Timestamp");
/// <remarks/>
public static readonly TsDaPropertyDescription ACCESSRIGHTS = new TsDaPropertyDescription(TsDaProperty.ACCESSRIGHTS, typeof(TsDaAccessRights), "Item Access Rights");
/// <remarks/>
public static readonly TsDaPropertyDescription SCANRATE = new TsDaPropertyDescription(TsDaProperty.SCANRATE, typeof(float), "Server Scan Rate");
/// <remarks/>
public static readonly TsDaPropertyDescription EUTYPE = new TsDaPropertyDescription(TsDaProperty.EUTYPE, typeof(TsDaEuType), "Item EU Type");
/// <remarks/>
public static readonly TsDaPropertyDescription EUINFO = new TsDaPropertyDescription(TsDaProperty.EUINFO, typeof(string[]), "Item EU Info");
/// <remarks/>
public static readonly TsDaPropertyDescription ENGINEERINGUINTS = new TsDaPropertyDescription(TsDaProperty.ENGINEERINGUINTS, typeof(string), "EU Units");
/// <remarks/>
public static readonly TsDaPropertyDescription DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.DESCRIPTION, typeof(string), "Item Description");
/// <remarks/>
public static readonly TsDaPropertyDescription HIGHEU = new TsDaPropertyDescription(TsDaProperty.HIGHEU, typeof(double), "High EU");
/// <remarks/>
public static readonly TsDaPropertyDescription LOWEU = new TsDaPropertyDescription(TsDaProperty.LOWEU, typeof(double), "Low EU");
/// <remarks/>
public static readonly TsDaPropertyDescription HIGHIR = new TsDaPropertyDescription(TsDaProperty.HIGHIR, typeof(double), "High Instrument Range");
/// <remarks/>
public static readonly TsDaPropertyDescription LOWIR = new TsDaPropertyDescription(TsDaProperty.LOWIR, typeof(double), "Low Instrument Range");
/// <remarks/>
public static readonly TsDaPropertyDescription CLOSELABEL = new TsDaPropertyDescription(TsDaProperty.CLOSELABEL, typeof(string), "Contact Close Label");
/// <remarks/>
public static readonly TsDaPropertyDescription OPENLABEL = new TsDaPropertyDescription(TsDaProperty.OPENLABEL, typeof(string), "Contact Open Label");
/// <remarks/>
public static readonly TsDaPropertyDescription TIMEZONE = new TsDaPropertyDescription(TsDaProperty.TIMEZONE, typeof(int), "Timezone");
/// <remarks/>
public static readonly TsDaPropertyDescription CONDITION_STATUS = new TsDaPropertyDescription(TsDaProperty.CONDITION_STATUS, typeof(string), "Condition Status");
/// <remarks/>
public static readonly TsDaPropertyDescription ALARM_QUICK_HELP = new TsDaPropertyDescription(TsDaProperty.ALARM_QUICK_HELP, typeof(string), "Alarm Quick Help");
/// <remarks/>
public static readonly TsDaPropertyDescription ALARM_AREA_LIST = new TsDaPropertyDescription(TsDaProperty.ALARM_AREA_LIST, typeof(string), "Alarm Area List");
/// <remarks/>
public static readonly TsDaPropertyDescription PRIMARY_ALARM_AREA = new TsDaPropertyDescription(TsDaProperty.PRIMARY_ALARM_AREA, typeof(string), "Primary Alarm Area");
/// <remarks/>
public static readonly TsDaPropertyDescription CONDITION_LOGIC = new TsDaPropertyDescription(TsDaProperty.CONDITION_LOGIC, typeof(string), "Condition Logic");
/// <remarks/>
public static readonly TsDaPropertyDescription LIMIT_EXCEEDED = new TsDaPropertyDescription(TsDaProperty.LIMIT_EXCEEDED, typeof(string), "Limit Exceeded");
/// <remarks/>
public static readonly TsDaPropertyDescription DEADBAND = new TsDaPropertyDescription(TsDaProperty.DEADBAND, typeof(double), "Deadband");
/// <remarks/>
public static readonly TsDaPropertyDescription HIHI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HIHI_LIMIT, typeof(double), "HiHi Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription HI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HI_LIMIT, typeof(double), "Hi Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription LO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LO_LIMIT, typeof(double), "Lo Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription LOLO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LOLO_LIMIT, typeof(double), "LoLo Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription RATE_CHANGE_LIMIT = new TsDaPropertyDescription(TsDaProperty.RATE_CHANGE_LIMIT, typeof(double), "Rate of Change Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription DEVIATION_LIMIT = new TsDaPropertyDescription(TsDaProperty.DEVIATION_LIMIT, typeof(double), "Deviation Limit");
/// <remarks/>
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");
/// <remarks/>
public static readonly TsDaPropertyDescription TYPE_SYSTEM_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_SYSTEM_ID, typeof(string), "Type System ID");
/// <remarks/>
public static readonly TsDaPropertyDescription DICTIONARY_ID = new TsDaPropertyDescription(TsDaProperty.DICTIONARY_ID, typeof(string), "Dictionary ID");
/// <remarks/>
public static readonly TsDaPropertyDescription TYPE_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_ID, typeof(string), "Type ID");
/// <remarks/>
public static readonly TsDaPropertyDescription DICTIONARY = new TsDaPropertyDescription(TsDaProperty.DICTIONARY, typeof(object), "Dictionary");
/// <remarks/>
public static readonly TsDaPropertyDescription TYPE_DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.TYPE_DESCRIPTION, typeof(string), "Type Description");
/// <remarks/>
public static readonly TsDaPropertyDescription CONSISTENCY_WINDOW = new TsDaPropertyDescription(TsDaProperty.CONSISTENCY_WINDOW, typeof(string), "Consistency Window");
/// <remarks/>
public static readonly TsDaPropertyDescription WRITE_BEHAVIOR = new TsDaPropertyDescription(TsDaProperty.WRITE_BEHAVIOR, typeof(string), "Write Behavior");
/// <remarks/>
public static readonly TsDaPropertyDescription UNCONVERTED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNCONVERTED_ITEM_ID, typeof(string), "Unconverted Item ID");
/// <remarks/>
public static readonly TsDaPropertyDescription UNFILTERED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNFILTERED_ITEM_ID, typeof(string), "Unfiltered Item ID");
/// <remarks/>
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");
/// <remarks/>
public static readonly TsDaPropertyDescription QUALITY = new TsDaPropertyDescription(TsDaProperty.QUALITY, typeof(TsCDaQuality), "Item Quality");
/// <remarks/>
public static readonly TsDaPropertyDescription TIMESTAMP = new TsDaPropertyDescription(TsDaProperty.TIMESTAMP, typeof(DateTime), "Item Timestamp");
/// <remarks/>
public static readonly TsDaPropertyDescription ACCESSRIGHTS = new TsDaPropertyDescription(TsDaProperty.ACCESSRIGHTS, typeof(TsDaAccessRights), "Item Access Rights");
/// <remarks/>
public static readonly TsDaPropertyDescription SCANRATE = new TsDaPropertyDescription(TsDaProperty.SCANRATE, typeof(float), "Server Scan Rate");
/// <remarks/>
public static readonly TsDaPropertyDescription EUTYPE = new TsDaPropertyDescription(TsDaProperty.EUTYPE, typeof(TsDaEuType), "Item EU Type");
/// <remarks/>
public static readonly TsDaPropertyDescription EUINFO = new TsDaPropertyDescription(TsDaProperty.EUINFO, typeof(string[]), "Item EU Info");
/// <remarks/>
public static readonly TsDaPropertyDescription ENGINEERINGUINTS = new TsDaPropertyDescription(TsDaProperty.ENGINEERINGUINTS, typeof(string), "EU Units");
/// <remarks/>
public static readonly TsDaPropertyDescription DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.DESCRIPTION, typeof(string), "Item Description");
/// <remarks/>
public static readonly TsDaPropertyDescription HIGHEU = new TsDaPropertyDescription(TsDaProperty.HIGHEU, typeof(double), "High EU");
/// <remarks/>
public static readonly TsDaPropertyDescription LOWEU = new TsDaPropertyDescription(TsDaProperty.LOWEU, typeof(double), "Low EU");
/// <remarks/>
public static readonly TsDaPropertyDescription HIGHIR = new TsDaPropertyDescription(TsDaProperty.HIGHIR, typeof(double), "High Instrument Range");
/// <remarks/>
public static readonly TsDaPropertyDescription LOWIR = new TsDaPropertyDescription(TsDaProperty.LOWIR, typeof(double), "Low Instrument Range");
/// <remarks/>
public static readonly TsDaPropertyDescription CLOSELABEL = new TsDaPropertyDescription(TsDaProperty.CLOSELABEL, typeof(string), "Contact Close Label");
/// <remarks/>
public static readonly TsDaPropertyDescription OPENLABEL = new TsDaPropertyDescription(TsDaProperty.OPENLABEL, typeof(string), "Contact Open Label");
/// <remarks/>
public static readonly TsDaPropertyDescription TIMEZONE = new TsDaPropertyDescription(TsDaProperty.TIMEZONE, typeof(int), "Timezone");
/// <remarks/>
public static readonly TsDaPropertyDescription CONDITION_STATUS = new TsDaPropertyDescription(TsDaProperty.CONDITION_STATUS, typeof(string), "Condition Status");
/// <remarks/>
public static readonly TsDaPropertyDescription ALARM_QUICK_HELP = new TsDaPropertyDescription(TsDaProperty.ALARM_QUICK_HELP, typeof(string), "Alarm Quick Help");
/// <remarks/>
public static readonly TsDaPropertyDescription ALARM_AREA_LIST = new TsDaPropertyDescription(TsDaProperty.ALARM_AREA_LIST, typeof(string), "Alarm Area List");
/// <remarks/>
public static readonly TsDaPropertyDescription PRIMARY_ALARM_AREA = new TsDaPropertyDescription(TsDaProperty.PRIMARY_ALARM_AREA, typeof(string), "Primary Alarm Area");
/// <remarks/>
public static readonly TsDaPropertyDescription CONDITION_LOGIC = new TsDaPropertyDescription(TsDaProperty.CONDITION_LOGIC, typeof(string), "Condition Logic");
/// <remarks/>
public static readonly TsDaPropertyDescription LIMIT_EXCEEDED = new TsDaPropertyDescription(TsDaProperty.LIMIT_EXCEEDED, typeof(string), "Limit Exceeded");
/// <remarks/>
public static readonly TsDaPropertyDescription DEADBAND = new TsDaPropertyDescription(TsDaProperty.DEADBAND, typeof(double), "Deadband");
/// <remarks/>
public static readonly TsDaPropertyDescription HIHI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HIHI_LIMIT, typeof(double), "HiHi Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription HI_LIMIT = new TsDaPropertyDescription(TsDaProperty.HI_LIMIT, typeof(double), "Hi Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription LO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LO_LIMIT, typeof(double), "Lo Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription LOLO_LIMIT = new TsDaPropertyDescription(TsDaProperty.LOLO_LIMIT, typeof(double), "LoLo Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription RATE_CHANGE_LIMIT = new TsDaPropertyDescription(TsDaProperty.RATE_CHANGE_LIMIT, typeof(double), "Rate of Change Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription DEVIATION_LIMIT = new TsDaPropertyDescription(TsDaProperty.DEVIATION_LIMIT, typeof(double), "Deviation Limit");
/// <remarks/>
public static readonly TsDaPropertyDescription SOUNDFILE = new TsDaPropertyDescription(TsDaProperty.SOUNDFILE, typeof(string), "Sound File");
#endregion
#region Object Member Overrides
#region Complex Data Properties
/// <remarks/>
public static readonly TsDaPropertyDescription TYPE_SYSTEM_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_SYSTEM_ID, typeof(string), "Type System ID");
/// <remarks/>
public static readonly TsDaPropertyDescription DICTIONARY_ID = new TsDaPropertyDescription(TsDaProperty.DICTIONARY_ID, typeof(string), "Dictionary ID");
/// <remarks/>
public static readonly TsDaPropertyDescription TYPE_ID = new TsDaPropertyDescription(TsDaProperty.TYPE_ID, typeof(string), "Type ID");
/// <remarks/>
public static readonly TsDaPropertyDescription DICTIONARY = new TsDaPropertyDescription(TsDaProperty.DICTIONARY, typeof(object), "Dictionary");
/// <remarks/>
public static readonly TsDaPropertyDescription TYPE_DESCRIPTION = new TsDaPropertyDescription(TsDaProperty.TYPE_DESCRIPTION, typeof(string), "Type Description");
/// <remarks/>
public static readonly TsDaPropertyDescription CONSISTENCY_WINDOW = new TsDaPropertyDescription(TsDaProperty.CONSISTENCY_WINDOW, typeof(string), "Consistency Window");
/// <remarks/>
public static readonly TsDaPropertyDescription WRITE_BEHAVIOR = new TsDaPropertyDescription(TsDaProperty.WRITE_BEHAVIOR, typeof(string), "Write Behavior");
/// <remarks/>
public static readonly TsDaPropertyDescription UNCONVERTED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNCONVERTED_ITEM_ID, typeof(string), "Unconverted Item ID");
/// <remarks/>
public static readonly TsDaPropertyDescription UNFILTERED_ITEM_ID = new TsDaPropertyDescription(TsDaProperty.UNFILTERED_ITEM_ID, typeof(string), "Unfiltered Item ID");
/// <remarks/>
public static readonly TsDaPropertyDescription DATA_FILTER_VALUE = new TsDaPropertyDescription(TsDaProperty.DATA_FILTER_VALUE, typeof(string), "Data Filter Value");
#endregion
#region Object Member Overrides
/// <summary>
/// Converts the description to a string.
/// </summary>
public override string ToString()
{
return Name;
}
/// Converts the description to a string.
/// </summary>
public override string ToString()
{
return Name;
}
#endregion
#region Public Methods
#region Public Methods
/// <summary>
/// Returns the description for the specified property.
/// </summary>
public static TsDaPropertyDescription Find(TsDaPropertyID id)
{
var fields = typeof(TsDaPropertyDescription).GetFields(BindingFlags.Static | BindingFlags.Public);
/// Returns the description for the specified property.
/// </summary>
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;
}
/// <summary>
/// Returns an array of all well-known property descriptions.
/// </summary>
public static TsDaPropertyDescription[] Enumerate()
{
var values = new ArrayList();
/// <summary>
/// Returns an array of all well-known property descriptions.
/// </summary>
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
}
}
}

View File

@@ -22,91 +22,91 @@
#region Using Directives
using System;
using System.Xml;
using System.Runtime.Serialization;
using System.Xml;
#endregion
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Contains a unique identifier for a property.
/// </summary>
[Serializable]
public struct TsDaPropertyID : ISerializable
{
#region Names Class
/// <summary>
/// Contains a unique identifier for a property.
/// </summary>
[Serializable]
public struct TsDaPropertyID : ISerializable
{
#region Names Class
/// <summary>
/// A set of names for fields used in serialization.
/// </summary>
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.
/// </summary>
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
/// <summary>
/// Initializes a property identified by a qualified name.
/// </summary>
public TsDaPropertyID(XmlQualifiedName name) { qualifiedName_ = name; code_ = 0; }
/// <summary>
/// Initializes a property identified by an integer.
/// </summary>
public TsDaPropertyID(int code) { qualifiedName_ = null; code_ = code; }
/// <summary>
/// Initializes a property identified by a property description.
/// </summary>
public TsDaPropertyID(string name, int code, string ns) { qualifiedName_ = new XmlQualifiedName(name, ns); code_ = code; }
///<remarks>
/// 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.
/// </remarks>
/// <summary>
/// Constructs a server by de-serializing its OpcUrl from the stream.
/// </summary>
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
/// <summary>
/// Used for properties identified by a qualified name.
/// </summary>
public XmlQualifiedName Name => qualifiedName_;
/// Initializes a property identified by a qualified name.
/// </summary>
public TsDaPropertyID(XmlQualifiedName name) { qualifiedName_ = name; code_ = 0; }
/// <summary>
/// Initializes a property identified by an integer.
/// </summary>
public TsDaPropertyID(int code) { qualifiedName_ = null; code_ = code; }
/// <summary>
/// Initializes a property identified by a property description.
/// </summary>
public TsDaPropertyID(string name, int code, string ns) { qualifiedName_ = new XmlQualifiedName(name, ns); code_ = code; }
///<remarks>
/// 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.
/// </remarks>
/// <summary>
/// Constructs a server by de-serializing its OpcUrl from the stream.
/// </summary>
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
/// <summary>
/// Used for properties identified by a qualified name.
/// </summary>
public XmlQualifiedName Name => qualifiedName_;
/// <summary>
/// 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
/// <summary>
/// Returns true if the objects are equal.
/// </summary>
public static bool operator ==(TsDaPropertyID a, TsDaPropertyID b)
{
return a.Equals(b);
}
/// Returns true if the objects are equal.
/// </summary>
public static bool operator ==(TsDaPropertyID a, TsDaPropertyID b)
{
return a.Equals(b);
}
/// <summary>
/// Returns true if the objects are not equal.
/// </summary>
public static bool operator !=(TsDaPropertyID a, TsDaPropertyID b)
{
return !a.Equals(b);
}
/// <summary>
/// Returns true if the objects are not equal.
/// </summary>
public static bool operator !=(TsDaPropertyID a, TsDaPropertyID b)
{
return !a.Equals(b);
}
#endregion
#region Serialization Functions
#region Serialization Functions
/// <summary>
/// Serializes a server into a stream.
/// </summary>
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.
/// </summary>
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
/// <summary>
/// Returns true if the target object is equal to the object.
/// </summary>
public override bool Equals(object target)
{
if (target != null && target.GetType() == typeof(TsDaPropertyID))
{
var propertyId = (TsDaPropertyID)target;
#region Object Member Overrides
/// <summary>
/// Returns true if the target object is equal to the object.
/// </summary>
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;
}
/// <summary>
/// Returns a useful hash code for the object.
/// </summary>
public override int GetHashCode()
{
if (Code != 0) return Code.GetHashCode();
if (Name != null) return Name.GetHashCode();
return base.GetHashCode();
}
/// <summary>
/// Returns a useful hash code for the object.
/// </summary>
public override int GetHashCode()
{
if (Code != 0) return Code.GetHashCode();
if (Name != null) return Name.GetHashCode();
return base.GetHashCode();
}
/// <summary>
/// Converts the property id to a string.
/// </summary>
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
}
/// <summary>
/// Converts the property id to a string.
/// </summary>
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
}
}

View File

@@ -27,225 +27,225 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Contains the quality field for an item value.
/// </summary>
[Serializable]
public struct TsCDaQuality
{
#region Fields
/// <summary>
/// Contains the quality field for an item value.
/// </summary>
[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
/// <summary>
/// Initializes the object with the specified quality.
/// </summary>
public TsCDaQuality(TsDaQualityBits quality)
{
qualityBits_ = quality;
limitBits_ = TsDaLimitBits.None;
vendorBits_ = 0;
}
/// Initializes the object with the specified quality.
/// </summary>
public TsCDaQuality(TsDaQualityBits quality)
{
qualityBits_ = quality;
limitBits_ = TsDaLimitBits.None;
vendorBits_ = 0;
}
/// <summary>
/// Initializes the object from the contents of a 16 bit integer.
/// </summary>
public TsCDaQuality(short code)
{
qualityBits_ = (TsDaQualityBits)(code & (short)TsDaQualityMasks.QualityMask);
limitBits_ = (TsDaLimitBits)(code & (short)TsDaQualityMasks.LimitMask);
vendorBits_ = (byte)((code & (short)TsDaQualityMasks.VendorMask) >> 8);
}
/// <summary>
/// Initializes the object from the contents of a 16 bit integer.
/// </summary>
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
/// <summary>
/// The value in the quality bits field.
/// </summary>
public TsDaQualityBits QualityBits
{
get => qualityBits_;
/// The value in the quality bits field.
/// </summary>
public TsDaQualityBits QualityBits
{
get => qualityBits_;
set => qualityBits_ = value;
}
/// <summary>
/// The value in the limit bits field.
/// </summary>
public TsDaLimitBits LimitBits
{
get => limitBits_;
/// <summary>
/// The value in the limit bits field.
/// </summary>
public TsDaLimitBits LimitBits
{
get => limitBits_;
set => limitBits_ = value;
}
/// <summary>
/// The value in the quality bits field.
/// </summary>
public byte VendorBits
{
get => vendorBits_;
/// <summary>
/// The value in the quality bits field.
/// </summary>
public byte VendorBits
{
get => vendorBits_;
set => vendorBits_ = value;
}
/// <summary>
/// A 'good' quality value.
/// </summary>
public static readonly TsCDaQuality Good = new TsCDaQuality(TsDaQualityBits.Good);
/// <summary>
/// A 'good' quality value.
/// </summary>
public static readonly TsCDaQuality Good = new TsCDaQuality(TsDaQualityBits.Good);
/// <summary>
/// An 'bad' quality value.
/// </summary>
public static readonly TsCDaQuality Bad = new TsCDaQuality(TsDaQualityBits.Bad);
/// <summary>
/// An 'bad' quality value.
/// </summary>
public static readonly TsCDaQuality Bad = new TsCDaQuality(TsDaQualityBits.Bad);
#endregion
#region Public Methods
#region Public Methods
/// <summary>
/// Returns the quality as a 16 bit integer.
/// </summary>
public short GetCode()
{
ushort code = 0;
/// Returns the quality as a 16 bit integer.
/// </summary>
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));
}
/// <summary>
/// Initializes the quality from a 16 bit integer.
/// </summary>
public void SetCode(short code)
{
qualityBits_ = (TsDaQualityBits)(code & (short)TsDaQualityMasks.QualityMask);
limitBits_ = (TsDaLimitBits)(code & (short)TsDaQualityMasks.LimitMask);
vendorBits_ = (byte)((code & (short)TsDaQualityMasks.VendorMask) >> 8);
}
/// <summary>
/// Initializes the quality from a 16 bit integer.
/// </summary>
public void SetCode(short code)
{
qualityBits_ = (TsDaQualityBits)(code & (short)TsDaQualityMasks.QualityMask);
limitBits_ = (TsDaLimitBits)(code & (short)TsDaQualityMasks.LimitMask);
vendorBits_ = (byte)((code & (short)TsDaQualityMasks.VendorMask) >> 8);
}
/// <summary>
/// Returns true if the objects are equal.
/// </summary>
public static bool operator ==(TsCDaQuality a, TsCDaQuality b)
{
return a.Equals(b);
}
/// <summary>
/// Returns true if the objects are equal.
/// </summary>
public static bool operator ==(TsCDaQuality a, TsCDaQuality b)
{
return a.Equals(b);
}
/// <summary>
/// Returns true if the objects are not equal.
/// </summary>
public static bool operator !=(TsCDaQuality a, TsCDaQuality b)
{
return !a.Equals(b);
}
/// <summary>
/// Returns true if the objects are not equal.
/// </summary>
public static bool operator !=(TsCDaQuality a, TsCDaQuality b)
{
return !a.Equals(b);
}
#endregion
#region Object Member Overrides
#region Object Member Overrides
/// <summary>
/// Converts a quality to a string with the format: 'quality[limit]:vendor'.
/// </summary>
public override string ToString()
{
string text = null;
/// Converts a quality to a string with the format: 'quality[limit]:vendor'.
/// </summary>
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;
}
/// <summary>
/// Determines whether the specified Object is equal to the current Quality
/// </summary>
public override bool Equals(object target)
{
if (target == null || target.GetType() != typeof(TsCDaQuality)) return false;
/// <summary>
/// Determines whether the specified Object is equal to the current Quality
/// </summary>
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;
}
/// <summary>
/// Returns hash code for the current Quality.
/// </summary>
public override int GetHashCode()
{
return GetCode();
}
#endregion
}
/// <summary>
/// Returns hash code for the current Quality.
/// </summary>
public override int GetHashCode()
{
return GetCode();
}
#endregion
}
}

View File

@@ -25,90 +25,90 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// <para>Defines the possible quality status bits.</para>
/// <para>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.</para>
/// </summary>
public enum TsDaQualityBits
/// <summary>
/// <para>Defines the possible quality status bits.</para>
/// <para>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.</para>
/// </summary>
public enum TsDaQualityBits
{
/// <summary>The Quality of the value is Good.</summary>
Good = 0x000000C0,
/// <summary>The value has been Overridden. Typically this means the input has been disconnected and a manually entered value has been 'forced'.</summary>
GoodLocalOverride = 0x000000D8,
/// <summary>The value is bad but no specific reason is known.</summary>
Bad = 0x00000000,
/// <summary>
/// There is some server specific problem with the configuration. For example the
/// item in question has been deleted from the configuration.
/// </summary>
BadConfigurationError = 0x00000004,
/// <summary>
/// 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.
/// </summary>
BadNotConnected = 0x00000008,
/// <summary>A device failure has been detected.</summary>
BadDeviceFailure = 0x0000000c,
/// <summary>
/// A sensor failure had been detected (the Limits field can provide additional
/// diagnostic information in some situations).
/// </summary>
BadSensorFailure = 0x00000010,
/// <summary>
/// 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.
/// </summary>
BadLastKnownValue = 0x00000014,
/// <summary>Communications have failed. There is no last known value is available.</summary>
BadCommFailure = 0x00000018,
/// <summary>
/// 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.
/// </summary>
BadOutOfService = 0x0000001C,
/// <summary>
/// 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.
/// </summary>
BadWaitingForInitialData = 0x00000020,
/// <summary>There is no specific reason why the value is uncertain.</summary>
Uncertain = 0x00000040,
/// <summary>
/// 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.
/// </summary>
UncertainLastUsableValue = 0x00000044,
/// <summary>
/// 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).
/// </summary>
UncertainSensorNotAccurate = 0x00000050,
/// <summary>
/// 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.
/// </summary>
UncertainEUExceeded = 0x00000054,
/// <summary>
/// The value is derived from multiple sources and has less than the required number
/// of Good sources.
/// </summary>
UncertainSubNormal = 0x00000058
}
/// <summary>The Quality of the value is Good.</summary>
Good = 0x000000C0,
/// <summary>The value has been Overridden. Typically this means the input has been disconnected and a manually entered value has been 'forced'.</summary>
GoodLocalOverride = 0x000000D8,
/// <summary>The value is bad but no specific reason is known.</summary>
Bad = 0x00000000,
/// <summary>
/// There is some server specific problem with the configuration. For example the
/// item in question has been deleted from the configuration.
/// </summary>
BadConfigurationError = 0x00000004,
/// <summary>
/// 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.
/// </summary>
BadNotConnected = 0x00000008,
/// <summary>A device failure has been detected.</summary>
BadDeviceFailure = 0x0000000c,
/// <summary>
/// A sensor failure had been detected (the Limits?field can provide additional
/// diagnostic information in some situations).
/// </summary>
BadSensorFailure = 0x00000010,
/// <summary>
/// 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.
/// </summary>
BadLastKnownValue = 0x00000014,
/// <summary>Communications have failed. There is no last known value is available.</summary>
BadCommFailure = 0x00000018,
/// <summary>
/// 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.
/// </summary>
BadOutOfService = 0x0000001C,
/// <summary>
/// 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.
/// </summary>
BadWaitingForInitialData = 0x00000020,
/// <summary>There is no specific reason why the value is uncertain.</summary>
Uncertain = 0x00000040,
/// <summary>
/// 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.
/// </summary>
UncertainLastUsableValue = 0x00000044,
/// <summary>
/// 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).
/// </summary>
UncertainSensorNotAccurate = 0x00000050,
/// <summary>
/// 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.
/// </summary>
UncertainEUExceeded = 0x00000054,
/// <summary>
/// The value is derived from multiple sources and has less than the required number
/// of Good sources.
/// </summary>
UncertainSubNormal = 0x00000058
}
}

View File

@@ -25,16 +25,16 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Defines bit masks for the quality.
/// </summary>
public enum TsDaQualityMasks : int
{
/// <summary>Quality related bits</summary>
QualityMask = +0x00FC,
/// <summary>Limit related bits</summary>
LimitMask = +0x0003,
/// <summary>Vendor specific bits</summary>
VendorMask = -0x00FD
}
/// <summary>
/// Defines bit masks for the quality.
/// </summary>
public enum TsDaQualityMasks : int
{
/// <summary>Quality related bits</summary>
QualityMask = +0x00FC,
/// <summary>Limit related bits</summary>
LimitMask = +0x0003,
/// <summary>Vendor specific bits</summary>
VendorMask = -0x00FD
}
}

View File

@@ -26,33 +26,33 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Describes the state of a subscription.
/// </summary>
[Serializable]
public class TsCDaRequest : IOpcRequest
{
#region Fields
/// <summary>
/// Describes the state of a subscription.
/// </summary>
[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
/// <summary>
/// Initializes the object with a subscription and a unique id.
/// </summary>
public TsCDaRequest(ITsCDaSubscription subscription, object handle)
{
subscription_ = subscription;
handle_ = handle;
}
/// Initializes the object with a subscription and a unique id.
/// </summary>
public TsCDaRequest(ITsCDaSubscription subscription, object handle)
{
subscription_ = subscription;
handle_ = handle;
}
#endregion
#region Properties
#region Properties
/// <summary>
/// The subscription processing the request.
/// </summary>
public ITsCDaSubscription Subscription => subscription_;
/// The subscription processing the request.
/// </summary>
public ITsCDaSubscription Subscription => subscription_;
/// <summary>
/// An unique identifier, assigned by the client, for the request.
@@ -66,5 +66,5 @@ namespace Technosoftware.DaAeHdaClient.Da
/// </summary>
public void Cancel(TsCDaCancelCompleteEventHandler callback) { subscription_.Cancel(this, callback); }
#endregion
}
}
}

View File

@@ -26,50 +26,50 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Filters applied by the server before returning item results.
/// </summary>
[Flags]
public enum TsCDaResultFilter
{
/// <summary>
/// Include the ItemName in the ItemIdentifier if bit is set.
/// </summary>
ItemName = 0x01,
/// <summary>
/// Filters applied by the server before returning item results.
/// </summary>
[Flags]
public enum TsCDaResultFilter
{
/// <summary>
/// Include the ItemName in the ItemIdentifier if bit is set.
/// </summary>
ItemName = 0x01,
/// <summary>
/// Include the ItemPath in the ItemIdentifier if bit is set.
/// </summary>
ItemPath = 0x02,
/// <summary>
/// Include the ItemPath in the ItemIdentifier if bit is set.
/// </summary>
ItemPath = 0x02,
/// <summary>
/// Include the ClientHandle in the ItemIdentifier if bit is set.
/// </summary>
ClientHandle = 0x04,
/// <summary>
/// Include the ClientHandle in the ItemIdentifier if bit is set.
/// </summary>
ClientHandle = 0x04,
/// <summary>
/// Include the Timestamp in the ItemValue if bit is set.
/// </summary>
ItemTime = 0x08,
/// <summary>
/// Include the Timestamp in the ItemValue if bit is set.
/// </summary>
ItemTime = 0x08,
/// <summary>
/// Include verbose, localized error text with result if bit is set.
/// </summary>
ErrorText = 0x10,
/// <summary>
/// Include verbose, localized error text with result if bit is set.
/// </summary>
ErrorText = 0x10,
/// <summary>
/// Include additional diagnostic information with result if bit is set.
/// </summary>
DiagnosticInfo = 0x20,
/// <summary>
/// Include additional diagnostic information with result if bit is set.
/// </summary>
DiagnosticInfo = 0x20,
/// <summary>
/// Include the ItemName and Timestamp if bit is set.
/// </summary>
Minimal = ItemName | ItemTime,
/// <summary>
/// Include the ItemName and Timestamp if bit is set.
/// </summary>
Minimal = ItemName | ItemTime,
/// <summary>
/// Include all information in the results if bit is set.
/// </summary>
All = 0x3F
}
/// <summary>
/// Include all information in the results if bit is set.
/// </summary>
All = 0x3F
}
}

View File

@@ -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

View File

@@ -25,44 +25,44 @@
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// The set of possible server states.
/// </summary>
public enum TsCDaServerState
{
/// <summary>
/// The server state is not known.
/// </summary>
Unknown,
/// <summary>
/// The set of possible server states.
/// </summary>
public enum TsCDaServerState
{
/// <summary>
/// The server state is not known.
/// </summary>
Unknown,
/// <summary>
/// The server is running normally.
/// </summary>
Running,
/// <summary>
/// The server is running normally.
/// </summary>
Running,
/// <summary>
/// The server is not functioning due to a fatal error.
/// </summary>
Failed,
/// <summary>
/// The server is not functioning due to a fatal error.
/// </summary>
Failed,
/// <summary>
/// The server cannot load its configuration information.
/// </summary>
NoConfig,
/// <summary>
/// The server cannot load its configuration information.
/// </summary>
NoConfig,
/// <summary>
/// The server has halted all communication with the underlying hardware.
/// </summary>
Suspended,
/// <summary>
/// The server has halted all communication with the underlying hardware.
/// </summary>
Suspended,
/// <summary>
/// The server is disconnected from the underlying hardware.
/// </summary>
Test,
/// <summary>
/// The server is disconnected from the underlying hardware.
/// </summary>
Test,
/// <summary>
/// The server cannot communicate with the underlying hardware.
/// </summary>
CommFault
}
/// <summary>
/// The server cannot communicate with the underlying hardware.
/// </summary>
CommFault
}
}

View File

@@ -26,67 +26,67 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Defines masks to be used when modifying the subscription or item state.
/// </summary>
[Flags]
public enum TsCDaStateMask
{
/// <summary>
/// The name of the subscription.
/// </summary>
Name = 0x0001,
/// <summary>
/// Defines masks to be used when modifying the subscription or item state.
/// </summary>
[Flags]
public enum TsCDaStateMask
{
/// <summary>
/// The name of the subscription.
/// </summary>
Name = 0x0001,
/// <summary>
/// The client assigned handle for the item or subscription.
/// </summary>
ClientHandle = 0x0002,
/// <summary>
/// The client assigned handle for the item or subscription.
/// </summary>
ClientHandle = 0x0002,
/// <summary>
/// The locale to use for results returned to the client from the subscription.
/// </summary>
Locale = 0x0004,
/// <summary>
/// The locale to use for results returned to the client from the subscription.
/// </summary>
Locale = 0x0004,
/// <summary>
/// Whether the item or subscription is active.
/// </summary>
Active = 0x0008,
/// <summary>
/// Whether the item or subscription is active.
/// </summary>
Active = 0x0008,
/// <summary>
/// The maximum rate at which data update notifications are sent.
/// </summary>
UpdateRate = 0x0010,
/// <summary>
/// The maximum rate at which data update notifications are sent.
/// </summary>
UpdateRate = 0x0010,
/// <summary>
/// The longest period between data update notifications.<br/>
/// <strong>Note:</strong> This feature is only supported with OPC Data Access 3.0
/// Servers.
/// </summary>
KeepAlive = 0x0020,
/// <summary>
/// The longest period between data update notifications.<br/>
/// <strong>Note:</strong> This feature is only supported with OPC Data Access 3.0
/// Servers.
/// </summary>
KeepAlive = 0x0020,
/// <summary>
/// The requested data type for the item.
/// </summary>
ReqType = 0x0040,
/// <summary>
/// The requested data type for the item.
/// </summary>
ReqType = 0x0040,
/// <summary>
/// The deadband for the item or subscription.
/// </summary>
Deadband = 0x0080,
/// <summary>
/// The deadband for the item or subscription.
/// </summary>
Deadband = 0x0080,
/// <summary>
/// The rate at which the server should check for changes to an item value.
/// </summary>
SamplingRate = 0x0100,
/// <summary>
/// The rate at which the server should check for changes to an item value.
/// </summary>
SamplingRate = 0x0100,
/// <summary>
/// Whether the server should buffer multiple changes to a single item.
/// </summary>
EnableBuffering = 0x0200,
/// <summary>
/// Whether the server should buffer multiple changes to a single item.
/// </summary>
EnableBuffering = 0x0200,
/// <summary>
/// All fields are valid.
/// </summary>
All = 0xFFFF
}
/// <summary>
/// All fields are valid.
/// </summary>
All = 0xFFFF
}
}

View File

@@ -210,8 +210,10 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <summary>
/// The items belonging to the subscription.
/// </summary>
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
/// <summary>
/// An event to receive data change updates.
/// </summary>
public event TsCDaDataChangedEventHandler DataChangedEvent {
public event TsCDaDataChangedEventHandler DataChangedEvent
{
add => Subscription.DataChangedEvent += value;
remove => Subscription.DataChangedEvent -= value;
}

View File

@@ -27,84 +27,84 @@ using System.Collections;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>A collection of subscriptions.</summary>
[Serializable]
public class TsCDaSubscriptionCollection : ICollection, ICloneable, IList
{
///////////////////////////////////////////////////////////////////////
#region Fields
/// <summary>A collection of subscriptions.</summary>
[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
/// <summary>
/// Initializes object with the default values.
/// </summary>
public TsCDaSubscriptionCollection() { }
///////////////////////////////////////////////////////////////////////
#region Constructors, Destructor, Initialization
/// <summary>
/// Initializes object with the specified SubscriptionCollection object.
/// </summary>
public TsCDaSubscriptionCollection(TsCDaSubscriptionCollection subscriptions)
{
if (subscriptions != null)
{
foreach (TsCDaSubscription subscription in subscriptions)
{
Add(subscription);
}
}
}
/// <summary>
/// Initializes object with the default values.
/// </summary>
public TsCDaSubscriptionCollection() { }
#endregion
/// <summary>
/// Initializes object with the specified SubscriptionCollection object.
/// </summary>
public TsCDaSubscriptionCollection(TsCDaSubscriptionCollection subscriptions)
{
if (subscriptions != null)
{
foreach (TsCDaSubscription subscription in subscriptions)
{
Add(subscription);
}
}
}
///////////////////////////////////////////////////////////////////////
#region Properties
#endregion
/// <summary>
/// Gets the item at the specified index.
/// </summary>
public TsCDaSubscription this[int index]
{
get => (TsCDaSubscription)_subscriptions[index];
///////////////////////////////////////////////////////////////////////
#region Properties
/// <summary>
/// Gets the item at the specified index.
/// </summary>
public TsCDaSubscription this[int index]
{
get => (TsCDaSubscription)_subscriptions[index];
set => _subscriptions[index] = value;
}
#endregion
#endregion
///////////////////////////////////////////////////////////////////////
#region ICloneable Members
///////////////////////////////////////////////////////////////////////
#region ICloneable Members
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
public virtual object Clone()
{
var clone = (TsCDaSubscriptionCollection)MemberwiseClone();
/// <summary>
/// Creates a deep copy of the object.
/// </summary>
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
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public bool IsSynchronized => false;
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public bool IsSynchronized => false;
/// <summary>
/// Gets the number of objects in the collection.
@@ -117,150 +117,150 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(Array array, int index)
{
if (_subscriptions != null)
{
_subscriptions.CopyTo(array, index);
}
}
{
if (_subscriptions != null)
{
_subscriptions.CopyTo(array, index);
}
}
/// <summary>
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaSubscription[] array, int index)
{
CopyTo((Array)array, index);
}
/// <summary>
/// Copies the objects to an Array, starting at a the specified index.
/// </summary>
/// <param name="array">The one-dimensional Array that is the destination for the objects.</param>
/// <param name="index">The zero-based index in the Array at which copying begins.</param>
public void CopyTo(TsCDaSubscription[] array, int index)
{
CopyTo((Array)array, index);
}
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public object SyncRoot => this;
/// <summary>
/// Indicates whether access to the ICollection is synchronized (thread-safe).
/// </summary>
public object SyncRoot => this;
#endregion
///////////////////////////////////////////////////////////////////////
#region IEnumerable Members
///////////////////////////////////////////////////////////////////////
#region IEnumerable Members
/// <summary>
/// Returns an enumerator that can iterate through a collection.
/// </summary>
/// <returns>An IEnumerator that can be used to iterate through the collection.</returns>
public IEnumerator GetEnumerator()
{
return _subscriptions.GetEnumerator();
}
/// <summary>
/// Returns an enumerator that can iterate through a collection.
/// </summary>
/// <returns>An IEnumerator that can be used to iterate through the collection.</returns>
public IEnumerator GetEnumerator()
{
return _subscriptions.GetEnumerator();
}
#endregion
#endregion
///////////////////////////////////////////////////////////////////////
#region IList Members
///////////////////////////////////////////////////////////////////////
#region IList Members
/// <summary>
/// Gets a value indicating whether the IList is read-only.
/// </summary>
public bool IsReadOnly => false;
/// <summary>
/// Gets a value indicating whether the IList is read-only.
/// </summary>
public bool IsReadOnly => false;
/// <summary>
/// Gets or sets the element at the specified index.
/// </summary>
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;
}
}
/// <summary>
/// Removes the IList subscription at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the subscription to remove.</param>
public void RemoveAt(int index)
{
_subscriptions.RemoveAt(index);
}
/// <summary>
/// Removes the IList subscription at the specified index.
/// </summary>
/// <param name="index">The zero-based index of the subscription to remove.</param>
public void RemoveAt(int index)
{
_subscriptions.RemoveAt(index);
}
/// <summary>
/// Inserts an subscription to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, object value)
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
/// <summary>
/// Inserts an subscription to the IList at the specified position.
/// </summary>
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
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);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(object value)
{
_subscriptions.Remove(value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(object value)
{
_subscriptions.Remove(value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(object value)
{
return _subscriptions.Contains(value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(object value)
{
return _subscriptions.Contains(value);
}
/// <summary>
/// Removes all subscriptions from the IList.
/// </summary>
public void Clear()
{
_subscriptions.Clear();
}
/// <summary>
/// Removes all subscriptions from the IList.
/// </summary>
public void Clear()
{
_subscriptions.Clear();
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(object value)
{
return _subscriptions.IndexOf(value);
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(object value)
{
return _subscriptions.IndexOf(value);
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(object value)
{
if (!typeof(TsCDaSubscription).IsInstanceOfType(value))
{
throw new ArgumentException("May only add Subscription objects into the collection.");
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
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);
}
/// <summary>
/// Indicates whether the IList has a fixed size.
/// </summary>
public bool IsFixedSize => false;
/// <summary>
/// Indicates whether the IList has a fixed size.
/// </summary>
public bool IsFixedSize => false;
/// <summary>
/// Inserts an subscription to the IList at the specified position.
@@ -268,49 +268,49 @@ namespace Technosoftware.DaAeHdaClient.Da
/// <param name="index">The zero-based index at which value should be inserted.</param>
/// <param name="value">The Object to insert into the IList. </param>
public void Insert(int index, TsCDaSubscription value)
{
Insert(index, (object)value);
}
{
Insert(index, (object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaSubscription value)
{
Remove((object)value);
}
/// <summary>
/// Removes the first occurrence of a specific object from the IList.
/// </summary>
/// <param name="value">The Object to remove from the IList.</param>
public void Remove(TsCDaSubscription value)
{
Remove((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaSubscription value)
{
return Contains((object)value);
}
/// <summary>
/// Determines whether the IList contains a specific value.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>true if the Object is found in the IList; otherwise, false.</returns>
public bool Contains(TsCDaSubscription value)
{
return Contains((object)value);
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaSubscription value)
{
return IndexOf((object)value);
}
/// <summary>
/// Determines the index of a specific subscription in the IList.
/// </summary>
/// <param name="value">The Object to locate in the IList.</param>
/// <returns>The index of value if found in the list; otherwise, -1.</returns>
public int IndexOf(TsCDaSubscription value)
{
return IndexOf((object)value);
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaSubscription value)
{
return Add((object)value);
}
/// <summary>
/// Adds an subscription to the IList.
/// </summary>
/// <param name="value">The Object to add to the IList. </param>
/// <returns>The position into which the new element was inserted.</returns>
public int Add(TsCDaSubscription value)
{
return Add((object)value);
}
#endregion
}
#endregion
}
}

View File

@@ -26,45 +26,45 @@ using System;
namespace Technosoftware.DaAeHdaClient.Da
{
/// <summary>
/// Describes the state of a subscription.
/// </summary>
[Serializable]
public class TsCDaSubscriptionState : ICloneable
{
#region Fields
/// <summary>
/// Describes the state of a subscription.
/// </summary>
[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
/// <summary>
/// A unique name for the subscription controlled by the client.
/// </summary>
public string Name { get; set; }
/// A unique name for the subscription controlled by the client.
/// </summary>
public string Name { get; set; }
/// <summary>
/// A unique identifier for the subscription assigned by the client.
/// </summary>
public object ClientHandle { get; set; }
/// <summary>
/// A unique identifier for the subscription assigned by the client.
/// </summary>
public object ClientHandle { get; set; }
/// <summary>
/// A unique subscription identifier assigned by the server.
/// </summary>
public object ServerHandle { get; set; }
/// <summary>
/// A unique subscription identifier assigned by the server.
/// </summary>
public object ServerHandle { get; set; }
/// <summary>
/// The locale used for any error messages or results returned to the client.
/// </summary>
public string Locale { get; set; }
/// <summary>
/// The locale used for any error messages or results returned to the client.
/// </summary>
public string Locale { get; set; }
/// <summary>
/// Whether the subscription is scanning for updates to send to the client.
/// </summary>
public bool Active
{
get => active_;
/// <summary>
/// Whether the subscription is scanning for updates to send to the client.
/// </summary>
public bool Active
{
get => active_;
set => active_ = value;
}
@@ -82,8 +82,8 @@ namespace Technosoftware.DaAeHdaClient.Da
/// the fastest practical rate.
/// </remarks>
public int UpdateRate
{
get => updateRate_;
{
get => updateRate_;
set => updateRate_ = value;
}
@@ -114,59 +114,59 @@ namespace Technosoftware.DaAeHdaClient.Da
/// </remarks>
public int KeepAlive { get; set; }
/// <summary>
/// The minimum percentage change from 0.0 to 100.0 required to trigger a data update
/// for an item.
/// </summary>
/// <remarks>
/// <para>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:</para>
/// <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
/// <para>Exception if (absolute value of (last cached value - current value) &gt;
/// (pPercentDeadband/100.0) * (EU High - EU Low) )</para>
/// </blockquote>
/// <para>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.</para>
/// <para>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 clients 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.</para>
/// <para>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.</para>
/// </remarks>
public float Deadband
{
get => deadband_;
/// <summary>
/// The minimum percentage change from 0.0 to 100.0 required to trigger a data update
/// for an item.
/// </summary>
/// <remarks>
/// <para>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:</para>
/// <blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
/// <para>Exception if (absolute value of (last cached value - current value) &gt;
/// (pPercentDeadband/100.0) * (EU High - EU Low) )</para>
/// </blockquote>
/// <para>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.</para>
/// <para>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 clients 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.</para>
/// <para>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.</para>
/// </remarks>
public float Deadband
{
get => deadband_;
set => deadband_ = value;
}
/// <summary>
/// TimeZone Bias of Group (in minutes).
/// </summary>
public int TimeBias { get; set; }
/// <summary>
/// TimeZone Bias of Group (in minutes).
/// </summary>
public int TimeBias { get; set; }
#endregion
#region ICloneable Members
#region ICloneable Members
/// <summary>
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
/// Creates a shallow copy of the object.
/// </summary>
public virtual object Clone()
{
return MemberwiseClone();
}
#endregion
}
}
}

View File

@@ -77,7 +77,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The identifiers for the items to validate.</param>
/// <returns>The results for each item containing the result code.</returns>
OpcItemResult[] ValidateItems(OpcItem[] items);
/// <summary>
/// Reads raw (unprocessed) data from the historian database for a set of items.
/// </summary>
@@ -88,10 +88,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The set of items to read (must include the item name).</param>
/// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns>
TsCHdaItemValueCollection[] ReadRaw(
TsCHdaTime startTime,
TsCHdaTime endTime,
int maxValues,
bool includeBounds,
TsCHdaTime startTime,
TsCHdaTime endTime,
int maxValues,
bool includeBounds,
OpcItem[] items);
/// <summary>
@@ -167,10 +167,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The set of items to read (must include the item name).</param>
/// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns>
TsCHdaItemValueCollection[] ReadProcessed(
TsCHdaTime startTime,
TsCHdaTime endTime,
TsCHdaTime startTime,
TsCHdaTime endTime,
decimal resampleInterval,
TsCHdaItem[] items);
TsCHdaItem[] items);
/// <summary>
/// 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);
/// <summary>
/// Reads item values that have been deleted or replaced.
/// </summary>
@@ -270,10 +270,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The set of items to read (must include the item name).</param>
/// <returns>A set of values, qualities and timestamps within the requested time range for each item.</returns>
TsCHdaModifiedValueCollection[] ReadModified(
TsCHdaTime startTime,
TsCHdaTime endTime,
int maxValues,
OpcItem[] items);
TsCHdaTime startTime,
TsCHdaTime endTime,
int maxValues,
OpcItem[] items);
/// <summary>
/// Sends an asynchronous request to read item values that have been deleted or replaced.
@@ -304,11 +304,11 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="attributeIDs">The attributes to read.</param>
/// <returns>A set of attribute values for each requested attribute.</returns>
TsCHdaItemAttributeCollection ReadAttributes(
TsCHdaTime startTime,
TsCHdaTime endTime,
TsCHdaTime startTime,
TsCHdaTime endTime,
OpcItem item,
int[] attributeIDs);
int[] attributeIDs);
/// <summary>
/// Sends an asynchronous request to read the attributes of an item.
/// </summary>
@@ -337,8 +337,8 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The set of items to read (must include the item name).</param>
/// <returns>A set of annotations within the requested time range for each item.</returns>
TsCHdaAnnotationValueCollection[] ReadAnnotations(
TsCHdaTime startTime,
TsCHdaTime endTime,
TsCHdaTime startTime,
TsCHdaTime endTime,
OpcItem[] items);
/// <summary>
@@ -387,7 +387,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="replace">Whether existing values should be replaced.</param>
/// <returns></returns>
TsCHdaResultCollection[] Insert(TsCHdaItemValueCollection[] items, bool replace);
/// <summary>
/// Sends an asynchronous request to inserts values for one or more items.
/// </summary>
@@ -410,7 +410,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The set of values to replace.</param>
/// <returns></returns>
TsCHdaResultCollection[] Replace(TsCHdaItemValueCollection[] items);
/// <summary>
/// Sends an asynchronous request to replace values for one or more items.
/// </summary>
@@ -433,10 +433,10 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The set of items to delete (must include the item name).</param>
/// <returns>The results of the delete operation for each item.</returns>
OpcItemResult[] Delete(
TsCHdaTime startTime,
TsCHdaTime endTime,
TsCHdaTime startTime,
TsCHdaTime endTime,
OpcItem[] items);
/// <summary>
/// Sends an asynchronous request to delete values for one or more items.
/// </summary>
@@ -461,7 +461,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// <param name="items">The set of timestamps to delete for one or more items.</param>
/// <returns>The results of the operation for each timestamp.</returns>
TsCHdaResultCollection[] DeleteAtTime(TsCHdaItemTimeCollection[] items);
/// <summary>
/// Sends an asynchronous request to delete values for one or more items at a specified times.
/// </summary>
@@ -481,7 +481,7 @@ namespace Technosoftware.DaAeHdaClient.Hda
/// </summary>
/// <param name="request">The state object for the request to cancel.</param>
void CancelRequest(IOpcRequest request);
/// <summary>
/// Cancels an asynchronous request.
/// </summary>

View File

@@ -22,8 +22,6 @@
#region Using Directives
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
#pragma warning disable 618
#endregion

View File

@@ -22,8 +22,8 @@
#region Using Directives
using System;
using System.Text;
using System.Collections;
using System.Text;
#endregion
namespace Technosoftware.DaAeHdaClient.Hda

View File

@@ -27,16 +27,16 @@ using System;
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// This interface is used to discover OPC servers on the network.
/// </summary>
public interface IOpcDiscovery : IDisposable
{
/// <summary>
/// Returns a list of host names which could contain OPC servers.
/// </summary>
/// <returns>A array of strings that are valid network host names.</returns>
string[] EnumerateHosts();
/// <summary>
/// This interface is used to discover OPC servers on the network.
/// </summary>
public interface IOpcDiscovery : IDisposable
{
/// <summary>
/// Returns a list of host names which could contain OPC servers.
/// </summary>
/// <returns>A array of strings that are valid network host names.</returns>
string[] EnumerateHosts();
/// <summary>
/// Returns a list of servers that support an OPC specification.
@@ -53,5 +53,5 @@ namespace Technosoftware.DaAeHdaClient
/// <param name="connectData">Any necessary user authentication or protocol configuration information.</param>
/// <returns>An array of unconnected OPC server objects.</returns>
OpcServer[] GetAvailableServers(OpcSpecification specification, string host, OpcConnectData connectData);
}
}
}

View File

@@ -26,69 +26,69 @@ using System;
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// Defines functionality that is common to all OPC servers.
/// </summary>
public interface IOpcServer : IDisposable
{
/// <summary>
/// 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.
/// </summary>
/// <remarks>
/// The OpcServerShutdownEvent event will be called when the server needs to
/// shutdown. The client should release all connections and interfaces for this
/// server.<br/>
/// 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.
/// </remarks>
/// <summary>
/// Defines functionality that is common to all OPC servers.
/// </summary>
public interface IOpcServer : IDisposable
{
/// <summary>
/// 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.
/// </summary>
/// <remarks>
/// The OpcServerShutdownEvent event will be called when the server needs to
/// shutdown. The client should release all connections and interfaces for this
/// server.<br/>
/// 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.
/// </remarks>
event OpcServerShutdownEventHandler ServerShutdownEvent;
/// <summary>
/// The locale used in any error messages or results returned to the client.
/// </summary>
/// <returns>The locale name in the format "[languagecode]-[country/regioncode]".</returns>
string GetLocale();
/// <summary>
/// The locale used in any error messages or results returned to the client.
/// </summary>
/// <returns>The locale name in the format "[languagecode]-[country/regioncode]".</returns>
string GetLocale();
/// <summary>
/// Sets the locale used in any error messages or results returned to the client.
/// </summary>
/// <param name="locale">The locale name in the format "[languagecode]-[country/regioncode]".</param>
/// <returns>A locale that the server supports and is the best match for the requested locale.</returns>
string SetLocale(string locale);
/// <summary>
/// Sets the locale used in any error messages or results returned to the client.
/// </summary>
/// <param name="locale">The locale name in the format "[languagecode]-[country/regioncode]".</param>
/// <returns>A locale that the server supports and is the best match for the requested locale.</returns>
string SetLocale(string locale);
/// <summary>
/// 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.
/// </summary>
void SetClientName(string clientName);
/// <summary>
/// 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.
/// </summary>
void SetClientName(string clientName);
/// <summary>
/// Returns the locales supported by the server
/// </summary>
/// <remarks>The first element in the array must be the default locale for the server.</remarks>
/// <returns>An array of locales with the format "[languagecode]-[country/regioncode]".</returns>
string[] GetSupportedLocales();
/// <summary>
/// Returns the locales supported by the server
/// </summary>
/// <remarks>The first element in the array must be the default locale for the server.</remarks>
/// <returns>An array of locales with the format "[languagecode]-[country/regioncode]".</returns>
string[] GetSupportedLocales();
/// <summary>
/// Returns the localized text for the specified result code.
/// </summary>
/// <param name="locale">The locale name in the format "[languagecode]-[country/regioncode]".</param>
/// <param name="resultId">The result code identifier.</param>
/// <returns>A message localized for the best match for the requested locale.</returns>
string GetErrorText(string locale, OpcResult resultId);
/// <summary>
/// Returns the localized text for the specified result code.
/// </summary>
/// <param name="locale">The locale name in the format "[languagecode]-[country/regioncode]".</param>
/// <param name="resultId">The result code identifier.</param>
/// <returns>A message localized for the best match for the requested locale.</returns>
string GetErrorText(string locale, OpcResult resultId);
}
/// <summary>
/// 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.
/// </summary>
/// <param name="reason">
/// 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.
/// </param>
/// <summary>
/// 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.
/// </summary>
/// <param name="reason">
/// 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.
/// </param>
public delegate void OpcServerShutdownEventHandler(string reason);
}

View File

@@ -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
/// <summary>
/// Validate the license.

View File

@@ -81,7 +81,7 @@ namespace Technosoftware.DaAeHdaClient
}
else
{
return new WebProxy();
return new WebProxy();
}
}

View File

@@ -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());
}

View File

@@ -32,24 +32,24 @@ namespace Technosoftware.DaAeHdaClient
public class OpcNamespace
{
/// <summary>XML Schema</summary>
public const string XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
public const string XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
/// <summary>XML Schema Instance</summary>
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";
/// <summary>OPC Alarmes &amp; Events</summary>
public const string OPC_ALARM_AND_EVENTS = "http://opcfoundation.org/AlarmAndEvents/";
public const string OPC_ALARM_AND_EVENTS = "http://opcfoundation.org/AlarmAndEvents/";
/// <summary>OPC Complex Data</summary>
public const string OPC_COMPLEX_DATA = "http://opcfoundation.org/ComplexData/";
public const string OPC_COMPLEX_DATA = "http://opcfoundation.org/ComplexData/";
/// <summary>OPC Data Exchange</summary>
public const string OPC_DATA_EXCHANGE = "http://opcfoundation.org/DataExchange/";
public const string OPC_DATA_EXCHANGE = "http://opcfoundation.org/DataExchange/";
/// <summary>OPC Data Access</summary>
public const string OPC_DATA_ACCESS = "http://opcfoundation.org/DataAccess/";
public const string OPC_DATA_ACCESS = "http://opcfoundation.org/DataAccess/";
/// <summary>OPC Historical Data Access</summary>
public const string OPC_HISTORICAL_DATA_ACCESS = "http://opcfoundation.org/HistoricalDataAccess/";
public const string OPC_HISTORICAL_DATA_ACCESS = "http://opcfoundation.org/HistoricalDataAccess/";
/// <summary>OPC Binary 1.0</summary>
public const string OPC_BINARY = "http://opcfoundation.org/OPCBinary/1.0/";
public const string OPC_BINARY = "http://opcfoundation.org/OPCBinary/1.0/";
/// <summary>OPC XML-DA 1.0</summary>
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/";
/// <summary>OPC UA 1.0</summary>
public const string OPC_UA10 = "http://opcfoundation.org/webservices/UA/1.0/";
public const string OPC_UA10 = "http://opcfoundation.org/webservices/UA/1.0/";
}
}

View File

@@ -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

View File

@@ -27,28 +27,28 @@ using System.Runtime.Serialization;
namespace Technosoftware.DaAeHdaClient
{
/// <summary>Used to raise an exception associated with a specified result code.</summary>
/// <remarks>
/// The OpcResultException includes the OPC result code within the Result
/// property.
/// </remarks>
/// <seealso cref="OpcResult">OpcResult Structure</seealso>
[Serializable]
public class OpcResultException : ApplicationException
{
/// <summary>Used to raise an exception associated with a specified result code.</summary>
/// <remarks>
/// The OpcResultException includes the OPC result code within the Result
/// property.
/// </remarks>
/// <seealso cref="OpcResult">OpcResult Structure</seealso>
[Serializable]
public class OpcResultException : ApplicationException
{
/// <remarks/>
public OpcResult Result => result_;
public OpcResult Result => result_;
/// <remarks/>
public OpcResultException(OpcResult result) : base(result.Description()) { result_ = result; }
/// <remarks/>
public OpcResultException(OpcResult result, string message) : base(message + ": " + result.ToString() + Environment.NewLine) { result_ = result; }
/// <remarks/>
public OpcResultException(OpcResult result, string message, Exception e) : base(message + ": " + result.ToString() + Environment.NewLine, e) { result_ = result; }
/// <remarks/>
protected OpcResultException(SerializationInfo info, StreamingContext context) : base(info, context) { }
/// <remarks/>
public OpcResultException(OpcResult result, string message) : base(message + ": " + result.ToString() + Environment.NewLine) { result_ = result; }
/// <remarks/>
public OpcResultException(OpcResult result, string message, Exception e) : base(message + ": " + result.ToString() + Environment.NewLine, e) { result_ = result; }
/// <remarks/>
protected OpcResultException(SerializationInfo info, StreamingContext context) : base(info, context) { }
/// <remarks/>
private OpcResult result_ = OpcResult.E_FAIL;
}
/// <remarks/>
private OpcResult result_ = OpcResult.E_FAIL;
}
}

View File

@@ -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

View File

@@ -42,10 +42,10 @@ namespace Technosoftware.DaAeHdaClient
/// </summary>
public string VendorName { get; set; }
/// <summary>
/// <para>Namespace for types defined by this vendor. This may or
/// may not be the same as the VendorName. Null or empty if not used.</para>
/// </summary>
/// <summary>
/// <para>Namespace for types defined by this vendor. This may or
/// may not be the same as the VendorName. Null or empty if not used.</para>
/// </summary>
public string VendorNamespace { get; set; }
/// <summary>
@@ -53,19 +53,19 @@ namespace Technosoftware.DaAeHdaClient
/// </summary>
public string ServerName { get; set; }
/// <summary>
/// <para>Namespace for server-specific types. Null or empty if not used.</para>
/// <para>This name is typically a concatentation of the VendorNamespace
/// and the ServerName (separated by a '/' character)
/// (e.g "MyVendorNamespace/MyServer").</para>
/// </summary>
/// <summary>
/// <para>Namespace for server-specific types. Null or empty if not used.</para>
/// <para>This name is typically a concatentation of the VendorNamespace
/// and the ServerName (separated by a '/' character)
/// (e.g "MyVendorNamespace/MyServer").</para>
/// </summary>
public string ServerNamespace { get; set; }
/// <summary>
/// <para>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.</para>
/// </summary>
/// <summary>
/// <para>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.</para>
/// </summary>
public string HostName { get; set; }
/// <summary>
@@ -81,5 +81,5 @@ namespace Technosoftware.DaAeHdaClient
/// accessed without a client context.
/// </summary>
public OpcServerDetail ServerDetails { get; set; }
}
}
}

View File

@@ -26,30 +26,30 @@ using System;
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// Detailed information about the server.
/// Set to null if the ServerDescription is being accessed without a client context.
/// </summary>
/// <summary>
/// Detailed information about the server.
/// Set to null if the ServerDescription is being accessed without a client context.
/// </summary>
public class OpcServerDetail
{
/// <summary>
/// The time the server was last started.
/// </summary>
public DateTime StartTime;
{
/// <summary>
/// The time the server was last started.
/// </summary>
public DateTime StartTime;
/// <summary>
/// The build number of the server.
/// </summary>
public string BuildNumber;
/// <summary>
/// The build number of the server.
/// </summary>
public string BuildNumber;
/// <summary>
/// The version of the server.
/// </summary>
public string Version;
/// <summary>
/// The version of the server.
/// </summary>
public string Version;
/// <summary>
/// Vendor-specific information about the server.
/// </summary>
public string VendorInfo;
}
/// <summary>
/// Vendor-specific information about the server.
/// </summary>
public string VendorInfo;
}
}

View File

@@ -26,39 +26,39 @@
namespace Technosoftware.DaAeHdaClient
{
/// <summary>
/// The set of possible server states.
/// </summary>
public enum OpcServerState
{
/// <summary>
/// The server state is not known.
/// </summary>
Unknown,
/// <summary>
/// The set of possible server states.
/// </summary>
public enum OpcServerState
{
/// <summary>
/// The server state is not known.
/// </summary>
Unknown,
/// <summary>
/// The server is running normally. This is the usual state for a server
/// </summary>
Operational,
/// <summary>
/// The server is running normally. This is the usual state for a server
/// </summary>
Operational,
/// <summary>
/// <summary>
/// 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.
/// </summary>
/// </summary>
Faulted,
/// <summary>
/// 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.
/// </summary>
/// <summary>
/// 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.
/// </summary>
NeedsConfiguration,
/// <summary>
/// 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.
/// </summary>
/// <summary>
/// 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.
/// </summary>
OutOfService,
/// <summary>
/// <summary>
/// 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.
/// </summary>
/// </summary>
Diagnostics,
/// <summary>
@@ -80,5 +80,5 @@ namespace Technosoftware.DaAeHdaClient
/// The server is not operational, but the reason is not known.
/// </summary>
NotOperational,
}
}
}

View File

@@ -34,81 +34,81 @@ namespace Technosoftware.DaAeHdaClient
public class OpcType
{
/// <remarks/>
public static Type SBYTE = typeof(sbyte);
public static Type SBYTE = typeof(sbyte);
/// <remarks/>
public static Type BYTE = typeof(byte);
public static Type BYTE = typeof(byte);
/// <remarks/>
public static Type SHORT = typeof(short);
public static Type SHORT = typeof(short);
/// <remarks/>
public static Type USHORT = typeof(ushort);
public static Type USHORT = typeof(ushort);
/// <remarks/>
public static Type INT = typeof(int);
public static Type INT = typeof(int);
/// <remarks/>
public static Type UINT = typeof(uint);
public static Type UINT = typeof(uint);
/// <remarks/>
public static Type LONG = typeof(long);
public static Type LONG = typeof(long);
/// <remarks/>
public static Type ULONG = typeof(ulong);
public static Type ULONG = typeof(ulong);
/// <remarks/>
public static Type FLOAT = typeof(float);
public static Type FLOAT = typeof(float);
/// <remarks/>
public static Type DOUBLE = typeof(double);
public static Type DOUBLE = typeof(double);
/// <remarks/>
public static Type DECIMAL = typeof(decimal);
public static Type DECIMAL = typeof(decimal);
/// <remarks/>
public static Type BOOLEAN = typeof(bool);
public static Type BOOLEAN = typeof(bool);
/// <remarks/>
public static Type DATETIME = typeof(DateTime);
public static Type DATETIME = typeof(DateTime);
/// <remarks/>
public static Type DURATION = typeof(TimeSpan);
public static Type DURATION = typeof(TimeSpan);
/// <remarks/>
public static Type STRING = typeof(string);
public static Type STRING = typeof(string);
/// <remarks/>
public static Type ANY_TYPE = typeof(object);
public static Type ANY_TYPE = typeof(object);
/// <remarks/>
public static Type BINARY = typeof(byte[]);
public static Type BINARY = typeof(byte[]);
/// <remarks/>
public static Type ARRAY_SHORT = typeof(short[]);
public static Type ARRAY_SHORT = typeof(short[]);
/// <remarks/>
public static Type ARRAY_USHORT = typeof(ushort[]);
public static Type ARRAY_USHORT = typeof(ushort[]);
/// <remarks/>
public static Type ARRAY_INT = typeof(int[]);
public static Type ARRAY_INT = typeof(int[]);
/// <remarks/>
public static Type ARRAY_UINT = typeof(uint[]);
public static Type ARRAY_UINT = typeof(uint[]);
/// <remarks/>
public static Type ARRAY_LONG = typeof(long[]);
public static Type ARRAY_LONG = typeof(long[]);
/// <remarks/>
public static Type ARRAY_ULONG = typeof(ulong[]);
public static Type ARRAY_ULONG = typeof(ulong[]);
/// <remarks/>
public static Type ARRAY_FLOAT = typeof(float[]);
public static Type ARRAY_FLOAT = typeof(float[]);
/// <remarks/>
public static Type ARRAY_DOUBLE = typeof(double[]);
public static Type ARRAY_DOUBLE = typeof(double[]);
/// <remarks/>
public static Type ARRAY_DECIMAL = typeof(decimal[]);
public static Type ARRAY_DECIMAL = typeof(decimal[]);
/// <remarks/>
public static Type ARRAY_BOOLEAN = typeof(bool[]);
public static Type ARRAY_BOOLEAN = typeof(bool[]);
/// <remarks/>
public static Type ARRAY_DATETIME = typeof(DateTime[]);
/// <remarks/>
public static Type ARRAY_STRING = typeof(string[]);
public static Type ARRAY_STRING = typeof(string[]);
/// <remarks/>
public static Type ARRAY_ANY_TYPE = typeof(object[]);
/// <remarks/>
public static Type ILLEGAL_TYPE = typeof(OpcType);
public static Type ILLEGAL_TYPE = typeof(OpcType);
/// <summary>
/// Returns an array of all well-known types.
/// </summary>
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));
}
}
}

View File

@@ -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
///////////////////////////////////////////////////////////////////////

View File

@@ -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

View File

@@ -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;
}
/// <summary>

View File

@@ -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