1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 02:40:50 +01:00

insturment: add catergory for time + doc fix

- Add a category name for time MeasurmentType's, as there are now
  multiple.
- Fix the names of time_ms and time_us in the documentation.
This commit is contained in:
Sergei Trofimov 2017-08-30 14:27:03 +01:00
parent 15333eb09c
commit 2afa8f86a4
2 changed files with 6 additions and 6 deletions

View File

@ -75,19 +75,19 @@ class MeasurementType(object):
# Standard measures # Standard measures
_measurement_types = [ _measurement_types = [
MeasurementType('unknown', None), MeasurementType('unknown', None),
MeasurementType('time', 'seconds', MeasurementType('time', 'seconds', 'time',
conversions={ conversions={
'time_us': lambda x: x * 1000000, 'time_us': lambda x: x * 1000000,
'time_ms': lambda x: x * 1000, 'time_ms': lambda x: x * 1000,
} }
), ),
MeasurementType('time_us', 'microseconds', MeasurementType('time_us', 'microseconds', 'time',
conversions={ conversions={
'time': lambda x: x / 1000000, 'time': lambda x: x / 1000000,
'time_ms': lambda x: x / 1000, 'time_ms': lambda x: x / 1000,
} }
), ),
MeasurementType('time_ms', 'milliseconds', MeasurementType('time_ms', 'milliseconds', 'time',
conversions={ conversions={
'time': lambda x: x / 1000, 'time': lambda x: x / 1000,
'time_us': lambda x: x * 1000, 'time_us': lambda x: x * 1000,

View File

@ -229,11 +229,11 @@ defined measurement types are
+-------------+-------------+---------------+ +-------------+-------------+---------------+
| name | units | category | | name | units | category |
+=============+=============+===============+ +=============+=============+===============+
| time | seconds | | | time | seconds | time |
+-------------+-------------+---------------+ +-------------+-------------+---------------+
| time | microseconds| | | time_us | microseconds| time |
+-------------+-------------+---------------+ +-------------+-------------+---------------+
| time | milliseconds| | | time_ms | milliseconds| time |
+-------------+-------------+---------------+ +-------------+-------------+---------------+
| temperature | degrees | | | temperature | degrees | |
+-------------+-------------+---------------+ +-------------+-------------+---------------+