Files
mxsc/script/motion/unmount.py
gac-S_Changer 4371d9c6d8
2018-06-29 11:27:20 +02:00

40 lines
940 B
Python

def unmount(segment, puck, sample, force=False):
"""
"""
print "unmount: ", segment, puck, sample, force
#Initial checks
assertValidAddress(segment, puck, sample)
robot.assert_no_task()
robot.reset_motion()
robot.wait_ready()
robot.assert_cleared()
#robot.assert_in_known_point()
hexiposi.assert_homed()
if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == False:
raise Exception("No pin detected on gonio")
#Enabling
enable_motion()
set_hexiposi(segment)
if not force:
visual_check_hexiposi(segment)
#location = robot.get_current_point()
if not robot.is_gonio():
robot.move_gonio()
smart_magnet.set_unmount_current()
try:
robot.get_gonio()
robot.move_dewar()
robot.put_dewar(segment, puck, sample)
finally:
smart_magnet.set_default_current()