Apply suggestions from code review of branch jogging
Co-authored-by: Joe Knapper <joe.knapper@glasgow.ac.uk>
This commit is contained in:
parent
56f68db5ca
commit
ea3de5f45d
2 changed files with 3 additions and 6 deletions
|
|
@ -38,7 +38,7 @@ class JogCommand:
|
||||||
def __init__(self, displacement: Optional[Sequence[int]]) -> None:
|
def __init__(self, displacement: Optional[Sequence[int]]) -> None:
|
||||||
"""Initialise a JogCommand.
|
"""Initialise a JogCommand.
|
||||||
|
|
||||||
:param displacement: The distances as a sequence of the move for each axis.
|
:param displacement: The distances as a sequence of moves for each axis.
|
||||||
None for stop motion.
|
None for stop motion.
|
||||||
"""
|
"""
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
@ -347,7 +347,7 @@ class BaseStage(lt.Thing):
|
||||||
if not self._poll_moving():
|
if not self._poll_moving():
|
||||||
# The stage is no longer moving, return None
|
# The stage is no longer moving, return None
|
||||||
return None
|
return None
|
||||||
# If we reached here then the stage is still moving shorten timeout and
|
# If we reached here then the stage is still moving. Shorten timeout and
|
||||||
# check again.
|
# check again.
|
||||||
timeout = 0.1
|
timeout = 0.1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,7 @@ class DummyStage(BaseStage):
|
||||||
def _set_pos_during_move(
|
def _set_pos_during_move(
|
||||||
self, displacement: Sequence[int], fraction_complete: float
|
self, displacement: Sequence[int], fraction_complete: float
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set the instantaneous position from the fraction through a move.
|
"""Set the instantaneous position based on the completed fraction of an ongoing move."""
|
||||||
|
|
||||||
If this is the final set, also update hardware position
|
|
||||||
"""
|
|
||||||
self.instantaneous_position = {
|
self.instantaneous_position = {
|
||||||
ax: self._hardware_position[ax] + int(fraction_complete * disp)
|
ax: self._hardware_position[ax] + int(fraction_complete * disp)
|
||||||
for ax, disp in zip(self.axis_names, displacement, strict=True)
|
for ax, disp in zip(self.axis_names, displacement, strict=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue