diff --git a/README.md b/README.md index feaea0f..dd1ad3c 100644 --- a/README.md +++ b/README.md @@ -99,23 +99,18 @@ figures — presses / on-the-way / oven are always real-time. } ``` -### Wiring the REAL data (currently SAMPLE) +### Live data wiring -`api/routes.py` returns sample data today. To make it live (see the big `TODO` there -and `.claude/memory/temper-line-overview.md` in the gateway): - -- Import the kernel proxy: `from .._db import run_select_query` (read-only). -- Reuse the temper status-derivation in `modules/fastpress/press/temper.py` - (`_temper_aggregates_all` derives on-way / in-oven / finished from planned - timestamps vs `NOW()`), un-scoped across **all** presses. Read - `production.temper_tracking` (carts grouped by `ttCartId`, keyed by origin press - `ttPress`) + `production.active_orders`/`finished_orders`. -- `notVerladen` = produced good parts (cycles) − parts logged to temper. **Open - question:** per-press or plant-wide? -- Scope `finished` by `range` on `ttOutOfOvenAt`. Never echo customer/price fields. - -Alternatively, add a public `GET /press/temper/overview` in fastpress and have the -frontend call that — decide before wiring; keep the payload shape above either way. +`api/routes.py` reads live MariaDB (`sample:true` only appears in the standalone +dev fallback with no backend). Details + the exact column sources are in the gateway +memory `.claude/memory/temper-line-overview.md`. In short: it uses the kernel proxy +`from .._db import run_select_query` (read-only), un-scoped across **all** presses for +plant `PLANT_NAME` — press list from `press_settings.presses`; good/chips from +`active_orders`+`rejects`; run/stop/idle from `cycles_new` recency; carts + +`notVerladen` from `production.temper_tracking` with position derived in SQL from the +planned timestamps vs `NOW()` (reprints excluded). `finished` is scoped by `range` on +`ttOutOfOvenAt`. Oven temperature is omitted (no sensor). Never echo customer/price +fields. ---