From eb799055813b212174ff4ac855a3b81c50b38dc6 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Fri, 13 Feb 2026 16:36:14 +0000 Subject: [PATCH] Removed the received Event as waiting for forces every jog to be queued and dequeued --- .../things/stage/__init__.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/openflexure_microscope_server/things/stage/__init__.py b/src/openflexure_microscope_server/things/stage/__init__.py index 08762c1e..74a43429 100644 --- a/src/openflexure_microscope_server/things/stage/__init__.py +++ b/src/openflexure_microscope_server/things/stage/__init__.py @@ -42,7 +42,6 @@ class JogCommand: def __init__(self) -> None: """Initialise a JogCommand.""" super().__init__() - self.received = threading.Event() self.finished = threading.Event() def __repr__(self) -> str: @@ -336,7 +335,6 @@ class BaseStage(lt.Thing): self._jog_thread.start() else: self._jog_queue.put(command) - command.received.wait(1) finally: self._jog_lock.release() # The final wait happens after releasing the lock: this allows jog moves to @@ -348,12 +346,7 @@ class BaseStage(lt.Thing): """Execute jog commands in a background thread. This function is intended to be run in a background thread. It will look at - ``self._jog_command`` when the ``self._jog_send`` event is set, and signal that - the command is being processed with ``self._jog_received``. - - If no new command is received before the current command finishes, the thread - will terminate, and ``self._jog_received`` will be set again. This means that - it should be safe to + ``self._jog_command`` when the ``self._jog_send`` event is set. """ # Timeout for checking queue timeout = 0.1 @@ -363,8 +356,6 @@ class BaseStage(lt.Thing): # prevent others using the stage while jogging. with self._hardware_lock: while command is not None: - # Acknowledge the command - command.received.set() if previous_command: # Notify the last command it's superseded previous_command.finished.set()