0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

WIP Image Widget cleanup for toolbar monitor selection and for main curve

This commit is contained in:
2025-04-09 00:58:03 +02:00
parent f24bc43837
commit da65d145d5
2 changed files with 11 additions and 1 deletions

View File

@ -913,10 +913,14 @@ class Image(PlotBase):
"""
Disconnect the image update signals and clean up the image.
"""
# Main Image cleanup
if self._main_image.config.monitor is not None:
self.disconnect_monitor(self._main_image.config.monitor)
self._main_image.config.monitor = None
self.plot_item.removeItem(self._main_image)
self._main_image = None
# Colorbar Cleanup
if self._color_bar:
if self.config.color_bar == "full":
self.cleanup_histogram_lut_item(self._color_bar)
@ -925,6 +929,10 @@ class Image(PlotBase):
self._color_bar.deleteLater()
self._color_bar = None
# Toolbar cleanup
self.toolbar.widgets["monitor"].widget.close()
self.toolbar.widgets["monitor"].widget.deleteLater()
super().cleanup()

View File

@ -28,7 +28,9 @@ class MonitorSelectionToolbarBundle(ToolbarBundle):
# 1) Device combo box
self.device_combo_box = DeviceComboBox(
device_filter=BECDeviceFilter.DEVICE, readout_priority_filter=[ReadoutPriority.ASYNC]
parent=self.target_widget,
device_filter=BECDeviceFilter.DEVICE,
readout_priority_filter=[ReadoutPriority.ASYNC],
)
self.device_combo_box.addItem("", None)
self.device_combo_box.setCurrentText("")