1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +00:00

Instruments: Add millisecond MeasurementType and conversion

Allows for reporting times in milliseconds as used with the acmecape
instrument.
This commit is contained in:
Marc Bonnici 2017-08-18 09:59:23 +01:00
parent 2de2b36387
commit 9b465c2766

View File

@ -76,11 +76,19 @@ _measurement_types = [
MeasurementType('time', 'seconds',
conversions={
'time_us': lambda x: x * 1000000,
'time_ms': lambda x: x * 1000,
}
),
MeasurementType('time_us', 'microseconds',
conversions={
'time': lambda x: x / 1000000,
'time_ms': lambda x: x / 1000,
}
),
MeasurementType('time_ms', 'milliseconds',
conversions={
'time': lambda x: x / 1000,
'time_us': lambda x: x * 1000,
}
),
MeasurementType('temperature', 'degrees'),