Files
mxsc/script/motion/unmount.py
gac-S_Changer bc21bb95a3
2018-09-17 16:56:55 +02:00

44 lines
1.1 KiB
Python

def unmount(segment, puck, sample, force=False):
"""
"""
print "unmount: ", segment, puck, sample, force
#Initial checks
assert_valid_address(segment, puck, sample)
assert_puck_detected(segment, puck)
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()
#TODO: Shuld check if smart magnet detection is off?
update_samples_info_sample_unmount(get_puck_name(segment, puck))
robot.move_dewar()
robot.put_dewar(segment, puck, sample)
finally:
smart_magnet.set_default_current()