Sub Module misc

fgui.misc

fgui.misc.can

fgui.misc.can.can_constants

Defines the CAN constants for the project.

fgui.misc.can.can_helpers

Miscellaneous helpers that are related to to CAN (speaking with CAN adapters, reading DBC files etc.)

fgui.misc.can.can_helpers.adapter_initialize(can_adapter: Optional[str], baud_rate: Optional[int]) <module 'can.interface' from 'C:\\Miniconda3\\envs\\2023-02-fennec-fox\\lib\\site-packages\\can\\interface.py'>

wrapper for CAN adapter initialization. Currently only PCAN USB is supported

fgui.misc.can.can_helpers.adapter_uninitialize(adapter: can.interface.Bus) None

wrapper for CAN adapter uninitialization.

fgui.misc.can.can_helpers.dbc_file_to_database(dbc_file) cantools.database.can.database.Database

returns the database representation of a dbc file.

fgui.misc.can.can_helpers.detect_can_adapters() list[can.interface.Bus]

Detect possible CAN adapters. Currently only PCAN USB is supported

fgui.misc.can.can_helpers.get_dbc_dialog() Tuple[Optional[cantools.database.can.database.Database], Tuple[pathlib.Path, None]]

Returns a tuple dbc database and the file it has been read from.

fgui.misc.can.can_helpers.try_to_select_can_adapter(can_adapter: str)

Try to select a specific CAN adapter

fgui.misc.gui_helpers

Miscellaneous helper functions for the GUI

fgui.misc.gui_helpers.cb_open_documentation(_, **args)

Shows the foxBMS documentation from local source if it exists, from web if it does not

fgui.misc.gui_helpers.cb_show_info(_, **args)

Shows the program information

fgui.misc.gui_helpers.get_icon()

Returns the foxBMS logo as icon

fgui.misc.gui_helpers.open_documentation()

Shows the foxBMS documentation from local source if it exists, from web if it does not

fgui.misc.gui_helpers.show_info()

Shows the program information

fgui.misc.info_dialog

helper for the info dialog

class fgui.misc.info_dialog.FoxbmsInfoDialog(*args, **kw)

Dialog box for ‘Info’ message

static get_file(_file)

Returns the file, if it exists.

get_license_text()

Get the license text, if this is not possible link to the online documentation of the license

get_readme_text()

returns the text of the README or a default one.

init_foxbms_dialog()

Setup the text of the dialog box

fgui.misc.misc

Miscellaneous configurations etc. for all parts of the GUI

class fgui.misc.misc.BatterySystemConfiguration(config_file: pathlib.Path)

Battery System configuration as read from the C sources.

fgui.misc.program_arguments

Implements the command line argument the module must understand.

fgui.misc.program_arguments.chose_baud_rate()

Helper to select the BAUD rate, if a CAN adapter was specified but no BAUD rate.

fgui.misc.program_arguments.chose_can_adapter()

Helper to select a CAN adapter

fgui.misc.program_arguments.chose_logging_dir(logging_dir)

Helper to select the logging directory for the CAN messages.

fgui.misc.program_arguments.validate_argument_combination(can_adapter, baud_rate, logging_dir)

Validates that the combination of provided arguments on the command line is meaningful.