Skip to content

Commit

Permalink
Documentation of new keyword instantiate (COVESA#461)
Browse files Browse the repository at this point in the history
As discussed in COVESA#448 and implemented in
COVESA/vss-tools#168
it gives more flexibility in defining instances.

Signed-off-by: Daniel Wilms <Daniel.DW.Wilms@bmw.de>
  • Loading branch information
danielwilms authored and jdacoello committed Feb 15, 2023
1 parent 93119b0 commit dc35859
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs-gen/content/rule_set/instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interpreted by the tools.

## Definition

### How can I instances for my `branch`?

1. An instance can be defined in any branch.
2. The instantiation is done for every node in the following path.
3. Instances are defined with the key-word `instances`, followed by its
Expand All @@ -35,6 +37,19 @@ interpreted by the tools.
four position instances will be created for each of the 'Left' and 'Right' instances,
resulting into a total number of 8 instances.

### How can I exclude child-nodes from instantiation?

Often it makes sense to instantiate all child-nodes of a branch.
But there are cases, when nodes are linked more the general concept of
a branch, but not to the single instance. This could be the `DoorCount`,
which would rather be `Door.Count`, `WheelDiamater`, which is rather linked
to an axle rather than the wheel itself or `Brake.FluidLevel` which is not
measured for a single break, but rather a system indication.

To exclude a child-node from the instantiation of the *direct* parent node, set the
keyword `instantiate` to `false` (`true` by default). Please check the following
example for details.

## Example

The example from above in the specification:
Expand All @@ -49,7 +64,16 @@ Door:
description: All doors, including windows and switches
#include SingleDoor.vspec Door

Door.Count:
datatype: uint8
type: attribute
default: 4
instantiate: false
description: Number of doors in vehicle.
```
```yml
# SingleDoor.vspec

#
Expand All @@ -65,6 +89,7 @@ Results in the following dot-notated output:
```
Vehicle.Cabin.Door
Vehicle.Cabin.Door.Count
Vehicle.Cabin.Door.Row1
Vehicle.Cabin.Door.Row1.Left
Vehicle.Cabin.Door.Row1.Left.IsOpen
Expand Down

0 comments on commit dc35859

Please sign in to comment.