fix(opcua): condition Severity is carried verbatim, not re-bucketed to 5 points
OtOpcUaNodeManager.MapSeverity re-bucketed every projected severity onto the SDK's five EventSeverity values (<800 -> 700, else 900), defeating #626's exact OpcUaSeverity: an MTConnect Fault (800) read and evented as 900; a scripted alarm graded 1000 published 900 while /alerts said 1000; a native Low (200) published 300. EventSeverity merely names points on the 1..1000 scale, so the node now carries the value clamped to 1..1000 (ToPart9Severity), at materialise, projection and in the delta gate. MTConnect wire test now asserts Fault ActiveState=true/Severity=800 and the Normal clear ActiveState=false/Retain=false/Severity=800. Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
@@ -398,8 +398,8 @@ public sealed class SdkAddressSpaceSinkTests : IDisposable
|
||||
// SetShelvingState(shelved:true, oneShot:false) drives the shelving sub-state machine into a
|
||||
// shelved state; CurrentState is populated (TimedShelved).
|
||||
condition.ShelvingState!.CurrentState.Id.Value.ShouldNotBeNull();
|
||||
// Severity 850 → High bucket (>= 800) → EventSeverity.High (the SDK stamps the ushort value).
|
||||
condition.Severity.Value.ShouldBe((ushort)EventSeverity.High);
|
||||
// Severity 850 is carried verbatim — not re-bucketed onto EventSeverity.High (900).
|
||||
condition.Severity.Value.ShouldBe((ushort)850);
|
||||
condition.Message.Value.Text.ShouldBe("Pressure above limit");
|
||||
condition.Retain.Value.ShouldBeTrue(); // active || !acked ⇒ retain
|
||||
|
||||
|
||||
Reference in New Issue
Block a user