Commit 4bb4fcd4 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Fixes bug with barrier in abstract hardware components

No related merge requests found
Showing with 3 additions and 4 deletions
+3 -4
...@@ -55,7 +55,7 @@ class MuxAbstract(ABC): ...@@ -55,7 +55,7 @@ class MuxAbstract(ABC):
self.cabling.update({k: (v[1], k[1])}) self.cabling.update({k: (v[1], k[1])})
self.exec_logger.debug(f'{self.board_id} cabling: {self.cabling}') self.exec_logger.debug(f'{self.board_id} cabling: {self.cabling}')
self.addresses = kwargs.pop('addresses', None) self.addresses = kwargs.pop('addresses', None)
self.barrier = kwargs.pop('barrier', None) self.barrier = kwargs.pop('barrier', Barrier(1))
@abstractmethod @abstractmethod
def _get_addresses(self): def _get_addresses(self):
...@@ -108,9 +108,8 @@ class MuxAbstract(ABC): ...@@ -108,9 +108,8 @@ class MuxAbstract(ABC):
return return
# if all ok, then wait for the barrier to open, then switch the electrodes # if all ok, then wait for the barrier to open, then switch the electrodes
if self.barrier is not None: self.exec_logger.debug(f'{self.board_id} waiting to switch.')
self.exec_logger.debug(f'{self.board_id} waiting to switch.') self.barrier.wait()
self.barrier.wait()
for role in elec_dict: for role in elec_dict:
for elec in elec_dict[role]: for elec in elec_dict[role]:
if elec > 0: # Is this condition related to electrodes to infinity? if elec > 0: # Is this condition related to electrodes to infinity?
......
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