In Section 2.2.2. Definition of Units the conversion of units based on <BaseUnit>
is described.
One important pitfall is to incorporate the offset
if relativeQuantity="true"
; an example is given in subsection Signal connection check which even refers to the definition of relativeQuantity
below.
The problem now is, that the definition/description of relativeQuantity
only talks about semantic means w.r.t. displayUnit
:
If this attribute is true, then the offset of displayUnit must be ignored. [For example, 10 degree Celsius = 10 Kelvin if relativeQuantity = true and not 283.15 Kelvin.]
I think, this is wrong. The relativeQuantity
is much more important for the formal conversion of units based on <BaseUnit>
definitions.
The definition of relativeQuantity
should be respectively adapted. Also a more complex example how to use it for unit conversions has to be added.
Finally, the formula given for <BaseUnit>
-based unit conversion should already incorporate relativeQuantity
. At the moment it is just:
BaseUnit_value = factor * Unit_value + offset
but I guess it should be BaseUnit_value = factor * Unit_value + (if relativeQuantity 0.0 else offset)
, although it now requires some linking to relativeQuantity
which is not part of the <Unit>
/<BaseUnit>
definition itself but rather variable specific (it is an attribute of <Float64Type>
, not <BaseUnit>
).