diff --git a/ohmpi/hardware_components/mb_2024_0_2.py b/ohmpi/hardware_components/mb_2024_0_2.py index f59efcd359758ef26cbead9a86241b132fd94554..1d916dac7c70e1d5f070f07eaedd719d84db5083 100644 --- a/ohmpi/hardware_components/mb_2024_0_2.py +++ b/ohmpi/hardware_components/mb_2024_0_2.py @@ -1,5 +1,4 @@ import datetime -import time import adafruit_ads1x15.ads1115 as ads # noqa from adafruit_ads1x15.analog_in import AnalogIn # noqa from adafruit_ads1x15.ads1x15 import Mode # noqa @@ -81,29 +80,6 @@ class Tx(Tx_mb_2023): Tx_mb_2023.inject(self, polarity=polarity, injection_duration=injection_duration) self.pin6.value = False - @property - def polarity(self): - return self._polarity - - @polarity.setter - def polarity(self, polarity): - print(polarity) - assert polarity in [-1, 0, 1] - print(f'asserted polarity: {self.polarity}') - self._polarity = polarity - if polarity == 1: - self.pin0.value = True - self.pin1.value = False - time.sleep(self._activation_delay) - elif polarity == -1: - self.pin0.value = False - self.pin1.value = True - time.sleep(self._activation_delay) - else: - self.pin0.value = False - self.pin1.value = False - time.sleep(self._release_delay) - class Rx(Rx_mb_2023): def __init__(self, **kwargs): diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py index 50e41c0a88e011f65743605eb2ff71974a539b02..8660145880c223fc2f0c2b40c1a7b90f2896d8b1 100644 --- a/ohmpi/hardware_system.py +++ b/ohmpi/hardware_system.py @@ -123,7 +123,7 @@ class OhmPiHardware: ctl_mod = importlib.import_module(f'ohmpi.hardware_components.{ctl_mod}') HARDWARE_CONFIG['tx']['ctl'] = ctl_mod.Ctl(**HARDWARE_CONFIG['tx']['ctl']) HARDWARE_CONFIG['tx'].update({'connection': HARDWARE_CONFIG['tx'].pop('connection', - HARDWARE_CONFIG['rx']['ctl'].interfaces[ + HARDWARE_CONFIG['tx']['ctl'].interfaces[ HARDWARE_CONFIG['tx'].pop( 'interface_name', 'i2c')])}) HARDWARE_CONFIG['tx'].pop('ctl', None) @@ -204,6 +204,7 @@ class OhmPiHardware: def _inject(self, polarity=1, injection_duration=None): # TODO: deal with voltage or current pulse self.exec_logger.event(f'OhmPiHardware\tinject\tbegin\t{datetime.datetime.utcnow()}') + print('inject') self.tx.voltage_pulse(length=injection_duration, polarity=polarity) self.exec_logger.event(f'OhmPiHardware\tinject\tend\t{datetime.datetime.utcnow()}')