Removed the received Event as waiting for forces every jog to be queued and dequeued
This commit is contained in:
parent
728880e49d
commit
eb79905581
1 changed files with 1 additions and 10 deletions
|
|
@ -42,7 +42,6 @@ class JogCommand:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialise a JogCommand."""
|
"""Initialise a JogCommand."""
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.received = threading.Event()
|
|
||||||
self.finished = threading.Event()
|
self.finished = threading.Event()
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
|
|
@ -336,7 +335,6 @@ class BaseStage(lt.Thing):
|
||||||
self._jog_thread.start()
|
self._jog_thread.start()
|
||||||
else:
|
else:
|
||||||
self._jog_queue.put(command)
|
self._jog_queue.put(command)
|
||||||
command.received.wait(1)
|
|
||||||
finally:
|
finally:
|
||||||
self._jog_lock.release()
|
self._jog_lock.release()
|
||||||
# The final wait happens after releasing the lock: this allows jog moves to
|
# 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.
|
"""Execute jog commands in a background thread.
|
||||||
|
|
||||||
This function is intended to be run in a background thread. It will look at
|
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
|
``self._jog_command`` when the ``self._jog_send`` event is set.
|
||||||
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
|
|
||||||
"""
|
"""
|
||||||
# Timeout for checking queue
|
# Timeout for checking queue
|
||||||
timeout = 0.1
|
timeout = 0.1
|
||||||
|
|
@ -363,8 +356,6 @@ class BaseStage(lt.Thing):
|
||||||
# prevent others using the stage while jogging.
|
# prevent others using the stage while jogging.
|
||||||
with self._hardware_lock:
|
with self._hardware_lock:
|
||||||
while command is not None:
|
while command is not None:
|
||||||
# Acknowledge the command
|
|
||||||
command.received.set()
|
|
||||||
if previous_command:
|
if previous_command:
|
||||||
# Notify the last command it's superseded
|
# Notify the last command it's superseded
|
||||||
previous_command.finished.set()
|
previous_command.finished.set()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue