Remove an method from BaseStage that is not hardware specific
This commit is contained in:
parent
8a77c09305
commit
96ff243239
1 changed files with 11 additions and 16 deletions
|
|
@ -268,22 +268,17 @@ class BaseStage(lt.Thing):
|
||||||
"""
|
"""
|
||||||
if stop:
|
if stop:
|
||||||
self._send_jog_command(JogCommand(None))
|
self._send_jog_command(JogCommand(None))
|
||||||
|
return
|
||||||
|
|
||||||
|
hardware_moves = self._apply_axis_direction(kwargs)
|
||||||
|
move = [hardware_moves.get(axis, 0) for axis in self.axis_names]
|
||||||
|
if all(ax == 0 for ax in move):
|
||||||
|
self.logger.warning(
|
||||||
|
"Requested jog movement is is empty. Sending STOP instead."
|
||||||
|
)
|
||||||
|
self._send_jog_command(JogCommand(None))
|
||||||
else:
|
else:
|
||||||
self._hardware_jog(**self._apply_axis_direction(kwargs))
|
self._send_jog_command(JogCommand(move))
|
||||||
|
|
||||||
def _hardware_jog(self, **kwargs: int) -> None:
|
|
||||||
"""Make a relative move that may be interrupted by a future ``jog``.
|
|
||||||
|
|
||||||
This function uses hardware coordinates, ``jog`` is the public wrapper that
|
|
||||||
applies any neecessary transform and then calls this function. See the
|
|
||||||
docs for that function for more explanation.
|
|
||||||
|
|
||||||
See `_jog_loop` for an explanation of the mechanism.
|
|
||||||
|
|
||||||
:param kwargs: Keyword arguments should be axis names.
|
|
||||||
"""
|
|
||||||
move = [kwargs.get(axis, 0) for axis in self.axis_names]
|
|
||||||
self._send_jog_command(JogCommand(move))
|
|
||||||
|
|
||||||
def _send_jog_command(self, command: JogCommand) -> None:
|
def _send_jog_command(self, command: JogCommand) -> None:
|
||||||
"""Send a jog command to the background jog thread.
|
"""Send a jog command to the background jog thread.
|
||||||
|
|
@ -304,7 +299,7 @@ class BaseStage(lt.Thing):
|
||||||
# Make sure the queue exists.
|
# Make sure the queue exists.
|
||||||
# Check the background thread is running, and restart it if not.
|
# Check the background thread is running, and restart it if not.
|
||||||
if self._jog_thread is None or not self._jog_thread.is_alive():
|
if self._jog_thread is None or not self._jog_thread.is_alive():
|
||||||
self.logger.info("Starting background thread for jog commands")
|
self.logger.debug("Starting background thread for jog commands")
|
||||||
self._jog_queue = JogQueue()
|
self._jog_queue = JogQueue()
|
||||||
self._jog_thread = threading.Thread(
|
self._jog_thread = threading.Thread(
|
||||||
target=self._jog_loop, args=(command,)
|
target=self._jog_loop, args=(command,)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue