From 2719d49eb0d0e242c145bed12dc9e291e52ac18b Mon Sep 17 00:00:00 2001
From: wendtalexander <wendtalexander@protonmail.com>
Date: Tue, 1 Oct 2024 12:04:47 +0200
Subject: [PATCH] [refacorting] adding DataBuffer

---
 pyrelacs/ui/mainwindow.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

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