diff --git a/src/firefly/controller.py b/src/firefly/controller.py index 73384148..45433299 100644 --- a/src/firefly/controller.py +++ b/src/firefly/controller.py @@ -11,7 +11,7 @@ from ophydregistry import Registry from qasync import asyncSlot from qtpy import QtCore, QtWidgets -from qtpy.QtCore import Signal +from qtpy.QtCore import Signal, Slot from qtpy.QtGui import QIcon, QKeySequence from qtpy.QtWidgets import QAction, QErrorMessage @@ -318,9 +318,6 @@ def setup_window_actions(self): icon=qta.icon("mdi.sine-wave"), ) - def update_queue_controls(self, status): - print(status) - @asyncSlot(QAction) async def finalize_new_window(self, action): """Slot for providing new windows for after a new window is created.""" @@ -609,6 +606,7 @@ def start(self): def update_devices_allowed(self, devices): pass + @Slot(str) def enable_queue_controls(self, re_state): """Enable/disable the navbar buttons that control the queue. @@ -617,7 +615,6 @@ def enable_queue_controls(self, re_state): engine is already running. """ - print(f"New re_state: {re_state}") queue_actions = self.actions.queue_controls # Decide which signals to enable unknown_re_state = re_state is None or re_state.strip() == "" diff --git a/src/firefly/queue_client.py b/src/firefly/queue_client.py index 68c89b98..3bd85cdb 100644 --- a/src/firefly/queue_client.py +++ b/src/firefly/queue_client.py @@ -72,6 +72,7 @@ def queue_status(status_mapping: Mapping[str, str] = {}): for key, val in status.items() if key not in last_status or val != last_status[key] } + log.debug(f"Received updated queue status: {status_diff}") updated_params = { status_mapping[key]: (val,) for key, val in status_diff.items() @@ -122,7 +123,7 @@ def __init__(self, *args, api, **kwargs): self.timer = QTimer() self.timer.timeout.connect(self.update) # Create the generator to keep track of the queue states - self.status = queue_status() + self.status = queue_status(status_mapping=self.parameter_mapping) next(self.status) # Prime the generator def start(self): @@ -242,6 +243,8 @@ async def update(self): new_status = await self.queue_status() signals_changed = self.status.send(new_status) # Check individual components of the status if they've changed + if signals_changed != {}: + log.debug(f"Emitting changed signals: {signals_changed}") for signal_name, args in signals_changed.items(): if hasattr(self, signal_name): signal = getattr(self, signal_name)