From cc54fbc3bef9b6458a0920190bd205989b0b7310 Mon Sep 17 00:00:00 2001 From: Arnaud Watlet <arnaud.watlet@umons.ac.be> Date: Mon, 22 Jan 2024 14:24:50 +0100 Subject: [PATCH] adds ohmpi_measure led --- ohmpi/hardware_system.py | 9 ++++++++- ohmpi/ohmpi.py | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py index 2d732bdc..3a38eafb 100644 --- a/ohmpi/hardware_system.py +++ b/ohmpi/hardware_system.py @@ -609,10 +609,14 @@ class OhmPiHardware: if self.pwr_state == 'off': self.pwr_state = 'on' switch_tx_pwr_off = True + + #Switches on measuring LED + self.tx.measuring = 'on' + if self.tx.pwr.pwr_state == 'off': self.tx.pwr.pwr_state = 'on' # switch_pwr_off = True - self.tx.measuring = 'on' + self._gain_auto(vab=vab) assert 0. <= duty_cycle <= 1. if duty_cycle < 1.: @@ -629,6 +633,7 @@ class OhmPiHardware: self.tx.pwr.pwr_state = 'off' if switch_tx_pwr_off: self.pwr_state = 'off' + # Switches off measuring LED self.tx.measuring = 'off' def _vab_pulse(self, vab=None, duration=1., sampling_rate=None, polarity=1, append=False): @@ -648,6 +653,8 @@ class OhmPiHardware: if self.tx.pwr.pwr_state == 'off': self.tx.pwr.pwr_state = 'on' switch_pwr_off = True + pulse_only = False + # reads current and voltage during the pulse injection = Thread(target=self._inject, kwargs={'injection_duration': duration, 'polarity': polarity}) readings = Thread(target=self._read_values, kwargs={'sampling_rate': sampling_rate, 'append': append}) diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index c65edd31..9d36d8dd 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -838,12 +838,17 @@ class OhmPi(object): self.status = 'running' self.reset_mux() + # switches off measuring LED + self._hw.tx.measuring = 'on' + # turn dps_pwr_on if needed switch_pwr_off = False + if self._hw.pwr.pwr_state == 'off': self._hw.pwr.pwr_state = 'on' switch_pwr_off = True + # measure all quad of the RS sequence for i in range(0, quads.shape[0]): quad = quads[i, :] # quadrupole @@ -885,7 +890,10 @@ class OhmPi(object): self.status = 'idle' if switch_pwr_off: self._hw.pwr.pwr_state = 'off' - + + #switches off measuring LED + self._hw.tx.measuring = 'off' + # if power was off before measurement, let's turn if off if switch_tx_pwr_off: self._hw.pwr_state = 'off' -- GitLab