Skip to content

SI-prefixed display for Statistics panel and chart y-axis - #9

Merged
Fyfar merged 1 commit into
mainfrom
feat/si-unit-display
Sep 28, 2026
Merged

Fyfar merged 1 commit into
mainfrom
feat/si-unit-display

Conversation

@Fyfar

@Fyfar Fyfar commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Summary

Statistics panel entries (Average/Min/Max/Peak-to-Peak/Std Dev) and the realtime chart's y-axis now render with SI unit prefixes (e.g. 11.13 MΩ) instead of raw base-unit numbers (e.g. 11130000.00 Ω). Display only — no change to stored values, resolution, CSV export, or Data Log rows.

  • Each Statistics panel entry picks its own SI prefix from its own magnitude; the chart's y-axis picks one shared prefix per redraw from the visible range (lib/si.ts: siPrefixOf, formatSiValue).
  • Decimals come from the existing measurement-resolution tracking (binWidth/recordedResolution), never a new precision source.
  • The SI prefix is chosen from a value's true, unrounded magnitude and never re-picked after rounding, so a value can't be promoted into the next prefix by rounding (999999.6 Ω at 1 Ω resolution reads 1000.000 kΩ, never 1.00 MΩ).
  • Capacitance's internal base unit is nF, not physical F — corrected via toPhysicalUnit wherever a capacitance number reaches the formatter.
  • siPrefixOf relocated from lib/passfail.ts to a new lib/si.ts, now shared by the Dashboard, Pass/Fail, and the chart.

Hardware testing

Tested against a ZOYI ZT703s (28/29 cases passing on first run); three real issues found and fixed:

  • A genuine zero (e.g. Peak-to-Peak before a 2nd sample) briefly rendered as a long decimal string (0.00000000000000F) instead of 0.
  • Pass/Fail's Measured Spread panel showed a flat 3 decimals against the meter's real resolution once SI-scaled next to the Dashboard's resolution-accurate numbers. VerdictRow now carries the capturing reading's resolution; Pass/Fail tracks the coarsest resolution across the batch's captured rows, same as the Dashboard.
  • Clear Batch could re-trigger a capture (and verdict beep) for a part still sitting on the probes, from any view, because it redundantly reset the same-part capture guard that already re-arms correctly on a genuine probe lift.

Three unrelated findings from the same test pass (unbounded manual y-range inputs, unscaled histogram bin labels, a bad x-axis offset after reload-before-reconnect) are recorded as known issues, not fixed here.

Verification

  • npx tsc --noEmit — clean
  • npx eslint — clean
  • npm run check — all 8 self-checks pass, including new check-si.mts (19/19)
  • npm run build — production build succeeds
  • Two independent cold code reviews of the full diff (must-fix: none)
  • Manual hardware verification against a real ZT703s

Version bumped 1.7.2 → 1.8.0 (minor, non-breaking addition).

🤖 Generated with Claude Code

Statistics panel entries (Average/Min/Max/Peak-to-Peak/Std Dev) and the
realtime chart's y-axis now render with SI unit prefixes (e.g. "11.13 MΩ")
instead of raw base-unit numbers (e.g. "11130000.00 Ω"). Display only —
no change to stored values, resolution, CSV export, or Data Log rows.

- Each Statistics panel entry picks its own SI prefix from its own
  magnitude; the chart's y-axis picks one shared prefix per redraw from
  the visible range (lib/si.ts: siPrefixOf, formatSiValue).
- Decimals come from the existing measurement-resolution tracking
  (binWidth/recordedResolution), never a new precision source.
- The SI prefix is chosen from a value's true, unrounded magnitude and
  never re-picked after rounding, so a value can't be promoted into the
  next prefix by rounding (999999.6 Ω at 1 Ω resolution reads
  "1000.000 kΩ", never "1.00 MΩ").
- Capacitance's internal base unit is nF, not physical F — corrected via
  toPhysicalUnit wherever a capacitance number reaches the formatter.
- siPrefixOf relocated from lib/passfail.ts to a new lib/si.ts, now
  shared by the Dashboard, Pass/Fail, and the chart.

Hardware-tested against a ZOYI ZT703s (28/29 cases passing on first run);
three real issues found and fixed:
- A genuine zero (e.g. Peak-to-Peak before a 2nd sample) briefly rendered
  as a long decimal string ("0.00000000000000F") instead of "0".
- Pass/Fail's Measured Spread panel showed a flat 3 decimals against the
  meter's real resolution once SI-scaled next to the Dashboard's
  resolution-accurate numbers. VerdictRow now carries the capturing
  reading's resolution; Pass/Fail tracks the coarsest resolution across
  the batch's captured rows, same as the Dashboard.
- Clear Batch could re-trigger a capture (and verdict beep) for a part
  still sitting on the probes, from any view, because it redundantly
  reset the same-part capture guard that already re-arms correctly on a
  genuine probe lift.

Three unrelated findings from the same test pass (unbounded manual
y-range inputs, unscaled histogram bin labels, a bad x-axis offset after
reload-before-reconnect) are recorded as known issues, not fixed here.

🤖 Generated with [Claude Code](https://claude.ai/code)
@Fyfar
Fyfar force-pushed the feat/si-unit-display branch from 19c9f67 to 3b95c0b Compare September 28, 2026 12:40
@Fyfar
Fyfar merged commit fc6ee6b into main Sep 28, 2026
3 checks passed
@Fyfar
Fyfar deleted the feat/si-unit-display branch September 28, 2026 12:42
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