Commit ffcfa66f authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Searches for run_measurement error

Showing with 8 additions and 3 deletions
+8 -3
...@@ -247,9 +247,7 @@ class Rx(RxAbstract): ...@@ -247,9 +247,7 @@ class Rx(RxAbstract):
def _adc_gain_auto(self): def _adc_gain_auto(self):
self.exec_logger.event(f'{self.board_name}\trx_adc_auto_gain\tbegin\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.board_name}\trx_adc_auto_gain\tbegin\t{datetime.datetime.utcnow()}')
gain_0 = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P0)) gain = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P0, ads.P1))
gain_2 = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P2))
gain = np.min([gain_0, gain_2])
self.exec_logger.debug(f'Setting RX ADC gain automatically to {gain}') self.exec_logger.debug(f'Setting RX ADC gain automatically to {gain}')
self.gain = gain self.gain = gain
self.exec_logger.event(f'{self.board_name}\trx_adc_auto_gain\tend\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.board_name}\trx_adc_auto_gain\tend\t{datetime.datetime.utcnow()}')
......
...@@ -105,6 +105,13 @@ class Rx(Rx_mb_2023): ...@@ -105,6 +105,13 @@ class Rx(Rx_mb_2023):
# TODO: try to only log this event and not the one created by super() # TODO: try to only log this event and not the one created by super()
self.exec_logger.event(f'{self.board_name}\trx_init\tend\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.board_name}\trx_init\tend\t{datetime.datetime.utcnow()}')
def _adc_gain_auto(self):
self.exec_logger.event(f'{self.board_name}\trx_adc_auto_gain\tbegin\t{datetime.datetime.utcnow()}')
gain = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P0))
self.exec_logger.debug(f'Setting RX ADC gain automatically to {gain}')
self.gain = gain
self.exec_logger.event(f'{self.board_name}\trx_adc_auto_gain\tend\t{datetime.datetime.utcnow()}')
def _dg411_gain_auto(self): def _dg411_gain_auto(self):
if self.voltage < self._vmn_hardware_offset : if self.voltage < self._vmn_hardware_offset :
self._dg411_gain = 1. self._dg411_gain = 1.
......
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