Skip to content

Commit 22c1a6a

Browse files
sschleemilchSebastianSchildt
authored andcommitted
Adapted docs to be in sync with vss-tools rework
Signed-off-by: Sebastian Schleemilch <[email protected]>
1 parent 3211fb8 commit 22c1a6a

File tree

11 files changed

+63
-82
lines changed

11 files changed

+63
-82
lines changed

docs-gen/content/rule_set/basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if the meta-data of the moved node hasn't changed.
9696
* Nodes which are deprecated will be removed from the specification, either in the second minor update or, if earlier, the next major update.
9797

9898
### Example
99-
```YAML
99+
```yaml
100100
Vehicle.Navigation.CurrentLocation:
101101
type: branch
102102
description: The current latitude and longitude of the vehicle.

docs-gen/content/rule_set/branches.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ signals.
99

1010
A branch entry example is given below:
1111

12-
```YAML
12+
```yaml
1313
Trunk:
1414
type: branch
1515
description: All signals related to the rear trunk

docs-gen/content/rule_set/data_entry/allowed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It is expected, that any value not mentioned in the array is considered an error
1010
The datatype of the array elements is the `datatype` defined for the data entry itself.
1111
For `attributes` it is possible to optionally set a default value.
1212

13-
```YAML
13+
```yaml
1414
SteeringWheel.Position:
1515
datatype: string
1616
type: attribute
@@ -46,7 +46,7 @@ The actual value of the signal is expected to contain a subset of the values spe
4646

4747
Example:
4848

49-
```YAML
49+
```yaml
5050
DogBreeds:
5151
datatype: string[]
5252
type: attribute

docs-gen/content/rule_set/data_entry/attributes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ or else it should be defined as a sensor instead.
1818

1919
Below is an example of a complete attribute describing engine power
2020

21-
```YAML
21+
```yaml
2222
MaxPower:
2323
datatype: uint16
2424
type: attribute
@@ -31,19 +31,19 @@ It is possible to give default values also for arrays. In this case square brack
3131
3232
Example 1: Empty Array
3333
34-
```YAML
34+
```yaml
3535
default: []
3636
```
3737
3838
Example 2: Array with 3 elements, first element has value 1, second element value 2, third element value 0
3939
40-
```YAML
40+
```yaml
4141
default: [1, 2, 0]
4242
```
4343
4444
Full example, array with two elements, first with value2, second with value 3:
4545
46-
```YAML
46+
```yaml
4747
SeatPosCount:
4848
datatype: uint8[]
4949
type: attribute

docs-gen/content/rule_set/data_entry/data_types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ definition*, wherein it's specified. By default the size of the array is undefin
3737
By the optional keyword `arraysize` the size of the array can be specified.
3838
The following syntax shall be used to declare an array:
3939

40-
```YAML
40+
```yaml
4141
# Array of datatype uint32, by default size of the array is undefined
4242
datatype: uint32[]
4343
# Optional: specified number of elements in the array
@@ -62,7 +62,7 @@ corresponding data stream.
6262
A camera can be a good example of it. The Data Entry for the camera
6363
and the corresponding video stream could look like:
6464

65-
```YAML
65+
```yaml
6666
Camera:
6767
type: branch
6868
description: Information about the camera and how to connect to the video stream

docs-gen/content/rule_set/data_entry/data_types_struct.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ This is not a problem as it always from context is clear whether a name refers t
102102

103103
This could be a hypothetical content of a VSS datatype file
104104

105-
```
105+
```yaml
106106
Types:
107107
type: branch
108108

@@ -123,15 +123,15 @@ Types.DeliveryInfo.Receiver:
123123
124124
This struct definition could then be referenced from the VSS signal tree
125125
126-
```
126+
```yaml
127127
Delivery:
128128
datatype: Types.DeliveryInfo
129129
type: sensor
130130
```
131131
132132
The datatype file may contain sub-branches and `#include`-statements just like regular VSS files
133133

134-
```
134+
```yaml
135135
Types:
136136
type: branch
137137
@@ -168,7 +168,7 @@ They may support read of parts of signal, e.g. `DeliveryList.Receiver`
168168
It is allowed to use a struct type in an array
169169

170170

171-
```
171+
```yaml
172172
DeliveryList:
173173
datatype: Types.DeliveryInfo[]
174174
type: sensor
@@ -178,7 +178,7 @@ DeliveryList:
178178
By default the array has an arbitrary number of element and may be empty.
179179
If a fixed size array is wanted the keyword `arraysize` can be used to specify size:
180180

181-
```
181+
```yaml
182182
DeliveryList:
183183
datatype: Types.DeliveryInfo[]
184184
arraysize: 5
@@ -201,7 +201,7 @@ For array datatypes (like above) VSS implementations may support several mechani
201201

202202
It is allowed to refer to a structure datatype from within a structure
203203

