7b0b9c7365
Solution + 23 src projects + 26 test projects renamed; folders, csproj, namespaces, and ScadaLinkDbContext/ScadaBridgeDbContext class updated. ActorSystem "scadalink" → "scadabridge", Akka seed-node URLs migrated. SQL roles/logins, LDAP domains, CLI command name, and CLI config dir (~/.scadalink → ~/.scadabridge) also renamed. Build green; 5 Host.Tests fail awaiting SQL login rename in next commit. Pre-existing StaleTagMonitor timing flakes unchanged. Rename script committed at tools/rename-to-scadabridge.sh.
55 lines
2.3 KiB
C#
55 lines
2.3 KiB
C#
namespace ZB.MOM.WW.ScadaBridge.Commons.Entities.Instances;
|
|
|
|
/// <summary>
|
|
/// Per-instance override for a template-defined alarm. Lets a deployed
|
|
/// instance tweak setpoints, priority, or per-band messages without forking
|
|
/// the template. Locked alarms (TemplateAlarm.IsLocked) cannot be overridden
|
|
/// — LockEnforcer rejects the change at write time.
|
|
///
|
|
/// Merge semantics (applied during flattening, after template inheritance and
|
|
/// composition):
|
|
/// • <see cref="TriggerConfigurationOverride"/> with a HiLo trigger merges
|
|
/// into the inherited JSON setpoint-by-setpoint (derived keys win,
|
|
/// inherited keys survive for unset derived keys). Same logic as
|
|
/// template-to-template HiLo override, just one layer deeper.
|
|
/// • For ValueMatch / RangeViolation / RateOfChange, the override replaces
|
|
/// the whole TriggerConfiguration JSON (existing whole-replace semantics).
|
|
/// • <see cref="PriorityLevelOverride"/> replaces the alarm's PriorityLevel
|
|
/// when set.
|
|
/// </summary>
|
|
public class InstanceAlarmOverride
|
|
{
|
|
/// <summary>Primary key.</summary>
|
|
public int Id { get; set; }
|
|
/// <summary>Foreign key to the instance this override belongs to.</summary>
|
|
public int InstanceId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Canonical name of the alarm being overridden — matches
|
|
/// <c>ResolvedAlarm.CanonicalName</c> after flattening, so composed-member
|
|
/// alarms are referenced as <c>[CompositionInstance].[AlarmName]</c>.
|
|
/// </summary>
|
|
public string AlarmCanonicalName { get; set; }
|
|
|
|
/// <summary>
|
|
/// Partial JSON (for HiLo) or full JSON (for binary trigger types) to
|
|
/// override the inherited TriggerConfiguration. <c>null</c> means
|
|
/// "leave inherited as-is".
|
|
/// </summary>
|
|
public string? TriggerConfigurationOverride { get; set; }
|
|
|
|
/// <summary>
|
|
/// Replaces the alarm's PriorityLevel when set. <c>null</c> = keep inherited.
|
|
/// </summary>
|
|
public int? PriorityLevelOverride { get; set; }
|
|
|
|
/// <summary>
|
|
/// Initializes a new alarm override for the specified alarm.
|
|
/// </summary>
|
|
/// <param name="alarmCanonicalName">Canonical name of the alarm to override.</param>
|
|
public InstanceAlarmOverride(string alarmCanonicalName)
|
|
{
|
|
AlarmCanonicalName = alarmCanonicalName ?? throw new ArgumentNullException(nameof(alarmCanonicalName));
|
|
}
|
|
}
|