From 0a39221063c2ba59dbf8606d271e16f910775be3 Mon Sep 17 00:00:00 2001 From: awatlet <arnaud.watlet@umons.ac.be> Date: Mon, 9 Oct 2023 15:48:37 +0200 Subject: [PATCH] test pulse --- ohmpi/hardware_components/mb_2024_0_2.py | 24 ------------------------ ohmpi/hardware_system.py | 3 ++- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/ohmpi/hardware_components/mb_2024_0_2.py b/ohmpi/hardware_components/mb_2024_0_2.py index f59efcd3..1d916dac 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 50e41c0a..86601458 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()}') -- GitLab