204-
```
204+
```yaml
205205
OpenHours:
206206
type: struct
207207
description: A struct datatype containing information on open hours
@@ -245,17 +245,16 @@ The order of declaration/definition shall not matter.
245245
As signals and datatypes are defined in different trees this is a topic only for struct definitions referring to other struct definitions.
246246
A hypothetical example is shown below. An item in the struct `DeliveryInfo` can refer to the struct `OpenHours` even if that struct
247247
is defined further down in the same file.
248-
If using `-vt < file>` multiple times all files except the first will be treated similar to overlays.
248+
If using `--types <file>` multiple times all files except the first will be treated similar to overlays.
249249
This means that is allowed to define `A.B.C` in multiple files, but then subsequent (re-)definitions will overwrite
250-
what has been defined previously.
250+
what has been defined previously. Note that if type files want to use structs from other files that the dependent
251+
files are specified first. Therefore the order of given type files matters.
251252

252-
```
253+
```yaml
253254
DeliveryInfo:
254255
type: struct
255256
description: A struct datatype containing info for each delivery
256257
257-
...
258-
259258
DeliveryInfo.Open:
260259
datatype: OpenHours
261260
type: property
@@ -264,9 +263,6 @@ DeliveryInfo.Open:
264263
OpenHours:
265264
type: struct
266265
description: A struct datatype containing information on open hours
267-
268-
...
269-
270266
```
271267

272268
## Inline Struct

docs-gen/content/rule_set/data_entry/data_units.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ weight: 20
99
It is in VSS possible for signals to specify a unit of measurement from a list of predefined data units.
1010
For most signals in the VSS standard catalog, a data unit has been selected. A typical example is `Vehicle.Speed`, as shown below.
1111

12-
```
12+
```yaml
1313
Vehicle.Speed:
1414
datatype: float
1515
type: sensor
@@ -26,6 +26,7 @@ as `km/h` (with float as datatype). A user interface or API may show or request
2626
and a transport protocol may send speed in another unit, possibly also involving scaling and offset.
2727
But in protocols not explicitly specifying data units (like [VISS](https://raw.githack.com/w3c/automotive/gh-pages/spec/VISSv2_Core.html))
2828
it is expected that `Vehicle.Speed` is sent and received as `km/h` (without scaling or offset).
29+
However since units define possible `allowed-datatypes` the given `datatype` has to match the allowed ones.
2930

3031
VSS does not offer any syntax for defining alternative units for a specific signal.
3132
The VSS project has specified for all units a corresponding quantity e.g. `velocity` for `km/h`.
@@ -36,7 +37,7 @@ the quantity `velocity`, it is not specified how they relate to each other.
3637
In some cases it is natural to omit the data unit. This concerns typically signals where datatype `string` is used,
3738
but also signals where the value just represents a number (dimensionless quantities), like in the example below:
3839

39-
```
40+
```yaml
4041
Vehicle.Cabin.DoorCount:
4142
datatype: uint8
4243
type: attribute
@@ -51,7 +52,7 @@ In some cases, the definition on how to calculate the signal value is obvious, l
5152
below. It is likely that all VSS users will calculate fuel level in the same way, i.e. the meaning of a fuel level of 50%
5253
is well agreed, the liters of fuel in the tank is exactly 50% of nominal capacity.
5354

54-
```
55+
```yaml
5556
Vehicle.Powertrain.FuelSystem.Level:
5657
datatype: uint8
5758
type: sensor
@@ -69,7 +70,7 @@ Some vehicles might monitor actual wear, others might estimate it based on vehic
6970
This is in VSS called a logical range, a VSS user knows what range to use but are free to define the formula for calculating the value.
7071
Values from different vehicles (of different make/model) can not always be compared, as the formula used for calculation may differ.
7172

72-
```
73+
```yaml
7374
Vehicle.Powertrain.Transmission.ClutchWear:
7475
datatype: uint8
7576
type: sensor
@@ -81,8 +82,8 @@ Vehicle.Powertrain.Transmission.ClutchWear:
8182
## Supported Data Units in VSS Standard Catalog
8283

8384
The VSS syntax does not in itself specify what units can be used, the unit attribute as declared for signals in *.vspec files is optional and can contain an arbitrary string value.
84-
[VSS-Tools](https://github.com/COVESA/vss-tools) however require that all units used are defined,
85-
and at is also a requirement for signals in the VSS standard catalog.
85+
[VSS-Tools](https://github.com/COVESA/vss-tools) however require that all units used are defined
86+
and therefore is also a requirement for signals in the VSS standard catalog.
8687
Units are defined by including them in a unit file with syntax as described below.
8788
One or more unit files can be specified by the `-u` parameter and, if not given, the tools search for a file `units.yaml`
8889
in the same directory as the root *.vspec file.
@@ -129,7 +130,7 @@ using different units but defined with the same quantity.
129130

130131
Example:
131132

132-
```
133+
```yaml
133134
m:
134135
definition: Length measured in meters
135136
unit: meter
@@ -158,8 +159,7 @@ The `deprecation` keyword can be used to indicate that a specific unit may be re
158159
Tooling shall preferably give a warning if a signal uses a deprecated unit or the unit used belongs to a deprecated quantity.
159160
The reason should preferably list when and why the unit is deprecated, a hypothetical example is given below:
160161

161-
```
162-
162+
```yaml
163163
inch:
164164
definition: Distance measured in inches
165165
unit: inch
@@ -171,29 +171,14 @@ The reason should preferably list when and why the unit is deprecated, a hypothe
171171
quantity: distance
172172
```
173173

