Add alarm acknowledge plan and incorporate code review fixes

Adds alarm_ack.md documenting the two-way acknowledge flow (OPC UA client
writes AckMsg, Galaxy confirms via Acked data change). Includes external
code review fixes for subscriptions and node manager, and removes stale
plan files now superseded by component documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-27 01:02:47 -04:00
parent e3fedcc8f0
commit 9368767b1b
11 changed files with 415 additions and 998 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Shouldly;
using Xunit;
@@ -57,6 +58,25 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.MxAccess
_client.ActiveSubscriptionCount.ShouldBe(1);
}
/// <summary>
/// Confirms that subscribing to the same address twice reuses the existing runtime item.
/// </summary>
[Fact]
public async Task Subscribe_SameAddressTwice_ReusesExistingRuntimeItem()
{
await _client.ConnectAsync();
await _client.SubscribeAsync("TestTag.Attr", (_, _) => { });
await _client.SubscribeAsync("TestTag.Attr", (_, _) => { });
_client.ActiveSubscriptionCount.ShouldBe(1);
_proxy.Items.Values.Count(v => v == "TestTag.Attr").ShouldBe(1);
await _client.UnsubscribeAsync("TestTag.Attr");
_proxy.Items.Values.ShouldNotContain("TestTag.Attr");
}
/// <summary>
/// Confirms that unsubscribing clears the active subscription count after a tag was previously monitored.
/// </summary>