[focas] FOCAS — Operator messages + block text #329

Merged
dohertj2 merged 1 commits from auto/focas/F1-e into auto/driver-gaps 2026-04-25 14:51:49 -04:00
Owner

Summary

Adds two FOCAS fixed-tree nodes per device, mirroring f1a-d patterns:

  • Messages/External/Latest (String) — most recent operator message via cnc_rdopmsg3. Loops 4 message classes (OPMSG / MACRO / EXTERN / REJ-EXT) collecting non-empty trimmed entries.
  • Program/CurrentBlock (String) — currently-executing block text via cnc_rdactpt.

Took the simpler "Latest" form over a 4-slot ring buffer per the issue body's permitted minimum.

  • New FocasOperatorMessage, FocasOperatorMessagesInfo, FocasCurrentBlockInfo records + 2 default-null IFocasClient methods.
  • FwlibNative.cscnc_rdopmsg3 + cnc_rdactpt P/Invokes plus OPMSG3 + ODBACTPT structs.
  • Shared TrimAnsiPadding helper stops at first NUL and trims trailing spaces — guarantees trim-stable round-trip.
  • Probe-loop refreshes both caches with the established best-effort policy. DeviceState gains LastMessages / LastCurrentBlock.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.FOCAS — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests229 / 229 passed (6 new in FocasMessagesBlockTextFixedTreeTests: discovery shape, cached read, BadCommunicationError when caches empty, empty-snapshot Good, disconnected client returns null, TrimAnsiPadding covers nulls/spaces/empty)
  • Integration tests — skipped (live CNC required)

🤖 Auto-generated by the Mode-B execution loop. Closes #261.

Closes #261

## Summary Adds two FOCAS fixed-tree nodes per device, mirroring f1a-d patterns: - **`Messages/External/Latest`** (String) — most recent operator message via `cnc_rdopmsg3`. Loops 4 message classes (OPMSG / MACRO / EXTERN / REJ-EXT) collecting non-empty trimmed entries. - **`Program/CurrentBlock`** (String) — currently-executing block text via `cnc_rdactpt`. Took the simpler "Latest" form over a 4-slot ring buffer per the issue body's permitted minimum. - New `FocasOperatorMessage`, `FocasOperatorMessagesInfo`, `FocasCurrentBlockInfo` records + 2 default-null `IFocasClient` methods. - `FwlibNative.cs` — `cnc_rdopmsg3` + `cnc_rdactpt` P/Invokes plus `OPMSG3` + `ODBACTPT` structs. - Shared `TrimAnsiPadding` helper stops at first NUL and trims trailing spaces — guarantees trim-stable round-trip. - Probe-loop refreshes both caches with the established best-effort policy. `DeviceState` gains `LastMessages` / `LastCurrentBlock`. ## Test plan - [x] `dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.FOCAS` — clean (0 / 0) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests` — **229 / 229 passed** (6 new in `FocasMessagesBlockTextFixedTreeTests`: discovery shape, cached read, BadCommunicationError when caches empty, empty-snapshot Good, disconnected client returns null, `TrimAnsiPadding` covers nulls/spaces/empty) - [ ] Integration tests — skipped (live CNC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #261. Closes #261
dohertj2 added 1 commit 2026-04-25 14:51:44 -04:00
dohertj2 merged commit 63a79791cd into auto/driver-gaps 2026-04-25 14:51:49 -04:00
dohertj2 deleted branch auto/focas/F1-e 2026-04-25 14:51:49 -04:00
Sign in to join this conversation.