feat: wireview pin-imbalance warning, per-pin rating bars, pin_imbalance_a

- Per-pin bar now scales against the 9.2 A per-pin rating (10 A full
  scale, red at/over rating) instead of the 55 A total connector OCP
- Debounced app-wide warning banner (visible on all tabs) when the
  current between two pins diverges by > 2 A for ~7 s - the signature
  of a bad pin contact that can overheat and melt the 12VHPWR
  connector; 5 s grace period after clearing
- New pin_imbalance_a sample field (max - min pin current) in both the
  serial and hwmon sample builders, plus frontend type
- Docs: README + WireView.md cover the warning and threshold; fresh
  screenshot with the new per-pin labels
- Tests: vitest setup + 9 unit tests for the debounce state machine;
  3 new backend checks for pin_imbalance_a
This commit is contained in:
ARIA committed 2026-10-03 22:13:13 +02:00
1 parent 92356d1409
commit b69b7502b3
14 files changed
+810 -18

No files matched your search

+13
View File
@@ -89,6 +89,18 @@ def test_parse_sensor_struct():
"total power",
abs(s["power_total_w"] - round(6 * 11.904 * 6.221, 3)) < 1e-9,
)
check(
"pin imbalance (uniform)",
s["pin_imbalance_a"] == 0.0,
)
# Imbalance is the spread between the highest- and lowest-loaded pin.
uneven = wv.parse_sensor_struct(
make_frame(pins=((11904, 6221, 74055),) * 5 + ((11900, 1100, 13090),))
)
check(
"pin imbalance (uneven)",
abs(uneven["pin_imbalance_a"] - 5.121) < 1e-9,
)
check(
"avg voltage",
abs(s["voltage_avg_v"] - 11.904) < 1e-3,
@@ -296,6 +308,7 @@ def test_hwmon_device():
"hwmon total current",
abs(s["current_total_a"] - round(6 * 6.221, 3)) < 1e-9,
)
check("hwmon pin imbalance (uniform)", s["pin_imbalance_a"] == 0.0)
dev.close()
check("hwmon closed", not dev.connected)