From e3a75169865ad47148586ad99b75ceffdd6345be Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Tue, 14 Jun 2022 22:29:26 -0400 Subject: added timestamp for Instrument config --- qolab/hardware/basic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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') -- cgit v1.2.3