Skip to content

Commit

Permalink
Change domain to quantity
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Jaegervall <[email protected]>
  • Loading branch information
erikbosch committed Nov 15, 2023
1 parent a2d6e54 commit 628ca18
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 78 deletions.
32 changes: 16 additions & 16 deletions docs-gen/content/rule_set/data_entry/data_unit_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,35 +96,35 @@ Unit files follow the syntax defined below:
<vss-unit-identifier>: # Typically unit abbreviation, like km/h or mm, but
definition: <string>
[unit: <string>] # Full name of unit, optional, if not given assumed to be equal to vss-unit-identifier
domain: <string> # Domain of the unit.
quantity: <string> # Quantity of the unit.
[allowed-datatypes] : ['numeric', 'string', uint8', ...]] # Allowed datatypes in VSS standard catalog
[deprecation: <reason>]
]*
```

The VSS term `domain` corresponds roughly to the term `quantity` as defined in for example ISO 80000.
The VSS term `quantity` corresponds roughly to the term `quantity` as defined in for example ISO 80000.
Typical example are `length`, `mass` and `velocity` that all can be expressed in SI-units.
However, from a VSS perspective domains do not need to correspond to physical quantities.
However, from a VSS perspective quantities do not need to correspond to physical quantities.
It could be an arbitrary term, but it is generally expected that it is possible to convert between values
using different units but defined with the same domain.
using different units but defined with the same quantity.

Example:

```
m:
definition: Length measured in meters
unit: meter
domain: length
quantity: length
allowed-datatypes: ['numeric']
mm:
definition: Length measured in millimeters
unit: millimeter
domain: length
quantity: length
allowed-datatypes: ['numeric']
```

As `m` and `mm` are defined with the same domain it is expected that you can convert a value from `m` to `mm`.
As `m` and `mm` are defined with the same quantity it is expected that you can convert a value from `m` to `mm`.

The `allowed-datatypes` attributes can be used to specify which VSS datatypes can contain values of a particular unit.
For most units the symbolic datatype `numeric` meaning any float or integer datatype can be used.
Expand All @@ -143,12 +143,12 @@ Tooling shall preferably give a warning if a signal uses a deprecated unit or th
inch:
definition: Distance measured in inches
unit: inch
domain: distance
quantity: distance
deprecation: V5.0 replaced by 'in'
in:
definition: Distance measured in inches
unit: inch
domain: distance
quantity: distance
```


Expand All @@ -161,16 +161,16 @@ units:
<vss-unit-identifier>: # Typically unit abbreviation, like km/h or mm, but
label: <string> # Replaced with "unit"
description: <string> # Replaced with "definition"
domain: <string>
quantity: <string>
]*
```

## Domain file syntax
## Quantity file syntax


Defing domains is recommended, but currently optional for backward compatibility reasons.
If tooling supports domain files it can verify that all units provided in unit files
use defined domains.
Defing quantities is recommended, but currently optional for backward compatibility reasons.
If tooling supports quantity files it can verify that all units provided in unit files
use defined quantities.

``

Expand All @@ -185,7 +185,7 @@ use defined domains.
```
The VSS list of domains for the standard catalog exists in [domains.yaml](https://github.com/COVESA/vehicle_signal_specification/blob/master/spec/domains.yaml).
The VSS list of quantitiess for the standard catalog exists in [quantities.yaml](https://github.com/COVESA/vehicle_signal_specification/blob/master/spec/quantities.yaml).
## Defining custom units
Expand All @@ -200,6 +200,6 @@ of furlong to other units.
units:
furlong:
definition: Length measured in furlong, 1 furlong equals 201.1680 m
domain: length
quantity: length
allowed-datatypes: ['numeric']
```
3 changes: 3 additions & 0 deletions spec/domains.yaml → spec/quantities.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This file defines available quantities for the units defined for the VSS standard catalog in the file unit.yaml.
# See VSS documentation for information on syntax and intended content

length:
definition: Linear extent in space between any two points (ISO 80000-3:2019)
remark: Length does not need to be measured along a straight line.
Expand Down
Loading

0 comments on commit 628ca18

Please sign in to comment.