Generates a language-specific data model out of VSS vspec files
Project description
Velocitas Vehicle Model Generator
About
This generator creates a vehicle model from the given vspec specification for the target programming language.
Supported languages
- Python 3
- C++
Supported VSS versions
- 3.0
- 3.1
- 3.1.1
- 4.0
Usage
Invoke the src/velocitas/model_generator/cli.py
script with the path to the vspec or json file you wish to generate code for, additionally passing include pathes to directories which contain referenced vspec files. You need a units.yaml
in the same directory. If you want to use the default one see here. For stability use release branch with tags. For example branch release/4.0
.
python3 src/velocitas/model_generator/cli.py -I <path_to_dir_with_included_vspec_files> <path_to_your_vspec_file>
or
python3 src/velocitas/model_generator/cli.py <path_to_your_json_file>
Example
git clone -b v3.1 https://github.com/COVESA/vehicle_signal_specification.git
python3 src/velocitas/model_generator/cli.py -I ./vehicle_signal_specification/spec ./vehicle_signal_specification/spec/VehicleSignalSpecification.vspec
Or use VSCode Launch: Press F5
, select Python
or cpp
and pass in the include directory and input file path.
Arguments
Argument | Description |
---|---|
-h , --help |
show this help message and exit |
-I dir , --include-dir dir |
Add include directory to search for included vspec files. |
-T TARGET_FOLDER , --target-folder TARGET_FOLDER |
The folder name (with relative path) where the code will be generated into. |
-N PACKAGE_NAME , --package-name PACKAGE_NAME |
Name of the root module/package (Python) or root namespace (C++). |
-s , --strict |
Use strict checking: Terminate when anything not covered or not recommended by the core VSS specs is found. |
-l {python} , --language {python} |
The target language of the generated code. |
-o OVERLAY_FILE , --overlays OVERLAY_FILE |
Add overlays that will be layered on top of the VSS file in the order they appear. |
-u UNITS , --units UNITS |
The file location of units file. If left empty it tries downloading default units file from https://github.com/COVESA/vehicle_signal_specification/blob/v4.0/spec/units.yaml. |
-e EXTENDED_ATTRIBUTES ,--extended-attributes EXTENDED_ATTRIBUTES |
Whitelisted extended attributes as comma separated list. Note, that extended attributes aren't considered by the generator. This paramter is only for suppressing warnings/errors." |
Known issues
VSS v3.0 has a typo in its specification. This clashes with vss tools 4.0 which is needed to support VSS v4.0 because it allows only lower case versions for types of signals. e.g the problem is with 'actuator' instead of 'Actuator' in https://github.com/COVESA/vehicle_signal_specification/blob/525e2bd00ddf061851bdc75e849178e5d3ad5833/spec/Powertrain/Battery.vspec#L229. Json files work just fine. See https://github.com/COVESA/vehicle_signal_specification/releases for getting the json files.
Contribution
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file velocitas_model_generator-0.7.1.tar.gz
.
File metadata
- Download URL: velocitas_model_generator-0.7.1.tar.gz
- Upload date:
- Size: 43.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8af1a89ba21af2e49b3fb72b70679cf76408f67e1581bcd4862cb21d386dc23 |
|
MD5 | 9aa4d4b3b43ebea3e3bb268076364b24 |
|
BLAKE2b-256 | 7c0fb2ded67e480c7e36c019ff498c899dcacaba36b75d5278136fd856f8244c |
File details
Details for the file velocitas_model_generator-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: velocitas_model_generator-0.7.1-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2f451db729438a36fdbc6c4a4d2af19d43487763f99af69709182025d339538 |
|
MD5 | 1bb3cca0cadad79366f5238cd79c136d |
|
BLAKE2b-256 | 9660621a65ee2d947e8c26110470ba189a6a3456c5221f347a720766a278a9a5 |