Commit 41e89469 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Works on issue #101

Showing with 6 additions and 5 deletions
+6 -5
...@@ -30,7 +30,7 @@ HARDWARE_CONFIG = { ...@@ -30,7 +30,7 @@ HARDWARE_CONFIG = {
'sampling_rate': 10., # ms 'sampling_rate': 10., # ms
'nb_samples': 20, # Max value 10 # was named integer before... 'nb_samples': 20, # Max value 10 # was named integer before...
}, },
'mux': {'mux_1':{'model' : 'mux_2024_rev_0_0', # 'ohmpi_i2c_mux64_v1.01', 'mux': {'mux_1': {'model' : 'mux_2024_rev_0_0', # 'ohmpi_i2c_mux64_v1.01',
'tca_address': None, # TODO: This should be part of the system config (cabling of several mux boards) 'tca_address': None, # TODO: This should be part of the system config (cabling of several mux boards)
'tca_channel': 0, # TODO: This should be part of the system config (cabling of several mux boards) 'tca_channel': 0, # TODO: This should be part of the system config (cabling of several mux boards)
'mcp_0' : '0x22', # TODO : Replace this with pos of jumper on MUX board (address doesn't mean anything for the average user...) 'mcp_0' : '0x22', # TODO : Replace this with pos of jumper on MUX board (address doesn't mean anything for the average user...)
......
...@@ -48,11 +48,12 @@ class MuxAbstract(ABC): ...@@ -48,11 +48,12 @@ class MuxAbstract(ABC):
self.controller = kwargs.pop('controller', None) self.controller = kwargs.pop('controller', None)
cabling = kwargs.pop('cabling', None) cabling = kwargs.pop('cabling', None)
print(f'cabling: {cabling}') print(f'cabling: {cabling}')
self._cabling = {} self.cabling = {}
if cabling is not None: if cabling is not None:
for k, v in cabling: for k, v in cabling:
print('{v[0]}, {self.board_id}')
if v[0]==self.board_id: if v[0]==self.board_id:
self._cabling.update({k: v[1]}) self.cabling.update({k: v[1]})
self.addresses = kwargs.pop('addresses', None) self.addresses = kwargs.pop('addresses', None)
@abstractmethod @abstractmethod
......
...@@ -110,8 +110,8 @@ class Mux(MuxAbstract): ...@@ -110,8 +110,8 @@ class Mux(MuxAbstract):
d = inner_cabling[self._mode] d = inner_cabling[self._mode]
self.addresses = {} self.addresses = {}
for k, v in d.items(): for k, v in d.items():
print(f'self._cabling: {self._cabling}, k: {k}, self._roles: {self._roles}') print(f'self.cabling: {self.cabling}, k: {k}, self._roles: {self._roles}')
self.addresses.update({(self._cabling[k[0]], self._roles[k[1]]): v}) self.addresses.update({(self.cabling[k[0]], self._roles[k[1]]): v})
print(f'addresses: {self.addresses}') print(f'addresses: {self.addresses}')
def reset(self): def reset(self):
......
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