feat(commons): enrich AlarmStateChanged with unified condition state (additive)

This commit is contained in:
Joseph Doherty
2026-05-29 15:40:20 -04:00
parent 696da92c3a
commit edc2dacf6c
3 changed files with 89 additions and 0 deletions
@@ -0,0 +1,16 @@
using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums;
namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Alarms;
/// <summary>Builds <see cref="AlarmConditionState"/> values for the supported alarm kinds.</summary>
public static class AlarmConditionStateFactory
{
/// <summary>
/// Computed alarms have no native ack/shelve/suppress lifecycle: they are
/// auto-acked, never shelved or suppressed, not confirmable, and their
/// severity is the configured priority. Active mirrors the alarm State.
/// </summary>
public static AlarmConditionState ForComputed(AlarmState state, int priority) =>
new(Active: state == AlarmState.Active, Acknowledged: true, Confirmed: null,
Shelve: AlarmShelveState.Unshelved, Suppressed: false, Severity: priority);
}