Compare commits
No commits in common. "e4e86cbc49e2e326a26327213468eef09100a825" and "6d2eb09c6547b763f1ed0b0270aebff48e324d17" have entirely different histories.
e4e86cbc49
...
6d2eb09c65
@ -1,4 +1,3 @@
|
||||
import time
|
||||
from IPython import embed
|
||||
import nixio
|
||||
|
||||
@ -18,21 +17,15 @@ class NixWriter:
|
||||
chunk = 1000
|
||||
log.debug("Starting the writing")
|
||||
self.write = True
|
||||
|
||||
total_count = self.buffer.totalcount()
|
||||
while self.write:
|
||||
if total_count - items >= chunk:
|
||||
log.debug(items)
|
||||
try:
|
||||
data, _ = self.buffer.read(items, extend=chunk)
|
||||
self.data_array.append(data)
|
||||
except IndexError as e:
|
||||
time.sleep(0.01)
|
||||
log.debug(f"{e}")
|
||||
items += chunk
|
||||
else:
|
||||
time.sleep(0.01)
|
||||
# log.debug(items)
|
||||
try:
|
||||
data, _ = self.buffer.read(items, extend=chunk)
|
||||
self.data_array.append(data)
|
||||
except IndexError as e:
|
||||
# log.debug(f"{e}")
|
||||
continue
|
||||
items += chunk
|
||||
log.debug("Stoppint the writing")
|
||||
log.debug(f"Samples written {items}")
|
||||
self.nix_file.close()
|
||||
|
@ -38,7 +38,12 @@ class SinProducer:
|
||||
|
||||
log.debug(f"duration sinus {end_time-start_time}")
|
||||
log.debug(f"Stimulation time {t}")
|
||||
log.debug(f"Total samples produced {self.buffer.totalcount()}")
|
||||
log.debug(f"{self.buffer.totalcount()}")
|
||||
# data = self.buffer.get_all()
|
||||
# log.debug(data.shape[0])
|
||||
# log.debug(data.shape[0] / self.buffer.samplerate)
|
||||
# plt.plot(np.arange(data.size) / self.buffer.samplerate, data)
|
||||
# plt.show()
|
||||
|
||||
def stop_request(self):
|
||||
self.stop = True
|
||||
|
@ -13,7 +13,6 @@ from PyQt6.QtWidgets import (
|
||||
QStatusBar,
|
||||
)
|
||||
|
||||
from pyqtgraph.Qt.QtCore import QThread
|
||||
import uldaq
|
||||
import nixio as nix
|
||||
import pyqtgraph as pg
|
||||
@ -101,11 +100,12 @@ class PyRelacs(QMainWindow):
|
||||
mutex=self.mutex,
|
||||
)
|
||||
self.continously_plot = Continously(self.figure, self.buffer)
|
||||
# self.continously_plot.plot()
|
||||
self.continously_plot.plot()
|
||||
|
||||
if self.config.settings.daq:
|
||||
log.debug("Creating Daq Generator")
|
||||
self.daq_producer = DaqProducer(self.buffer, self.mccdaq.daq_device, [1, 1])
|
||||
|
||||
log.debug("Creating Sinus Generator")
|
||||
self.sinus_producer = SinProducer(self.buffer)
|
||||
|
||||
|
@ -53,7 +53,6 @@ class Continously:
|
||||
self.last_plotted_index,
|
||||
extend=self.CHUNK_PLOT,
|
||||
)
|
||||
|
||||
self.time = np.concatenate((self.time, times))[-self.PLOT_HISTORY :]
|
||||
self.data = np.concatenate((self.data, items))[-self.PLOT_HISTORY :]
|
||||
self.line.setData(
|
||||
|
Loading…
Reference in New Issue
Block a user