Skip to content

Project Structure

File Purpose
main.py program entry point: starts Flask / the window / the CSV writer thread
C_config.py global settings (COM Port, colors, update rate...)
C_packet_def.py packet field definitions (the only file to edit when hooking up your own hardware)
C_parser.py packet decoder: turns bytes into values per the field table
C_state.py shared state, thread-synchronization objects, log
C_sources.py data sources: Serial / Demo / three kinds of Replay
C_writer.py the CSV writer thread (pulls a packet from the Queue -> decodes -> writes to file)
C_routes.py the Flask app and every /api/* route
C_template.py the frontend HTML / CSS / JavaScript

Data flow:

[COM Port]  ──▶ [SerialReader]  ┐
[Demo]      ──▶ [DemoSource]    ├──▶ queue.Queue ──▶ [CsvWriter] ──▶ CSV
[Replay]    ──▶ [ReplaySource]  ┘                          │
                                                            ▼
                                              [Flask /api/*] ──▶ [Plotly.js UI]