GUI: only initialise workflow SSE client if test flag is True. WIP

This commit is contained in:
appleb_m committed 2026-03-31 13:50:15 +02:00
1 parent d7579c4a5f
commit 5b81f7388a
1 file changed
+28 -25
+28 -25
View File
@@ -63,6 +63,7 @@ from aare.gui.panels.automation_panel import WorkflowPanel
from aare.gui.threads.workflow_sse_client import WorkflowSSEClient
logger = setup_logger("aareGUI")
WORKFLOW_SSE_TEST = False
class MainWindow(QMainWindow):
sample_geometry = Signal(SampleGeometryModel)
@@ -544,7 +545,8 @@ class MainWindow(QMainWindow):
register_tutorials(self, self.tutorial_manager)
# Workflow SSE client
if self.__base_url is not None:
if self.__base_url is not None and WORKFLOW_SSE_TEST is True:
self.workflow_sse = WorkflowSSEClient(self.__base_url, self.__token, self)
self.workflow_sse.runtime_changed.connect(self.workflow_panel.update_runtime)
self.workflow_sse.control_changed.connect(self.workflow_panel.update_control)
@@ -556,33 +558,34 @@ class MainWindow(QMainWindow):
self.workflow_sse = None
# Connect workflow panel signals to DAQ worker
self.workflow_panel.request_queue_refresh.connect(self.daq.workflow_load_queue)
self.workflow_panel.request_add_sample.connect(self.daq.workflow_add_sample)
self.workflow_panel.request_add_samples.connect(self.daq.workflow_add_samples)
self.workflow_panel.request_delete_item.connect(self.daq.workflow_delete_item)
self.workflow_panel.request_move_item.connect(self.daq.workflow_move_item)
self.workflow_panel.request_clear_queue.connect(self.daq.workflow_clear_queue)
self.workflow_panel.request_start_item.connect(self.daq.workflow_start_item)
self.workflow_panel.request_next_step.connect(self.daq.workflow_next_step)
self.workflow_panel.request_pause.connect(self.daq.workflow_pause)
self.workflow_panel.request_resume.connect(self.daq.workflow_resume)
self.workflow_panel.request_abort.connect(self.daq.workflow_abort)
self.workflow_panel.request_skip.connect(self.daq.workflow_skip)
self.workflow_panel.request_start_automation.connect(self.daq.workflow_start_automation)
self.workflow_panel.request_stop_automation.connect(self.daq.workflow_stop_automation)
self.workflow_panel.request_skip_sample.connect(self.daq.workflow_skip_sample)
if WORKFLOW_SSE_TEST is True:
self.workflow_panel.request_queue_refresh.connect(self.daq.workflow_load_queue)
self.workflow_panel.request_add_sample.connect(self.daq.workflow_add_sample)
self.workflow_panel.request_add_samples.connect(self.daq.workflow_add_samples)
self.workflow_panel.request_delete_item.connect(self.daq.workflow_delete_item)
self.workflow_panel.request_move_item.connect(self.daq.workflow_move_item)
self.workflow_panel.request_clear_queue.connect(self.daq.workflow_clear_queue)
self.workflow_panel.request_start_item.connect(self.daq.workflow_start_item)
self.workflow_panel.request_next_step.connect(self.daq.workflow_next_step)
self.workflow_panel.request_pause.connect(self.daq.workflow_pause)
self.workflow_panel.request_resume.connect(self.daq.workflow_resume)
self.workflow_panel.request_abort.connect(self.daq.workflow_abort)
self.workflow_panel.request_skip.connect(self.daq.workflow_skip)
self.workflow_panel.request_start_automation.connect(self.daq.workflow_start_automation)
self.workflow_panel.request_stop_automation.connect(self.daq.workflow_stop_automation)
self.workflow_panel.request_skip_sample.connect(self.daq.workflow_skip_sample)
# DAQ worker -> workflow panel
self.daq.workflow_queue_loaded.connect(self.workflow_panel.update_queue)
self.daq.workflow_item_updated.connect(self.workflow_panel.update_current_item)
# DAQ worker -> workflow panel
self.daq.workflow_queue_loaded.connect(self.workflow_panel.update_queue)
self.daq.workflow_item_updated.connect(self.workflow_panel.update_current_item)
# Forward sample list to workflow panel for "Add All" feature
self.daq.spreadsheet.connect(
lambda slist: self.workflow_panel.update_available_samples(slist.s)
)
# Forward sample list to workflow panel for "Add All" feature
self.daq.spreadsheet.connect(
lambda slist: self.workflow_panel.update_available_samples(slist.s)
)
# Initial load
QTimer.singleShot(1000, self.daq.workflow_load_queue)
# Initial load
QTimer.singleShot(1000, self.daq.workflow_load_queue)
@Slot(QPixmap)
def _on_samcam_prediction_pixmap(self, pix: QPixmap) -> None: