From d3067ca036bd884047806c7182971ad27aaca943 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Sat, 28 Nov 2026 09:14:49 -0500 Subject: [PATCH] fix(dcl): key OPC UA alarms on ConditionId (#147) OtOpcUa now exposes conditions imported over gRPC data connections in the namespace https://zb.com/otopcua/mapped/conditions. Their ConditionId is an opaque c1. NodeId stable for the life of the connection, but their SourceName (/) moves when the primary placement mapping changes. ScadaBridge keyed every condition on SourceName.ConditionName, so a mapping change read as one alarm clearing and a new one raising. - Event filter selects ConditionId (select clause 19: ConditionType, empty browse path, AttributeId = NodeId). - When the ConditionId (or SourceNode, which OtOpcUa sets to it) is in the mapped/conditions namespace, the per-condition key is its durable nsu=... string (index-proof across an OtOpcUa pair / upgrade). Every other OPC UA condition keeps the SourceName.ConditionName key, so no existing persisted row, MES script or operator view is re-keyed. - The old SourceName.ConditionName text becomes an additive, display-only DisplayName: NativeAlarmTransition -> AlarmStateChanged -> AlarmStateUpdate.display_name (26) / DebugAlarmStateDto.display_name (22) -> ScriptAlarm.DisplayName. Persisted in native_alarm_state metadata_json (no column, no CDC trigger change); updates in place on every transition under the fixed key. Protos regenerated. - Alarm Summary and Debug View show DisplayName (key as tooltip) and filter on it; site event log writes "label [key]". - Upgrade: a pre-#147 row for an imported condition is retired by the first completed refresh snapshot (one return-to-normal + drop), then the condition continues under its ConditionId. Tests: RealOpcUaImportedConditionKeyTests, OpcUaAlarmMapperTests, NativeAlarmActorTests (DisplayName, rehydration, legacy-row retirement), StreamRelayActorTests, SiteCommand golden sample, AlarmsAccessorTests, DebugTreeBuilderTests; filter select-clause count 19 -> 20. Docs: Component-DataConnectionLayer/Commons/Communication/SiteRuntime. --- docs/requirements/Component-Commons.md | 2 +- docs/requirements/Component-Communication.md | 3 + .../Component-DataConnectionLayer.md | 11 +- docs/requirements/Component-SiteRuntime.md | 4 +- .../Pages/Deployment/DebugTreeBuilder.cs | 8 +- .../Pages/Deployment/DebugView.razor | 2 + .../Pages/Monitoring/AlarmSummary.razor | 13 +- .../Messages/Streaming/AlarmStateChanged.cs | 8 + .../Types/Alarms/NativeAlarmTransition.cs | 16 +- .../Types/Scripts/ScriptAlarm.cs | 9 +- .../Actors/StreamRelayActor.cs | 4 +- .../Grpc/SiteCommandDtoMapper.cs | 6 +- .../Grpc/SiteStreamGrpcClient.cs | 4 +- .../Protos/site_command.proto | 4 + .../Protos/sitestream.proto | 6 + .../SiteCommandGrpc/SiteCommand.cs | 460 ++++++++++-------- .../SiteStreamGrpc/Sitestream.cs | 179 ++++--- .../Adapters/OpcUaAlarmMapper.cs | 47 ++ .../Adapters/RealOpcUaClient.cs | 56 ++- .../Actors/NativeAlarmActor.cs | 28 +- .../Scripts/ScriptRuntimeContext.cs | 4 +- .../Deployment/DebugTreeBuilderTests.cs | 18 + .../Grpc/StreamRelayActorTests.cs | 35 ++ .../SiteCommandSamples.cs | 6 +- .../RealOpcUaClientAlarmFilterTests.cs | 24 +- .../RealOpcUaImportedConditionKeyTests.cs | 162 ++++++ .../OpcUaAlarmMapperTests.cs | 39 ++ .../Actors/NativeAlarmActorTests.cs | 130 +++++ .../Scripts/AlarmsAccessorTests.cs | 14 + 29 files changed, 992 insertions(+), 310 deletions(-) create mode 100644 tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaImportedConditionKeyTests.cs diff --git a/docs/requirements/Component-Commons.md b/docs/requirements/Component-Commons.md index c37f1600..c3a57589 100644 --- a/docs/requirements/Component-Commons.md +++ b/docs/requirements/Component-Commons.md @@ -38,7 +38,7 @@ Commons must define shared primitive and utility types used across multiple comp - **`AlarmShelveState` enum**: Unshelved, OneShotShelved, TimedShelved, PermanentShelved. OPC UA Part 9 shelving sub-state of an alarm condition; mirrored read-only from the source. Computed alarms are always `Unshelved`. - **`AlarmTransitionKind` enum**: Snapshot, SnapshotComplete, Raise, Acknowledge, Clear, Retrigger, StateChange. Classifies a `NativeAlarmTransition`; `Snapshot`/`SnapshotComplete` carry the initial active-condition replay produced on every (re)subscribe so consumers can re-seed state. - **`AlarmConditionState`**: The unified, read-only alarm condition state. The OPC UA Part 9 sub-conditions are orthogonal (and MxAccess's ACTIVE / ACTIVE_ACKED / INACTIVE map cleanly onto them), so they are modeled as independent flags — `Active`, `Acknowledged`, `Confirmed` (`bool?`; null when not confirmable), `Shelve` (`AlarmShelveState`), `Suppressed` — plus a `Severity` on the unified 0–1000 scale, **higher = more urgent for every source** (Gitea #129), and a trailing `Priority` (`int?`). OPC UA rows carry their Part 9 Severity (and repeat it as `Priority` — OPC UA has no separate priority); MxAccess Gateway rows and computed alarms band their AVEVA-style priority (lower = more urgent) onto `Severity` — AVEVA priority 1–250 → 1000, 251–500 → 750, 501–750 → 500, 751–999 → 250 (`AlarmPriorityBands`, the same table as OtOpcUa `GalaxyAlarmPriority`, lmxopcua#887) — and keep the raw value on `Priority`, which is exactly what `Severity` held before #129 and what the native MES 900–999 band keys off. Never sort or threshold on `Priority`; its direction depends on the source. `Priority` is null only on a pre-#129 persisted row (the native mirror upgrades it on rehydrate). (Helper `AlarmConditionStateFactory` builds the computed-alarm projection and `SeverityFromPriority(kind, priority)` for central's stream decode.) -- **`NativeAlarmTransition`**: The protocol-neutral alarm transition emitted by an `IAlarmSubscribableConnection` adapter — `SourceReference` (stable per-condition key), `SourceObjectReference` (owning source object, used for instance routing), `AlarmTypeName`, `Kind` (`AlarmTransitionKind`), `Condition` (`AlarmConditionState`), source taxonomy/operator/value metadata (`Category`, `Description`, `Message`, `OperatorUser`, `OperatorComment`, `CurrentValue`, `LimitValue`), and `OriginalRaiseTime?` / `TransitionTime`. +- **`NativeAlarmTransition`**: The protocol-neutral alarm transition emitted by an `IAlarmSubscribableConnection` adapter — `SourceReference` (stable per-condition key), `SourceObjectReference` (owning source object, used for instance routing), `AlarmTypeName`, `Kind` (`AlarmTransitionKind`), `Condition` (`AlarmConditionState`), source taxonomy/operator/value metadata (`Category`, `Description`, `Message`, `OperatorUser`, `OperatorComment`, `CurrentValue`, `LimitValue`), and `OriginalRaiseTime?` / `TransitionTime`. Additive trailing `DisplayName?` (Gitea #147): a display-only label set when `SourceReference` is an opaque key — OtOpcUa imported conditions are keyed on their durable `ConditionId`, and the label is the `SourceName.ConditionName` that may move; mirrored as `AlarmStateChanged.DisplayName` and `ScriptAlarm.DisplayName` (empty = show the key). - **`ConnectionHealth` enum**: Connected, Disconnected, Connecting, Error. - **`TrackedOperationId`**: A GUID identifying a tracked store-and-forward operation (`ExternalSystem.CachedCall`, `Database.CachedWrite`, `Notify.Send`). Generated caller-side at the site at call time, returned to the script as a tracking handle, and reused as the idempotency key for telemetry sent to central. The notification domain's existing `NotificationId` is the notification-specific name for this same concept. - **`TrackedOperationKind` enum**: ExternalCall, DatabaseWrite. Discriminates the two cached-call kinds carried by a tracked operation (notifications are tracked separately via the `NotificationType` enum). diff --git a/docs/requirements/Component-Communication.md b/docs/requirements/Component-Communication.md index 785a82b0..87077a2d 100644 --- a/docs/requirements/Component-Communication.md +++ b/docs/requirements/Component-Communication.md @@ -248,6 +248,9 @@ read the traffic". TLS is follow-on hardening and does not change this design. | `limit_value` | 21 | string | Limit / setpoint value that the alarm evaluates against. | | `native_source_canonical_name` | 22 | string | Native binding canonical name; empty for computed alarms. | | `is_configured_placeholder` | 23 | bool | Marks a quiet-binding placeholder row. **Snapshot-only** — see the relay note below; on the live gRPC stream this is always `false`. | +| `ack_time` | 24 | Timestamp | Ack instant; absent while unacknowledged and on computed alarms. | +| `is_mes_reportable` | 25 | bool | Deployed MES-reportable flag (Gitea #60). | +| `display_name` | 26 | string | Display-only label when `alarm_name`/`source_reference` is an opaque key — an OtOpcUa imported condition keyed on its `ConditionId` (Gitea #147). Empty ⇒ display `alarm_name` (also what a pre-#147 site sends). Mirrored as `DebugAlarmStateDto.display_name` (22) on the snapshot. | - **Server-side mapping (`StreamRelayActor.HandleAlarmStateChanged`)**: maps the enriched domain `AlarmStateChanged` event — `Kind` + `AlarmConditionState` + native metadata — out to the proto `AlarmStateUpdate`. The nullable `original_raise_time` is emitted only when present, and `shelve_state` is mapped from the domain shelve enum to its wire string via a new **`AlarmShelveStateCodec`** (string↔enum, defaulting to `Unshelved`). The domain `Confirmed` (`bool?`) is collapsed to a definite bool for field 11. - **Placeholder rows are dropped at the relay**: `is_configured_placeholder` (field 23) is a **Debug View snapshot-only** concept emitted by `InstanceActor.BuildAlarmStatesSnapshot` for quiet bindings — it is never a real alarm transition (its timestamp may be `DateTimeOffset.MinValue`, the Protobuf `Timestamp` lower boundary). `StreamRelayActor.HandleAlarmStateChanged` therefore returns early — **never relaying a placeholder row to the live gRPC stream** — so field 23 is always `false` on the live stream and only ever carries `true` in the snapshot path. diff --git a/docs/requirements/Component-DataConnectionLayer.md b/docs/requirements/Component-DataConnectionLayer.md index 52d6d0ba..ccf6e6a5 100644 --- a/docs/requirements/Component-DataConnectionLayer.md +++ b/docs/requirements/Component-DataConnectionLayer.md @@ -380,7 +380,14 @@ Other/custom protocols do not implement the capability; a subscribe request agai The `DataConnectionActor` opens **one alarm feed per source** (not per subscriber) and routes incoming transitions to instance subscribers by **source-object reference** — a prefix match of the transition's `SourceObjectReference` (falling back to `SourceReference`) against each subscriber's registered `SourceReference`. Subscribers (the Site Runtime's `NativeAlarmActor` instances) are **ref-counted per source**, so the underlying feed is opened once and torn down only when the last subscriber for that source unsubscribes. -The registered `SourceReference` is a **NodeId** for OPC UA (the picker, CSV and config all store NodeIds), so the transition's routing identity must live in the same space or nothing matches. **Gitea #17**: the OPC UA adapter previously set `SourceObjectReference` from the event's `SourceName` (a plain name — the RawPath for OtOpcUa), which never prefix-matches a NodeId binding, so every native OPC UA alarm transition was silently dropped. Because each OPC UA feed is opened for exactly one binding, the adapter now tags every transition on that feed with the **binding string verbatim** (via the pure `OpcUaAlarmMapper.BuildIdentity`), making the routing key an exact match independent of whether the binding is stored as `ns=` or the durable `nsu=` form. The Server-object aggregate feed (empty binding) keeps an empty routing identity, so it reaches only "mirror everything" subscribers and never leaks into a specific-node binding. The per-condition `SourceReference` key stays the human-readable `SourceName.ConditionName`, so persistence and display are unchanged. MxGateway is unaffected — its bindings are object names and its mapper already emits matching names. +The registered `SourceReference` is a **NodeId** for OPC UA (the picker, CSV and config all store NodeIds), so the transition's routing identity must live in the same space or nothing matches. **Gitea #17**: the OPC UA adapter previously set `SourceObjectReference` from the event's `SourceName` (a plain name — the RawPath for OtOpcUa), which never prefix-matches a NodeId binding, so every native OPC UA alarm transition was silently dropped. Because each OPC UA feed is opened for exactly one binding, the adapter now tags every transition on that feed with the **binding string verbatim** (via the pure `OpcUaAlarmMapper.BuildIdentity`), making the routing key an exact match independent of whether the binding is stored as `ns=` or the durable `nsu=` form. The Server-object aggregate feed (empty binding) keeps an empty routing identity, so it reaches only "mirror everything" subscribers and never leaks into a specific-node binding. The per-condition `SourceReference` key stays the human-readable `SourceName.ConditionName`, so persistence and display are unchanged — with one exception, below. MxGateway is unaffected — its bindings are object names and its mapper already emits matching names. + +**Imported OtOpcUa conditions key on `ConditionId` (Gitea #147).** OtOpcUa can import another cluster's conditions over a gRPC data connection; they live in the namespace `https://zb.com/otopcua/mapped/conditions` with an opaque `ConditionId` (`s=c1.`, never constructed or parsed) that is stable for the life of the data connection, while their `SourceName` is `/` and **moves** when the primary placement mapping changes (mapping disabled/undeployed or no longer listing the condition, a higher-priority mapping starts listing it, or a condition first seen while the Raw mapping was unavailable moving once Raw lists it). Keyed on `SourceName.ConditionName`, a mapping change looked like one alarm clearing and a new one raising. The event filter therefore selects `ConditionId` (select clause **19**: `ConditionType`, empty browse path, `AttributeId = NodeId`, per Part 9), and when the ConditionId — or, if a server leaves that operand unanswered, the `SourceNode`, which OtOpcUa sets to the ConditionId for these — is in that namespace, `OpcUaAlarmMapper.BuildIdentity` makes the durable `nsu=https://zb.com/otopcua/mapped/conditions;s=c1.…` string the per-condition key. The `nsu=` form is deliberate: namespace indices can differ between the two members of an OtOpcUa pair or across a server upgrade, and a key that changed on failover would re-introduce the defect. The old `SourceName.ConditionName` text becomes the additive, display-only **`DisplayName`** (`NativeAlarmTransition.DisplayName` → `AlarmStateChanged.DisplayName` → `AlarmStateUpdate.display_name` = 26 / `DebugAlarmStateDto.display_name` = 22 → `ScriptAlarm.DisplayName`; persisted in `native_alarm_state.metadata_json`, so no column or replication-trigger change), carried on every transition so it updates in place while the key holds. The Alarm Summary and Debug View show `DisplayName` when present (the key is the tooltip) and the site event log writes `label [key]`; an older central or site simply sees an empty `DisplayName` and shows the key. + +- **Scope — imported conditions only.** Every other OPC UA condition keeps `SourceName.ConditionName`: OtOpcUa local conditions already have a unique, stable SourceName (RawPath / scripted alarm id), third-party servers make no stability promise for ConditionId (some mint a node per occurrence, some omit it), and re-keying them would rename every condition already in `native_alarm_state`, in MES scripts and on operators' screens. +- **Upgrade of persisted state.** A row written for an imported condition by a pre-#147 build is keyed the old way. It is rehydrated as before, and the first refresh after (re)subscribe lists the condition under its new key, so the snapshot swap retires the old key with one synthesised return-to-normal + `NativeAlarmDropped` and the condition continues under the ConditionId — no ghost row survives a completed refresh. If no refresh completes (the subscribe-time ConditionRefresh fails), the old row stays until the next successful one; a redeploy clears native alarm state outright. +- **Routing is unchanged** — still the binding string (`SourceObjectReference`); template native-alarm-source bindings and condition-type filters do not look at the per-condition key. Transition-kind derivation (`_alarmLastState`) uses the same key, so an ack after a SourceName move is an Acknowledge, not a fresh Raise. A ConditionId also changes when the origin rotates its `ConditionKeySecret` or the connection is re-created — the server then removes and re-adds the condition with RefreshRequired (#148), which this mirror handles as a clear + raise. +- Covered by `RealOpcUaImportedConditionKeyTests`, `OpcUaAlarmMapperTests`, `NativeAlarmActorTests` (`DisplayName_*`, `Rehydration_RestoresDisplayName`, `LegacyKeyedRow_IsRetiredByTheFirstSnapshot`), `StreamRelayActorTests` and `DebugTreeBuilderTests`. - **State gating**: `SubscribeAlarmsRequest` is handled only in the **Connected** state; requests arriving while **Connecting**/**Reconnecting** are coalesced to the latest request per subscriber actor/source and processed on entering Connected. Unsubscribes and subscriber termination are handled in every state. - **Capability check**: if `_adapter is not IAlarmSubscribableConnection`, the actor replies `SubscribeAlarmsResponse(Success = false, ...)`. @@ -397,7 +404,7 @@ All defined in Commons so the feed is identical across protocols: | Type | Shape | |------|-------| -| `NativeAlarmTransition` | `SourceReference`, `SourceObjectReference`, `AlarmTypeName`, `Kind`, `Condition`, `Category`, `Description`, `Message`, `OperatorUser`, `OperatorComment`, `OriginalRaiseTime?`, `TransitionTime`, `CurrentValue`, `LimitValue`, `AckTime?` | +| `NativeAlarmTransition` | `SourceReference`, `SourceObjectReference`, `AlarmTypeName`, `Kind`, `Condition`, `Category`, `Description`, `Message`, `OperatorUser`, `OperatorComment`, `OriginalRaiseTime?`, `TransitionTime`, `CurrentValue`, `LimitValue`, `AckTime?`, `SnapshotSourceReference?`, `SnapshotId?`, `DisplayName?` (#147) | | `AlarmConditionState` | `Active`, `Acknowledged`, `Confirmed?` (null when not confirmable), `Shelve`, `Suppressed`, `Severity` (0–1000, higher = more urgent), `Priority?` (raw source number) | **Severity direction (Gitea #129).** `Severity` is OPC UA Part 9 direction for both adapters. `OpcUaAlarmMapper` clamps the server's Severity to 0–1000 and repeats it as `Priority`. `MxGatewayAlarmMapper` reads the gateway's `severity` field — which mxaccessgw fills from the AVEVA alarm **priority** (1 = most urgent) — bands it onto `Severity` (AVEVA priority 1–250 → 1000, 251–500 → 750, 501–750 → 500, 751–999 → 250 (`AlarmPriorityBands`, the same table as OtOpcUa `GalaxyAlarmPriority`, lmxopcua#887); out-of-range clamps: ≤ 0 → 1000, > 999 → 250) and keeps it on `Priority` clamped to 0–1000, i.e. the value `Severity` carried before #129. A Galaxy alarm therefore reads the same `Severity` through OtOpcUa and straight from the gateway. diff --git a/docs/requirements/Component-SiteRuntime.md b/docs/requirements/Component-SiteRuntime.md index baad4b0a..9689308a 100644 --- a/docs/requirements/Component-SiteRuntime.md +++ b/docs/requirements/Component-SiteRuntime.md @@ -486,7 +486,9 @@ The `AlarmStateChanged` message published by both Alarm Actors and Native Alarm - **`IsConfiguredPlaceholder`** (`bool`): `true` for a synthetic row emitted by the Instance Actor to represent a configured native source binding that currently has no live conditions. These rows are never persisted or forwarded as operational alarms — they exist solely so the Debug View can render every configured binding as a tree node. `false` on all other rows. - **`AckTime`** (`DateTimeOffset?`): the instant the condition was acknowledged; `null` while unacknowledged, `null` on computed alarms (auto-acked but with no operator ack event), and cleared on re-raise. Stamped by the DCL adapter — the source's own ack instant where the protocol supplies one (OPC UA A&C), the DCL's observation time of the ack transition where it does not (MxAccess Gateway) — and carried verbatim by the `NativeAlarmActor`, which never invents or suppresses one. See [Component-DataConnectionLayer.md](Component-DataConnectionLayer.md) → *Ack Timestamp*. -These fields are **additive-only** (init-only with defaults: `null` / `false`) and are mirrored additively on the gRPC `AlarmStateUpdate` proto as fields 22 (`native_source_canonical_name`, `string`), 23 (`is_configured_placeholder`, `bool`) and 24 (`ack_time`, `google.protobuf.Timestamp`, absent ⇒ `null`). `StreamRelayActor` and `SiteStreamGrpcClient` pack/unpack these fields without touching existing fields, preserving backward compatibility across version-skew boundaries. +- **`DisplayName`** (`string`, empty by default; Gitea #147): a display-only label for a native condition whose key is opaque — an OtOpcUa imported condition keyed on its durable `ConditionId`. Copied by `NativeAlarmActor` from the latest transition (so it updates in place under a fixed key), persisted in `native_alarm_state.metadata_json` (no column — the table is LocalDb-replicated), restored on rehydration, and surfaced to scripts as `ScriptAlarm.DisplayName`. Never a key. See [Component-DataConnectionLayer.md](Component-DataConnectionLayer.md) → *Imported OtOpcUa conditions key on `ConditionId`*. + +These fields are **additive-only** (init-only with defaults: `null` / `false`) and are mirrored additively on the gRPC `AlarmStateUpdate` proto as fields 22 (`native_source_canonical_name`, `string`), 23 (`is_configured_placeholder`, `bool`), 24 (`ack_time`, `google.protobuf.Timestamp`, absent ⇒ `null`) and 26 (`display_name`, `string`). `StreamRelayActor` and `SiteStreamGrpcClient` pack/unpack these fields without touching existing fields, preserving backward compatibility across version-skew boundaries. The enriched message flows Instance Actor → site-wide Akka stream → `SiteStreamManager` → `SiteStreamGrpcServer` and is streamed to central as the gRPC `AlarmStateUpdate` event (see [Component-Communication.md](Component-Communication.md)). diff --git a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugTreeBuilder.cs b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugTreeBuilder.cs index 27fc2923..8fa5d0bd 100644 --- a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugTreeBuilder.cs +++ b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugTreeBuilder.cs @@ -128,7 +128,8 @@ public static class DebugTreeBuilder private static bool MatchesFilter(AlarmStateChanged alarm, string filter) => alarm.AlarmName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0 || alarm.SourceReference.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0 - || alarm.NativeSourceCanonicalName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0; + || alarm.NativeSourceCanonicalName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0 + || alarm.DisplayName.IndexOf(filter, StringComparison.OrdinalIgnoreCase) >= 0; /// Place a computed alarm as a leaf at its path-qualified canonical name. private static void AddComputedLeaf( @@ -186,8 +187,11 @@ public static class DebugTreeBuilder binding.Children.Add(new DebugTreeNode { + // Keyed on the stable SourceReference; labelled with the readable DisplayName when the + // key is an opaque OtOpcUa ConditionId (Gitea #147), so the row keeps its identity while + // its label updates in place. Key = canonical + "::" + alarm.SourceReference, - Segment = alarm.SourceReference, + Segment = string.IsNullOrEmpty(alarm.DisplayName) ? alarm.SourceReference : alarm.DisplayName, Alarm = alarm, }); } diff --git a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugView.razor b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugView.razor index 9ef86b56..c96258ce 100644 --- a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugView.razor +++ b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Deployment/DebugView.razor @@ -795,6 +795,8 @@ if (a.OriginalRaiseTime.HasValue) parts.Add($"Raised: {a.OriginalRaiseTime.Value.LocalDateTime:HH:mm:ss}"); if (!string.IsNullOrEmpty(a.CurrentValue)) parts.Add($"Value: {a.CurrentValue}"); if (!string.IsNullOrEmpty(a.LimitValue)) parts.Add($"Limit: {a.LimitValue}"); + // Gitea #147: the row is labelled with DisplayName; surface the stable key it is tracked by. + if (!string.IsNullOrEmpty(a.DisplayName)) parts.Add($"Condition id: {a.SourceReference}"); return parts.Count == 0 ? null : string.Join(" · ", parts); } diff --git a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/AlarmSummary.razor b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/AlarmSummary.razor index e0eca376..3c39c98f 100644 --- a/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/AlarmSummary.razor +++ b/src/ZB.MOM.WW.ScadaBridge.CentralUI/Components/Pages/Monitoring/AlarmSummary.razor @@ -247,7 +247,9 @@ private RenderFragment AlarmRow => row => @ @row.InstanceUniqueName - @row.Alarm.AlarmName + @* Gitea #147: an opaque-keyed native condition (OtOpcUa imported) shows its + readable label; the key stays available as the tooltip. *@ + @DisplayLabel(row.Alarm) @row.Alarm.Condition.Severity ; @@ -523,18 +525,23 @@ } if (!string.IsNullOrWhiteSpace(_filterName)) { - q = q.Where(r => r.Alarm.AlarmName.Contains(_filterName, StringComparison.OrdinalIgnoreCase)); + q = q.Where(r => r.Alarm.AlarmName.Contains(_filterName, StringComparison.OrdinalIgnoreCase) + || r.Alarm.DisplayName.Contains(_filterName, StringComparison.OrdinalIgnoreCase)); } return SortRows(q); } + /// The name an operator sees: the readable label when the key is opaque (Gitea #147). + private static string DisplayLabel(ZB.MOM.WW.ScadaBridge.Commons.Messages.Streaming.AlarmStateChanged alarm) + => string.IsNullOrEmpty(alarm.DisplayName) ? alarm.AlarmName : alarm.DisplayName; + private IEnumerable SortRows(IEnumerable rows) { Func key = _sortKey switch { "instance" => r => r.InstanceUniqueName, - "name" => r => r.Alarm.AlarmName, + "name" => r => DisplayLabel(r.Alarm), _ => r => r.Alarm.Condition.Severity, }; return _sortDescending ? rows.OrderByDescending(key) : rows.OrderBy(key); diff --git a/src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Streaming/AlarmStateChanged.cs b/src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Streaming/AlarmStateChanged.cs index b38b9226..9859bc08 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Streaming/AlarmStateChanged.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Commons/Messages/Streaming/AlarmStateChanged.cs @@ -62,6 +62,14 @@ public record AlarmStateChanged( /// Native per-condition key (e.g. "Tank01.Level.HiHi"); empty for computed alarms. public string SourceReference { get; init; } = string.Empty; + /// + /// Human-readable label for a native condition whose key ( / + /// ) is not itself readable — an OtOpcUa imported condition keyed + /// on its opaque ConditionId (Gitea #147). Display-only and may change between events for the + /// same key; never key on it. Empty means "display ". + /// + public string DisplayName { get; init; } = string.Empty; + /// Native alarm type name (e.g. "AnalogLimitAlarm.HiHi"); empty for computed alarms. public string AlarmTypeName { get; init; } = string.Empty; diff --git a/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Alarms/NativeAlarmTransition.cs b/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Alarms/NativeAlarmTransition.cs index e91689be..3e0f21b4 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Alarms/NativeAlarmTransition.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Alarms/NativeAlarmTransition.cs @@ -8,7 +8,12 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Alarms; /// Keyed by ; routed to instances by /// . /// -/// Stable per-condition key (e.g. "Tank01.Level.HiHi"). +/// +/// Stable per-condition key (e.g. "Tank01.Level.HiHi"). For an OPC UA condition IMPORTED by +/// OtOpcUa over a gRPC data connection (namespace https://zb.com/otopcua/mapped/conditions) +/// it is the durable ConditionId NodeId instead, because that condition's SourceName moves +/// when the server's mapping changes (Gitea #147) — see . +/// /// Owning source object used for instance routing (e.g. "Tank01"). /// Source alarm type (e.g. "AnalogLimitAlarm.HiHi"). /// Transition classification, incl. snapshot replay sentinels. @@ -32,6 +37,12 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Alarms; /// /// Exact feed binding for a scoped snapshot, including empty for the OPC UA Server feed; null means connection-wide legacy framing. /// Refresh epoch shared by start, entries and end; null preserves legacy snapshot framing. +/// +/// Human-readable label for the condition when it differs from ; +/// null means "display the key". Set for OtOpcUa imported conditions (Gitea #147), whose key is an +/// opaque ConditionId: the label is SourceName.ConditionName as last reported, so it may +/// change in place on any transition while the key stays fixed. Additive trailing parameter. +/// public record NativeAlarmTransition( string SourceReference, string SourceObjectReference, @@ -49,4 +60,5 @@ public record NativeAlarmTransition( string LimitValue, DateTimeOffset? AckTime = null, string? SnapshotSourceReference = null, - Guid? SnapshotId = null); + Guid? SnapshotId = null, + string? DisplayName = null); diff --git a/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Scripts/ScriptAlarm.cs b/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Scripts/ScriptAlarm.cs index 092658f6..341933ad 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Scripts/ScriptAlarm.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Commons/Types/Scripts/ScriptAlarm.cs @@ -70,6 +70,12 @@ namespace ZB.MOM.WW.ScadaBridge.Commons.Types.Scripts; /// API's Severity/MinSeverity/MaxSeverity (a 0–999 priority) key off this. /// Its direction differs by kind; do not rank alarms by it. /// +/// +/// Human-readable label when is an opaque key, else empty. Set for OtOpcUa +/// imported conditions, which are keyed on their stable ConditionId (Gitea #147); the label is the +/// condition's current SourceName.ConditionName and can change while +/// stays fixed. Correlate on , show this. +/// public sealed record ScriptAlarm( string Name, string SourceReference, @@ -93,4 +99,5 @@ public sealed record ScriptAlarm( string LimitValue, bool IsConfiguredPlaceholder, bool IsMesReportable = false, - int Priority = 0); + int Priority = 0, + string DisplayName = ""); diff --git a/src/ZB.MOM.WW.ScadaBridge.Communication/Actors/StreamRelayActor.cs b/src/ZB.MOM.WW.ScadaBridge.Communication/Actors/StreamRelayActor.cs index dbba105f..bc527215 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Communication/Actors/StreamRelayActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Communication/Actors/StreamRelayActor.cs @@ -106,7 +106,9 @@ public class StreamRelayActor : ReceiveActor ? Timestamp.FromDateTimeOffset(msg.AckTime.Value) : null, // Gitea #60: the deployed MES-reportable flag, stamped by the Instance Actor. - IsMesReportable = msg.IsMesReportable + IsMesReportable = msg.IsMesReportable, + // Gitea #147: readable label for an opaque (ConditionId) key; empty otherwise. + DisplayName = msg.DisplayName ?? string.Empty } }; diff --git a/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteCommandDtoMapper.cs b/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteCommandDtoMapper.cs index 4aa2a7f7..cdd4d5e3 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteCommandDtoMapper.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteCommandDtoMapper.cs @@ -1942,7 +1942,8 @@ public static class SiteCommandDtoMapper LimitValue = alarm.LimitValue, NativeSourceCanonicalName = alarm.NativeSourceCanonicalName, IsConfiguredPlaceholder = alarm.IsConfiguredPlaceholder, - IsMesReportable = alarm.IsMesReportable + IsMesReportable = alarm.IsMesReportable, + DisplayName = alarm.DisplayName ?? string.Empty }; if (alarm.Condition != AlarmConditionStateFactory.ForComputed(alarm.State, alarm.Priority)) @@ -1991,7 +1992,8 @@ public static class SiteCommandDtoMapper NativeSourceCanonicalName = dto.NativeSourceCanonicalName, IsConfiguredPlaceholder = dto.IsConfiguredPlaceholder, IsMesReportable = dto.IsMesReportable, - AckTime = DtoOrNull(dto.AckTime) + AckTime = DtoOrNull(dto.AckTime), + DisplayName = dto.DisplayName }; // AlarmConditionStateDto carries Severity only; the raw priority (Gitea #129) travels as the diff --git a/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs b/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs index 846cd1ae..d6849543 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Communication/Grpc/SiteStreamGrpcClient.cs @@ -621,7 +621,9 @@ public class SiteStreamGrpcClient : IAsyncDisposable, IDisposable // condition, computed alarm, or a pre-AckTime site) stays null. AckTime = update.AckTime?.ToDateTimeOffset(), // Gitea #60: a pre-#60 site leaves the field at its proto3 default (false). - IsMesReportable = update.IsMesReportable + IsMesReportable = update.IsMesReportable, + // Gitea #147: a pre-#147 site leaves it empty, which means "display AlarmName". + DisplayName = update.DisplayName ?? string.Empty }; } diff --git a/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/site_command.proto b/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/site_command.proto index 9a8a96b2..47379974 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/site_command.proto +++ b/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/site_command.proto @@ -661,6 +661,10 @@ message DebugAlarmStateDto { // AlarmStateUpdate.ack_time = 24 on the live stream, Gitea #84). Absent => null, // including from a pre-#84 site. google.protobuf.Timestamp ack_time = 21; + // Readable label of a native condition keyed on an opaque OtOpcUa ConditionId + // (AlarmStateChanged.DisplayName; mirrors AlarmStateUpdate.display_name = 26, Gitea #147). + // Empty => display alarm_name, including from a pre-#147 site. + string display_name = 22; } message DebugViewSnapshotDto { diff --git a/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/sitestream.proto b/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/sitestream.proto index 59166e1c..6ffa45ff 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/sitestream.proto +++ b/src/ZB.MOM.WW.ScadaBridge.Communication/Protos/sitestream.proto @@ -146,6 +146,12 @@ message AlarmStateUpdate { // (ResolvedAlarm.IsMesReportable, Gitea #60). Always false for native conditions, // which have no per-alarm config row; a pre-#60 site leaves it at the proto3 default. bool is_mes_reportable = 25; + + // Human-readable label for a native condition whose alarm_name/source_reference key is not + // itself readable — an OtOpcUa imported condition keyed on its opaque ConditionId (Gitea #147). + // Display-only; it can change between events for the same key. Empty means "display + // alarm_name", which is also what a pre-#147 site sends. + string display_name = 26; } // Audit Log (#23) telemetry: single lifecycle event ferried from a site SQLite diff --git a/src/ZB.MOM.WW.ScadaBridge.Communication/SiteCommandGrpc/SiteCommand.cs b/src/ZB.MOM.WW.ScadaBridge.Communication/SiteCommandGrpc/SiteCommand.cs index bf7a2f3f..a60fd32d 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Communication/SiteCommandGrpc/SiteCommand.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Communication/SiteCommandGrpc/SiteCommand.cs @@ -292,7 +292,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { "dGgYAiABKAkSFgoOYXR0cmlidXRlX25hbWUYAyABKAkSNQoFdmFsdWUYBCAB", "KAsyJi5zY2FkYWJyaWRnZS5zaXRlY29tbWFuZC52MS5Mb29zZVZhbHVlEg8K", "B3F1YWxpdHkYBSABKAkSLQoJdGltZXN0YW1wGAYgASgLMhouZ29vZ2xlLnBy", - "b3RvYnVmLlRpbWVzdGFtcCL4BQoSRGVidWdBbGFybVN0YXRlRHRvEhwKFGlu", + "b3RvYnVmLlRpbWVzdGFtcCKOBgoSRGVidWdBbGFybVN0YXRlRHRvEhwKFGlu", "c3RhbmNlX3VuaXF1ZV9uYW1lGAEgASgJEhIKCmFsYXJtX25hbWUYAiABKAkS",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QiuqAihaQi5NT00u", + "V1cuU2NhZGFCcmlkZ2UuQ29tbXVuaWNhdGlvbi5HcnBjYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.DurationReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.SitestreamReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DeploymentStatusDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.BrowseNodeClassDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.BrowseFailureKindDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.ReadTagValuesFailureKindDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.VerifyFailureKindDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.StoreAndForwardCategoryDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmStateDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmLevelDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmKindDto), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmShelveStateDto), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -583,7 +583,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.UnsubscribeDebugViewAckDto), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.UnsubscribeDebugViewAckDto.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmConditionStateDto), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmConditionStateDto.Parser, new[]{ "Active", "Acknowledged", "Confirmed", "Shelve", "Suppressed", "Severity" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugAttributeValueDto), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugAttributeValueDto.Parser, new[]{ "InstanceUniqueName", "AttributePath", "AttributeName", "Value", "Quality", "Timestamp" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugAlarmStateDto), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugAlarmStateDto.Parser, new[]{ "InstanceUniqueName", "AlarmName", "State", "Priority", "Timestamp", "Level", "Message", "Kind", "Condition", "SourceReference", "AlarmTypeName", "Category", "OperatorUser", "OperatorComment", "OriginalRaiseTime", "CurrentValue", "LimitValue", "NativeSourceCanonicalName", "IsConfiguredPlaceholder", "IsMesReportable", "AckTime" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugAlarmStateDto), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugAlarmStateDto.Parser, new[]{ "InstanceUniqueName", "AlarmName", "State", "Priority", "Timestamp", "Level", "Message", "Kind", "Condition", "SourceReference", "AlarmTypeName", "Category", "OperatorUser", "OperatorComment", "OriginalRaiseTime", "CurrentValue", "LimitValue", "NativeSourceCanonicalName", "IsConfiguredPlaceholder", "IsMesReportable", "AckTime", "DisplayName" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugViewSnapshotDto), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.DebugViewSnapshotDto.Parser, new[]{ "InstanceUniqueName", "AttributeValues", "AlarmStates", "SnapshotTimestamp", "InstanceNotFound" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.QueryRequest), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.QueryRequest.Parser, new[]{ "EventLogQuery", "DebugSnapshot", "SubscribeDebugView", "UnsubscribeDebugView" }, new[]{ "Command" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.QueryReply), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.QueryReply.Parser, new[]{ "EventLogQuery", "DebugViewSnapshot", "UnsubscribeDebugView" }, new[]{ "Reply" }, null, null, null), @@ -22347,6 +22347,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { isConfiguredPlaceholder_ = other.isConfiguredPlaceholder_; isMesReportable_ = other.isMesReportable_; ackTime_ = other.ackTime_ != null ? other.ackTime_.Clone() : null; + displayName_ = other.displayName_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -22625,6 +22626,23 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { } } + /// Field number for the "display_name" field. + public const int DisplayNameFieldNumber = 22; + private string displayName_ = ""; + /// + /// Readable label of a native condition keyed on an opaque OtOpcUa ConditionId + /// (AlarmStateChanged.DisplayName; mirrors AlarmStateUpdate.display_name = 26, Gitea #147). + /// Empty => display alarm_name, including from a pre-#147 site. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string DisplayName { + get { return displayName_; } + set { + displayName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -22661,6 +22679,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { if (IsConfiguredPlaceholder != other.IsConfiguredPlaceholder) return false; if (IsMesReportable != other.IsMesReportable) return false; if (!object.Equals(AckTime, other.AckTime)) return false; + if (DisplayName != other.DisplayName) return false; return Equals(_unknownFields, other._unknownFields); } @@ -22689,6 +22708,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { if (IsConfiguredPlaceholder != false) hash ^= IsConfiguredPlaceholder.GetHashCode(); if (IsMesReportable != false) hash ^= IsMesReportable.GetHashCode(); if (ackTime_ != null) hash ^= AckTime.GetHashCode(); + if (DisplayName.Length != 0) hash ^= DisplayName.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -22791,6 +22811,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { output.WriteRawTag(170, 1); output.WriteMessage(AckTime); } + if (DisplayName.Length != 0) { + output.WriteRawTag(178, 1); + output.WriteString(DisplayName); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -22885,6 +22909,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { output.WriteRawTag(170, 1); output.WriteMessage(AckTime); } + if (DisplayName.Length != 0) { + output.WriteRawTag(178, 1); + output.WriteString(DisplayName); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -22958,6 +22986,9 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { if (ackTime_ != null) { size += 2 + pb::CodedOutputStream.ComputeMessageSize(AckTime); } + if (DisplayName.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(DisplayName); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -23045,6 +23076,9 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { } AckTime.MergeFrom(other.AckTime); } + if (other.DisplayName.Length != 0) { + DisplayName = other.DisplayName; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -23160,6 +23194,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { input.ReadMessage(AckTime); break; } + case 178: { + DisplayName = input.ReadString(); + break; + } } } #endif @@ -23275,6 +23313,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { input.ReadMessage(AckTime); break; } + case 178: { + DisplayName = input.ReadString(); + break; + } } } } diff --git a/src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/Sitestream.cs b/src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/Sitestream.cs index 169e579b..17aca216 100644 --- a/src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/Sitestream.cs +++ b/src/ZB.MOM.WW.ScadaBridge.Communication/SiteStreamGrpc/Sitestream.cs @@ -42,7 +42,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { "CRINCgV2YWx1ZRgEIAEoCRIkCgdxdWFsaXR5GAUgASgOMhMuc2l0ZXN0cmVh", "bS5RdWFsaXR5Ei0KCXRpbWVzdGFtcBgGIAEoCzIaLmdvb2dsZS5wcm90b2J1", "Zi5UaW1lc3RhbXASGwoTc291cmNlX2V4ZWN1dGlvbl9pZBgHIAEoCRINCgV0", - "cmFjZRgIIAEoCCLKBQoQQWxhcm1TdGF0ZVVwZGF0ZRIcChRpbnN0YW5jZV91", + "cmFjZRgIIAEoCCLgBQoQQWxhcm1TdGF0ZVVwZGF0ZRIcChRpbnN0YW5jZV91", "bmlxdWVfbmFtZRgBIAEoCRISCgphbGFybV9uYW1lGAIgASgJEikKBXN0YXRl", "GAMgASgOMhouc2l0ZXN0cmVhbS5BbGFybVN0YXRlRW51bRIQCghwcmlvcml0", "eRgEIAEoBRItCgl0aW1lc3RhbXAYBSABKAsyGi5nb29nbGUucHJvdG9idWYu", @@ -58,72 +58,72 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { "bmF0aXZlX3NvdXJjZV9jYW5vbmljYWxfbmFtZRgWIAEoCRIhChlpc19jb25m", "aWd1cmVkX3BsYWNlaG9sZGVyGBcgASgIEiwKCGFja190aW1lGBggASgLMhou", "Z29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIZChFpc19tZXNf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QoRU3Vic2NyaWJlSW5zdGFuY2USIS5zaXRl", + "c3RyZWFtLkluc3RhbmNlU3RyZWFtUmVxdWVzdBobLnNpdGVzdHJlYW0uU2l0", + "ZVN0cmVhbUV2ZW50MAESTQoNU3Vic2NyaWJlU2l0ZRIdLnNpdGVzdHJlYW0u", + "U2l0ZVN0cmVhbVJlcXVlc3QaGy5zaXRlc3RyZWFtLlNpdGVTdHJlYW1FdmVu", + "dDABEkcKEUluZ2VzdEF1ZGl0RXZlbnRzEhsuc2l0ZXN0cmVhbS5BdWRpdEV2", + "ZW50QmF0Y2gaFS5zaXRlc3RyZWFtLkluZ2VzdEFjaxJQChVJbmdlc3RDYWNo", + "ZWRUZWxlbWV0cnkSIC5zaXRlc3RyZWFtLkNhY2hlZFRlbGVtZXRyeUJhdGNo", + "GhUuc2l0ZXN0cmVhbS5Jbmdlc3RBY2sSWgoPUHVsbEF1ZGl0RXZlbnRzEiIu", + "c2l0ZXN0cmVhbS5QdWxsQXVkaXRFdmVudHNSZXF1ZXN0GiMuc2l0ZXN0cmVh", + "bS5QdWxsQXVkaXRFdmVudHNSZXNwb25zZRJaCg9QdWxsVHJhY2VFdmVudHMS", + "Ii5zaXRlc3RyZWFtLlB1bGxUcmFjZUV2ZW50c1JlcXVlc3QaIy5zaXRlc3Ry", + "ZWFtLlB1bGxUcmFjZUV2ZW50c1Jlc3BvbnNlElQKDVB1bGxTaXRlQ2FsbHMS", + "IC5zaXRlc3RyZWFtLlB1bGxTaXRlQ2FsbHNSZXF1ZXN0GiEuc2l0ZXN0cmVh", + "bS5QdWxsU2l0ZUNhbGxzUmVzcG9uc2VCK6oCKFpCLk1PTS5XVy5TY2FkYUJy", + "aWRnZS5Db21tdW5pY2F0aW9uLkdycGNiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.Quality), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmStateEnum), typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmLevelEnum), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -132,7 +132,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.SiteStreamEvent), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.SiteStreamEvent.Parser, new[]{ "CorrelationId", "AttributeChanged", "AlarmChanged", "Batch" }, new[]{ "Event" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.SiteStreamEventBatch), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.SiteStreamEventBatch.Parser, new[]{ "Events" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AttributeValueUpdate), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AttributeValueUpdate.Parser, new[]{ "InstanceUniqueName", "AttributePath", "AttributeName", "Value", "Quality", "Timestamp", "SourceExecutionId", "Trace" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmStateUpdate), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmStateUpdate.Parser, new[]{ "InstanceUniqueName", "AlarmName", "State", "Priority", "Timestamp", "Level", "Message", "Kind", "Active", "Acknowledged", "Confirmed", "ShelveState", "Suppressed", "SourceReference", "AlarmTypeName", "Category", "OperatorUser", "OperatorComment", "OriginalRaiseTime", "CurrentValue", "LimitValue", "NativeSourceCanonicalName", "IsConfiguredPlaceholder", "AckTime", "IsMesReportable" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmStateUpdate), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AlarmStateUpdate.Parser, new[]{ "InstanceUniqueName", "AlarmName", "State", "Priority", "Timestamp", "Level", "Message", "Kind", "Active", "Acknowledged", "Confirmed", "ShelveState", "Suppressed", "SourceReference", "AlarmTypeName", "Category", "OperatorUser", "OperatorComment", "OriginalRaiseTime", "CurrentValue", "LimitValue", "NativeSourceCanonicalName", "IsConfiguredPlaceholder", "AckTime", "IsMesReportable", "DisplayName" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AuditEventDto), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AuditEventDto.Parser, new[]{ "EventId", "OccurredAtUtc", "Channel", "Kind", "CorrelationId", "SourceSiteId", "SourceInstanceId", "SourceScript", "Actor", "Target", "Status", "HttpStatus", "DurationMs", "ErrorMessage", "ErrorDetail", "RequestSummary", "ResponseSummary", "PayloadTruncated", "Extra", "ExecutionId", "ParentExecutionId", "SourceNode" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AuditEventBatch), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.AuditEventBatch.Parser, new[]{ "Events" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.IngestAck), global::ZB.MOM.WW.ScadaBridge.Communication.Grpc.IngestAck.Parser, new[]{ "AcceptedEventIds", "RejectedEventIds" }, null, null, null, null), @@ -1824,6 +1824,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { isConfiguredPlaceholder_ = other.isConfiguredPlaceholder_; ackTime_ = other.ackTime_ != null ? other.ackTime_.Clone() : null; isMesReportable_ = other.isMesReportable_; + displayName_ = other.displayName_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } @@ -2178,6 +2179,24 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { } } + /// Field number for the "display_name" field. + public const int DisplayNameFieldNumber = 26; + private string displayName_ = ""; + /// + /// Human-readable label for a native condition whose alarm_name/source_reference key is not + /// itself readable — an OtOpcUa imported condition keyed on its opaque ConditionId (Gitea #147). + /// Display-only; it can change between events for the same key. Empty means "display + /// alarm_name", which is also what a pre-#147 site sends. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string DisplayName { + get { return displayName_; } + set { + displayName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public override bool Equals(object other) { @@ -2218,6 +2237,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { if (IsConfiguredPlaceholder != other.IsConfiguredPlaceholder) return false; if (!object.Equals(AckTime, other.AckTime)) return false; if (IsMesReportable != other.IsMesReportable) return false; + if (DisplayName != other.DisplayName) return false; return Equals(_unknownFields, other._unknownFields); } @@ -2250,6 +2270,7 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { if (IsConfiguredPlaceholder != false) hash ^= IsConfiguredPlaceholder.GetHashCode(); if (ackTime_ != null) hash ^= AckTime.GetHashCode(); if (IsMesReportable != false) hash ^= IsMesReportable.GetHashCode(); + if (DisplayName.Length != 0) hash ^= DisplayName.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } @@ -2368,6 +2389,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { output.WriteRawTag(200, 1); output.WriteBool(IsMesReportable); } + if (DisplayName.Length != 0) { + output.WriteRawTag(210, 1); + output.WriteString(DisplayName); + } if (_unknownFields != null) { _unknownFields.WriteTo(output); } @@ -2478,6 +2503,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { output.WriteRawTag(200, 1); output.WriteBool(IsMesReportable); } + if (DisplayName.Length != 0) { + output.WriteRawTag(210, 1); + output.WriteString(DisplayName); + } if (_unknownFields != null) { _unknownFields.WriteTo(ref output); } @@ -2563,6 +2592,9 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { if (IsMesReportable != false) { size += 2 + 1; } + if (DisplayName.Length != 0) { + size += 2 + pb::CodedOutputStream.ComputeStringSize(DisplayName); + } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } @@ -2659,6 +2691,9 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { if (other.IsMesReportable != false) { IsMesReportable = other.IsMesReportable; } + if (other.DisplayName.Length != 0) { + DisplayName = other.DisplayName; + } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } @@ -2787,6 +2822,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { IsMesReportable = input.ReadBool(); break; } + case 210: { + DisplayName = input.ReadString(); + break; + } } } #endif @@ -2915,6 +2954,10 @@ namespace ZB.MOM.WW.ScadaBridge.Communication.Grpc { IsMesReportable = input.ReadBool(); break; } + case 210: { + DisplayName = input.ReadString(); + break; + } } } } diff --git a/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaAlarmMapper.cs b/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaAlarmMapper.cs index 62c2346c..71771614 100644 --- a/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaAlarmMapper.cs +++ b/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/OpcUaAlarmMapper.cs @@ -12,6 +12,53 @@ namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Adapters; /// public static class OpcUaAlarmMapper { + /// + /// The OtOpcUa namespace holding conditions IMPORTED from another cluster over a gRPC data + /// connection (OtOpcUa docs/AlarmTracking.md → Imported conditions). Their + /// ConditionId is an opaque NodeId stable for the life of the data connection, while + /// their SourceName is a display path that moves with the server's mapping (Gitea #147). + /// + public const string ImportedConditionsNamespaceUri = "https://zb.com/otopcua/mapped/conditions"; + + /// + /// plus the OtOpcUa imported-condition + /// rule (Gitea #147): when is supplied (the event's + /// ConditionId is in , as a durable + /// nsu=… string), it IS the per-condition key and the usual + /// SourceName.ConditionName becomes a display-only label. + /// + /// + /// + /// Why only imported conditions. Their SourceName is + /// <anchor>/<placement path> and moves whenever the primary placement mapping + /// changes (mapping disabled/undeployed or no longer listing the condition, a higher-priority + /// mapping starts listing it, or a condition first seen while the Raw mapping was unavailable + /// moving once Raw lists it) — keyed on it, one condition would read as one alarm clearing and a + /// new one raising. Every other OPC UA condition keeps the SourceName.ConditionName key: + /// OtOpcUa local conditions already have a unique, stable SourceName (the RawPath / scripted + /// alarm id), third-party servers make no stability promise about ConditionId (some mint a node + /// per occurrence, some omit it), and re-keying them would rename every alarm already persisted + /// in native_alarm_state, referenced by MES scripts or shown to operators. + /// + /// + /// The display label is exactly what the key would have been before #147, so an operator sees + /// the same text; it updates in place on every event while the key stays fixed. + /// + /// + /// The binding string this alarm feed was subscribed under. + /// The event's SourceName, or null/empty when unset. + /// The event's ConditionName, or null/empty when unset. + /// The durable ConditionId of an imported condition, else null. + /// The per-condition key, the routing identity, and the display label (null when the key is the label). + public static (string SourceReference, string SourceObjectReference, string? DisplayName) BuildIdentity( + string? subscriptionSourceReference, string? sourceName, string? conditionName, string? importedConditionId) + { + var (readableKey, routingRef) = BuildIdentity(subscriptionSourceReference, sourceName, conditionName); + if (string.IsNullOrEmpty(importedConditionId)) + return (readableKey, routingRef, null); + return (importedConditionId, routingRef, string.IsNullOrEmpty(readableKey) ? null : readableKey); + } + /// /// Derives the two identity strings a native OPC UA alarm transition carries: /// the routing identity that DataConnectionActor matches against the stored diff --git a/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs b/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs index e6a302d7..4de0230d 100644 --- a/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs +++ b/src/ZB.MOM.WW.ScadaBridge.DataConnectionLayer/Adapters/RealOpcUaClient.cs @@ -1128,6 +1128,18 @@ public class RealOpcUaClient : IOpcUaClient // ConditionRefresh caveat as index 13: a replayed snapshot may re-stamp it. selectClauses.Add( SelectField(ObjectTypeIds.AcknowledgeableConditionType, "AckedState", "TransitionTime")); // 18 + + // 19: ConditionId — Part 9 §5.5.2's dedicated operand: TypeDefinitionId = ConditionType, + // EMPTY browse path, AttributeId = NodeId, which selects the condition node's own NodeId. + // Used as the per-condition key for OtOpcUa IMPORTED conditions (Gitea #147, see + // OpcUaAlarmMapper.BuildIdentity); null on non-condition events and servers that do + // not support the operand. + selectClauses.Add(new SimpleAttributeOperand + { + TypeDefinitionId = ObjectTypeIds.ConditionType, + BrowsePath = Array.Empty(), + AttributeId = Attributes.NodeId + }); // 19 filter.SelectClauses = selectClauses; // UNAVAILABLE via standard OPC UA A&C event fields (documented here so future @@ -1343,8 +1355,15 @@ public class RealOpcUaClient : IOpcUaClient if (string.IsNullOrEmpty(sourceName)) sourceName = fields[1] is NodeId sourceNode ? sourceNode.ToString() ?? "" : ""; var conditionName = fields.Length > 11 ? fields[11] as string : null; - var (sourceRef, sourceObjectRef) = - OpcUaAlarmMapper.BuildIdentity(subscriptionSourceReference, sourceName, conditionName); + + // Gitea #147: an OtOpcUa IMPORTED condition (mapped/conditions namespace) is keyed on its + // ConditionId, because its SourceName moves when the server's mapping changes. ConditionId + // is select clause 19; OtOpcUa also sets SourceNode = ConditionId for these, which covers a + // server that leaves the dedicated operand unanswered. + var importedConditionId = ImportedConditionKey(fields.Length > 19 ? fields[19] as NodeId? : null) + ?? ImportedConditionKey(fields[1] as NodeId?); + var (sourceRef, sourceObjectRef, displayName) = OpcUaAlarmMapper.BuildIdentity( + subscriptionSourceReference, sourceName, conditionName, importedConditionId); if (string.IsNullOrEmpty(sourceRef)) return; // not a condition event we can key @@ -1430,7 +1449,38 @@ public class RealOpcUaClient : IOpcUaClient // else the observed event time; null unless the condition is active AND acked. AckTime: OpcUaAlarmMapper.DeriveAckTime(active, acked, sourceAckTime, time), SnapshotSourceReference: inRefresh ? subscriptionSourceReference ?? string.Empty : null, - SnapshotId: inRefresh && _alarmSnapshotIds.TryGetValue(handle, out var epoch) ? epoch : null)); + SnapshotId: inRefresh && _alarmSnapshotIds.TryGetValue(handle, out var epoch) ? epoch : null, + DisplayName: displayName)); + } + + /// + /// Namespace table used to recognise imported conditions when no session is attached (unit + /// tests drive directly). Production reads the live session's. + /// + internal NamespaceTable? NamespaceUrisOverride { get; set; } + + /// + /// The durable nsu=… key of an OtOpcUa imported condition, or null when + /// is not in + /// (Gitea #147). The durable form is used rather than ns=<index> because the + /// namespace index is per session and per server: the two members of an OtOpcUa pair, or one + /// server after an upgrade, may order their namespace arrays differently, and a key that + /// changed on failover would re-key every mirrored condition — the very defect being fixed. + /// The identifier is taken verbatim, never parsed (OtOpcUa: "never construct or parse it"). + /// + /// The ConditionId (or SourceNode) from the event, or null. + /// The namespace-qualified key, or null when the node is not an imported condition. + private string? ImportedConditionKey(NodeId? nodeId) + { + if (nodeId is not { } id || id.IsNull || id.NamespaceIndex == 0) + return null; + var table = _session?.NamespaceUris ?? NamespaceUrisOverride; + if (table == null) + return null; + var uri = table.GetString(id.NamespaceIndex); + if (!string.Equals(uri, OpcUaAlarmMapper.ImportedConditionsNamespaceUri, StringComparison.Ordinal)) + return null; + return OpcUaNodeReference.ToDurable(new ExpandedNodeId(id), table); } /// The text of a LocalizedText event field (a struct in SDK 2), or null. diff --git a/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/NativeAlarmActor.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/NativeAlarmActor.cs index aaf1586b..53fbda64 100644 --- a/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/NativeAlarmActor.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Actors/NativeAlarmActor.cs @@ -245,7 +245,9 @@ public class NativeAlarmActor : ReceiveActor // acknowledged condition keeps its AckTime across a restart/failover // instead of reappearing as if it had never been acknowledged. Null on // pre-AckTime metadata rows (absent JSON property deserializes to null). - AckTime: meta.AckTime); + AckTime: meta.AckTime, + // Gitea #147: the readable label of an opaque-keyed condition; null on older rows. + DisplayName: meta.DisplayName); _alarms[row.SourceReference] = t; // Rehydration replays last-known state on (re)start — surface it // upward for the DebugView but do NOT re-log it as a fresh operational @@ -495,6 +497,10 @@ public class NativeAlarmActor : ReceiveActor Condition = condition, SourceReference = t.SourceReference, AlarmTypeName = t.AlarmTypeName, + // Gitea #147: readable label for an opaque ConditionId key (OtOpcUa imported + // conditions). Carried from the latest transition, so it updates in place when the + // server moves the condition's SourceName while the key stays fixed. + DisplayName = t.DisplayName ?? string.Empty, Category = t.Category, Message = t.Message, OperatorUser = t.OperatorUser, @@ -564,22 +570,26 @@ public class NativeAlarmActor : ReceiveActor return; } + // Gitea #147: an opaque ConditionId key is logged with its readable label alongside it. + var name = string.IsNullOrEmpty(t.DisplayName) + ? t.SourceReference + : $"{t.DisplayName} [{t.SourceReference}]"; string severity; string message; if (t.Kind == AlarmTransitionKind.Acknowledge) { severity = "Info"; - message = $"Native alarm {t.SourceReference} acknowledged"; + message = $"Native alarm {name} acknowledged"; } else if (condition.Active) { severity = condition.Severity >= ErrorSeverityThreshold ? "Error" : "Warning"; - message = $"Native alarm {t.SourceReference} active (severity {condition.Severity})"; + message = $"Native alarm {name} active (severity {condition.Severity})"; } else { severity = "Info"; - message = $"Native alarm {t.SourceReference} returned to normal"; + message = $"Native alarm {name} returned to normal"; } _ = logger.LogEventAsync( @@ -624,7 +634,8 @@ public class NativeAlarmActor : ReceiveActor t.SourceReference, JsonSerializer.Serialize(t.Condition), (string?)JsonSerializer.Serialize(new NativeAlarmMetadata( - t.AlarmTypeName, t.Category, t.Message, t.CurrentValue, t.LimitValue, t.AckTime)), + t.AlarmTypeName, t.Category, t.Message, t.CurrentValue, t.LimitValue, t.AckTime, + t.DisplayName)), t.TransitionTime)) .ToList(); var deletes = _dirtyUpserts.Where(kv => kv.Value is null).Select(kv => kv.Key).ToList(); @@ -684,8 +695,13 @@ public class NativeAlarmActor : ReceiveActor /// change — System.Text.Json leaves the missing property at null, which is /// the correct "ack time unknown" value. /// + /// + /// DisplayName (Gitea #147) rides here for the same reason: the readable label of a + /// condition keyed on an opaque OtOpcUa ConditionId. Null on older rows and on every + /// condition whose key is already readable. + /// /// private sealed record NativeAlarmMetadata( string AlarmTypeName, string Category, string Message, string CurrentValue, string LimitValue, - DateTimeOffset? AckTime = null); + DateTimeOffset? AckTime = null, string? DisplayName = null); } diff --git a/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs index 4ac1b1e5..51243bbd 100644 --- a/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs +++ b/src/ZB.MOM.WW.ScadaBridge.SiteRuntime/Scripts/ScriptRuntimeContext.cs @@ -1395,7 +1395,9 @@ public class ScriptRuntimeContext IsConfiguredPlaceholder: a.IsConfiguredPlaceholder, IsMesReportable: a.IsMesReportable, // Gitea #129: the raw source number (pre-#129 Severity) — the MES 900-999 band keys off it. - Priority: a.Priority); + Priority: a.Priority, + // Gitea #147: readable label for an opaque (ConditionId) key; empty otherwise. + DisplayName: a.DisplayName); /// /// Site-local tracking-status API for cached operations. diff --git a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugTreeBuilderTests.cs b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugTreeBuilderTests.cs index 6436037c..e131fe3b 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugTreeBuilderTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.CentralUI.Tests/Deployment/DebugTreeBuilderTests.cs @@ -313,6 +313,24 @@ public class DebugTreeBuilderTests Assert.NotNull(node.Alarm); } + /// + /// Gitea #147: a condition keyed on an opaque OtOpcUa ConditionId is labelled with its + /// DisplayName while its node key stays the stable SourceReference, and the filter matches the + /// label too. + /// + [Fact] + public void Native_OpaqueKeyedCondition_IsLabelledWithDisplayName_KeyedOnSourceReference() + { + const string key = "nsu=https://zb.com/otopcua/mapped/conditions;s=c1.eyJ4IjoxfQ"; + var alarm = Native("Tank1.Levels", key) with { DisplayName = "Plant/remote-a/Tank1/Level.HiHi" }; + + var tree = DebugTreeBuilder.BuildAlarmTree(new[] { alarm }, "remote-a"); + + var condition = Assert.Single(Assert.Single(Assert.Single(tree).Children).Children); + Assert.Equal("Tank1.Levels::" + key, condition.Key); + Assert.Equal("Plant/remote-a/Tank1/Level.HiHi", condition.Segment); + } + /// Verifies that a native condition nests under its binding node with the source reference segment. [Fact] public void Native_Condition_NestsUnderBindingNode_WithSourceReferenceSegment() diff --git a/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs index d473b3dd..41ee64ad 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/Grpc/StreamRelayActorTests.cs @@ -243,6 +243,41 @@ public class StreamRelayActorTests : TestKit SiteStreamGrpcClient.ConvertToDomainEvent(plainProto)).IsMesReportable); } + /// + /// Verifies that a native condition's DisplayName survives the relay → proto → central decode + /// round trip (Gitea #147, AlarmStateUpdate field 26), and that an unlabelled alarm + /// (and so a pre-#147 site) arrives as empty. + /// + [Fact] + public void RelaysAlarmStateChanged_DisplayName_SurvivesFullRoundTrip() + { + var channel = Channel.CreateUnbounded(); + var actor = Sys.ActorOf(Props.Create(() => + new StreamRelayActor("corr-display", channel.Writer))); + const string key = "nsu=https://zb.com/otopcua/mapped/conditions;s=c1.eyJ4IjoxfQ"; + + var labelled = new AlarmStateChanged( + "Site1.Oven1", key, AlarmState.Active, 700, + new DateTimeOffset(2026, 11, 28, 12, 0, 0, TimeSpan.Zero)) + { + Kind = AlarmKind.NativeOpcUa, + SourceReference = key, + DisplayName = "Plant/remote-a/Oven1/Temp.Hi" + }; + + actor.Tell(labelled); + var proto = ReadProtoEvent(channel); + Assert.Equal("Plant/remote-a/Oven1/Temp.Hi", proto.AlarmChanged.DisplayName); + var decoded = Assert.IsType(SiteStreamGrpcClient.ConvertToDomainEvent(proto)); + Assert.Equal("Plant/remote-a/Oven1/Temp.Hi", decoded.DisplayName); + Assert.Equal(key, decoded.AlarmName); + + actor.Tell(labelled with { DisplayName = string.Empty }); + var plain = ReadProtoEvent(channel); + Assert.Equal(string.Empty, + Assert.IsType(SiteStreamGrpcClient.ConvertToDomainEvent(plain)).DisplayName); + } + /// /// Reads the next relayed proto event, retrying once after a short pause because the /// relay actor writes to the channel asynchronously (mirrors the existing round-trip diff --git a/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCommandSamples.cs b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCommandSamples.cs index ff85aaf9..ffd8a268 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCommandSamples.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.Communication.Tests/SiteCommandSamples.cs @@ -293,7 +293,8 @@ internal static class SiteCommandSamples /// /// A mirrored native alarm: every native enrichment field populated, Condition explicit. /// Carries an ack time so the golden pins DebugAlarmStateDto field 21 (Gitea #84); the - /// computed sample leaves it null, pinning the absent-means-null decode. + /// computed sample leaves it null, pinning the absent-means-null decode. Carries a + /// DisplayName so the golden pins field 22 (Gitea #147); the computed sample leaves it empty. /// private static AlarmStateChanged NativeAlarm() => new("Site1.Pump1", "Tank01.Level.HiHi", AlarmState.Active, 850, T2) @@ -312,7 +313,8 @@ internal static class SiteCommandSamples CurrentValue = "91.2", LimitValue = "90.0", NativeSourceCanonicalName = "Tank01.TankAlarms", - IsConfiguredPlaceholder = true + IsConfiguredPlaceholder = true, + DisplayName = "Plant/remote-a/Tank01/Level.HiHi" }; /// diff --git a/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaClientAlarmFilterTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaClientAlarmFilterTests.cs index a33890b7..3e65f5dc 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaClientAlarmFilterTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaClientAlarmFilterTests.cs @@ -106,17 +106,31 @@ public class RealOpcUaClientAlarmFilterTests // ── SelectClause index alignment ─────────────────────────── // CRITICAL: HandleAlarmEvent reads fields[N] by position. Verify new clauses - // are APPENDED at indices 13–18 so existing mappings (0–12) are undisturbed. + // are APPENDED at indices 13–19 so existing mappings (0–12) are undisturbed. - /// Verifies that the alarm event filter has exactly 19 select clauses. + /// Verifies that the alarm event filter has exactly 20 select clauses. [Fact] - public void BuildAlarmEventFilter_HasExactly19SelectClauses() + public void BuildAlarmEventFilter_HasExactly20SelectClauses() { // Baseline: 6 base fields + 7 A&C sub-state fields + 5 appended fields (13–17) - // + AckedState/TransitionTime at 18 (MES alarm-status API §6.4) = 19. + // + AckedState/TransitionTime at 18 (MES alarm-status API §6.4) + // + ConditionId at 19 (Gitea #147) = 20. // If this count changes, review HandleAlarmEvent index mappings immediately. var filter = RealOpcUaClient.BuildAlarmEventFilter(AlarmConditionFilter.AllowAll); - Assert.Equal(19, filter.SelectClauses.Count); + Assert.Equal(20, filter.SelectClauses.Count); + } + + /// + /// Verifies that select clause 19 is Part 9's ConditionId operand: ConditionType, empty browse + /// path, AttributeId = NodeId (Gitea #147). + /// + [Fact] + public void BuildAlarmEventFilter_Index19_IsConditionId() + { + var clause = RealOpcUaClient.BuildAlarmEventFilter(AlarmConditionFilter.AllowAll).SelectClauses.ToList()[19]; + Assert.Equal(ObjectTypeIds.ConditionType, clause.TypeDefinitionId); + Assert.Empty(clause.BrowsePath.ToList()); + Assert.Equal(Attributes.NodeId, clause.AttributeId); } /// Verifies that select clause 18 is the acknowledgeable-condition acked-state transition time. diff --git a/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaImportedConditionKeyTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaImportedConditionKeyTests.cs new file mode 100644 index 00000000..3277cb19 --- /dev/null +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/Adapters/RealOpcUaImportedConditionKeyTests.cs @@ -0,0 +1,162 @@ +using System.Collections.Concurrent; +using System.Reflection; +using Opc.Ua; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Alarms; +using ZB.MOM.WW.ScadaBridge.Commons.Types.Enums; +using ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Adapters; + +namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests.Adapters; + +/// +/// Gitea #147: OtOpcUa imported conditions (namespace https://zb.com/otopcua/mapped/conditions) +/// carry an opaque ConditionId stable for the life of the data connection, while their SourceName +/// moves with the server's mapping. HandleAlarmEvent must key them on the durable +/// ConditionId and carry SourceName.ConditionName as a display label only; every other +/// condition keeps the pre-#147 key. +/// +public class RealOpcUaImportedConditionKeyTests +{ + private const string Handle = "h1"; + private const string Binding = "nsu=https://zb.com/otopcua/mapped/uns;s=assembly"; + private const string ConditionsUri = "https://zb.com/otopcua/mapped/conditions"; + private const string ConditionIdentifier = "c1.eyJDb25uZWN0aW9uSWQiOiJjb25uLTEiLCJDb25kaXRpb25LZXkiOiJrMSJ9"; + private const string ExpectedKey = "nsu=" + ConditionsUri + ";s=" + ConditionIdentifier; + + private static readonly MethodInfo Handler = + typeof(RealOpcUaClient).GetMethod("HandleAlarmEvent", BindingFlags.Instance | BindingFlags.NonPublic)!; + + /// A consumer OtOpcUa namespace table with the conditions namespace at . + private static NamespaceTable Table(ushort conditionsIndex) + { + var t = new NamespaceTable(); + t.Append("urn:localhost:OtOpcUa"); + var others = new[] { "https://zb.com/otopcua/mapped/raw", "https://zb.com/otopcua/mapped/uns", "https://zb.com/otopcua/raw" }; + var next = 0; + for (ushort i = 2; i <= 5; i++) + t.Append(i == conditionsIndex ? ConditionsUri : others[next++ % others.Length] + "/" + i); + return t; + } + + private static RealOpcUaClient Client(ushort conditionsIndex = 4) + { + var client = new RealOpcUaClient { NamespaceUrisOverride = Table(conditionsIndex) }; + var field = typeof(RealOpcUaClient).GetField("_alarmLastState", BindingFlags.Instance | BindingFlags.NonPublic)!; + var map = (ConcurrentDictionary>)field.GetValue(client)!; + map[Handle] = new Dictionary(StringComparer.Ordinal); + return client; + } + + private static NativeAlarmTransition Emit( + RealOpcUaClient client, NodeId sourceNode, string sourceName, bool active, bool acked, + NodeId? conditionId, string conditionName = "HR200") + { + var fields = new Variant[20]; + fields[0] = Variant.From(ObjectTypeIds.OffNormalAlarmType); + fields[1] = Variant.From(sourceNode); + fields[2] = Variant.From(sourceName); + fields[3] = Variant.From(DateTime.UtcNow); + fields[4] = Variant.From(new LocalizedText("msg")); + fields[5] = Variant.From((ushort)500); + fields[6] = Variant.From(active); + fields[7] = Variant.From(acked); + fields[11] = Variant.From(conditionName); + if (conditionId is { } id) + fields[19] = Variant.From(id); + + var sink = new List(); + Handler.Invoke(client, [Handle, Binding, new EventFieldList { EventFields = fields }, + (Action)sink.Add]); + return Assert.Single(sink); + } + + /// The imported condition is keyed on the durable ConditionId; the SourceName path is the label. + [Fact] + public void ImportedCondition_IsKeyedOnDurableConditionId() + { + var client = Client(); + var id = new NodeId(ConditionIdentifier, 4); + + var t = Emit(client, id, "Plant/remote-a/Modbus/dev1/HR200", active: true, acked: false, conditionId: id); + + Assert.Equal(ExpectedKey, t.SourceReference); + Assert.Equal("Plant/remote-a/Modbus/dev1/HR200.HR200", t.DisplayName); + Assert.Equal(Binding, t.SourceObjectReference); // routing identity unchanged + Assert.Equal(AlarmTransitionKind.Raise, t.Kind); + } + + /// + /// A primary-placement change moves SourceName: the key holds, the label updates in place, and + /// the transition kind is derived against the SAME condition's prior state (an ack after the move + /// is an Acknowledge, not a fresh Raise of a "new" alarm). + /// + [Fact] + public void SourceNameMove_KeepsKey_UpdatesLabel_AndKindContinuity() + { + var client = Client(); + var id = new NodeId(ConditionIdentifier, 4); + + var raised = Emit(client, id, "Plant/remote-a/Modbus/dev1/HR200", active: true, acked: false, conditionId: id); + var acked = Emit(client, id, "assembly/remote-line-2/filler/HR200", active: true, acked: true, conditionId: id); + + Assert.Equal(raised.SourceReference, acked.SourceReference); + Assert.Equal("assembly/remote-line-2/filler/HR200.HR200", acked.DisplayName); + Assert.Equal(AlarmTransitionKind.Acknowledge, acked.Kind); + } + + /// + /// The key is namespace-index-proof: two servers (an OtOpcUa pair) or one server after an upgrade + /// may place the conditions namespace at different indices; the key must not change on failover. + /// + [Fact] + public void Key_IsIndependentOfTheNamespaceIndex() + { + var a = Emit(Client(conditionsIndex: 3), new NodeId(ConditionIdentifier, 3), "x", true, false, new NodeId(ConditionIdentifier, 3)); + var b = Emit(Client(conditionsIndex: 5), new NodeId(ConditionIdentifier, 5), "x", true, false, new NodeId(ConditionIdentifier, 5)); + + Assert.Equal(ExpectedKey, a.SourceReference); + Assert.Equal(a.SourceReference, b.SourceReference); + } + + /// + /// A server that leaves the ConditionId operand unanswered still keys imported conditions on + /// SourceNode, which OtOpcUa sets to the ConditionId for them. + /// + [Fact] + public void MissingConditionIdOperand_FallsBackToSourceNode() + { + var t = Emit(Client(), new NodeId(ConditionIdentifier, 4), "Plant/remote-a/HR200", true, false, conditionId: null); + + Assert.Equal(ExpectedKey, t.SourceReference); + Assert.Equal("Plant/remote-a/HR200.HR200", t.DisplayName); + } + + /// + /// A local OtOpcUa (or any third-party) condition keeps the pre-#147 SourceName.ConditionName key + /// and no label, even when the server answers ConditionId — so no persisted row is re-keyed. + /// + [Fact] + public void NonImportedCondition_KeepsLegacyKey() + { + // Index 2 is a mapped/raw namespace in this table, not the conditions namespace. + var local = new NodeId("pymodbus/plc/HR200", 2); + + var t = Emit(Client(), local, "pymodbus/plc/HR200", true, false, conditionId: local); + + Assert.Equal("pymodbus/plc/HR200.HR200", t.SourceReference); + Assert.Null(t.DisplayName); + } + + /// With no namespace table at all nothing can be recognised as imported: legacy keying. + [Fact] + public void NoNamespaceTable_KeepsLegacyKey() + { + var client = Client(); + client.NamespaceUrisOverride = null; + var id = new NodeId(ConditionIdentifier, 4); + + var t = Emit(client, id, "Plant/remote-a/HR200", true, false, conditionId: id); + + Assert.Equal("Plant/remote-a/HR200.HR200", t.SourceReference); + Assert.Null(t.DisplayName); + } +} diff --git a/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/OpcUaAlarmMapperTests.cs b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/OpcUaAlarmMapperTests.cs index 6afc6ad2..6dbc2a4e 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/OpcUaAlarmMapperTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Tests/OpcUaAlarmMapperTests.cs @@ -8,6 +8,45 @@ public class OpcUaAlarmMapperTests { // ── Routing identity must be the binding, not the event name ── + // ── Gitea #147: OtOpcUa imported conditions key on ConditionId ── + + private const string ImportedId = "nsu=https://zb.com/otopcua/mapped/conditions;s=c1.eyJDb25uZWN0aW9uSWQiOiJ4In0"; + + /// An imported condition is keyed on its ConditionId; SourceName.ConditionName becomes the label. + [Fact] + public void BuildIdentity_ImportedCondition_KeysOnConditionId_WithReadableLabel() + { + var (sourceRef, routing, display) = OpcUaAlarmMapper.BuildIdentity( + "nsu=https://zb.com/otopcua/mapped/raw;s=Plant/remote-a", "Plant/remote-a/Modbus/dev1/HR200", "HR200", ImportedId); + + Assert.Equal(ImportedId, sourceRef); + Assert.Equal("nsu=https://zb.com/otopcua/mapped/raw;s=Plant/remote-a", routing); // routing unchanged + Assert.Equal("Plant/remote-a/Modbus/dev1/HR200.HR200", display); + } + + /// A SourceName move changes only the label, never the key. + [Fact] + public void BuildIdentity_ImportedCondition_SourceNameMove_KeepsKey() + { + var before = OpcUaAlarmMapper.BuildIdentity("", "Plant/remote-a/Modbus/dev1/HR200", "HR200", ImportedId); + var after = OpcUaAlarmMapper.BuildIdentity("", "assembly/remote-line-2/filler/HR200", "HR200", ImportedId); + + Assert.Equal(before.SourceReference, after.SourceReference); + Assert.NotEqual(before.DisplayName, after.DisplayName); + } + + /// Every other condition keeps the pre-#147 readable key and carries no separate label. + [Theory] + [InlineData(null)] + [InlineData("")] + public void BuildIdentity_NotImported_KeepsSourceNameKey_NoLabel(string? importedId) + { + var (sourceRef, _, display) = OpcUaAlarmMapper.BuildIdentity("", "pymodbus/plc/HR200", "HR200", importedId); + + Assert.Equal("pymodbus/plc/HR200.HR200", sourceRef); + Assert.Null(display); + } + /// Verifies that a NodeId binding routes on the binding rather than the event name. [Fact] public void BuildIdentity_NodeIdBinding_RoutesOnBindingNotName() diff --git a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/NativeAlarmActorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/NativeAlarmActorTests.cs index d645b378..bf289006 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/NativeAlarmActorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Actors/NativeAlarmActorTests.cs @@ -828,4 +828,134 @@ public class NativeAlarmActorTests : TestKit, IDisposable Assert.DoesNotContain(messages.OfType(), m => m.State == AlarmState.Active); } + + // ── Gitea #147: opaque ConditionId key + readable DisplayName ────────── + + private const string ImportedKey = + "nsu=https://zb.com/otopcua/mapped/conditions;s=c1.eyJDb25uZWN0aW9uSWQiOiJjMSJ9"; + + private static NativeAlarmTransition Imported( + AlarmTransitionKind kind, bool active, bool acked, string displayName, DateTimeOffset time, + Guid? snapshotId = null) => + new(ImportedKey, "ns=2;s=T01", "OffNormalAlarmType", kind, + new AlarmConditionState(active, acked, null, AlarmShelveState.Unshelved, false, 800), + "", "", "msg", "", "", null, time, "", "", + SnapshotSourceReference: snapshotId is null ? null : Source().SourceReference, + SnapshotId: snapshotId, DisplayName: displayName); + + /// + /// The emitted state carries the transition's DisplayName, and a later transition with a moved + /// label updates it in place under the SAME key — no clear of an "old" alarm (Gitea #147). + /// + [Fact] + public void DisplayName_IsEmitted_AndUpdatesInPlaceUnderTheSameKey() + { + var instance = CreateTestProbe(); + var dcl = CreateTestProbe(); + var actor = Spawn(instance.Ref, dcl.Ref); + dcl.ExpectMsg(); + var t0 = DateTimeOffset.UtcNow; + + actor.Tell(new NativeAlarmTransitionUpdate("Opc", + Imported(AlarmTransitionKind.Raise, true, false, "Plant/remote-a/HR200.HR200", t0))); + var raised = instance.ExpectMsg(); + Assert.Equal(ImportedKey, raised.AlarmName); + Assert.Equal(ImportedKey, raised.SourceReference); + Assert.Equal("Plant/remote-a/HR200.HR200", raised.DisplayName); + + actor.Tell(new NativeAlarmTransitionUpdate("Opc", + Imported(AlarmTransitionKind.Acknowledge, true, true, "assembly/line-2/HR200.HR200", t0.AddSeconds(1)))); + var acked = instance.ExpectMsg(); + Assert.Equal(ImportedKey, acked.AlarmName); + Assert.Equal("assembly/line-2/HR200.HR200", acked.DisplayName); + Assert.Equal(AlarmState.Active, acked.State); + instance.ExpectNoMsg(TimeSpan.FromMilliseconds(200)); // no return-to-normal, no drop + } + + /// A computed-style / legacy condition with no DisplayName emits an empty label. + [Fact] + public void NoDisplayName_EmitsEmptyLabel() + { + var instance = CreateTestProbe(); + var dcl = CreateTestProbe(); + var actor = Spawn(instance.Ref, dcl.Ref); + dcl.ExpectMsg(); + + actor.Tell(new NativeAlarmTransitionUpdate("Opc", Transition( + "T01.Hi", AlarmTransitionKind.Raise, + new AlarmConditionState(true, false, null, AlarmShelveState.Unshelved, false, 800)))); + + Assert.Equal(string.Empty, instance.ExpectMsg().DisplayName); + } + + /// The DisplayName rides metadata_json and comes back on rehydration (no new column). + /// A task that represents the asynchronous operation. + [Fact] + public async Task Rehydration_RestoresDisplayName() + { + var instance1 = CreateTestProbe(); + var dcl1 = CreateTestProbe(); + var actor1 = SpawnWithFlush(instance1.Ref, dcl1.Ref, TimeSpan.FromMilliseconds(50)); + dcl1.ExpectMsg(); + actor1.Tell(new NativeAlarmTransitionUpdate("Opc", + Imported(AlarmTransitionKind.Raise, true, false, "Plant/remote-a/HR200.HR200", DateTimeOffset.UtcNow))); + instance1.ExpectMsg(); + + await AwaitAssertAsync(async () => + { + var rows = await _storage.GetNativeAlarmsAsync("inst", Source().CanonicalName); + Assert.Contains(rows, r => r.SourceReference == ImportedKey + && r.MetadataJson != null && r.MetadataJson.Contains("DisplayName")); + }, TimeSpan.FromSeconds(3)); + + var instance2 = CreateTestProbe(); + SpawnWithFlush(instance2.Ref, CreateTestProbe().Ref, TimeSpan.FromMilliseconds(50)); + var emitted = instance2.FishForMessage( + m => m.SourceReference == ImportedKey, TimeSpan.FromSeconds(5)); + Assert.Equal("Plant/remote-a/HR200.HR200", emitted.DisplayName); + } + + /// + /// Upgrade path (Gitea #147): a row persisted by a pre-#147 build under the old + /// SourceName.ConditionName key is rehydrated, then the first refresh snapshot lists the same + /// condition under its ConditionId key. The snapshot swap retires the old key (one + /// return-to-normal + drop) and the condition continues under the new key — no ghost row. + /// + /// A task that represents the asynchronous operation. + [Fact] + public async Task LegacyKeyedRow_IsRetiredByTheFirstSnapshot() + { + const string legacyKey = "Plant/remote-a/HR200.HR200"; + await _storage.UpsertNativeAlarmAsync( + "inst", Source().CanonicalName, legacyKey, + JsonSerializer.Serialize(new AlarmConditionState(true, false, null, AlarmShelveState.Unshelved, false, 800)), + DateTimeOffset.UtcNow.AddMinutes(-5), null); + + var instance = CreateTestProbe(); + var dcl = CreateTestProbe(); + var actor = SpawnWithFlush(instance.Ref, dcl.Ref, TimeSpan.FromMilliseconds(50)); + dcl.ExpectMsg(); + instance.FishForMessage(m => m.SourceReference == legacyKey, TimeSpan.FromSeconds(5)); + + var epoch = Guid.NewGuid(); + var now = DateTimeOffset.UtcNow; + actor.Tell(new NativeAlarmTransitionUpdate("Opc", Imported(AlarmTransitionKind.SnapshotStart, false, true, "", now, epoch))); + actor.Tell(new NativeAlarmTransitionUpdate("Opc", Imported(AlarmTransitionKind.Snapshot, true, false, legacyKey, now, epoch))); + actor.Tell(new NativeAlarmTransitionUpdate("Opc", Imported(AlarmTransitionKind.SnapshotComplete, false, true, "", now, epoch))); + + var messages = instance.ReceiveWhile(o => o, TimeSpan.FromMilliseconds(500)); + var retired = Assert.Single(messages.OfType(), m => m.SourceReference == legacyKey); + Assert.Equal(AlarmState.Normal, retired.State); + Assert.Contains(messages.OfType(), d => d.SourceReference == legacyKey); + var current = Assert.Single(messages.OfType(), m => m.SourceReference == ImportedKey); + Assert.Equal(AlarmState.Active, current.State); + Assert.Equal(legacyKey, current.DisplayName); // same text the operator saw before, now as a label + + await AwaitAssertAsync(async () => + { + var rows = await _storage.GetNativeAlarmsAsync("inst", Source().CanonicalName); + Assert.DoesNotContain(rows, r => r.SourceReference == legacyKey); + Assert.Contains(rows, r => r.SourceReference == ImportedKey); + }, TimeSpan.FromSeconds(3)); + } } diff --git a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/AlarmsAccessorTests.cs b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/AlarmsAccessorTests.cs index b80d2979..693f6c36 100644 --- a/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/AlarmsAccessorTests.cs +++ b/tests/ZB.MOM.WW.ScadaBridge.SiteRuntime.Tests/Scripts/AlarmsAccessorTests.cs @@ -222,6 +222,20 @@ public class AlarmsAccessorTests : TestKit, IDisposable Assert.False(Assert.Single(alarms, a => a.Name == "HighTemp").IsMesReportable); } + /// Verifies that a native condition's DisplayName reaches the script (Gitea #147). + /// A task that represents the asynchronous operation. + [Fact] + public async Task CurrentAsync_ProjectsDisplayName() + { + var probe = CreateTestProbe(); + var ctx = MakeContext(probe.Ref); + + var pending = ctx.Alarms.CurrentAsync(); + RespondWith(probe, NativeAcked() with { DisplayName = "Plant/remote-a/Z28061.Heartbeat" }); + + Assert.Equal("Plant/remote-a/Z28061.Heartbeat", Assert.Single(await pending).DisplayName); + } + /// Verifies that the MES-reportable call returns only the flagged rows. /// A task that represents the asynchronous operation. [Fact]