canmatrix_webapp
A Streamlit webapp for the canmatrix Python package.
Features
- Upload CAN matrix files in various formats (DBC, ARXML, KCD, FIBEX, XLS, XLSX, XML)
- Explore loaded matrices, view ECUs, frames, and signals
- Export matrices to supported formats
Usage
Launch the Web Application
You can start the web application using the provided launcher:
python -m canmatrix_webapp.run_web_app
Optional Arguments
--server-address ADDRESS
Address to bind the Streamlit server (default: system FQDN)--server-port PORT
Port to run the Streamlit server on (default: 8502)
Example:
python -m canmatrix_webapp.run_web_app --server-address 127.0.0.1 --server-port 8502
source manual
WebApp()
Streamlit-based web application for interacting with CAN matrix files using the canmatrix package.
Features
- Upload CAN matrix files in various formats (DBC, ARXML, KCD, FIBEX, XLS, XLSX, XML).
- Explore loaded matrices, view ECUs, frames, and signals.
- Export matrices to supported formats.
Initialize the WebApp instance.
display_frames_ui(matrix)
UI for selecting and displaying frame details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix
|
Any
|
The CAN matrix object containing frames. |
required |
display_matrix_info(matrix)
Display basic information about the selected matrix.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix
|
Any
|
The CAN matrix object to display information for. |
required |
explore_matrices_ui()
UI for exploring loaded matrices and exporting them.
export_matrix_to_bytes(matrix, export_format)
staticmethod
Export a CAN matrix to the specified format and return as bytes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix
|
Any
|
The CAN matrix object to export. |
required |
export_format
|
str
|
The export format (e.g., 'dbc', 'arxml', etc.). |
required |
Returns:
Name | Type | Description |
---|---|---|
bytes |
bytes
|
The exported file content. |
export_matrix_ui(matrix)
UI for exporting the selected matrix to a chosen format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
matrix
|
Any
|
The CAN matrix object to export. |
required |
load_canmatrix_file(file_bytes, file_format)
staticmethod
Load a CAN matrix file using canmatrix.formats.load and normalize the result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_bytes
|
bytes
|
The file content as bytes. |
required |
file_format
|
str
|
The format of the CAN matrix file. |
required |
Returns:
Type | Description |
---|---|
Tuple[Optional[Dict[str, Any]], Any]
|
Tuple[Optional[Dict[str, Any]], Any]: Tuple of (matrices dict or None, loaded raw object). |
load_matrix_ui()
UI for uploading and loading a CAN matrix file.
run()
Main entry point for the Streamlit web application.