From 4f5448cf51a204e077af162c7f0aed1f1a60e57a Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 22 Oct 2024 15:04:23 +0200 Subject: [PATCH] fix(scan_control): scan args signal fixed to emit list instead of hardcoded structure --- .../alignment/alignment_1d/alignment_1d.ui | 202 ++++++++---------- .../widgets/scan_control/scan_control.py | 5 +- 2 files changed, 91 insertions(+), 116 deletions(-) diff --git a/bec_widgets/applications/alignment/alignment_1d/alignment_1d.ui b/bec_widgets/applications/alignment/alignment_1d/alignment_1d.ui index 16acc782..411afeaa 100644 --- a/bec_widgets/applications/alignment/alignment_1d/alignment_1d.ui +++ b/bec_widgets/applications/alignment/alignment_1d/alignment_1d.ui @@ -215,42 +215,18 @@ - - - 1 - 0 - - - - - 0 - 0 - - line_scan false - - false - - - false - true true - - false - - - false - @@ -440,24 +416,9 @@ - ToggleSwitch + DapComboBox QWidget -
toggle_switch
-
- - BECWaveformWidget - QWidget -
bec_waveform_widget
-
- - BECStatusBox - QWidget -
bec_status_box
-
- - WebsiteWidget - QWidget -
website_widget
+
dap_combo_box
StopButton @@ -465,44 +426,59 @@
stop_button
- LMFitDialog + WebsiteWidget QWidget -
lm_fit_dialog
-
- - PositionerGroup - QWidget -
positioner_group
-
- - ScanControl - QWidget -
scan_control
+
website_widget
BECQueue QWidget
bec_queue
+ + ScanControl + QWidget +
scan_control
+
+ + ToggleSwitch + QWidget +
toggle_switch
+
BECProgressBar QWidget
bec_progress_bar
- - DeviceComboBox - QComboBox -
device_combobox
-
DarkModeButton QWidget
dark_mode_button
- DapComboBox + PositionerGroup QWidget -
dap_combo_box
+
positioner_group
+
+ + BECWaveformWidget + QWidget +
bec_waveform_widget
+
+ + DeviceComboBox + QComboBox +
device_combobox
+
+ + LMFitDialog + QWidget +
lm_fit_dialog
+
+ + BECStatusBox + QWidget +
bec_status_box
@@ -514,12 +490,12 @@ toogle_roi_select(bool) - 529 - 728 + 1042 + 212 - 1099 - 96 + 1416 + 322 @@ -546,12 +522,12 @@ plot(QString) - 297 - 170 + 577 + 215 - 1099 - 201 + 1416 + 427 @@ -562,12 +538,12 @@ select_y_axis(QString) - 297 - 170 + 577 + 215 - 467 - 170 + 909 + 215 @@ -578,44 +554,12 @@ add_dap(QString,QString,QString) - 467 - 170 - - - 1099 - 221 - - - - - scan_control - scan_axis(QString,double,double) - bec_waveform_widget - set_x(QString) - - - 244 - 348 - - - 1140 - 491 - - - - - scan_control - scan_axis(QString,double,double) - dap_combo_box - select_x_axis(QString) - - - 244 - 322 - - 909 - 189 + 215 + + + 1416 + 447 @@ -626,12 +570,44 @@ set_positioners(QString) - 227 - 337 + 230 + 306 - 227 - 676 + 187 + 926 + + + + + scan_control + device_selected(QString) + bec_waveform_widget + set_x(QString) + + + 187 + 356 + + + 972 + 509 + + + + + scan_control + device_selected(QString) + dap_combo_box + select_x_axis(QString) + + + 187 + 356 + + + 794 + 202 diff --git a/bec_widgets/widgets/scan_control/scan_control.py b/bec_widgets/widgets/scan_control/scan_control.py index ba8a324c..01dc4352 100644 --- a/bec_widgets/widgets/scan_control/scan_control.py +++ b/bec_widgets/widgets/scan_control/scan_control.py @@ -45,7 +45,7 @@ class ScanControl(BECWidget, QWidget): scan_started = Signal() scan_selected = Signal(str) device_selected = Signal(str) - scan_axis = Signal(str, float, float) + scan_args = Signal(list) def __init__( self, @@ -457,8 +457,7 @@ class ScanControl(BECWidget, QWidget): def run_scan(self): """Starts the selected scan with the given parameters.""" args, kwargs = self.get_scan_parameters() - for device, start, stop in zip(*[iter(args)] * 3): - self.scan_axis.emit(device.name, start, stop) + self.scan_args.emit(args) scan_function = getattr(self.scans, self.comboBox_scan_selection.currentText()) if callable(scan_function): self.scan_started.emit()