3.1.9. waf_tools.bms_config_model
Data model and parser for the foxBMS BMS configuration (bms.json).
This module defines the typed dataclass hierarchy that represents the complete
foxBMS battery management system configuration. Validation is performed by
pydantic: field types and Literal choices are checked when the model is
validated.
The dataclass hierarchy mirrors the JSON structure:
System(root)Application- Sensors, algorithms, balancing, redundancy.RTOS- Real-time OS name and addons.BMSSlave- Analog front-end and temperature sensor.Debug- Debug interface selection.MCU- MCU selection.
The validators raise ValueError. Pydantic collects them into a single
ValidationError, which parse_config_to_system() converts into one
InvalidConfigurationError listing all invalid entries.
3.1.9.1. Usage
Parse a configuration dictionary (typically read from bms.json):
from bms_config_model import parse_config_to_system
system = parse_config_to_system(config_dict)
The returned System instance is then consumed by
waf_tools.bms_config_generate to set environment variables and generate
configuration headers.
3.1.9.2. Dependencies
Consumed by
waf_tools.bms_config_validateandwaf_tools.bms_config_generate.
Functions
|
Parse a JSON configuration into a validated system configuration. |
Classes
|
Aerosol sensor hardware configuration. |
|
Algorithm configuration container. |
|
Analog front-end IC configuration. |
|
Application-level configuration, including sensors and algorithms. |
|
BMS-Slave board configuration. |
|
Current sensor hardware configuration. |
|
Debug interface configuration. |
|
Insulation monitoring device configuration. |
|
MCU configuration. |
|
Real-Time Operating System configuration. |
|
State-of-X estimation method selection for battery management. |
|
Root configuration object representing the complete BMS system. |
|
Temperature sensor configuration for the BMS-Slave board. |
Exceptions
Raised when the BMS configuration contains invalid or unsupported values. |