MethodicConfigurator

Vehicle Component Editor Sub-Application Architecture

Overview

The Vehicle Component Editor sub-application defines specifications of all vehicle components and their connections to the flight controller. This critical component ensures that the parameter configuration is tailored to the specific hardware setup of each vehicle, providing a foundation for accurate and safe vehicle configuration.

Requirements

Functional Requirements

  1. Component Definition Management
    • Must allow specification of all vehicle components (FC, ESC, motors, propellers, etc.)
    • Must define connections between components and flight controller pins/ports
    • Must validate component compatibility and connections
    • Must support component property editing with appropriate input validation
    • Must handle both required and optional component properties
  2. Component Template System
    • Must provide pre-defined component templates for common hardware
    • Must allow users to save custom component configurations as templates
    • Must support template loading and modification
    • Must organize templates by component type and manufacturer
    • Must provide template search and filtering capabilities
  3. Connection Validation
    • Must validate physical connections between components
    • Must check for pin conflicts and invalid assignments
    • Must verify power requirements and compatibility
    • Must validate communication protocol compatibility
    • Must detect and warn about potentially dangerous configurations
  4. Schema Validation
    • Must enforce JSON schema compliance for all component data
    • Must provide meaningful error messages for validation failures
    • Must support schema versioning and migration
    • Must validate data types and value ranges
    • Must ensure required fields are populated
  5. User Interface Complexity Management
    • Must support “simple” mode for beginners with reduced complexity
    • Must support “normal” mode for advanced users with full functionality
    • Must dynamically show/hide components based on relevance
    • Must provide appropriate defaults for common configurations
    • Must guide users through the configuration process
  6. Data Persistence
    • Must save component configurations to vehicle_components.json
    • Must load existing configurations reliably
    • Must backup configurations before modifications
    • Must support configuration import/export
    • Must maintain configuration history for rollback

Non-Functional Requirements

  1. Usability
    • Interface must be intuitive for users with varying technical expertise
    • Component selection should be guided with clear descriptions
    • Validation errors must be clearly communicated
    • Configuration changes should provide immediate feedback
  2. Data Integrity
    • All component data must be validated before saving
    • Configuration files must maintain consistency
    • Schema compliance must be enforced at all times
    • Backup and recovery mechanisms must be reliable
  3. Performance
    • Component editor should load quickly even with many templates
    • Real-time validation should not cause UI lag
    • Large component libraries should be handled efficiently
    • Memory usage should be optimized for embedded systems
  4. Extensibility
    • New component types should be easily addable
    • Template system should support third-party extensions
    • Schema should be versionable and upgradeable
    • Component properties should be dynamically configurable

Architecture

Components

Main Component Editor

Component Editor Base Classes

Component Template Manager

Vehicle Components Data Model

Base Vehicle Components Model

Component Import Handler

Component Template Data Model

Component Validation Engine

Battery Cell Voltage Calculator

Data Flow

  1. Initialization
    • Load existing vehicle_components.json if present
    • Initialize component templates library
    • Validate loaded configuration against schema
    • Set up UI based on complexity mode
  2. Component Configuration
    • User selects component types and properties
    • Real-time validation provides immediate feedback
    • Template system offers pre-configured options
    • Connection validation ensures proper wiring
  3. Template Operations
    • Users can load templates for quick configuration
    • Custom configurations can be saved as new templates
    • Template library provides organized access to options
    • Template compatibility checking prevents issues
  4. Validation and Saving
    • Comprehensive validation before saving
    • Schema compliance verification
    • Cross-component compatibility checking
    • Configuration backup and persistence

Integration Points

Component Types Supported

Required Components

Optional Components

Validation System

Schema Validation

Cross-Component Validation

Safety Validation

Error Handling Strategy

Testing Strategy

File Structure

frontend_tkinter_component_editor.py           # Main component editor GUI
frontend_tkinter_component_editor_base.py      # Base classes for editor
frontend_tkinter_component_template_manager.py # Template management GUI
data_model_vehicle_components.py               # Core component data model
data_model_vehicle_components_base.py          # Base component classes
data_model_vehicle_components_import.py        # Import handling
data_model_vehicle_components_templates.py     # Template data model
data_model_vehicle_components_validation.py    # Validation engine
battery_cell_voltages.py                       # Battery calculations

Dependencies

Component Template System

Template Organization

Templates are organized hierarchically:

Template Features

Template Validation

User Experience Features

Guided Configuration

Complexity Management

Error Prevention