Commit 0122e2c1 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Updates hardware_system test_mux

Showing with 9 additions and 9 deletions
+9 -9
No preview for this file type
......@@ -10,7 +10,7 @@ from digitalio import Direction # noqa
MUX_CONFIG = HARDWARE_CONFIG['mux'].pop('default', {})
MUX_CONFIG.update({'voltage_max': 50., 'current_max': 3.}) # board default values that overwrite system default values
default_mux_cabling = {(elec, role) : ('mux_1', elec) for role in ['A', 'B', 'M', 'N'] for elec in range(1,9)} # 4 roles cabling electrodes from 1 to 8
default_mux_cabling = {(elec, role) : ('mux_1', elec) for role in ['A', 'B', 'M', 'N'] for elec in range(1,9)} # defaults to 4 roles cabling electrodes from 1 to 8
inner_cabling = {'4_roles' : {(1, 'X'): {'MCP': 0, 'MCP_GPIO': 0}, (1, 'Y'): {'MCP': 0, 'MCP_GPIO': 8},
......@@ -62,7 +62,7 @@ class Mux(MuxAbstract):
tca_channel = kwargs.pop('tca_channel', 0)
self._roles = kwargs.pop('roles', None)
if self._roles is None:
self._roles = {'A': 'X', 'B': 'Y', 'M' : 'XX', 'N' : 'YY'}
self._roles = {'A': 'X', 'B': 'Y', 'M' : 'XX', 'N' : 'YY'} # NOTE: defaults to 4-roles
if np.alltrue([j in self._roles.values() for j in set([i[1] for i in list(inner_cabling['4_roles'].keys())])]):
self._mode = '4_roles'
elif np.alltrue([j in self._roles.values() for j in set([i[1] for i in list(inner_cabling['2_roles'].keys())])]):
......
......@@ -64,8 +64,9 @@ class OhmPiHardware:
cabling = self._cabling)})
self.mux_barrier = Barrier(len(self.mux_boards) + 1)
self._cabling={}
for mux_id, mux in self.mux_boards.items():
for _, mux in self.mux_boards.items():
mux.barrier = self.mux_barrier
print(mux.cabling)
update_dict(self._cabling, mux.cabling)
print(self._cabling)
self.readings = np.array([]) # time series of acquired data
......@@ -308,16 +309,15 @@ class OhmPiHardware:
"""
self.reset_mux()
if channel is None:
a = input('Which channel do you want to test? (1,A)')
if a =='':
if channel is not None:
if channel =='':
electrodes = [1]
roles = ['A']
else:
try:
a = a.lstrip('(').rstrip(')').split(',')
electrodes = [int(a[0])]
roles = [a[1]]
channel = channel.lstrip('(').rstrip(')').split(',')
electrodes = [int(channel[0])]
roles = [channel[1]]
except Exception as e:
self.exec_logger.error(f'Unable to parse your answer: {e}')
return
......
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