Commit ccc583b7 authored by Laurent Claustre's avatar Laurent Claustre

Merge branch 'jog_message' into 'master'

add help messages in 'jog' for users.

See merge request !2034
parents eb0c367f c362aa9e
Pipeline #21204 failed with stages
in 52 minutes and 53 seconds
......@@ -361,7 +361,12 @@ class Motion:
def user_msg(self):
start_ = rounder(self.axis.tolerance, self.axis.position)
if self.type == "jog":
return f"Moving {self.axis.name} from {start_} until it is stopped, at constant velocity: {self.target_pos}"
msg = (
f"Moving {self.axis.name} from {start_} until it is stopped, at constant velocity: {self.target_pos}\n"
f"To stop it: {self.axis.name}.stop()"
)
return msg
else:
if self.user_target_pos is None:
return None
......@@ -1467,6 +1472,7 @@ class Axis:
def stop_one(controller, motions):
controller.stop_jog(motions[0].axis)
lprint(f"Motor {self.name} stopped at posision: {self.position}")
self._group_move = GroupMove()
self._group_move.move(
......
......@@ -823,5 +823,6 @@ def test_user_msg(roby):
roby.jog(10)
assert (
str(user_msg.value)
== "Moving roby from 0 until it is stopped, at constant velocity: 10.0"
== f"Moving roby from 0 until it is stopped, at constant velocity: 10.0\n"
f"To stop it: roby.stop()"
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment