mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
WIP fix curve parent passing
This commit is contained in:
@ -90,16 +90,20 @@ class Curve(BECConnector, pg.PlotDataItem):
|
||||
self.config = config
|
||||
else:
|
||||
self.config = config
|
||||
self.parent_item = parent_item
|
||||
self.parent_id = self.parent_item.gui_id
|
||||
super().__init__(config=config, gui_id=gui_id)
|
||||
pg.PlotDataItem.__init__(self, name=name)
|
||||
|
||||
self.parent_item = parent_item
|
||||
self.apply_config()
|
||||
self.dap_params = None
|
||||
self.dap_summary = None
|
||||
if kwargs:
|
||||
self.set(**kwargs)
|
||||
|
||||
def parent(self):
|
||||
return self.parent_item
|
||||
|
||||
def apply_config(self, config: dict | CurveConfig | None = None, **kwargs) -> None:
|
||||
"""
|
||||
Apply the configuration to the curve.
|
||||
|
@ -10,7 +10,15 @@ from bec_lib import bec_logger, messages
|
||||
from bec_lib.endpoints import MessageEndpoints
|
||||
from pydantic import Field, ValidationError, field_validator
|
||||
from qtpy.QtCore import QTimer, Signal
|
||||
from qtpy.QtWidgets import QDialog, QHBoxLayout, QMainWindow, QVBoxLayout, QWidget
|
||||
from qtpy.QtWidgets import (
|
||||
QApplication,
|
||||
QDialog,
|
||||
QHBoxLayout,
|
||||
QMainWindow,
|
||||
QPushButton,
|
||||
QVBoxLayout,
|
||||
QWidget,
|
||||
)
|
||||
|
||||
from bec_widgets.utils import ConnectionConfig
|
||||
from bec_widgets.utils.bec_signal_proxy import BECSignalProxy
|
||||
@ -121,16 +129,23 @@ class Waveform(PlotBase):
|
||||
client=None,
|
||||
gui_id: str | None = None,
|
||||
popups: bool = True,
|
||||
name=None,
|
||||
**kwargs,
|
||||
):
|
||||
if config is None:
|
||||
config = WaveformConfig(widget_class=self.__class__.__name__)
|
||||
super().__init__(
|
||||
parent=parent, config=config, client=client, gui_id=gui_id, popups=popups, **kwargs
|
||||
parent=parent,
|
||||
config=config,
|
||||
client=client,
|
||||
gui_id=gui_id,
|
||||
popups=popups,
|
||||
name=name,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
# For PropertyManager identification
|
||||
self.setObjectName("Waveform")
|
||||
# self.setObjectName("Waveform")
|
||||
|
||||
# Curve data
|
||||
self._sync_curves = []
|
||||
|
Reference in New Issue
Block a user