fix(dcl): forget an OPC UA condition's last state once it returns to normal (review 2026-10-21 02/L3)
This commit is contained in:
@@ -1236,8 +1236,18 @@ public class RealOpcUaClient : IOpcUaClient
|
||||
var kind = inRefresh
|
||||
? AlarmTransitionKind.Snapshot
|
||||
: OpcUaAlarmMapper.DeriveKind(prevAcked, acked, prevActive, active);
|
||||
lastState?.TryAdd(sourceRef, (active, acked));
|
||||
if (lastState != null) lastState[sourceRef] = (active, acked);
|
||||
if (lastState != null)
|
||||
{
|
||||
// Inactive + acknowledged IS the default prior state above, so forgetting it changes
|
||||
// no derived kind — and keeps the map bounded on servers whose condition names carry
|
||||
// a per-occurrence component (batch, lot, counter), where every occurrence is a new
|
||||
// key for the life of the session (review 2026-10-21 02/L3; mirrors the actor's
|
||||
// CacheAlarmTransition removal rule).
|
||||
if (!active && acked)
|
||||
lastState.Remove(sourceRef);
|
||||
else
|
||||
lastState[sourceRef] = (active, acked);
|
||||
}
|
||||
|
||||
onTransition(new NativeAlarmTransition(
|
||||
SourceReference: sourceRef,
|
||||
|
||||
Reference in New Issue
Block a user