feat(commons): enrich AlarmStateChanged with unified condition state (additive)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user