Files
mxsc/script/motion/mount.py
gac-S_Changer 51858eb819
2018-06-22 11:09:37 +02:00

42 lines
1.1 KiB
Python

def mount(segment, puck, sample, force=False):
"""
"""
print "mount: ", segment, puck, sample, force
start = time.time()
#Initial checks
assertValidAddress(segment, puck, sample)
robot.assert_no_task()
robot.reset_motion()
robot.state.assertReady()
robot.assert_cleared()
#robot.assert_in_known_point()
hexiposi.assert_homed()
if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == True:
raise Exception("Pin detected on gonio")
#location = robot.get_current_point()
#Enabling
enable_motion()
set_hexiposi(segment)
if not force:
visual_check_hexiposi(segment)
if not robot.is_dewar():
robot.move_dewar()
robot.get_dewar(segment, puck, sample)
robot.move_gonio()
smart_magnet.set_mount_current()
try:
robot.put_gonio()
robot.move_dewar()
if smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0) == False:
raise Exception("No pin detected on gonio")
finally:
smart_magnet.set_default_current()