64e3fbe035
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
62 lines
3.0 KiB
C#
62 lines
3.0 KiB
C#
namespace ZB.MOM.WW.OtOpcUa.Configuration.Entities;
|
|
|
|
/// <summary>
|
|
/// Per Phase 7 plan decisions #5, #13, #15 — a scripted OPC UA Part 9 alarm whose
|
|
/// condition is the predicate <see cref="Script"/> referenced by
|
|
/// <see cref="PredicateScriptId"/>. Materialized by <c>Core.ScriptedAlarms</c> as a
|
|
/// concrete <c>AlarmConditionType</c> subtype per <see cref="AlarmType"/>.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Message tokens (<c>{TagPath}</c>) resolved at emission time per plan decision #13.
|
|
/// <see cref="HistorizeToAveva"/> (plan decision #15) gates whether transitions
|
|
/// route through the Core.AlarmHistorian SQLite queue + Galaxy.Host to the Aveva
|
|
/// Historian alarm schema.
|
|
/// </para>
|
|
/// </remarks>
|
|
public sealed class ScriptedAlarm
|
|
{
|
|
/// <summary>Gets or sets the database row identifier for this scripted alarm.</summary>
|
|
public Guid ScriptedAlarmRowId { get; set; }
|
|
|
|
/// <summary>Stable logical id — drives <c>AlarmConditionType.ConditionName</c>. Globally unique in v2.</summary>
|
|
public required string ScriptedAlarmId { get; set; }
|
|
|
|
/// <summary>Logical FK to <see cref="Equipment.EquipmentId"/> — owner of this alarm.</summary>
|
|
public required string EquipmentId { get; set; }
|
|
|
|
/// <summary>Operator-facing alarm name.</summary>
|
|
public required string Name { get; set; }
|
|
|
|
/// <summary>Concrete Part 9 type — "AlarmCondition" / "LimitAlarm" / "OffNormalAlarm" / "DiscreteAlarm".</summary>
|
|
public required string AlarmType { get; set; }
|
|
|
|
/// <summary>Numeric severity 1..1000 per OPC UA Part 9 (usual bands: 1-250 Low, 251-500 Medium, 501-750 High, 751-1000 Critical).</summary>
|
|
public int Severity { get; set; } = 500;
|
|
|
|
/// <summary>Template with <c>{TagPath}</c> tokens resolved at emission time.</summary>
|
|
public required string MessageTemplate { get; set; }
|
|
|
|
/// <summary>Logical FK to <see cref="Script.ScriptId"/> — predicate script returning <c>bool</c>.</summary>
|
|
public required string PredicateScriptId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Plan decision #15 — when true, transitions route through the SQLite store-and-forward
|
|
/// queue to the Aveva Historian. Defaults on for scripted alarms because they are the
|
|
/// primary motivation for the historian sink; operator can disable per alarm.
|
|
/// </summary>
|
|
public bool HistorizeToAveva { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// OPC UA Part 9 <c>Retain</c> flag — whether the alarm keeps active-state between
|
|
/// sessions. Most plant alarms are retained; one-shot event-style alarms are not.
|
|
/// </summary>
|
|
public bool Retain { get; set; } = true;
|
|
|
|
/// <summary>Gets or sets a value indicating whether this alarm is enabled.</summary>
|
|
public bool Enabled { get; set; } = true;
|
|
|
|
/// <summary>Optimistic concurrency token for last-write-wins detection in the v2 live-edit model.</summary>
|
|
public byte[] RowVersion { get; set; } = Array.Empty<byte>();
|
|
}
|