How It Works
High-level architecture and data flow. This page is derived from docs/CODEBASE_INDEX.md.
Architecture
main.py (entry point)
\-- src/DBCUtility.py (MainWindow)
|-- ConverterWindow (View DBC tab)
| \-- DBCProcessor (load + extract for viewing)
|-- DBCEditorWidget (Edit DBC tab UI)
| \-- src/dbc_editor.py (core edit + save logic)
\-- UnifiedSearchWidget (search + filters)
Key modules
- main.py: boots the Qt app and opens the main window.
- src/DBCUtility.py: main window, View tab UI, and the DBC viewer data extraction.
- src/dbc_editor.py: DBC editing logic, change tracking, save + backup.
- src/dbc_editor_ui.py: dialogs and widgets for editing messages/signals.
- src/search_module.py: reusable search widget used across tabs.
- src/resource_utils.py: resource path handling for dev vs PyInstaller.
Core data flow
View tab
User selects DBC
-> cantools loads file
-> messages + signals extracted
-> tree widget populated
-> details panel shows selected item
Edit tab
User loads DBC
-> DBCEditor loads file into an internal structure
-> UI lists messages/signals
User edits
-> dialogs validate input
-> DBCEditor updates working copy
Save
-> backup created
-> cantools database rebuilt
-> DBC written to disk
-> backup cleaned up
Why this design
- UI vs logic separation: keeps file processing testable and UI simpler.
- Working copy + original copy: enables reliable "has changes" detection.
- Resource abstraction: ensures icons/assets work in PyInstaller builds.