Commit 3f7b6452 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Checks polarity of VMN

Showing with 3 additions and 3 deletions
+3 -3
...@@ -173,7 +173,7 @@ class OhmPiHardware: ...@@ -173,7 +173,7 @@ class OhmPiHardware:
if sampling_rate is None: if sampling_rate is None:
sampling_rate = self.rx.sampling_rate sampling_rate = self.rx.sampling_rate
sample = 0 sample = 0
self.exec_logger.info(f'values when starting pulse {self._pulse} : {self.tx.current} mA, {self.rx.voltage} mV') # self.exec_logger.info(f'values when starting pulse {self._pulse} : {self.tx.current} mA, {self.rx.voltage} mV')
_ = self.rx.voltage _ = self.rx.voltage
lap = datetime.datetime.utcnow() # just in case tx_sync is not set immediately after passing wait lap = datetime.datetime.utcnow() # just in case tx_sync is not set immediately after passing wait
self.tx_sync.wait() # self.tx_sync.wait() #
...@@ -187,8 +187,8 @@ class OhmPiHardware: ...@@ -187,8 +187,8 @@ class OhmPiHardware:
sleep_time = self._start_time + datetime.timedelta(seconds=sample / sampling_rate) - lap sleep_time = self._start_time + datetime.timedelta(seconds=sample / sampling_rate) - lap
if sleep_time.total_seconds() < 0.: if sleep_time.total_seconds() < 0.:
# for i in range(int(sampling_rate * np.abs(sleep_time.total_seconds()))): # for i in range(int(sampling_rate * np.abs(sleep_time.total_seconds()))):
# _readings.append([elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, np.nan, np.nan]) # _readings.append([elapsed_seconds(self._start_time), self._pulse, self.tx.polarity, np.nan, np.nan])
# sample += 1 # sample += 1
sample += int(sampling_rate * np.abs(sleep_time.total_seconds())) sample += int(sampling_rate * np.abs(sleep_time.total_seconds()))
else: else:
time.sleep(np.max([0., sleep_time.total_seconds()])) time.sleep(np.max([0., sleep_time.total_seconds()]))
......
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