From 63179ed835078ee87722e130538d298e6121fd4e Mon Sep 17 00:00:00 2001 From: Mark Wolfman Date: Thu, 13 Jun 2024 10:27:30 -0500 Subject: [PATCH] Plan windows no longer enable the run button automatically. The idea is that the QueueButton class will enable/disable these buttons based on the state of the queueserver. By default, they will remain disabled until the queueserver is ready. --- src/firefly/plans/line_scan.py | 2 +- src/firefly/plans/move_motor_window.py | 1 - src/firefly/plans/xafs_scan.py | 1 - src/firefly/tests/test_xafs_scan.py | 2 ++ 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/firefly/plans/line_scan.py b/src/firefly/plans/line_scan.py index e837071a..b7ec2c39 100644 --- a/src/firefly/plans/line_scan.py +++ b/src/firefly/plans/line_scan.py @@ -48,7 +48,7 @@ def customize_ui(self): self.ui.num_motor_spin_box.lineEdit().setReadOnly(True) self.ui.num_motor_spin_box.valueChanged.connect(self.update_regions) - self.ui.run_button.setEnabled(True) # for testing + # Connect signals for executing the plan self.ui.run_button.clicked.connect(self.queue_plan) # when selections of detectors changed update_total_time diff --git a/src/firefly/plans/move_motor_window.py b/src/firefly/plans/move_motor_window.py index 866cb75b..1ddbfbfd 100644 --- a/src/firefly/plans/move_motor_window.py +++ b/src/firefly/plans/move_motor_window.py @@ -41,7 +41,6 @@ def customize_ui(self): self.ui.num_motor_spin_box.lineEdit().setReadOnly(True) self.ui.num_motor_spin_box.valueChanged.connect(self.update_regions) - self.ui.run_button.setEnabled(True) # for testing self.ui.run_button.clicked.connect(self.queue_plan) def time_converter(self, total_seconds): diff --git a/src/firefly/plans/xafs_scan.py b/src/firefly/plans/xafs_scan.py index 4adc6aa0..452f28a1 100644 --- a/src/firefly/plans/xafs_scan.py +++ b/src/firefly/plans/xafs_scan.py @@ -257,7 +257,6 @@ def customize_ui(self): self.ui.pushButton.clicked.connect(self.reset_default_regions) # Button to actually execute the plan - self.ui.run_button.setEnabled(True) self.ui.run_button.clicked.connect(self.queue_plan) # connect checkboxes with all regions' check box diff --git a/src/firefly/tests/test_xafs_scan.py b/src/firefly/tests/test_xafs_scan.py index 07bd852d..56d35214 100644 --- a/src/firefly/tests/test_xafs_scan.py +++ b/src/firefly/tests/test_xafs_scan.py @@ -155,6 +155,7 @@ def check_item(item): return True # Click the run button and see if the plan is queued + display.ui.run_button.setEnabled(True) with qtbot.waitSignal( ffapp.queue_item_added, timeout=1000, check_params_cb=check_item ): @@ -262,6 +263,7 @@ def check_item(item): return True # Click the run button and see if the plan is queued + display.ui.run_button.setEnabled(True) with qtbot.waitSignal( ffapp.queue_item_added, timeout=1000, check_params_cb=check_item ):