Commit 033b22c7 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Modifies sleep time computation

Showing with 4 additions and 4 deletions
+4 -4
......@@ -28,7 +28,7 @@ RX_CONFIG['voltage_min'] = np.min([voltage_adc_voltage_min, RX_CONFIG.pop('volta
RX_CONFIG['voltage_max'] = np.min([voltage_adc_voltage_max, RX_CONFIG.pop('voltage_max', np.inf)]) # mV
RX_CONFIG['sampling_rate'] = RX_CONFIG.pop('sampling_rate', sampling_rate)
RX_CONFIG['data_rate'] = RX_CONFIG.pop('data_rate', data_rate)
RX_CONFIG['coef_p2'] = 2.5
RX_CONFIG['coef_p2'] = RX_CONFIG.pop('coef_p2', 2.5)
# *** TX ***
# ADC for current
......
......@@ -192,9 +192,9 @@ class OhmPiHardware:
# 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])
# sample += 1
sample += int(sampling_rate * np.abs(sleep_time.total_seconds()))
else:
time.sleep(np.max([0., sleep_time.total_seconds()]))
sample += int(sampling_rate * np.abs(sleep_time.total_seconds())) + 1
sleep_time = self._start_time + datetime.timedelta(seconds=sample / sampling_rate) - lap
time.sleep(np.max([0., sleep_time.total_seconds()]))
self.exec_logger.warning(f'pulse {self._pulse}: elapsed time {(lap-self._start_time).total_seconds()} s') # TODO: Set to debug level
self.exec_logger.warning(f'pulse {self._pulse}: total samples {len(_readings)}') # TODO: Set to debug level
......
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