From ba05d67a8174f52c002e538331bb0cdf22b21e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Teichr=C3=B6b?= Date: Wed, 3 Nov 2021 09:06:43 +0100 Subject: [PATCH] Leons lost commit --- .idea/Python-PS2000B.iml | 2 +- .idea/misc.xml | 2 +- src/helmholtz_cage_device.py | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.idea/Python-PS2000B.iml b/.idea/Python-PS2000B.iml index edb294b..e299904 100644 --- a/.idea/Python-PS2000B.iml +++ b/.idea/Python-PS2000B.iml @@ -2,7 +2,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 7ec378f..f39fd7a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/src/helmholtz_cage_device.py b/src/helmholtz_cage_device.py index 4796f27..cfd8c0f 100644 --- a/src/helmholtz_cage_device.py +++ b/src/helmholtz_cage_device.py @@ -80,6 +80,17 @@ class HelmholtzCageDevice: # The axes talks to the HW objects (Arduino, PSU) referenced in this object self.axes.append(Axis(i, self)) + # --- Preliminary PSU type info --- + # Required post-initialization but before hardware has been connected + psu_type_string = config_handling.read_from_config("Supplies", "supply_model", + config_handling.CONFIG_OBJECT) + if psu_type_string == "ps2000b": + self.psu_type = PSUDevicePS2000B + elif psu_type_string == "ql355tp": + self.psu_type = PSUDeviceQL355TP + else: + raise Exception("Invalid psu model:\n{}".format(self.psu_type)) + # --- HW COMMUNICATION THREAD --- self._cmd_exec_thread = Thread(target=self._cmd_exec_thread_method) self._cmd_exec_thread.start()