aboutsummaryrefslogtreecommitdiff
path: root/qolab
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-02 18:11:59 -0400
committerEugeniy E. Mikhailov <evgmik@gmail.com>2024-07-02 18:11:59 -0400
commitb064012d71666d9b8153748bbe529fe17bb527f2 (patch)
treeed5462966c36c0a30336504fa612f429f68855a2 /qolab
parent24df9a895e5d7efd8bcb177af295b64aef14ee92 (diff)
downloadqolab-b064012d71666d9b8153748bbe529fe17bb527f2.tar.gz
qolab-b064012d71666d9b8153748bbe529fe17bb527f2.zip
added help for basic instrument
Diffstat (limited to 'qolab')
-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'