Commit d97a2f4e authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Improves simulated acquired results for not on_pi cases

Showing with 18 additions and 4 deletions
+18 -4
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment