[focas] FOCAS — ODBST status flags as fixed-tree nodes #325

Merged
dohertj2 merged 1 commits from auto/focas/F1-a into auto/driver-gaps 2026-04-25 14:07:44 -04:00
Owner

Summary

Projects the 9 fields of FOCAS cnc_statinfo (ODBST struct) under Status/ per device.

  • New FocasStatusInfo record (9 short fields: Dummy, Tmmode, Aut, Run, Motion, Mstb, EmergencyStop, Alarm, Edit) and default-implementation IFocasClient.GetStatusAsync so existing impls (IpcFocasClient, fakes) compile unchanged.
  • FwlibFocasClient decodes the full ODBST struct.
  • Boolean ProbeAsync health probe preserved verbatim.
  • FocasDriver.DiscoverAsync emits a Status/ subfolder per device with 9 read-only Int16 variables.
  • FocasDriver.ProbeLoopAsync refreshes a per-device cached snapshot on every probe tick after a successful probe.
  • ReadAsync intercepts status-node references and serves from cache (returns BadCommunicationError until first refresh).

EmergencyStop and Alarm documented as small enums (0..7) per Fanuc docs, so Int16 is the safer surfacing.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.FOCAS — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests207 / 207 passed (5 new in FocasStatusFixedTreeTests: discovery, cached read, empty-cache fallback, back-compat, FwlibFocasClient null guard)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Host.Tests — 13 / 13
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Shared.Tests — 24 / 24
  • Integration tests — skipped (live CNC required)

One pre-existing test needed a 2-line tweak (DiscoverAsync_emits_pre_declared_tags) — its Single(BrowseName=="Run") lookup now collides with the new Status/Run node; disambiguated by FullName.

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

Closes #257

## Summary Projects the 9 fields of FOCAS `cnc_statinfo` (ODBST struct) under `Status/` per device. - New `FocasStatusInfo` record (9 short fields: `Dummy`, `Tmmode`, `Aut`, `Run`, `Motion`, `Mstb`, `EmergencyStop`, `Alarm`, `Edit`) and default-implementation `IFocasClient.GetStatusAsync` so existing impls (`IpcFocasClient`, fakes) compile unchanged. - `FwlibFocasClient` decodes the full ODBST struct. - Boolean `ProbeAsync` health probe preserved verbatim. - `FocasDriver.DiscoverAsync` emits a `Status/` subfolder per device with 9 read-only `Int16` variables. - `FocasDriver.ProbeLoopAsync` refreshes a per-device cached snapshot on every probe tick after a successful probe. - `ReadAsync` intercepts status-node references and serves from cache (returns `BadCommunicationError` until first refresh). `EmergencyStop` and `Alarm` documented as small enums (0..7) per Fanuc docs, so Int16 is the safer surfacing. ## 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` — **207 / 207 passed** (5 new in `FocasStatusFixedTreeTests`: discovery, cached read, empty-cache fallback, back-compat, `FwlibFocasClient` null guard) - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Host.Tests` — 13 / 13 - [x] `dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Shared.Tests` — 24 / 24 - [ ] Integration tests — skipped (live CNC required) > One pre-existing test needed a 2-line tweak (`DiscoverAsync_emits_pre_declared_tags`) — its `Single(BrowseName=="Run")` lookup now collides with the new `Status/Run` node; disambiguated by `FullName`. 🤖 Auto-generated by the Mode-B execution loop. Closes #257. Closes #257
dohertj2 added 1 commit 2026-04-25 14:07:39 -04:00
dohertj2 merged commit 329e222aa2 into auto/driver-gaps 2026-04-25 14:07:44 -04:00
dohertj2 deleted branch auto/focas/F1-a 2026-04-25 14:07:44 -04:00
Sign in to join this conversation.