aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'qolab/hardware/basic.py')
-rw-r--r--qolab/hardware/basic.py32
1 files changed, 24 insertions, 8 deletions
diff --git a/qolab/hardware/basic.py b/qolab/hardware/basic.py
index 2161dca..2e99767 100644
--- a/qolab/hardware/basic.py
+++ b/qolab/hardware/basic.py
@@ -4,15 +4,31 @@ from qolab.file_utils import get_next_data_file
from qolab.tsdb import tsdb_append_metric_for_class_setter_or_getter
class BasicInstrument:
- """ This is the most basic instrument class """
+ """This is the most basic instrument class.
+
+ Parameters
+ ----------
+ device_nickname : None (default) or str
+ used to distinguish similar (in hardware, e.g. scopes) instruments,
+ also used as a tag in Time Series DB (TSDB) logging.
+ If not set we fallback to 'Device type' in config.
+ tsdb_ingester : None or tsdb ingester
+ used to log properties (with setter/getter) to TSDB. If 'None', the log entry is skipped
+ config : dictionary, default is empty dictionary
+ used to add or override default entries describing instrument
+ It is good idea to set the following keys in the dictionary:
+ 'Device type', 'Device model', 'DeviceId', 'DeviceNickname', 'FnamePrefix', 'SavePath'.
+
+ Example
+ -------
+ >>> config['Device type'] = 'Basic Instrument'
+ >>> config['Device model'] = 'Model is unset'
+ >>> config['DeviceId'] = None
+ >>> config['DeviceNickname'] = device_nickname; # to separate similar instruments
+ >>> config['FnamePrefix'] = 'basicInstrument'
+ >>> config['SavePath'] = './data'
+ """
def __init__(self, config={}, device_nickname=None, tsdb_ingester=None):
- """
- device_nickname - used to separate similar instruments,
- also used as a tag in Time Series DB (TSDB) logging,
- if not set we fallbacl to 'Device type'
- tsdb_ingester - used to log to TSDB if not set, the log entry is skipped
- config - used to add or override default entries
- """
self.config = {}
self.config['Device type'] = 'Basic Instrument'
self.config['Device model'] = 'Model is unset'