-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update static UID fka functionality. #326
Changes from 10 commits
ea5285c
5a15862
c650169
79b95de
82d4b67
1e2a3a0
0f8b014
b54a97e
c4f9c1d
9cc74b4
e5383fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# vspec2id - vspec static UID generator and validator | ||
|
||
The vspecID.py script is used to generate and validate static UIDs for all nodes in the tree. | ||
The vspec2id.py script is used to generate and validate static UIDs for all nodes in the tree. | ||
They will be used as unique identifiers to transmit data between nodes. The static UIDs are | ||
implemented to replace long strings like `Vehicle.Body.Lights.DirectionIndicator.Right.IsSignaling` | ||
with a 4-byte identifier. | ||
|
@@ -9,8 +9,9 @@ with a 4-byte identifier. | |
|
||
```bash | ||
usage: vspec2id.py [-h] [-I dir] [-e EXTENDED_ATTRIBUTES] [-s] [--abort-on-unknown-attribute] [--abort-on-name-style] [--format format] [--uuid] [--no-expand] [-o overlays] [-u unit_file] | ||
[-vt vspec_types_file] [-ot <types_output_file>] [--json-all-extended-attributes] [--json-pretty] [--yaml-all-extended-attributes] [-v version] [--all-idl-features] | ||
[--gqlfield GQLFIELD GQLFIELD] [--validate-static-uid VALIDATE_STATIC_UID] [--only-validate-no-export] | ||
[-q quantity_file] [-vt vspec_types_file] [-ot <types_output_file>] [--json-all-extended-attributes] [--json-pretty] [--yaml-all-extended-attributes] [-v version] [--all-idl-features] | ||
[--gqlfield GQLFIELD GQLFIELD] [--jsonschema-all-extended-attributes] [--jsonschema-disallow-additional-properties] [--jsonschema-require-all-properties] [--jsonschema-pretty] | ||
[--validate-static-uid VALIDATE_STATIC_UID] [--only-validate-no-export] [--strict-mode] | ||
<vspec_file> <output_file> | ||
|
||
Convert vspec to other formats. | ||
|
@@ -27,6 +28,7 @@ IDGEN arguments: | |
Path to validation file. | ||
--only-validate-no-export | ||
For pytests and pipelines you can skip the export of the <output_file> | ||
--strict-mode Strict mode means that the generation of static UIDs is case-sensitive. | ||
``` | ||
|
||
## Example | ||
|
@@ -43,6 +45,9 @@ cd path/to/your/vss-tools | |
Great, you generated your first overlay that will also be used as your validation file as soon as you update your | ||
vehicle signal specification file. | ||
|
||
If needed you can make the static UID generation case-sensitive using the command line argument `--strict-mode`. It | ||
will default to false. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does case sensitive mean here? That two signals |
||
|
||
### Generate e.g. yaml file with static UIDs | ||
|
||
Now if you just want to generate a new e.g. yaml file including your static UIDs, please use the overlay function of | ||
|
@@ -78,11 +83,10 @@ A.B.NewName: | |
type: actuator | ||
allowed: ["YES", "NO"] | ||
description: A.B.NewName's old name is 'OldName'. And its even older name is 'OlderName'. | ||
fka: ['A.B.OldName', 'A.B.OlderName'] | ||
fka: ['A.B.OlderName', 'A.B.OldName'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the order have any significance? |
||
``` | ||
|
||
As stated if you want to rename the node `A.B.NewName` to `A.NewName` you can also write the `fka` attribute | ||
stating its legacy path. | ||
As stated if you want to rename the node `A.B.NewName` to `A.NewName` you can also write the `fka` attribute stating its legacy path. For hashing function in previous case `A.B.OlderName` will be used. | ||
|
||
To summarize these are the `BREAKING CHANGES` that affect the hash and `NON-BREAKING CHANGES` that throw | ||
warnings only: | ||
|
@@ -93,14 +97,14 @@ warnings only: | |
| Data type | | Deprecation | | ||
| Type (i.e. node type) | | Deleted Attribute | | ||
| Unit | | Change description | | ||
| Enum values (allowed) | | | | ||
| Enum values (allowed) | | Qualified name (fka) | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe a stupid question but what does "fka" means |
||
| Minimum | | | | ||
| Maximum | | | | ||
|
||
Now you should know about all possible changes. To run the validation step, please do: | ||
|
||
```bash | ||
./vspecID.py ../vehicle_signal_specification/spec/VehicleSignalSpecification.vspec ../output_id_v2.vspec --validate-static-uid ../output_id_v1.vspec | ||
./vspec2id.py ../vehicle_signal_specification/spec/VehicleSignalSpecification.vspec ../output_id_v2.vspec --validate-static-uid ../output_id_v1.vspec | ||
``` | ||
|
||
Depending on what you changed in the vehicle signal specification the corresponding errors will be triggered. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could potentially remove some fields that have no impact (and will not even be allowed after my vss-tools restructuring PR has been merged) like
[--yaml-all-extended-attributes]
and[--gqlfield GQLFIELD GQLFIELD]