From be6858baa1e141c6fbedfc5b3705004f16390806 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Mon, 15 Jun 2026 14:30:17 -0400 Subject: [PATCH] fix(alarms): OnEnableDisable native-check via lock-guarded IsNativeAlarmNode + unstale AlarmCommand doc (code-review) --- src/Core/ZB.MOM.WW.OtOpcUa.Commons/OpcUa/AlarmCommand.cs | 6 +++--- .../ZB.MOM.WW.OtOpcUa.OpcUaServer/OtOpcUaNodeManager.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Core/ZB.MOM.WW.OtOpcUa.Commons/OpcUa/AlarmCommand.cs b/src/Core/ZB.MOM.WW.OtOpcUa.Commons/OpcUa/AlarmCommand.cs index d2045883..72e88c37 100644 --- a/src/Core/ZB.MOM.WW.OtOpcUa.Commons/OpcUa/AlarmCommand.cs +++ b/src/Core/ZB.MOM.WW.OtOpcUa.Commons/OpcUa/AlarmCommand.cs @@ -32,9 +32,9 @@ public static class AlarmCommandsTopic /// The Part 9 operation, one of: Acknowledge, Confirm, OneShotShelve, /// TimedShelve, Unshelve, Enable, Disable, AddComment. These map /// 1:1 onto the engine's Part9StateMachine.Apply* calls on the consuming side (T19). -/// Note: Enable and Disable are part of the vocabulary but are not yet wired at the -/// node-manager seam (T18 wired Acknowledge/Confirm/AddComment/Shelve/TimedUnshelve only); -/// OnEnableDisable delegate wiring is a future task. +/// All of Acknowledge/Confirm/AddComment/Shelve/TimedUnshelve/ +/// Enable/Disable are wired at the node-manager seam; the Enable/Disable +/// operations are produced by the condition's OnEnableDisable delegate. /// /// The acting user — the authenticated session identity's display/name. /// diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/OtOpcUaNodeManager.cs b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/OtOpcUaNodeManager.cs index d10bafd7..d96d993f 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/OtOpcUaNodeManager.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/OtOpcUaNodeManager.cs @@ -642,7 +642,7 @@ public sealed class OtOpcUaNodeManager : CustomNodeManager2 // engine enable/disable surface (Phase 3 decision #2) — they short-circuit to BadNotSupported. alarm.OnEnableDisable = (context, condition, enabling) => { - if (_nativeAlarmNodeIds.Contains(alarmNodeId)) + if (IsNativeAlarmNode(alarmNodeId)) return new ServiceResult(StatusCodes.BadNotSupported); return HandleAlarmCommand(context, condition, enabling ? "Enable" : "Disable", comment: null, unshelveAt: null); };