1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-05 00:12:49 +01:00

fix: bugfix in cleanup of ScatterWaveform ScatterCurve; closes #520

This commit is contained in:
2025-04-23 16:41:47 +02:00
parent 8e64b65c2d
commit 1d091071e1
2 changed files with 6 additions and 4 deletions

View File

@@ -79,7 +79,8 @@ class ScatterCurve(BECConnector, pg.PlotDataItem):
name = config.label
self.parent_item = parent_item
self.parent_id = self.parent_item.gui_id
super().__init__(name=name, config=config, gui_id=gui_id, **kwargs)
object_name = name.replace("-", "_") if name else None
super().__init__(name=name, object_name=object_name, config=config, gui_id=gui_id, **kwargs)
self.data_z = None # color scaling needs to be cashed for changing colormap
self.apply_config()

View File

@@ -333,12 +333,13 @@ class ScatterWaveform(PlotBase):
# To have only one main curve
if self._main_curve is not None:
self.rpc_register.remove_rpc(self._main_curve)
self.rpc_register.broadcast()
self.plot_item.removeItem(self._main_curve)
self._main_curve.deleteLater()
self._main_curve = None
self._main_curve = ScatterCurve(
parent_item=self, config=config, gui_id=self.gui_id, name=config.label
)
self._main_curve = ScatterCurve(parent_item=self, config=config, name=config.label)
self.plot_item.addItem(self._main_curve)
self.sync_signal_update.emit()