Skip to content

Commit

Permalink
Merge pull request #11 from UlfBj/enums
Browse files Browse the repository at this point in the history
Definition of a common Datatype tree vspec structure. HIM configurato…
  • Loading branch information
UlfBj committed Jun 26, 2024
2 parents 47ec539 + c7b0a39 commit 203c311
Show file tree
Hide file tree
Showing 13 changed files with 931 additions and 15 deletions.
21 changes: 20 additions & 1 deletion docs-gen/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,26 @@ The expressions can use any of the two syntax options mentioned above.

Currently this syntax can only be used for two-dimensional instantiations.

### Trees under development
### Datatypes tree
One of the information rule sets that HIM supports is the type definition rule set.
A type definition tree is able to define strutcs and enums (allowed) that can be referenced from trees of other information types.
Such a tree is defined in the spec/objects/Datatypes directory, currently containing the enums (allowed) that is used in the VSS tree.
This tree has a structure that mirrors the structure from the VSS tree where the enums were originally used.
This structure might later be changed to a more generic structuring to yield reference path names more decoupled from the VSS structure.

An external datatype reference to an enum (allowed) shall have a syntax as shown below.
```
datatype: Datatype.x.y.zValues
```
where x, y, z may be names providing an understanding of the defined enum (allowed) that conform to the node HIM node name syntax.
The name z must be postfixed with the tag Values.

If the HIM configurator is used to substitute external enum (Allowed) references it will create a Datatype.yaml file in the root directory of
the signal tree that it is working on. The node type in a type definition tree shall be 'property' but due to that the VSS-tools will reject
separate trees with that node type, the node type 'sensor' is used instead. This must therefore be manually edited to rename to 'property'
until a moodified version of VSS-tools is created, or that the HIM configurator is updated to handle the node type renaming.

