Skip to content

feat(bench): default the bench tools to one plate's carrier - #11

Merged
jewbetcha merged 1 commit into
mainfrom
claude/elegant-brattain-341470
Oct 28, 2026
Merged

jewbetcha merged 1 commit into
mainfrom
claude/elegant-brattain-341470

Conversation

@jewbetcha

Copy link
Copy Markdown
Member

What does this PR do?

Brings the bench tools in line with the "one stripboard carrier per plate" build in docs/harness.md (#10):

  • multi_cell.py: new parse_channels(): --channels takes L / R (a plate's four units), all, or names like L1,R2 (parts combine, e.g. L,R1). The default is now L (L1–L4), not the old toe set L1, L2, R1, R2. With --stdin and no --channels it still expects whichever units answered in the log.
  • carrier_check.py: --units uses the same parser, default L. The chain check now reads "plate L BUS OUT to plate R BUS IN". It is added automatically in the uno stage when the units span both plates (it used to be behind a heel_chained flag nothing set).
  • live_multi.py: new --channels (default L). The page is built from a layout taken from open_fp.config (corner positions and plate centres). It draws each plate in use with its four corners (dashed sockets for corners not in --channels), the total, a CoP dot on each plate plus text ("Plate L: 24 mm toe, 18 mm outer of centre"), and the L/R split and stance CoP when both plates are shown. Tare and Calibrate are unchanged. All 8 channels have colours.
  • docs/harness.md §4–5: removed the flags that are now the default, and added --units R / all, --channels R / all and the live-view variants.

Why was this required?

The owner built one carrier per plate, so the docs were changed to that (#10). The tools still defaulted to the toe cells from both plates. Running multi_cell.py or carrier_check.py with no flags on the plate L carrier would expect R1/R2 and report L3/L4 as unexpected. live_multi.py couldn't show a heel cell at all, and its "centre of load across the toe line" doesn't mean anything for a single plate.

Automated tests

  • tests/test_bench_multi.py: parse_channels (default is plate L, r/all aliases, combining, de-duplicating, unknown names rejected); run_stdin(None) expects only the units that answered in the log, and a bad --channels returns 2.
  • tests/test_bench_carrier.py: the plate R carrier checks D7 and A2 for R1 and R4, with no DRDY check. The chain check appears only in the uno stage when both plates are wired. Supply resistance for all 8 units with no cells is about 250 Ω.
  • tests/test_bench_live_multi.py: the layout for plate L matches open_fp.config (L1 −307.2/+122.4 toe outer, L3 −62.4/−122.4 heel inner, plate centre −184.8). Covers both plates and a partial toe set (the missing corners are marked on: false). The rendered page has its title and a parseable LAYOUT JSON filled in.

pytest: 210 passed. ruff check: clean. pylint: 9.38/10.

Manual (human) testing

No hardware run yet. That's for the owner on the plate L carrier (multi_cell.py and live_multi.py with no flags).

What I checked by hand, without hardware:

  • Served live_multi's rendered page with a local fake hub sending synthetic ads1220_all lines (readbacks, mode, 100 ms windows with load) and opened it in a browser, with no console errors:
    • --channels L: one plate, L1–L4 at the right corners (L1 toe-outer at top-left, L3 heel-inner at bottom-right). With L1 loaded most, the CoP read "24 mm toe, 18 mm outer of centre" and the dot moved up and to the left (outer on plate L). No L/R split shown.
    • --channels all: both plates, 8 cells, split "L 43 % / 57 % R", per-plate CoP lines and a stance line "32 mm toward R of the centre line". All 8 rows in the unit table, all 8 traces in the chart legend.
  • carrier_check.py --units X1 prints --units: unknown channel 'X1'; use L, R, all or names from … and exits 2. multi_cell.py --help shows the new --channels help.

Checklist

  • Single feature/fix — this PR is scoped to one thing with a clear story above
  • Automated tests included — new or updated tests cover this change
  • Manual testing described — I documented what I verified by hand above
  • Python tests pass (pytest)
  • Ruff passes (ruff check app/python tools tests docs/img)
  • Pylint passes (PYTHONPATH=app/python:tools/sim:tools/bench pylint app/python/open_fp tools/sim tools/bench --fail-under=9)
  • Hardware changes recorded in docs/VERIFIED.md (measurements, fit checks, pin changes) — n/a, no hardware change
  • Generated files regenerated and committed (e.g. docs/img/corner-assembly.svg, CAD STL/STEP) — n/a
  • Updated docs if needed
  • No unrelated changes mixed in

🤖 Generated with Claude Code

The harness is built as one stripboard carrier per plate (docs/harness.md),
but multi_cell.py and carrier_check.py defaulted to the old toe set
(L1, L2, R1, R2) and live_multi.py could only show those four cells.

- multi_cell.parse_channels: L / R (a plate's four), all, or names;
  the default is plate L. carrier_check --units uses it too, and adds the
  plate L BUS OUT -> plate R BUS IN check when both plates are wired.
- live_multi --channels (default L): draws each plate in use with its
  corners from open_fp.config, the CoP on each plate (toe/heel,
  inner/outer), and the L/R split when both plates are shown.
- docs/harness.md 4-5: drop the now-default flags; add --channels R/all.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jewbetcha
jewbetcha merged commit b887d58 into main Oct 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant