Commit 46c2ed90 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Updates _vab_pulse

Showing with 5 additions and 3 deletions
+5 -3
...@@ -54,16 +54,18 @@ class OhmPiHardware: ...@@ -54,16 +54,18 @@ class OhmPiHardware:
self.tx_sync.clear() self.tx_sync.clear()
def read_values(): def read_values():
current = [] readings = []
self.tx_sync.wait() self.tx_sync.wait()
start_time = time.gmtime() start_time = time.gmtime()
while self.tx_sync.is_set(): while self.tx_sync.is_set():
current.append([time.gmtime() - start_time, self.tx.current, self.rx.voltage]) readings.append([time.gmtime() - start_time, self.tx.current, self.rx.voltage])
return np.array(readings)
if polarity is not None and polarity != self.tx.polarity: if polarity is not None and polarity != self.tx.polarity:
self.tx.polarity = polarity self.tx.polarity = polarity
self.tx.voltage = vab self.tx.voltage = vab
injection = Thread(target=self.tx.voltage_pulse, kwargs={'length':length}) injection = Thread(target=inject, kwargs={'length':length})
readings = Thread(target=read_values)
# set gains automatically # set gains automatically
self.tx.adc_gain_auto() self.tx.adc_gain_auto()
self.rx.adc_gain_auto() self.rx.adc_gain_auto()
......
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