mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
WIP plot widgets data items inheritance order fixed
This commit is contained in:
@ -125,13 +125,13 @@ class Image(PlotBase):
|
||||
popups: bool = True,
|
||||
**kwargs,
|
||||
):
|
||||
self._main_image = ImageItem(parent_image=self)
|
||||
self._color_bar = None
|
||||
if config is None:
|
||||
config = ImageConfig(widget_class=self.__class__.__name__)
|
||||
super().__init__(
|
||||
parent=parent, config=config, client=client, gui_id=gui_id, popups=popups, **kwargs
|
||||
)
|
||||
self._main_image = ImageItem(parent_image=self)
|
||||
|
||||
# For PropertyManager identification
|
||||
self.setObjectName("Image")
|
||||
|
@ -84,7 +84,6 @@ class ImageItem(BECConnector, pg.ImageItem):
|
||||
else:
|
||||
self.config = config
|
||||
pg.ImageItem.__init__(self, parent=parent)
|
||||
BECConnector.__init__(self, config=config, gui_id=gui_id)
|
||||
|
||||
self.parent_image = parent_image
|
||||
|
||||
@ -95,6 +94,11 @@ class ImageItem(BECConnector, pg.ImageItem):
|
||||
# Image processor will handle any setting of data
|
||||
self._image_processor = ImageProcessor(config=self.config.processing)
|
||||
|
||||
BECConnector.__init__(self, config=config, gui_id=gui_id)
|
||||
|
||||
def parent(self):
|
||||
return self.parent_image
|
||||
|
||||
def set_data(self, data: np.ndarray):
|
||||
self.raw_data = data
|
||||
self._process_image()
|
||||
|
@ -78,11 +78,13 @@ class ScatterCurve(BECConnector, pg.PlotDataItem):
|
||||
self.config = config
|
||||
name = config.label
|
||||
pg.PlotDataItem.__init__(self, **kwargs, name=name)
|
||||
BECConnector.__init__(self, config=config, gui_id=gui_id)
|
||||
self.parent_item = parent_item
|
||||
self.parent = parent_item
|
||||
self.data_z = None # color scaling needs to be cashed for changing colormap
|
||||
self.apply_config()
|
||||
BECConnector.__init__(self, config=config, gui_id=gui_id)
|
||||
|
||||
def parent(self):
|
||||
return self.parent_item
|
||||
|
||||
def apply_config(self, config: dict | ScatterCurveConfig | None = None, **kwargs) -> None:
|
||||
"""
|
||||
|
@ -111,8 +111,6 @@ class ScatterWaveform(PlotBase):
|
||||
parent=parent, config=config, client=client, gui_id=gui_id, popups=popups, **kwargs
|
||||
)
|
||||
self._main_curve = ScatterCurve(parent=self, parent_item=self)
|
||||
# self._main_curve = ScatterCurve(parent_item=self)
|
||||
# For PropertyManager identification
|
||||
|
||||
# Specific GUI elements
|
||||
self.scatter_dialog = None
|
||||
|
Reference in New Issue
Block a user