feat(mgc-dashboard): -1 OFF sentinel on per-pump % control chart
fn_chart_pump_a/b/c now emit -1 on the ctrl output when the cached pump state is off/idle/maintenance, instead of the residual ctrl% (which would sit at 0 and be indistinguishable from a pump genuinely running at 0%). ui_chart_pumps_ctrl ymin set to -5 so the OFF rail is visible below the 0-100 band. Adds test/integration/per-pump-ctrl-fanout.integration.test.js covering both chart outputs of all three pumps in populated (running), OFF (off/idle/maintenance), and degraded (missing state/ctrl/flow, pre-tick, NaN, ctrl-only delta) states per .claude/rules/output-coverage.md. Updates test/_output-manifest.md to document the previously-undocumented per-pump fan-out functions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -139,6 +139,26 @@ whole msg as `null` (drop the output) when their source is missing — never
|
||||
| 16 | ui_chart_qh (passthrough) | raw `msg.payload` | ✔ | ✔ |
|
||||
| 17 | ui_chart_mgc_pctcap | `{topic:'% of capacity', payload:flow/capMax×100}` | ✔ State C | ✔ State A → null (drop) |
|
||||
|
||||
## Example flow fan-out — `examples/02-Dashboard.json :: fn_chart_pump_a/b/c` (outputs: 2 each)
|
||||
|
||||
Each per-pump fan-out delta-caches the pump's Port 0 then emits two chart msgs.
|
||||
The ctrl output carries a **-1 OFF sentinel**: when the cached pump `state` is
|
||||
`off` / `idle` / `maintenance` the pump is not running, so it plots `-1` (below
|
||||
the 0–100 band) — a clear OFF rail distinct from a pump genuinely running at 0%.
|
||||
`ui_chart_pumps_ctrl` has `ymin: "-5"` so the sentinel is visible. Charts return
|
||||
the whole msg as `null` (drop the output) when their source is missing — never
|
||||
`{ payload: null }`. All ports covered by
|
||||
`test/integration/per-pump-ctrl-fanout.integration.test.js`.
|
||||
|
||||
| # | Target chart | Topic / payload | Populated | Degraded |
|
||||
|---|---|---|---|---|
|
||||
| 0 | ui_chart_per_pump_flow | `{topic:'Pump A/B/C', payload:flow m³/h}` | ✔ running state | ✔ no `flow.predicted.downstream.*` key → null (drop) |
|
||||
| 1 | ui_chart_pumps_ctrl | `{topic:'Pump A/B/C', payload:ctrl%}`, or `payload:-1` when state ∈ {off,idle,maintenance} | ✔ running → +ctrl; ✔ off/idle/maintenance → -1 | ✔ no state + ctrl missing/NaN/null → null (drop); ✔ ctrl-only delta keeps cached OFF state |
|
||||
|
||||
`fn_chart_total` (outputs: 1) feeds the same flow chart with the group total
|
||||
(`downstream_predicted_flow ?? atEquipment_predicted_flow`); returns `null` when
|
||||
both are absent.
|
||||
|
||||
## Coverage gaps (open items)
|
||||
|
||||
These are known holes flagged during the 2026-05-14 governance review; not yet
|
||||
|
||||
Reference in New Issue
Block a user