diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-06-14 22:29:26 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-06-14 22:29:26 -0400 |
commit | e3a75169865ad47148586ad99b75ceffdd6345be (patch) | |
tree | bc6f2533f540fc37dc63ffb45b2ae7e563870b03 /qolab/hardware | |
parent | da607317738f99dd7a9f317679a7856c68ec1bc8 (diff) | |
download | qolab-e3a75169865ad47148586ad99b75ceffdd6345be.tar.gz qolab-e3a75169865ad47148586ad99b75ceffdd6345be.zip |
added timestamp for Instrument config
Diffstat (limited to 'qolab/hardware')
-rw-r--r-- | qolab/hardware/basic.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qolab/hardware/basic.py b/qolab/hardware/basic.py index f9a4dee..abc9417 100644 --- a/qolab/hardware/basic.py +++ b/qolab/hardware/basic.py @@ -1,4 +1,5 @@ import yaml +import time from qolab.file_utils import get_next_data_file from qolab.tsdb import tsdb_append_metric_for_class_setter_or_getter @@ -26,7 +27,7 @@ class BasicInstrument: # i.e. 'SampleRate' needs getSampleRate() and love to have setSampleRate(value) # they will be used to obtain config and set device according to it # self.deviceProperties = {'SampleRate', 'TimePerDiv', 'TrigDelay', }; - self.deviceProperties = set() + self.deviceProperties = {'TimeStamp'} def __repr__(self): s = '' @@ -103,6 +104,9 @@ class BasicInstrument: self.deviceProperties.add(p) setattr(self, p, v) + def getTimeStamp(self): + return time.strftime("%Y/%m/%d %H:%M:%S") + def getHeader(self): header = yaml.dump(self.getConfig(), default_flow_style=False, sort_keys=False) header = header.split('\n') |