174-
175-
The unit syntax has recently been changed. To simplify transition to the new syntax it is recommended that
176-
tooling also supports unit files using the old syntax described below.
177-
178-
```
179-
units:
180-
[
181-
<vss-unit-identifier>: # Typically unit abbreviation, like km/h or mm, but
182-
label: <string> # Replaced with "unit"
183-
description: <string> # Replaced with "definition"
184-
quantity: <string>
185-
]*
186-
```
187-
188174
## Quantity file syntax
189175

190-
Defining quantities is recommended, but currently optional for backward compatibility reasons.
176+
Defining of quantities is required.
191177
If tooling supports quantity files it can verify that all units provided in unit files
192178
use defined quantities.
193179
For the VSS standard catalog it is required that matching quantities have been defined for all units.
194180

195181
```
196-
197182
[
198183
<vss-quantity-identifier>: # Identifier preferably taken from a standard, like ISO 80000
199184
definition: <string>
@@ -226,9 +211,7 @@ As this unit is not commonly used and not described in any standards, it might b
226211
That is however only informative, as it a custom unit a downstream implementation supporting unit conversion may not support automatic conversion
227212
of furlong to other units.
228213
229-
230-
231-
```
214+
```yaml
232215
units:
233216
furlong:
234217
definition: Length measured in furlong, 1 furlong equals 201.1680 m

docs-gen/content/rule_set/data_entry/sensor_actuator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Actuators are used to control the desired value of a property. Some properties i
1111
A data entry for a sensor or actuator defines its members. A data
1212
entry example is given below:
1313

14-
```YAML
14+
```yaml
1515
Speed:
1616
type: sensor
1717
description: The vehicle speed.

docs-gen/content/rule_set/includes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 6
66

77
An include directive in a vspec file will read the file it refers to and the
88
contents of that file will be inserted into the current buffer in place of the
9-
include directive. The included file will, in its turn, be scanned for
9+
include directive. The included file will, in its turn, be scanned for
1010
include directives to be replaced, effectively forming a tree of included
1111
files.
1212

@@ -21,6 +21,8 @@ The include directive has the following format:
2121
#include <filename> [prefix]
2222

2323
The ```<filename>``` part specifies the path, relative to the file with the ```#include``` directive, to the vspec file to replace the directive with.
24+
Additionally, include paths to search for the file can be added when using `vss-tools` using the `-I/--include-dirs`.
25+
The order of include paths to be searched is first the relative path of the vspec specifying the include and then given include paths in the given order.
2426

2527
The optional ```[prefix]``` specifies a branch name to be
2628
prepended to all signal entries in the included file. This allows a vspec file

docs-gen/content/rule_set/instances.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ example for details.
5555

5656
The example from above in the specification:
5757

58-
```YAML
58+
```yaml
5959
# Cabin.vspec
6060
Door:
6161
type: branch
@@ -73,7 +73,7 @@ Door.SomeSignal:
7373
```
7474
7575
76-
```yml
76+
```yaml
7777
# SingleDoor.vspec
7878

7979
#
@@ -103,7 +103,7 @@ instance definitions, then the last found definition will be used.
103103
As an example, if three row of doors are needed, then the default VSS instance definition
104104
can be overridden by redefining the Door branch as shown in the example below.
105105

106-
```YAML
106+
```yaml
107107
#Redefinition changing number of rows from 2 to 3
108108
#The redefinition must appear "after" the original definition
109109
Vehicle.Cabin.Door:
@@ -126,7 +126,7 @@ and that offers heating for both windshields. But that is not the case for all v
126126
it is not even certain that all vehicles have two windshields. This sections gives recommendations on how
127127
to use VSS for a vehicle if the VSS specification does not offer an exact match of the capabilities of the vehicle.
128128

129-
```YAML
129+
```yaml
130130
Windshield:
131131
type: branch
132132
instances: ["Front", "Rear"]
@@ -159,7 +159,7 @@ of the following methods are recommended:
159159
- Redefine the branch. If a vehicle for example does not have a rear windshield
160160
then append a redefinition at the end of the VSS:
161161

162-
```YAML
162+
```yaml
163163
Vehicle.Body.Windshield:
164164
type: branch
165165
instances: ["Front"]

0 commit comments

Comments
 (0)