From 12746ae4aa2d60ef2f0dc36e49d25ba9f6dd8be9 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Sat, 17 Jan 2026 19:05:32 +0100 Subject: [PATCH] fix(scatter_waveform): modernization of scatter waveform settings dialog --- .../scatter_waveform/scatter_waveform.py | 17 +- .../settings/scatter_curve_setting.py | 6 +- .../scatter_curve_settings_horizontal.ui | 175 +++++++++++++----- 3 files changed, 142 insertions(+), 56 deletions(-) diff --git a/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py b/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py index 39736535..05278c18 100644 --- a/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py +++ b/bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py @@ -106,6 +106,13 @@ class ScatterWaveform(PlotBase): ) self._init_scatter_curve_settings() + + # Show toolbar bundles - only include scatter_waveform_settings if not in SIDE mode + shown_bundles = ["plot_export", "mouse_interaction", "roi", "axis_popup"] + if self.ui_mode != UIMode.SIDE: + shown_bundles.insert(0, "scatter_waveform_settings") + self.toolbar.show_bundles(shown_bundles) + self.update_with_scan_history(-1) ################################################################################ @@ -134,15 +141,9 @@ class ScatterWaveform(PlotBase): checkable=True, parent=self, ) - self.toolbar.components.add_safe("scatter_waveform_settings", scatter_curve_action) - self.toolbar.get_bundle("axis_popup").add_action("scatter_waveform_settings") + self.toolbar.add_action("scatter_waveform_settings", scatter_curve_action) scatter_curve_action.action.triggered.connect(self.show_scatter_curve_settings) - shown_bundles = self.toolbar.shown_bundles - if "performance" in shown_bundles: - shown_bundles.remove("performance") - self.toolbar.show_bundles(shown_bundles) - def show_scatter_curve_settings(self): """ Show the scatter curve settings dialog. @@ -158,7 +159,7 @@ class ScatterWaveform(PlotBase): window_title="Scatter Curve Settings", modal=False, ) - self.scatter_dialog.resize(620, 200) + self.scatter_dialog.resize(700, 240) # When the dialog is closed, update the toolbar icon and clear the reference self.scatter_dialog.finished.connect(self._scatter_dialog_closed) self.scatter_dialog.show() diff --git a/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_setting.py b/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_setting.py index 703266af..c0aa6c0d 100644 --- a/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_setting.py +++ b/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_setting.py @@ -86,17 +86,17 @@ class ScatterCurveSettings(SettingWidget): if hasattr(self.ui, "x_name"): self.ui.x_name.set_device(x_name) if hasattr(self.ui, "x_entry") and x_entry is not None: - self.ui.x_entry.setText(x_entry) + self.ui.x_entry.set_to_obj_name(x_entry) if hasattr(self.ui, "y_name"): self.ui.y_name.set_device(y_name) if hasattr(self.ui, "y_entry") and y_entry is not None: - self.ui.y_entry.setText(y_entry) + self.ui.y_entry.set_to_obj_name(y_entry) if hasattr(self.ui, "z_name"): self.ui.z_name.set_device(z_name) if hasattr(self.ui, "z_entry") and z_entry is not None: - self.ui.z_entry.setText(z_entry) + self.ui.z_entry.set_to_obj_name(z_entry) @SafeSlot() def accept_changes(self): diff --git a/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_settings_horizontal.ui b/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_settings_horizontal.ui index a61d2024..945c11d4 100644 --- a/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_settings_horizontal.ui +++ b/bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_settings_horizontal.ui @@ -6,8 +6,8 @@ 0 0 - 604 - 166 + 826 + 204 @@ -31,6 +31,13 @@ + + + + Qt::Orientation::Horizontal + + + @@ -46,9 +53,6 @@ - - - @@ -56,8 +60,22 @@ + + + + true + + + true + + + - + + + true + + @@ -75,9 +93,6 @@ - - - @@ -85,8 +100,22 @@ + + + + true + + + true + + + - + + + true + + @@ -111,11 +140,22 @@ - - - - + + + true + + + true + + + + + + + true + + @@ -126,76 +166,121 @@ - DeviceLineEdit - QLineEdit -
device_line_edit
+ DeviceComboBox + +
device_combo_box
+
+ + SignalComboBox + +
signal_combo_box
ToggleSwitch - QWidget +
toggle_switch
BECColorMapWidget - QWidget +
bec_color_map_widget
- - x_name - x_entry - y_name - y_entry - z_name - z_entry - x_name - textChanged(QString) + device_reset() x_entry - clear() + reset_selection() - 134 - 95 + 136 + 122 - 138 - 128 + 133 + 151 y_name - textChanged(QString) + device_reset() y_entry - clear() + reset_selection() - 351 - 91 + 412 + 122 - 349 - 121 + 409 + 151 z_name - textChanged(QString) + device_reset() z_entry - clear() + reset_selection() - 520 - 98 + 687 + 121 - 522 - 127 + 684 + 149 + + + + + x_name + currentTextChanged(QString) + x_entry + set_device(QString) + + + 152 + 123 + + + 151 + 151 + + + + + y_name + currentTextChanged(QString) + y_entry + set_device(QString) + + + 412 + 121 + + + 409 + 149 + + + + + z_name + currentTextChanged(QString) + z_entry + set_device(QString) + + + 687 + 121 + + + 684 + 149