IntervalMonitor
.
Usage
To set the signal unit you can call the methodsetSignalUnit
with the signal unit as a string. When updateValue is called the value will be automatically converted to the target unit. For example if your Data Source is a speed in km/h you can pass the unit as in the following code snippet :
- C++
- Python
setSignalUnit
is not compatible with the target unit, the following error message will be generated by the monitor : Cannot convert [signal unit] to [target unit] as they are not compatible
and the updateValue() won’t notify the Kernel.
You can also get the unit with the method getSignalUnit
which returns the unit.
About the library
- The conversion is done using the following 3rdparty units library : https://github.com/LLNL/units
- The list of units accepted by the library : https://units.readthedocs.io/en/latest/user-guide/defined_units.html#defined-units