diff options
Diffstat (limited to 'qolab/hardware/basic.py')
-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') |