[focas] FOCAS — Parts count + cycle time #326

Merged
dohertj2 merged 1 commits from auto/focas/F1-b into auto/driver-gaps 2026-04-25 14:17:19 -04:00
Owner

Summary

Per-device Production/ fixed-tree subfolder with 4 read-only Int32 nodes (PartsProduced, PartsRequired, PartsTotal, CycleTimeSeconds), mirroring the Status/ pattern shipped in #325.

  • IFocasClient.cs — new FocasProductionInfo record + default-null GetProductionAsync
  • FwlibFocasClient.cs — implements via cnc_rdparam(6711/6712/6713) for parts counters + cnc_rdtimer(type=2) for cycle-time-seconds (best-effort: cycle-time defaults to 0 if rdtimer fails)
  • FwlibNative.cs — adds cnc_rdtimer P/Invoke + IODBTMR struct
  • FocasDriver.cs — discovers Production/, refreshes cache on the existing probe tick, dispatches reads from cache (no extra wire calls). DeviceState gains LastProduction / LastProductionUtc.

Test plan

  • dotnet build src/ZB.MOM.WW.OtOpcUa.Driver.FOCAS — clean (0 / 0)
  • dotnet test tests/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests211 / 211 passed (4 new in FocasProductionFixedTreeTests: discovery shape, cached-snapshot read, BadCommunicationError when probe disabled, disconnected GetProductionAsync returns null)
  • Integration tests — skipped (live CNC required)

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

Closes #258

## Summary Per-device `Production/` fixed-tree subfolder with 4 read-only Int32 nodes (`PartsProduced`, `PartsRequired`, `PartsTotal`, `CycleTimeSeconds`), mirroring the `Status/` pattern shipped in #325. - `IFocasClient.cs` — new `FocasProductionInfo` record + default-null `GetProductionAsync` - `FwlibFocasClient.cs` — implements via `cnc_rdparam(6711/6712/6713)` for parts counters + `cnc_rdtimer(type=2)` for cycle-time-seconds (best-effort: cycle-time defaults to 0 if rdtimer fails) - `FwlibNative.cs` — adds `cnc_rdtimer` P/Invoke + `IODBTMR` struct - `FocasDriver.cs` — discovers `Production/`, refreshes cache on the existing probe tick, dispatches reads from cache (no extra wire calls). `DeviceState` gains `LastProduction` / `LastProductionUtc`. ## 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` — **211 / 211 passed** (4 new in `FocasProductionFixedTreeTests`: discovery shape, cached-snapshot read, BadCommunicationError when probe disabled, disconnected `GetProductionAsync` returns null) - [ ] Integration tests — skipped (live CNC required) 🤖 Auto-generated by the Mode-B execution loop. Closes #258. Closes #258
dohertj2 added 1 commit 2026-04-25 14:17:15 -04:00
dohertj2 merged commit ae7cc15178 into auto/driver-gaps 2026-04-25 14:17:19 -04:00
dohertj2 deleted branch auto/focas/F1-b 2026-04-25 14:17:20 -04:00
Sign in to join this conversation.