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

Fixes a bug in _adc_gain_auto in mb_2024

Showing with 4 additions and 2 deletions
+4 -2
...@@ -258,7 +258,7 @@ class Rx(RxAbstract): ...@@ -258,7 +258,7 @@ class Rx(RxAbstract):
self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tbegin\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tbegin\t{datetime.datetime.utcnow()}')
gain = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P0, ads.P1)) gain = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P0, ads.P1))
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._adc_gain = gain
self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tend\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tend\t{datetime.datetime.utcnow()}')
def gain_auto(self): def gain_auto(self):
......
...@@ -153,7 +153,7 @@ class Rx(Rx_mb_2023): ...@@ -153,7 +153,7 @@ class Rx(Rx_mb_2023):
self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tbegin\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tbegin\t{datetime.datetime.utcnow()}')
gain = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P0)) gain = _ads_1115_gain_auto(AnalogIn(self._ads_voltage, ads.P0))
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._adc_gain = gain
self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tend\t{datetime.datetime.utcnow()}') self.exec_logger.event(f'{self.model}\trx_adc_auto_gain\tend\t{datetime.datetime.utcnow()}')
def _dg411_gain_auto(self): def _dg411_gain_auto(self):
...@@ -161,6 +161,7 @@ class Rx(Rx_mb_2023): ...@@ -161,6 +161,7 @@ class Rx(Rx_mb_2023):
self._dg411_gain = 1. self._dg411_gain = 1.
else: else:
self._dg411_gain = 1/2 self._dg411_gain = 1/2
self.exec_logger.debug(f'Setting RX DG411 gain automatically to {self._dg411_gain}')
@property @property
def gain(self): def gain(self):
...@@ -179,6 +180,7 @@ class Rx(Rx_mb_2023): ...@@ -179,6 +180,7 @@ class Rx(Rx_mb_2023):
def gain_auto(self): def gain_auto(self):
self._dg411_gain_auto() self._dg411_gain_auto()
self.exec_logger.debug(f'Setting RX gain automatically to {self.gain}')
@property @property
def voltage(self): def voltage(self):
......
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