How It Works

High-level architecture and data flow derived from the current codebase index.

High-level architecture

main.py
  -> DBCUtility.py (MainWindow shell)
     -> HomeScreenWidget
     -> ConverterWindow (View tab)
     -> DBCEditorWidget (Edit tab)
     -> DBCCompareWidget (Compare tab)

Core modules

  • src/DBCUtility.py: main window, tab shell, view workflow, recent-file integration
  • src/dbc_editor.py: DBC load/save/edit logic and change tracking
  • src/dbc_editor_ui.py: edit widgets and dialogs
  • src/dbc_comparator.py: text and structured comparison engine
  • src/dbc_comparator_ui.py: side-by-side, unified, and structured compare UI
  • src/multiplex_support.py: multiplexed-signal classification, filtering, and validation
  • src/message_layout_visualizer.py: bit-level message layout rendering
  • src/home_screen.py: home screen and recent-files manager
  • src/about_dialog.py: version/about dialog
  • src/search_module.py: shared search widget
  • src/resource_utils.py: dev/PyInstaller resource path handling

Main flows

View flow

  • Load DBC via cantools
  • Extract messages, signals, and multiplexer metadata
  • Populate tree and detail panels

Edit flow

  • Load a DBC into an internal editable structure
  • Update messages or signals through dialogs
  • Track original vs modified state

Save-review flow

  • Editor requests save
  • Main window switches to Compare
  • User reviews the diff
  • Confirmed save writes the generated DBC text to disk

Compare flow

  • Read primary and secondary files
  • Build text diffs and semantic diffs
  • Render in the active compare mode
  • Re-diff live when editable views change

Why the current design matters

  • UI and business logic stay separated enough to keep core operations testable
  • Multiplexer behavior is handled consistently across view, edit, compare, and visualization
  • Resource loading works for both source runs and PyInstaller builds
  • Dirty-state tracking and save-review reduce accidental writes