Files
ScadaBridge/src/ZB.MOM.WW.ScadaBridge.Commons/Entities/Templates/TemplateNativeAlarmSource.cs
T

38 lines
2.0 KiB
C#

namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Templates;
/// <summary>
/// A template-defined binding to a native alarm source: a data connection plus
/// a source reference (OPC UA SourceNode/notifier nodeId, or MxAccess
/// object/area). At deploy time the instance subscribes and mirrors all
/// conditions discovered under the source. Inheritance/lock semantics mirror
/// <see cref="TemplateAlarm"/>.
/// </summary>
public class TemplateNativeAlarmSource
{
/// <summary>Database primary key.</summary>
public int Id { get; set; }
/// <summary>Foreign key to the owning <see cref="Template"/>.</summary>
public int TemplateId { get; set; }
/// <summary>Unique source binding name within the template.</summary>
public string Name { get; set; }
/// <summary>Optional human-readable description.</summary>
public string? Description { get; set; }
/// <summary>Name of the data connection that owns the alarm feed.</summary>
public string ConnectionName { get; set; } = string.Empty;
/// <summary>Source reference (OPC UA SourceNode/notifier nodeId, or MxAccess object/area).</summary>
public string SourceReference { get; set; } = string.Empty;
/// <summary>Optional condition filter; null = mirror all conditions under the source.</summary>
public string? ConditionFilter { get; set; }
/// <summary>When true, this binding cannot be overridden in derived templates.</summary>
public bool IsLocked { get; set; }
/// <summary>True when copied from a base template and not yet overridden on the derived template.</summary>
public bool IsInherited { get; set; }
/// <summary>Set on a base binding; when true derived templates may not override it.</summary>
public bool LockedInDerived { get; set; }
/// <summary>Initializes a new binding with the specified name.</summary>
/// <param name="name">The unique binding name within the template.</param>
public TemplateNativeAlarmSource(string name) =>
Name = name ?? throw new ArgumentNullException(nameof(name));
}