feat(opcua): surgical RemoveAlarmConditionNode (R2-07 T9)
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
{
|
||||
"id": "T9",
|
||||
"subject": "Phase 2: OtOpcUaNodeManager.RemoveAlarmConditionNode (+ native-flag cleanup) (high-risk)",
|
||||
"status": "pending",
|
||||
"status": "completed",
|
||||
"blockedBy": [
|
||||
"T7"
|
||||
]
|
||||
|
||||
@@ -1823,7 +1823,28 @@ public sealed class OtOpcUaNodeManager : CustomNodeManager2
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ISurgicalAddressSpaceSink.RemoveAlarmConditionNode"/>
|
||||
public bool RemoveAlarmConditionNode(string alarmNodeId) => false;
|
||||
public bool RemoveAlarmConditionNode(string alarmNodeId)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrEmpty(alarmNodeId);
|
||||
EnsureAddressSpaceCreated();
|
||||
|
||||
GeneralModelChangeEventState e;
|
||||
lock (Lock)
|
||||
{
|
||||
// Unknown id ⇒ map drift ⇒ false (caller rebuilds). Mirrors the condition teardown inside
|
||||
// RebuildAddressSpace, scoped to this one condition. The equipment folder's event-notifier
|
||||
// promotion is intentionally NOT demoted here — other conditions may still hang under it, and a
|
||||
// lingering notifier folder is harmless (RemoveEquipmentSubtree demotes it when the whole
|
||||
// equipment goes).
|
||||
if (!_alarmConditions.TryRemove(alarmNodeId, out var condition)) return false;
|
||||
condition.Parent?.RemoveChild(condition);
|
||||
PredefinedNodes?.Remove(condition.NodeId);
|
||||
_nativeAlarmNodeIds.Remove(alarmNodeId);
|
||||
e = BuildNodesRemovedModelChange(alarmNodeId);
|
||||
}
|
||||
ReportModelChangeOutsideLock(e, alarmNodeId);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ISurgicalAddressSpaceSink.RemoveEquipmentSubtree"/>
|
||||
public bool RemoveEquipmentSubtree(string equipmentNodeId) => false;
|
||||
|
||||
Reference in New Issue
Block a user