Skip to content

Add DockKind architecture and a g-g friction circle dock - #22

Merged
0x0Anna merged 1 commit into
mainfrom
gg-friction-circle
Sep 16, 2026
Merged

0x0Anna merged 1 commit into
mainfrom
gg-friction-circle

Conversation

@0x0Anna

@0x0Anna 0x0Anna commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds graph::DockKind (TimeSeries / GgCircle { lat_channel, long_channel }), kept as a vector parallel to AppState::dock_channels in main.rs (lockstep helpers for reorder/merge/remove) so the existing pure, index-based dock-list functions in graph.rs stay untouched.
  • New "Add g-g circle dock" button: resolves lateral/longitudinal g-force channels (ACR/ACC g_force_x/g_force_y, iRacing LatAccel/LongAccel; deliberately excludes RBR/NGP's vecLinearAccelerationCar.*, which real-capture investigation found reads implausible ~3000-magnitude values), converts to g, and renders an equal-scale scatter with a 1g reference circle (fit: contain, not fill, so the circle can't stretch into an ellipse).
  • DockPanel branches on kind: the g-g branch has no cursor-drag/scroll-zoom wiring, since a friction circle has no meaningful shared linear cursor fraction.

Part 2+3 of the graph value display + g-g friction circle plan, combined into one PR since Part 2 (the DockKind seam) has no independent user-facing value on its own.

Test plan

  • cargo test --workspace (includes a regression test against the real iRacing .ibt fixture's LatAccel/LongAccel, bounding converted values to catch a raw-unit bug like RBR/NGP's)
  • cargo build -p sde-app
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • Manual: launched sde-app.exe with SLINT_BACKEND=winit-software, loaded a real ACR/ACC .ld capture, resolved g_force_x/g_force_y, created a g-g circle dock and confirmed it renders an aspect-correct scatter (that capture's one ~55g outlier — a data artifact in the recording, not this code — shrinks the 1g reference circle to sub-pixel; the real-fixture unit test independently confirms the scaling math against iRacing's more reasonable ~15g spike).

Follow-up (not implemented this pass)

GPS/position track map and heading/yaw polar rose, both noted as follow-ups reusing this DockKind groundwork in the original plan.

Introduces graph::DockKind so a worksheet dock can render something
other than a per-channel time-series line graph, kept as a vector
parallel to AppState::dock_channels in main.rs so every existing
index-based dock-list operation (reorder, merge, remove) stays
Vec<Vec<String>>-only and unaware dock kinds exist.

Builds the g-g friction circle as the first consumer of that seam: a
new "Add g-g circle dock" button resolves lateral/longitudinal
g-force channels (ACR/ACC's g_force_x/y, iRacing's LatAccel/LongAccel,
deliberately excluding RBR/NGP's buggy vecLinearAccelerationCar.* —
see LAT_G_CANDIDATES' doc comment), converts to g, and plots an
equal-scale scatter with a 1g reference circle.

Claude-Session: https://claude.ai/code/session_019DvUhHPz4qmusxqSDqagLd
@0x0Anna
0x0Anna merged commit 4153dd5 into main Sep 16, 2026
7 checks passed
@0x0Anna
0x0Anna deleted the gg-friction-circle branch September 16, 2026 02:38
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