## Trees under development
Currently two trees are being developed:
* [Tractor tree](https://github.com/COVESA/commercial-vehicle-information-specifications/tree/main/spec/trees/Heavyduty/Tractor)
* [Trailer tree](https://github.com/COVESA/commercial-vehicle-information-specifications/tree/main/spec/trees/Heavyduty/Trailer)
Expand Down
22 changes: 14 additions & 8 deletions docs-gen/content/him_configurator/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ will show the command line options that is possible to apply at startup.
```
$ ./himConfigurator -h
usage: print [-h|--help] [-m|--makecommand (all|yaml|json|csv|binary)]
[-v|--vspecdir "<value>"] [-c|--saveconf]
[-v|--vspecdir "<value>"] [-c|--saveconf] [-e|--enumSubstitute]
HIM configurator
HIM preprocessor
Arguments:
-h --help Print help information
-m --makecommand Make command parameter must be either: all, yaml, csv, or
binary. Default: all
-v --vspecdir path to vspec root directory. Default: Heavyduty/Tractor/
-c --saveconf Saves the configured vspec file with extension .conf.
Default: false
-h --help Print help information
-m --makecommand Make command parameter must be either: all, yaml, csv,
or binary. Default: all
-v --vspecdir path to vspec root directory. Default:
Heavyduty/Tractor/
-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
```
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 @@ -52,3 +55,6 @@ 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.

49 changes: 49 additions & 0 deletions spec/objects/Datatype/ADAS/ADASDatatype.vspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (c) 2024 Contributors to COVESA
#
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# Commercial Vehicle Information Specifications ADAS Datatype file
#

#
# The root branch for CVIS ADAS datatype definitions.
#

ADAS:
type: branch
description: ADAS datatype definitions.

ADAS.ActiveAutonomyLevelValues:
type: sensor
datatype: string
allowed: [
'SAE_0',
'SAE_1',
'SAE_2_DISENGAGING',
'SAE_2',
'SAE_3_DISENGAGING', # Level 3 AD functions will disengage, driver notified
'SAE_3',
'SAE_4_DISENGAGING', # Level 4 AD functions will disengage, driver notified
'SAE_4',
'SAE_5'
]
description: ActiveAutonomyLevel allowed values.


ADAS.SupportedAutonomyLevelValues:
type: sensor
datatype: string
allowed: [
'SAE_0',
'SAE_1',
'SAE_2',
'SAE_3',
'SAE_4',
'SAE_5'
]
description: SupportedAutonomyLevel allowed values.
69 changes: 69 additions & 0 deletions spec/objects/Datatype/Body/BodyDatatype.vspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2024 Contributors to COVESA
#
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# Commercial Vehicle Information Specifications Body Datatype file
#

#
# The root branch for CVIS Body datatype definitions.
#

Body:
type: branch
description: Body datatype definitions.

Body.RefuelPositionValues:
type: sensor
datatype: stringx
allowed: ['FRONT_LEFT', 'FRONT_RIGHT', 'MIDDLE_LEFT', 'MIDDLE_RIGHT', 'REAR_LEFT', 'REAR_RIGHT']
description: RefuelPosition allowed values.

Body.Windshield:
type: branch
description: Body.Windshield datatype definitions.

Body.Windshield.Wiping:
type: branch
description: Body.Windshield.Wiping datatype definitions.

Body.Windshield.Wiping.ModeValues:
type: sensor
datatype: string
allowed: ['OFF', 'SLOW', 'MEDIUM', 'FAST', 'INTERVAL', 'RAIN_SENSOR']
description: Windshield.Wiping.Mode allowed values.

Body.WiperSystem:
type: branch
description: Body.WiperSystem datatype definitions.

Body.WiperSystem.ModeValues:
type: sensor
datatype: string
allowed: ['STOP_HOLD', 'WIPE', 'PLANT_MODE', 'EMERGENCY_STOP']
description: WiperSystem.Mode allowed values.

Body.Lights:
type: branch
description: Body.Lights datatype definitions.

Body.Lights.LightSwitchValues:
type: sensor
datatype: string
allowed: ['OFF', 'POSITION', 'DAYTIME_RUNNING_LIGHTS', 'AUTO', 'BEAM']
description: Lights.LightSwitch allowed values.

Body.BrakeLights:
type: branch
description: Body.BrakeLights datatype definitions.

Body.BrakeLights.IsActiveValues:
type: sensor
datatype: string
allowed: ['INACTIVE', 'ACTIVE', 'ADAPTIVE']
description: BrakeLights.IsActive allowed values.
187 changes: 187 additions & 0 deletions spec/objects/Datatype/Cabin/CabinDatatype.vspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# Copyright (c) 2024 Contributors to COVESA
#
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# Commercial Vehicle Information Specifications Cabin Datatype file
#

#
# The root branch for CVIS Cabin datatype definitions.
#

Cabin:
type: branch
description: Cabin datatype definitions.

Cabin.DriverPositionValues:
type: sensor
datatype: string
allowed: ['LEFT', 'MIDDLE', 'RIGHT']
description: DriverPosition allowed values.

Cabin.HVACStation:
type: branch
description: Cabin.HVACStation datatype definitions.

Cabin.HVACStation.AirDistributionValues:
type: sensor
datatype: string
allowed: ['UP', 'MIDDLE', 'DOWN']
description: HVACStation.AirDistribution allowed values.

Cabin.Sunroof:
type: branch
description: Cabin.Sunroof datatype definitions.

Cabin.Sunroof.SwitchValues:
type: sensor
datatype: string
allowed: ['INACTIVE', 'CLOSE', 'OPEN', 'ONE_SHOT_CLOSE', 'ONE_SHOT_OPEN', 'TILT_UP', 'TILT_DOWN']
description: Sunroof.Switch allowed values.

Cabin.Convertible:
type: branch
description: Cabin.Convertible datatype definitions.

Cabin.Convertible.StatusValues:
type: sensor
datatype: string
allowed: ['FRONT_LEFT', 'FRONT_RIGHT', 'MIDDLE_LEFT', 'MIDDLE_RIGHT', 'REAR_LEFT', 'REAR_RIGHT']
description: Convertible.Status allowed values.

Cabin.Media:
type: branch
description: Cabin.Media datatype definitions.

Cabin.Media.ActionValues:
type: sensor
datatype: string
allowed: ['UNKNOWN', 'STOP', 'PLAY', 'FAST_FORWARD', 'FAST_BACKWARD', 'SKIP_FORWARD', 'SKIP_BACKWARD']
description: Media.Action allowed values.

Cabin.Media.Played:
type: branch
description: Cabin.Media.Played datatype definitions.

Cabin.Media.Played.SourceValues:
type: sensor
datatype: string
allowed: ['UNKNOWN', 'SIRIUS_XM', 'AM', 'FM', 'DAB', 'TV', 'CD', 'DVD', 'AUX', 'USB', 'DISK', 'BLUETOOTH', 'INTERNET', 'VOICE', 'BEEP']
description: Media.Played.Source allowed values.

Cabin.Navigation:
type: branch
description: Cabin.Navigation datatype definitions.

Cabin.Navigation.MuteValues:
type: sensor
datatype: string
allowed: ['MUTED', 'ALERT_ONLY', 'UNMUTED']
description: Navigation.Mute allowed values.

Cabin.Navigation.GuidanceVoiceValues:
type: sensor
datatype: string
allowed: ['STANDARD_MALE', 'STANDARD_FEMALE', 'ETC']
description: Navigation.GuidanceVoice allowed values.

Cabin.HMI:
type: branch
description: Cabin.HMI datatype definitions.

Cabin.HMI.FontSizeValues:
type: sensor
datatype: string
allowed: ['STANDARD', 'LARGE', 'EXTRA_LARGE']
description: HMI.FontSize allowed values.

Cabin.HMI.DateFormatValues:
type: sensor
datatype: string
allowed: ['YYYY_MM_DD', 'DD_MM_YYYY', 'MM_DD_YYYY', 'YY_MM_DD', 'DD_MM_YY', 'MM_DD_YY']
description: HMI.DateFormat allowed values.

Cabin.HMI.TimeFormatValues:
type: sensor
datatype: string
allowed: ['HR_12', 'HR_24']
description: HMI.TimeFormat allowed values.

Cabin.HMI.DistanceUnitValues:
type: sensor
datatype: string
allowed: ['MILES', 'KILOMETERS']
description: HMI.DistanceUnit allowed values.

Cabin.HMI.FuelVolumeUnitValues:
type: sensor
datatype: string
allowed: ['LITER', 'GALLON_US', 'GALLON_UK']
description: HMI.FuelVolumeUnit allowed values.

Cabin.HMI.FuelEconomyUnitsValues:
type: sensor
datatype: string
allowed: ['MPG_UK', 'MPG_US', 'MILES_PER_LITER', 'KILOMETERS_PER_LITER', 'LITERS_PER_100_KILOMETERS']
description: HMI.FuelEconomyUnits allowed values.

Cabin.HMI.EVEconomyUnitsValues:
type: sensor
datatype: string
allowed: ['MILES_PER_KILOWATT_HOUR', 'KILOMETERS_PER_KILOWATT_HOUR', 'KILOWATT_HOURS_PER_100_MILES', 'KILOWATT_HOURS_PER_100_KILOMETERS', 'WATT_HOURS_PER_MILE', 'WATT_HOURS_PER_KILOMETER']
description: HMI.EVEconomyUnits allowed values.

Cabin.HMI.TemperatureUnitValues:
type: sensor
datatype: string
allowed: ['C', 'F']
description: HMI.TemperatureUnit allowed values.

Cabin.HMI.TirePressureUnitValues:
type: sensor
datatype: string
allowed: ['PSI', 'KPA', 'BAR']
description: HMI.TirePressureUnit allowed values.

Cabin.HMI.DayNightModeValues:
type: sensor
datatype: string
allowed: ['DAY', 'NIGHT']
description: HMI.DayNightMode allowed values.

Cabin.SmartphoneProjection:
type: branch
description: Cabin.SmartphoneProjection datatype definitions.

Cabin.SmartphoneProjection.ActiveValues:
type: sensor
datatype: string
allowed: [ 'NONE', 'ACTIVE', 'INACTIVE' ]
description: SmartphoneProjection.Active allowed values.

Cabin.SmartphoneProjection.SourceValues:
type: sensor
datatype: string
allowed: ['USB', 'BLUETOOTH', 'WIFI']
description: SmartphoneProjection.Source allowed values.

Cabin.SmartphoneProjection.SupportedModeValues:
type: sensor
datatype: string
allowed: [ 'ANDROID_AUTO', 'APPLE_CARPLAY', 'MIRROR_LINK', 'OTHER' ]
description: SmartphoneProjection.SupportedMode allowed values.

Cabin.SliderSwitch:
type: branch
description: Cabin.SliderSwitch datatype definitions.

Cabin.SliderSwitch.SwitchValues:
type: sensor
datatype: string
allowed: ['INACTIVE', 'CLOSE', 'OPEN', 'ONE_SHOT_CLOSE', 'ONE_SHOT_OPEN']
description: SliderSwitch.Switch allowed values.
18 changes: 18 additions & 0 deletions spec/objects/Datatype/Chassis/ChassisDatatype.vspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 Contributors to COVESA
#
# This program and the accompanying materials are made available under the
# terms of the Mozilla Public License 2.0 which is available at
# https://www.mozilla.org/en-US/MPL/2.0/
#
# SPDX-License-Identifier: MPL-2.0

#
# Commercial Vehicle Information Specifications Chassis Datatype file
#
#
# The root branch for CVIS Chassis datatype definitions.
#

Exterior:
type: branch
description: Chassis datatype definitions.
Loading

0 comments on commit 203c311

Please sign in to comment.