Commit 365febc3 authored by Arnaud WATLET's avatar Arnaud WATLET
Browse files

Fixes rs_check

Showing with 10 additions and 1 deletion
+10 -1
......@@ -587,6 +587,7 @@ class OhmPiHardware:
"""
self.exec_logger.event(f'OhmPiHardware\tvab_square_wave\tbegin\t{datetime.datetime.utcnow()}')
switch_pwr_off, switch_tx_pwr_off = False, False
# switches tx pwr on if needed (relays switching dps on and off)
if self.pwr_state == 'off':
self.pwr_state = 'on'
switch_tx_pwr_off = True
......@@ -623,6 +624,9 @@ class OhmPiHardware:
self.tx.voltage = vab
else:
vab = self.tx.voltage
# switches dps pwr on if needed
switch_pwr_off = False
if self.tx.pwr.pwr_state == 'off':
self.tx.pwr.pwr_state = 'on'
switch_pwr_off = True
......@@ -638,6 +642,8 @@ class OhmPiHardware:
self.tx.pwr.pwr_state = 'off'
def _vab_pulses(self, vab, durations, sampling_rate, polarities=None, append=False):
switch_pwr_off, switch_tx_pwr_off = False, False
# switches tx pwr on if needed (relays switching dps on and off)
if self.pwr_state == 'off':
self.pwr_state = 'on'
switch_pwr_off = True
......@@ -647,9 +653,12 @@ class OhmPiHardware:
self.tx.voltage = vab
else:
vab = self.tx.voltage
# switches dps pwr on if needed
if self.tx.pwr.pwr_state == 'off':
self.tx.pwr.pwr_state = 'on'
switch_pwr_off = True
if sampling_rate is None:
sampling_rate = RX_CONFIG['sampling_rate']
if polarities is not None:
......
......@@ -822,7 +822,7 @@ class OhmPi(object):
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
......
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