From 96b0ba2ebcd01494c3713ad5cd960f768e8cd386 Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Thu, 1 Jun 2023 11:18:06 +0200
Subject: [PATCH] Fixes config in dev/test_mux_2024 to use 2 mux boards

---
 dev/test_mux_2024.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/dev/test_mux_2024.py b/dev/test_mux_2024.py
index 26f6475c..cd6f99d5 100644
--- a/dev/test_mux_2024.py
+++ b/dev/test_mux_2024.py
@@ -1,9 +1,10 @@
 import time
 from ohmpi.utils import change_config
 import logging
-change_config('../configs/config_mb_2023_mux_2024.py', verbose=False)
+change_config('../configs/config_mb_2023_2_mux_2024.py', verbose=False)
 from ohmpi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG
 from ohmpi.hardware_components import raspberry_pi_i2c as ctl_module
+from ohmpi.config import HARDWARE_CONFIG
 
 stand_alone_mux = False
 part_of_hardware_system = False
@@ -19,7 +20,7 @@ if stand_alone_mux:
     mux.switch_one(elec=9, role='M', state='off')
     mux.switch({'A': [9], 'B': [12], 'M': [10], 'N': [11]}, state='on')
     time.sleep(8)
-    #mux.switch({'A': [1], 'B': [4], 'M': [2], 'N': [3]}, state='off')
+    # mux.switch({'A': [1], 'B': [4], 'M': [2], 'N': [3]}, state='off')
     mux.reset()
     mux.test({'A': [9, 10, 11, 12, 13, 14, 15, 16], 'B': [9, 10, 11, 12, 13, 14, 15, 16],
               'M': [9, 10, 11, 12, 13, 14, 15, 16], 'N': [9, 10, 11, 12, 13, 14, 15, 16]}, activation_time=.1)
@@ -28,20 +29,21 @@ if stand_alone_mux:
 if part_of_hardware_system:
     from ohmpi.hardware_system import OhmPiHardware
     print('Starting test of mux as part of a OhmPiHardware system.')
+
     k = OhmPiHardware()
     k.exec_logger.setLevel(logging.DEBUG)
 
     # Test mux switching
     k.reset_mux()
-    k.switch_mux(electrodes=[1,4,2,3], roles=['A', 'B', 'M', 'N'], state='on')
+    k.switch_mux(electrodes=[1, 4, 2, 3], roles=['A', 'B', 'M', 'N'], state='on')
     time.sleep(1.)
-    k.switch_mux(electrodes=[1,4,2,3], roles=['A', 'B', 'M', 'N'], state='off')
+    k.switch_mux(electrodes=[1, 4, 2, 3], roles=['A', 'B', 'M', 'N'], state='off')
 
 if within_ohmpi:
     from ohmpi.ohmpi import OhmPi
     print('Starting test of mux within OhmPi.')
     k = OhmPi()
-    k.switch_mux_on([1,4,2,3])
+    k.switch_mux_on([1, 4, 2, 3])
     time.sleep(1.)
     k.reset_mux()
 
-- 
GitLab