Skip to content

Commit 56d27a0

Browse files
Chrixcoclaude
andcommitted
Rebuild dashboard to AC's first-party transports + neumorphic UI
Drop the in-game Python plugin entirely. AC's embedded Python 3.3 ships without `_socket`, which made a UDP-broadcasting plugin a maintenance sink (vendoring binary stdlib from a 9-years-EOL Python build). Replace it with AC's two first-party transports: - `network/udp_receiver.py` speaks AC's remote-telemetry protocol on UDP 9996 directly. Handshake -> SUBSCRIBE_UPDATE -> RTCarInfo stream, with auto-reconnect on session restart and the Windows SIO_UDP_CONNRESET fix so the receive loop survives AC-not-running. - `network/shared_memory.py` maps `Local\acpmf_physics`, decodes Kunos's SPageFilePhysics struct via ctypes, fills the fields RTCarInfo omits (tyre core temperatures, fuel, pressures, wear). Polls at 30Hz and reopens when AC sessions come and go. `telemetry.py` is the single source of truth for the wire format, verified against the canonical Kunos document and rickwest's parser. Discovered (and regression-tested) two AC quirks live: handshake response uses '%' as the end-of-string marker (not the C null), and pads string slots with uninitialised stack memory. `_decode_wchar` cuts at whichever terminator appears first. UI rebuilt around a dark-neumorphic palette (`theme.py` + `NeumorphCard` base class with paint-time dual shadows). Three-column layout: - Left: CarInfo, Pedals, InputGraph (rolling input trace), WheelTempsCard. - Center: ShiftIndicator (RPM LEDs + gear), SpeedDisplay (big), AccelerationDisplay (G ball with trail), AssistsCard (ABS/TC pills), FuelDisplay. - Right: CircuitMapCard (auto-records track outline from carCoordinates, lime dot for current position) + RaceStatsPanel (lap counter, current/best/last with green/red delta). In-app console (View -> Console or Ctrl+Shift+C) opens a non-modal window with Log + Live Values tabs. Log is fed by a singleton LogBus that captures Python's logging via a custom handler and exposes a Qt signal + 5000-record ring buffer for replay. Filters by source (udp_receiver / shared_memory / app), level (DEBUG..ERROR), free-text search, plus pause/clear/save controls. `scripts/monitor.py` is a standalone CLI tool that connects to both transports (separate from the dashboard) and prints every field with the widget that consumes it -- useful for "what is AC actually sending?" debugging. Packaging: pyproject.toml with PEP 621 metadata, console entry point `ontrack`, ruff (E/F/W/I/B/UP/SIM) and pytest config. Restructured `dashboard/` -> `ontrack_dashboard/` so all imports are absolute and the package installs cleanly via `pip install -e .`. Tests: 24 pytest cases covering handshake encoding, RTCarInfo struct layout, the two AC string quirks, ABS/TC parsing, carCoordinates, PhysicsPacket round-trip, and packet immutability. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 83533bd commit 56d27a0

51 files changed

Lines changed: 4358 additions & 1570 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,9 @@ Thumbs.db
5858
# (Don't commit actual game files)
5959
game_plugin/config.ini.bak
6060

61-
# Dashboard config (user-specific)
62-
dashboard/.config/
61+
# Dashboard runtime / user-specific
62+
dashboard.log
63+
ontrack_dashboard/.config/
64+
65+
# Ruff
66+
.ruff_cache/

0 commit comments

Comments
 (0)