Files
mxsc/script/motion/unmount.py
gac-S_Changer 5e798200ff
2018-06-01 17:27:13 +02:00

44 lines
891 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.state.assertReady()
robot.assert_cleared()
if hexiposi.homed == False:
raise Exception ("Hexiposi is not homed")
#Enabling
enable_motion()
set_hexiposi(segment)
if not force:
#Clearing for image processing
robot.move_park()
assert_img_in_cover_pos(segment)
location = robot.get_current_point()
try:
robot.get_gonio()
except:
#TODO: recover
raise
try:
robot.move_dewar_wait()
except:
#TODO: recover
raise
try:
robot.put_dewar(segment, puck, sample)
except:
#robot.move_dewar()
raise