[refacorting] adding DataBuffer

This commit is contained in:
wendtalexander 2024-10-01 12:04:47 +02:00
parent a0c524326d
commit 2719d49eb0

View File

@ -11,19 +11,20 @@ from PyQt6.QtWidgets import (
QStatusBar, QStatusBar,
) )
import uldaq import uldaq
import numpy as np
import nixio as nix import nixio as nix
import pyqtgraph as pg import pyqtgraph as pg
from pathlib import Path as path from pathlib import Path as path
from scipy.signal import welch, find_peaks
from pyrelacs.worker import Worker from pyrelacs.worker import Worker
from pyrelacs.repros.repros import Repro from pyrelacs.repros.repros import Repro
from pyrelacs.util.logging import config_logging from pyrelacs.dataio.buffer import DataBuffer
from pyrelacs.ui.about import AboutDialog from pyrelacs.ui.about import AboutDialog
from pyrelacs.ui.plots.calibration import CalibrationPlot from pyrelacs.ui.plots.calibration import CalibrationPlot
from pyrelacs.util.logging import config_logging
log = config_logging() log = config_logging()
_root = path(__file__).parent.parent _root = path(__file__).parent.parent
@ -51,6 +52,7 @@ class PyRelacs(QMainWindow):
self.threadpool = QThreadPool() self.threadpool = QThreadPool()
self.repros = Repro() self.repros = Repro()
self.buffers = DataBuffer(channels=1, samples=100_000)
self.text = QPlainTextEdit() self.text = QPlainTextEdit()
self.text.setReadOnly(True) self.text.setReadOnly(True)
@ -179,9 +181,6 @@ class PyRelacs(QMainWindow):
except uldaq.ul_exception.ULException as e: except uldaq.ul_exception.ULException as e:
log.error(f"Could not Connect to DAQ: {e}") log.error(f"Could not Connect to DAQ: {e}")
self.daq_connect_button.setDisabled(True) self.daq_connect_button.setDisabled(True)
else:
log.debug("Already handeld the error")
pass
def disconnect_dac(self): def disconnect_dac(self):
try: try: