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:
@@ -85,6 +85,21 @@ namespace ZB.MOM.WW.LmxOpcUa.Tests.Helpers
|
||||
sw.Elapsed.TotalSeconds.ShouldBeLessThan(30);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that runtime callbacks arriving after shutdown are ignored cleanly.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Stop_UnhooksNodeManagerFromMxAccessCallbacks()
|
||||
{
|
||||
var mxClient = new FakeMxAccessClient();
|
||||
var fixture = OpcUaServerFixture.WithFakeMxAccessClient(mxClient);
|
||||
await fixture.InitializeAsync();
|
||||
|
||||
await fixture.DisposeAsync();
|
||||
|
||||
Should.NotThrow(() => mxClient.SimulateDataChange("TestMachine_001.MachineID", Vtq.Good(42)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirms that the fake-backed fixture builds the seeded address space and Galaxy statistics.
|
||||
/// </summary>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user