From df95868bf7250809a13756f1051efb10424553c5 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Sun, 2 Jan 2022 16:26:26 -0500 Subject: generalise getConfig to check for 'property' like attributes --- qolab/hardware/basic.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'qolab/hardware/basic.py') diff --git a/qolab/hardware/basic.py b/qolab/hardware/basic.py index 5e8d17d..387c4b2 100644 --- a/qolab/hardware/basic.py +++ b/qolab/hardware/basic.py @@ -45,6 +45,9 @@ class BasicInstrument: config = self.config.copy() dconfig = {} for p in self.deviceProperties: + if hasattr(self, p) or hasattr(type(self), p): + dconfig[p] = getattr(self, p) + continue getter = f'get{p}' if not hasattr(self, getter): print(f'warning no getter for {p}, i.e. {getter} is missing') -- cgit v1.2.3