Commit f33880fa authored by Matias Guijarro's avatar Matias Guijarro
Browse files

Merge branch 'motion_fixes' into 'master'

Motion fixes

See merge request !392
parents 856ebc37 f4a53b56
......@@ -121,8 +121,8 @@ class _Group(object):
for motion in motions:
motion.axis._start_move_task(motion.axis._do_handle_move,
motion, polling_time)
for motion in motions:
motion.axis.wait_move()
wait_motions = [gevent.spawn(motion.axis.wait_move) for motion in motions]
gevent.joinall(wait_motions,raise_error=True)
def rmove(self, *args, **kwargs):
kwargs["relative"] = True
......
......@@ -235,7 +235,7 @@ def __row(cols, fmt, sep=' '):
def __umove(*args, **kwargs):
kwargs['wait'] = False
group, motor_pos = __move(*args, **kwargs)
try:
with error_cleanup(group.stop):
motor_names = [axis.name for axis in motor_pos]
col_len = max(max(map(len, motor_names)), 8)
hfmt = '^{width}'.format(width=col_len)
......@@ -253,9 +253,6 @@ def __umove(*args, **kwargs):
row = __row_positions(positions, motor_pos, rfmt, sep=' ')
print_("\r" + row, end='', flush=True)
print_()
except KeyboardInterrupt:
print_("Ctrl+C pressed. Stopping all motors...")
group.stop()
return group, motor_pos
......@@ -266,11 +263,7 @@ def __move(*args, **kwargs):
for m, p in zip(__get_objects_iter(*args[::2]), args[1::2]):
motor_pos[m] = p
group = Group(*motor_pos.keys())
try:
group.move(motor_pos, wait=wait, relative=relative)
except KeyboardInterrupt:
print_("Ctrl+C pressed. Stopping all motors...")
group.stop()
group.move(motor_pos, wait=wait, relative=relative)
return group, motor_pos
......
Supports Markdown
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