From d97a2f4e5eb0c62776ee18c99a6e3cacf5a02b5b Mon Sep 17 00:00:00 2001 From: awatlet <arnaud.watlet@umons.ac.be> Date: Fri, 18 Nov 2022 11:25:31 +0100 Subject: [PATCH] Improves simulated acquired results for not on_pi cases --- ohmpi.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ohmpi.py b/ohmpi.py index 6c008c9e..ea4004f9 100644 --- a/ohmpi.py +++ b/ohmpi.py @@ -47,8 +47,6 @@ except ImportError as error: except Exception as error: print(colored(f'Unexpected error: {error}', 'red')) arm64_imports = None - exit() - class OhmPi(object): """ OhmPi class. @@ -1049,10 +1047,26 @@ class OhmPi(object): if self.on_pi: acquired_data = self.run_measurement(quad, **kwargs) else: # for testing, generate random data + sum_vmn = np.random.rand(1)[0] * 1000. + sum_i = np.random.rand(1)[0] * 100. + cmd_id = np.random.randint(1000) acquired_data = { - 'A': [quad[0]], 'B': [quad[1]], 'M': [quad[2]], 'N': [quad[3]], - 'R [ohm]': np.abs(np.random.randn(1)) + "time": datetime.now().isoformat(), + "A": quad[0], + "B": quad[1], + "M": quad[2], + "N": quad[3], + "inj time [ms]": self.settings['injection_duration'] * 1000., + "Vmn [mV]": sum_vmn, + "I [mA]": sum_i, + "R [ohm]": sum_vmn / sum_i, + "Ps [mV]": np.random.randn(1)[0] * 100., + "nbStack": self.settings['nb_stack'], + "Tx [V]": np.random.randn(1)[0] * 5., + "CPU temp [degC]": np.random.randn(1)[0] * 50., + "Nb samples [-]": self.nb_samples, } + self.data_logger.info(acquired_data) # switch mux off self.switch_mux_off(quad) -- GitLab