feat(alarms): wire OnEnableDisable over OPC UA (AlarmAck-gated; native→BadNotSupported) [H4]

This commit is contained in:
Joseph Doherty
2026-06-15 14:24:19 -04:00
parent 226587d817
commit 328bd1b9ee
2 changed files with 122 additions and 0 deletions
@@ -634,6 +634,19 @@ public sealed class OtOpcUaNodeManager : CustomNodeManager2
return ServiceResult.Good;
};
// H4 — inbound Part 9 Enable/Disable (the condition type's built-in Enable/Disable methods route
// here via this delegate). The engine handles Enable/Disable for SCRIPTED alarms
// (ScriptedAlarmEngine.EnableAsync/DisableAsync, dispatched by ScriptedAlarmHostActor on the
// "Enable"/"Disable" AlarmCommand operations), so a scripted condition routes through the same
// AlarmAck-gated HandleAlarmCommand as the other handlers. NATIVE (driver-fed) conditions have no
// engine enable/disable surface (Phase 3 decision #2) — they short-circuit to BadNotSupported.
alarm.OnEnableDisable = (context, condition, enabling) =>
{
if (_nativeAlarmNodeIds.Contains(alarmNodeId))
return new ServiceResult(StatusCodes.BadNotSupported);
return HandleAlarmCommand(context, condition, enabling ? "Enable" : "Disable", comment: null, unshelveAt: null);
};
parent.AddChild(alarm);
// Promote the equipment folder to an event notifier + register it as a root notifier so