Auto: focas-f5a — cycle time per part / last cycle delta

Closes #272
This commit is contained in:
Joseph Doherty
2026-04-26 09:11:21 -04:00
parent 45770e8d90
commit e3d7c65f61
7 changed files with 711 additions and 9 deletions

View File

@@ -44,6 +44,37 @@ reported wall-clock — keep CNC clocks on UTC so the dedup key
`(OccurrenceTime, AlarmNumber, AlarmType)` stays stable across DST
transitions.
## Derived telemetry — issue #272 (plan PR F5-a)
The `Production/` subtree gains two **derived** nodes alongside the four
F1-b wire-sourced fields:
- `Production/LastCycleSeconds` (`Float64`)
- `Production/LastCycleStartUtc` (`DateTime` UTC)
**No new wire calls.** Both nodes are computed client-visible from the
same `cnc_rdparam(6711)` + `cnc_rdtimer` poll the F1-b projection
already runs on every probe tick. There is no per-device knob — the
nodes are present for every CNC the driver connects to and surface
`null` until the second observed parts-count increment produces the
first delta.
This means:
- **No additional CNC load.** Probe-tick wire traffic is unchanged.
- **No new opt-in.** The nodes ship enabled by default and are
read-only (`SecurityClassification.ViewOnly`); no LDAP group needs
the new permission.
- **Reconnect re-baselines.** Per the FWLIB session boundary the
derivation state resets on reconnect / reinit, so the first cycle
observed after a reconnect re-establishes the baseline before
publishing the first post-reconnect delta.
See [`docs/drivers/FOCAS.md`](../drivers/FOCAS.md) § "Fixed-tree
`Production/` projection" for the full edge-case behaviour matrix
(parts-count counter reset, cycle-timer rollover, parts-count jumps
> 1).
## Write safety — issue #269 (PARAM/MACRO, F4-b) + issue #270 (PMC, F4-c)
The FOCAS driver supports `cnc_wrparam`, `cnc_wrmacro`, and `pmc_wrpmcrng`