diff --git a/ohmpi/hardware_components/ohmpi_card_3_15.py b/ohmpi/hardware_components/ohmpi_card_3_15.py index 873730a9ebd8acecfba97b4c58bae11e48e1dd02..a89c570428aed437ca36d7fd7e13a6a6ea117d55 100644 --- a/ohmpi/hardware_components/ohmpi_card_3_15.py +++ b/ohmpi/hardware_components/ohmpi_card_3_15.py @@ -233,18 +233,22 @@ class Rx(RxAbstract): self.exec_logger.debug(f'Setting RX ADC gain to {value}') def adc_gain_auto(self): + self.exec_logger.event(f'{self.board_name}\tAuto_Gain_RX\tbegin\t{datetime.datetime.utcnow()}') gain_0 = _gain_auto(AnalogIn(self._ads_voltage, ads.P0)) gain_2 = _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.adc_gain = gain + self.exec_logger.event(f'{self.board_name}\tAuto_Gain_RX\tend\t{datetime.datetime.utcnow()}') @property def voltage(self): """ Gets the voltage VMN in Volts """ + self.exec_logger.event(f'{self.board_name}\Measure_Voltage_RX\tbegin\t{datetime.datetime.utcnow()}') u0 = AnalogIn(self._ads_voltage, ads.P0).voltage * 1000. u2 = AnalogIn(self._ads_voltage, ads.P2).voltage * 1000. - u = np.max([u0,u2]) * (np.heaviside(u0-u2, 1.) * 2 - 1.) # gets the max between u0 & u2 and set the sign + u = np.max([u0, u2]) * (np.heaviside(u0-u2, 1.) * 2 - 1.) # gets the max between u0 & u2 and set the sign self.exec_logger.debug(f'Reading voltages {u0} mV and {u2} mV on RX. Returning {u} mV') + self.exec_logger.event(f'{self.board_name}\Measure_Voltage_RX\tend\t{datetime.datetime.utcnow()}') return u \ No newline at end of file