diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-02 16:26:26 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-02 16:26:26 -0500 |
commit | df95868bf7250809a13756f1051efb10424553c5 (patch) | |
tree | 56e9ee5d7f05117d0f1e381cb219ce17267f6d3c /qolab/hardware | |
parent | d9b975f87176ba0b616c297b4046404dfe40a421 (diff) | |
download | qolab-df95868bf7250809a13756f1051efb10424553c5.tar.gz qolab-df95868bf7250809a13756f1051efb10424553c5.zip |
generalise getConfig to check for 'property' like attributes
Diffstat (limited to 'qolab/hardware')
-rw-r--r-- | qolab/hardware/basic.py | 3 |
1 files changed, 3 insertions, 0 deletions
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') |