Skip to content

Commit

Permalink
Merge pull request #19 from UlfBj/main
Browse files Browse the repository at this point in the history
CLI and documentation update.
  • Loading branch information
UlfBj authored Oct 17, 2024
2 parents ba7ddff + 8fa2516 commit fc76b86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
18 changes: 10 additions & 8 deletions docs-gen/content/him_configurator/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Arguments:
-c --saveconf Saves the configured vspec file with extension .conf.
Default: false
-e --enumSubstitute Substitute enum links to Datatype tree with actual
datatypes. Default: false
datatypes. Default: true
```
The -m command line option is used to set which VSS-tools exporter the configured tree should have.
The value 'all' leads to that all the exporters that are compatible with the HIM configurator are executed.
Expand All @@ -87,17 +87,19 @@ These files are saved with their original name post-fixed by '.conf'.
If not set these files are deleted after being used as input to the call of the VSS-tools exporter(s).
If not used the default is false, i. e. not to save the files.

The -e command line option is used to substitute the external datatype references with the actual enum definitions
from the common Datatypes tree in the tree(s) that the VSS-tools generate.
The -e command line option is used if substitution is not desired of the external datatype references with the actual enum definitions
from the common Datatypes tree in the generated tree(s).

## Creation of a vehicle variant specific signal tree
The HIM configurator enables a model where a "super tree" covering all variations of a vehicle archetype
(like Truck, Trailer, Bus, etc) can be defined in the vspec files,
then the HIM configurator can be used to create a "variant specific" vehicle signal tree via the input data in the himConfiguration.json file.
The HIM configurator enables a model where a "super tree" covering all variations that a vehicle may be equipped with,
e. g. propulsion technology like ICE, PHEV, EV, etc. can be defined in the vspec files,
then the HIM configurator can be used to create a "variant specific" vehicle signal tree from the variation point configuration in the himConfiguration.json file.


## Usage of a vehicle variant specific signal tree
The output from the HIM configurator is the selected parts of the "vspec super tree" in a file with one of the supported formats.
This file can then e. g. be used in a vehicle of the selected variant by a server that is controlling the access to the signals.
The server cn then use the tree to "vet" client request - checking that the signal is present, whether it is read-only or read-write, etc.
This file can then e. g. be used in a vehicle of the selected variant by a server that is managing the access to the signals.
The server can then use the tree to "vet" client request - checking that the signal is present, whether it is read-only or read-write,
that credentials are valid if access control is applied, etc.
An example of a server using it like this is the [VISS reference server](https://github.com/COVESA/vissr).

9 changes: 1 addition & 8 deletions spec/trees/himConfigurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ func main() {
// configFileName := parser.String("p", "pathconfigfile", &argparse.Options{Required: false, Help: "path to configuration file", Default: "himConfiguration.json"})
vspecDir := parser.String("v", "vspecdir", &argparse.Options{Required: false, Help: "path to vspec root directory", Default: "Vehicle/Truck/"})
sConf := parser.Flag("c", "saveconf", &argparse.Options{Required: false, Help: "Saves the configured vspec file with extension .conf", Default: false})
enumSubst := parser.Flag("e", "enumSubstitute", &argparse.Options{Required: false, Help: "Substitute enum links to Datatype tree with actual datatypes", Default: false})
enumSubst := parser.Flag("e", "enumSubstitute", &argparse.Options{Required: false, Help: "Substitute enum links to Datatype tree with actual datatypes", Default: true})
err := parser.Parse(os.Args)
if err != nil {
fmt.Print(parser.Usage(err))
Expand Down Expand Up @@ -1162,12 +1162,6 @@ func main() {

if enumSubstitute {
enumData = readEnumDefinitions(*vspecDir + "Datatypes.yaml")
/*fmt.Printf("len(enumData)=%d\n", len(enumData))
for i := 0; i < len(enumData); i++ {
fmt.Printf("enumData[%d].Name=%s\n", i, enumData[i].Name)
fmt.Printf("enumData[%d].Datatype=%s\n", i, enumData[i].Datatype)
fmt.Printf("len(enumData[%d].Allowed)=%d\n", i, len(enumData[i].Allowed))
}*/
err = filepath.WalkDir(*vspecDir, walkEnumSubstitute)
if err != nil {
fmt.Printf("Enum substitute preprocessing failed. Terminating.\n")
Expand All @@ -1180,7 +1174,6 @@ for i := 0; i < len(enumData); i++ {
makeCmd = ""
}
cmd := exec.Command("/usr/bin/bash", "make.sh", makeCmd, "./spec/trees/" + *vspecDir+rootVspecFileName)
// cmd := exec.Command("/usr/bin/bash", "make.sh", makeCmd, *vspecDir+rootVspecFileName)
err = cmd.Run()
if err != nil {
fmt.Printf("Executing make failed with error=%s. Terminating.\n", err)
Expand Down

0 comments on commit fc76b86

Please sign in to comment.