From 6eb313fa76e559d62ecd8fa8849142b83817e47c Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Thu, 18 Jul 2024 15:24:29 +0200 Subject: [PATCH] fix(waveform_widget): adapted for BECWidget base class --- .../widgets/waveform/waveform_widget.py | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/bec_widgets/widgets/waveform/waveform_widget.py b/bec_widgets/widgets/waveform/waveform_widget.py index f6e06ead..dd457553 100644 --- a/bec_widgets/widgets/waveform/waveform_widget.py +++ b/bec_widgets/widgets/waveform/waveform_widget.py @@ -11,7 +11,7 @@ from qtpy.QtWidgets import QVBoxLayout, QWidget from bec_widgets.qt_utils.error_popups import SafeSlot, WarningPopupUtility from bec_widgets.qt_utils.settings_dialog import SettingsDialog from bec_widgets.qt_utils.toolbar import ModularToolBar, SeparatorAction -from bec_widgets.utils import BECConnector +from bec_widgets.utils.bec_widget import BECWidget from bec_widgets.widgets.figure import BECFigure from bec_widgets.widgets.figure.plots.axis_settings import AxisSettings from bec_widgets.widgets.figure.plots.waveform.waveform import Waveform1DConfig @@ -28,7 +28,7 @@ except ImportError: pd = None -class BECWaveformWidget(BECConnector, QWidget): +class BECWaveformWidget(BECWidget, QWidget): USER_ACCESS = [ "curves", "plot", @@ -149,29 +149,6 @@ class BECWaveformWidget(BECConnector, QWidget): dialog.resize(800, 600) dialog.show() - def _check_if_scans_have_same_x( - self, enabled=True, x_name_to_check: str = None - ) -> bool: # TODO probably not needed anymore - """ - Check if all scans have the same x-axis. - - Args: - enabled(bool): If True, check if all scans have the same x-axis. - x_name_to_check(str): The x-axis name to check. - - Returns: - bool: True if all scans have the same x-axis, False otherwise. - """ - if enabled and x_name_to_check is not None: - curves = self.waveform._curves_data["scan_segment"] - - for label, curve in curves.items(): - x_name = curve.config.signals.x.name - if x_name != x_name_to_check: - raise ValueError( - f"All scans must have the same x-axis. New curve provided with x-axis: {x_name}" - ) - ################################### # User Access Methods from Waveform ################################### @@ -576,10 +553,6 @@ class BECWaveformWidget(BECConnector, QWidget): self.client.shutdown() return super().cleanup() - def closeEvent(self, event): - self.cleanup() - QWidget().closeEvent(event) - def main(): # pragma: no cover