Clean
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 condition’s active state has changed.
|
||||
/// </summary>
|
||||
ActiveState = 0x0001,
|
||||
/// <summary>
|
||||
/// The bits indicating what changes generated an event notification.
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum TsCAeChangeMask
|
||||
{
|
||||
/// <summary>
|
||||
/// The condition’s active state has changed.
|
||||
/// </summary>
|
||||
ActiveState = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// The condition’s acknowledgment state has changed.
|
||||
/// </summary>
|
||||
AcknowledgeState = 0x0002,
|
||||
/// <summary>
|
||||
/// The condition’s acknowledgment state has changed.
|
||||
/// </summary>
|
||||
AcknowledgeState = 0x0002,
|
||||
|
||||
/// <summary>
|
||||
/// The condition’s enabled state has changed.
|
||||
/// </summary>
|
||||
EnableState = 0x0004,
|
||||
/// <summary>
|
||||
/// The condition’s 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#region Using Directives
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Runtime.Serialization;
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user