Skip to content

Reusable electrical report exporter and @ReadyWhen - #692

Merged
stephenjust merged 4 commits into
mainfrom
electrical-report
Nov 9, 2026
Merged

stephenjust merged 4 commits into
mainfrom
electrical-report

Conversation

@tblank1024

@tblank1024 tblank1024 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Moves the electrical report exporter from TeamXbot2026 into the library so every season repo (starting with 2027 from FRCRobotTemplate) gets it without copying.

Adds

  • @ReadyWhen("Name") (xbot.common.injection.electrical_contract): tags a contract getter with the hardware it belongs to, so the report leaves out devices whose mechanism isn't on the robot.
  • XElectricalReportContract: isReady(String), getHardwareNames() (catches typos in @ReadyWhen), CanBusOrderEntry, and optional default methods for CAN order, extra PDH loads and power branches.
  • xbot.common.electrical.report.ElectricalReport: text report and JSON snapshots for the electrical contract web tool (Team488/electrical-contract-web). run(args, contracts) takes a map of robot name → contract; --all -d DIR writes every robot plus index.json.
  • ElectricalReportTest: 8 tests (readiness filter, typo rejection, defined-in tracking, wiring lists only from a robot's own class, I/O sorting, JSON and text output, --all).

Changes from the 2026 version: CAN buses come from the devices (can_s0–can_s4, Canivore) since there's no RIO bus; minimal built-in JSON writer, no new dependency.

Notes for reviewers

Companion PR: Team488/FRCRobotTemplate#96 (draft).

🤖 Generated with Claude Code

https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp

- @ReadyWhen("Name") tags a contract getter with the hardware it belongs to.
- XElectricalReportContract: isReady/getHardwareNames plus optional wiring lists
  (CAN order, extra PDH loads, power branches) for the report.
- xbot.common.electrical.report.ElectricalReport: text report and JSON snapshots
  for the electrical contract web tool; --all -d DIR writes every robot plus
  index.json. Moved from TeamXbot2026 and generalised (CAN buses taken from the
  devices, no RIO bus).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
stephenjust and others added 2 commits November 7, 2026 11:50
…ctor

Migrate electrical report DeviceInfo usages to record accessors, update test contracts to fluent descriptor builders, and apply the new Spotless formatting.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 775680b9-d2ff-4c9c-9ede-3a01e371e54a
Integrate upstream finite-state-machine changes. Run Spotless across the repository; no additional formatting changes were needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 775680b9-d2ff-4c9c-9ede-3a01e371e54a
@stephenjust
stephenjust enabled auto-merge (squash) November 9, 2026 01:59
@stephenjust
stephenjust merged commit 2291a57 into main Nov 9, 2026
1 check passed
@stephenjust
stephenjust deleted the electrical-report branch November 9, 2026 02:03
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.

2 participants