# vedderb/vesc_tool architecture

> Architecture diagram of the GitHub repository vedderb/vesc_tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vedderb/vesc_tool
- Repository: https://github.com/vedderb/vesc_tool

## Overview

VESC Tool is a cross-platform desktop and mobile application for configuring, monitoring, and programming VESC hardware. The principal workflow is to connect to a controller, exchange commands and configuration through the interface and transport layers, then present or modify controller state in UI pages. Other substantial capabilities include firmware and ESP32 programming, logging and plotting, scripting, display editing, mapping, and Markdown parsing. Several subsystem links are supported only by the file index or project structure, so uncertain links are omitted rather than asserted.

Main entry points: [`pages`](https://github.com/vedderb/vesc_tool/tree/master/pages) (Configuration pages), [`vescinterface.cpp`](https://github.com/vedderb/vesc_tool/blob/master/vescinterface.cpp) (VESC interface), [`main.cpp`](https://github.com/vedderb/vesc_tool/blob/master/main.cpp) (Application entry), [`mainwindow.cpp`](https://github.com/vedderb/vesc_tool/blob/master/mainwindow.cpp) (Main window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_mainwindow["Main window<br/>[mainwindow.cpp]"]
  node_pages["Configuration pages"]
  node_wizard["Setup wizards<br/>[startupwizard.cpp]"]
  node_utility["Shared utilities<br/>[utility.h]"]
end

subgraph group_device["Device Communication"]
  node_interface["VESC interface<br/>[vescinterface.cpp]"]
  node_commands["Commands and packets<br/>[commands.cpp]"]
  node_transport["Connection transports<br/>[bleuart.cpp]"]
  node_controller(("VESC controller"))
  node_poller["Command polling<br/>[pollmanager.cpp]"]
  node_config["Configuration data<br/>[configparams.cpp]"]
  node_types["Shared data types<br/>[datatypes.h]"]
end

subgraph group_tools["Tools and Analysis"]
  node_firmware["Firmware handling<br/>[fwhelper.cpp]"]
  node_espflash["ESP32 flashing<br/>[esp_loader.c]"]
  node_logs["Log files<br/>[logreader.cpp]"]
  node_plots["Plotting<br/>[qcustomplot.h]"]
  node_editor["Code editor<br/>[QCodeEditor.cpp]"]
  node_display["Display editor<br/>[dispeditor.cpp]"]
end

subgraph group_content["Content and Mapping"]
  node_markdown["Markdown parser<br/>[parser.h]"]
  node_map["Map display<br/>[mapwidget.cpp]"]
  node_osm["Map tile client<br/>[osmclient.cpp]"]
end

node_user(("VESC Tool user"))

node_user -.->|"starts"| node_entry
node_entry -.->|"opens"| node_mainwindow
node_mainwindow -.->|"presents"| node_pages
node_pages -->|"configures"| node_interface
node_pages -->|"sends commands"| node_interface
node_poller -->|"dispatches"| node_commands
node_poller -->|"gets commands"| node_interface
node_interface -->|"uses"| node_commands
node_interface -->|"uses"| node_transport
node_interface -->|"uses"| node_config
node_interface -->|"uses"| node_types
node_transport -.->|"communicates"| node_controller
node_entry -->|"references"| node_firmware
node_entry -->|"references"| node_logs
node_entry -.->|"supports flashing"| node_espflash
node_logs -.->|"analyzes with"| node_plots
node_pages -.->|"displays data"| node_plots
node_pages -.->|"provides scripting"| node_editor
node_pages -.->|"opens tool"| node_display
node_map -.->|"requests tiles"| node_osm
node_pages -.->|"presents"| node_map
node_wizard -.->|"assists setup"| node_interface
node_pages -->|"uses"| node_utility
node_mainwindow -.->|"renders content"| node_markdown

click node_entry "https://github.com/vedderb/vesc_tool/blob/master/main.cpp"
click node_mainwindow "https://github.com/vedderb/vesc_tool/blob/master/mainwindow.cpp"
click node_pages "https://github.com/vedderb/vesc_tool/tree/master/pages"
click node_wizard "https://github.com/vedderb/vesc_tool/blob/master/startupwizard.cpp"
click node_interface "https://github.com/vedderb/vesc_tool/blob/master/vescinterface.cpp"
click node_commands "https://github.com/vedderb/vesc_tool/blob/master/commands.cpp"
click node_transport "https://github.com/vedderb/vesc_tool/blob/master/bleuart.cpp"
click node_poller "https://github.com/vedderb/vesc_tool/blob/master/pollmanager.cpp"
click node_config "https://github.com/vedderb/vesc_tool/blob/master/configparams.cpp"
click node_types "https://github.com/vedderb/vesc_tool/blob/master/datatypes.h"
click node_firmware "https://github.com/vedderb/vesc_tool/blob/master/mobile/fwhelper.cpp"
click node_espflash "https://github.com/vedderb/vesc_tool/blob/master/esp32/esp_loader.c"
click node_logs "https://github.com/vedderb/vesc_tool/blob/master/mobile/logreader.cpp"
click node_plots "https://github.com/vedderb/vesc_tool/blob/master/widgets/qcustomplot.h"
click node_editor "https://github.com/vedderb/vesc_tool/blob/master/QCodeEditor/src/internal/QCodeEditor.cpp"
click node_display "https://github.com/vedderb/vesc_tool/blob/master/display_tool/dispeditor.cpp"
click node_markdown "https://github.com/vedderb/vesc_tool/blob/master/maddy/parser.h"
click node_map "https://github.com/vedderb/vesc_tool/blob/master/map/mapwidget.cpp"
click node_osm "https://github.com/vedderb/vesc_tool/blob/master/map/osmclient.cpp"
click node_utility "https://github.com/vedderb/vesc_tool/blob/master/utility.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_mainwindow,node_pages,node_wizard,node_utility,node_user toneBlue
class node_interface,node_commands,node_transport,node_controller,node_poller,node_config,node_types toneAmber
class node_firmware,node_espflash,node_logs,node_plots,node_editor,node_display toneMint
class node_markdown,node_map,node_osm toneRose
```

## Components

### Application UI

- [Application entry](https://github.com/vedderb/vesc_tool/blob/master/main.cpp): `main.cpp`
- [Main window](https://github.com/vedderb/vesc_tool/blob/master/mainwindow.cpp): `mainwindow.cpp`
- [Configuration pages](https://github.com/vedderb/vesc_tool/tree/master/pages): `pages`
- [Setup wizards](https://github.com/vedderb/vesc_tool/blob/master/startupwizard.cpp): `startupwizard.cpp`
- [Shared utilities](https://github.com/vedderb/vesc_tool/blob/master/utility.h): `utility.h`

### Device Communication

- [VESC interface](https://github.com/vedderb/vesc_tool/blob/master/vescinterface.cpp): `vescinterface.cpp`
- [Commands and packets](https://github.com/vedderb/vesc_tool/blob/master/commands.cpp): `commands.cpp`
- [Connection transports](https://github.com/vedderb/vesc_tool/blob/master/bleuart.cpp): `bleuart.cpp`
- **VESC controller**
- [Command polling](https://github.com/vedderb/vesc_tool/blob/master/pollmanager.cpp): `pollmanager.cpp`
- [Configuration data](https://github.com/vedderb/vesc_tool/blob/master/configparams.cpp): `configparams.cpp`
- [Shared data types](https://github.com/vedderb/vesc_tool/blob/master/datatypes.h): `datatypes.h`

### Tools and Analysis

- [Firmware handling](https://github.com/vedderb/vesc_tool/blob/master/mobile/fwhelper.cpp): `mobile/fwhelper.cpp`
- [ESP32 flashing](https://github.com/vedderb/vesc_tool/blob/master/esp32/esp_loader.c): `esp32/esp_loader.c`
- [Log files](https://github.com/vedderb/vesc_tool/blob/master/mobile/logreader.cpp): `mobile/logreader.cpp`
- [Plotting](https://github.com/vedderb/vesc_tool/blob/master/widgets/qcustomplot.h): `widgets/qcustomplot.h`
- [Code editor](https://github.com/vedderb/vesc_tool/blob/master/QCodeEditor/src/internal/QCodeEditor.cpp): `QCodeEditor/src/internal/QCodeEditor.cpp`
- [Display editor](https://github.com/vedderb/vesc_tool/blob/master/display_tool/dispeditor.cpp): `display_tool/dispeditor.cpp`

### Content and Mapping

- [Markdown parser](https://github.com/vedderb/vesc_tool/blob/master/maddy/parser.h): `maddy/parser.h`
- [Map display](https://github.com/vedderb/vesc_tool/blob/master/map/mapwidget.cpp): `map/mapwidget.cpp`
- [Map tile client](https://github.com/vedderb/vesc_tool/blob/master/map/osmclient.cpp): `map/osmclient.cpp`

### Other components

- **VESC Tool user**

## Connections

- VESC Tool user → Application entry: starts
- Application entry → Main window: opens
- Main window → Configuration pages: presents
- Configuration pages → VESC interface: configures (evidence: `pages/pagecontrollers.cpp`)
- Configuration pages → VESC interface: sends commands (evidence: `pages/pagecontrollers.cpp`)
- Command polling → Commands and packets: dispatches (evidence: `pollmanager.cpp`)
- Command polling → VESC interface: gets commands (evidence: `pollmanager.cpp`)
- VESC interface → Commands and packets: uses
- VESC interface → Connection transports: uses
- VESC interface → Configuration data: uses
- VESC interface → Shared data types: uses
- Connection transports → VESC controller: communicates
- Application entry → Firmware handling: references (evidence: `main.cpp`)
- Application entry → Log files: references (evidence: `main.cpp`)
- Application entry → ESP32 flashing: supports flashing
- Log files → Plotting: analyzes with
- Configuration pages → Plotting: displays data
- Configuration pages → Code editor: provides scripting
- Configuration pages → Display editor: opens tool
- Map display → Map tile client: requests tiles
- Configuration pages → Map display: presents
- Setup wizards → VESC interface: assists setup
- Configuration pages → Shared utilities: uses (evidence: `pages/pagecontrollers.cpp`)
- Main window → Markdown parser: renders content
