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.
diff --git a/devlib/instrument/__init__.py b/devlib/instrument/__init__.py
index cceada6..6d11eda 100644
--- a/devlib/instrument/__init__.py
+++ b/devlib/instrument/__init__.py
@@ -75,19 +75,19 @@
# Standard measures
_measurement_types = [
MeasurementType('unknown', None),
- MeasurementType('time', 'seconds',
+ MeasurementType('time', 'seconds', 'time',
conversions={
'time_us': lambda x: x * 1000000,
'time_ms': lambda x: x * 1000,
}
),
- MeasurementType('time_us', 'microseconds',
+ MeasurementType('time_us', 'microseconds', 'time',
conversions={
'time': lambda x: x / 1000000,
'time_ms': lambda x: x / 1000,
}
),
- MeasurementType('time_ms', 'milliseconds',
+ MeasurementType('time_ms', 'milliseconds', 'time',
conversions={
'time': lambda x: x / 1000,
'time_us': lambda x: x * 1000,
diff --git a/doc/instrumentation.rst b/doc/instrumentation.rst
index 8aee1ce..6f381b4 100644
--- a/doc/instrumentation.rst
+++ b/doc/instrumentation.rst
@@ -229,11 +229,11 @@
+-------------+-------------+---------------+
| name | units | category |
+=============+=============+===============+
-| time | seconds | |
+| time | seconds | time |
+-------------+-------------+---------------+
-| time | microseconds| |
+| time_us | microseconds| time |
+-------------+-------------+---------------+
-| time | milliseconds| |
+| time_ms | milliseconds| time |
+-------------+-------------+---------------+
| temperature | degrees | |
+-------------+-------------+---------------+