Commit 9c3c337b authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Tests settings CONTINUOUS mode on TX'

Showing with 3 additions and 1 deletion
+3 -1
...@@ -133,6 +133,7 @@ class Tx(TxAbstract): ...@@ -133,6 +133,7 @@ class Tx(TxAbstract):
self._adc_gain = value self._adc_gain = value
self._ads_current = ads.ADS1115(self.ctl.bus, gain=self.adc_gain, data_rate=860, self._ads_current = ads.ADS1115(self.ctl.bus, gain=self.adc_gain, data_rate=860,
address=self._ads_current_address) address=self._ads_current_address)
self._ads_current.mode = Mode.CONTINUOUS
self.exec_logger.debug(f'Setting TX ADC gain to {value}') self.exec_logger.debug(f'Setting TX ADC gain to {value}')
def adc_gain_auto(self): def adc_gain_auto(self):
......
...@@ -178,12 +178,13 @@ class OhmPiHardware: ...@@ -178,12 +178,13 @@ class OhmPiHardware:
sampling_rate = self.rx.sampling_rate sampling_rate = self.rx.sampling_rate
sample = 0 sample = 0
# self.exec_logger.info(f'values when starting pulse {self._pulse} : {self.tx.current} mA, {self.rx.voltage} mV') # self.exec_logger.info(f'values when starting pulse {self._pulse} : {self.tx.current} mA, {self.rx.voltage} mV')
_ = self.rx.voltage
lap = datetime.datetime.utcnow() # just in case tx_sync is not set immediately after passing wait lap = datetime.datetime.utcnow() # just in case tx_sync is not set immediately after passing wait
self.tx_sync.wait() # self.tx_sync.wait() #
if not append or self._start_time is None: if not append or self._start_time is None:
self._start_time = datetime.datetime.utcnow() self._start_time = datetime.datetime.utcnow()
time.sleep(np.max([self.rx._latency, self.tx._latency])) time.sleep(np.max([self.rx._latency, self.tx._latency]))
# _ = self.rx.voltage
while self.tx_sync.is_set(): while self.tx_sync.is_set():
lap = datetime.datetime.utcnow() lap = datetime.datetime.utcnow()
r = [elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, self.tx.current, self.rx.voltage] r = [elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, self.tx.current, self.rx.voltage]
......
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