diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-30 22:24:12 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-30 22:24:12 -0500 |
commit | ed558b646e96d2b3ff95976eaaacb9722240b452 (patch) | |
tree | 7b9e293e9043a59bb5bc531f16d90dc2306b478f | |
parent | 5d8331d0a61be05528dabf63a1aad6d18342a91c (diff) | |
download | qolab-ed558b646e96d2b3ff95976eaaacb9722240b452.tar.gz qolab-ed558b646e96d2b3ff95976eaaacb9722240b452.zip |
BasicInstrument can init with config which overrides/adds to defaults
-rw-r--r-- | qolab/hardware/basic.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/qolab/hardware/basic.py b/qolab/hardware/basic.py index ee412db..dab32ab 100644 --- a/qolab/hardware/basic.py +++ b/qolab/hardware/basic.py @@ -3,14 +3,16 @@ from qolab.file_utils import get_next_data_file from qolab.tsdb import tsdb_append_metric_for_class_setter_or_getter class BasicInstrument: - def __init__(self, device_nickname=None, tsdb_ingester=None): - self.config={} + def __init__(self, config={}, device_nickname=None, tsdb_ingester=None): + self.config = {} self.config['Device type'] = 'Basic Instrument' self.config['Device model'] = 'Model is unset' self.config['DeviceId'] = None self.config['DeviceNickname'] = device_nickname; # to separate similar instruments self.config['FnamePrefix'] = 'basicInstrument' self.config['SavePath'] = './data' + for k, v in config.items(): + self.config[k]=v self.tsdb_ingester = tsdb_ingester # deviceProperties must have 'get' and preferably 'set' methods available, # i.e. 'SampleRate' needs getSampleRate() and love to have setSampleRate(value) |