This commit is contained in:
gac-S_Changer
2018-09-21 16:51:33 +02:00
parent 7deba9eee4
commit ea1b2bad2a
8 changed files with 131 additions and 64 deletions

View File

@@ -13,7 +13,7 @@ def unmount(segment = None, puck = None, sample = None, force=False):
#Initial checks
assert_valid_address(segment, puck, sample)
assert_puck_detected(segment, puck)
robot.assert_no_task()
robot.reset_motion()
robot.wait_ready()
@@ -21,25 +21,27 @@ def unmount(segment = None, puck = None, sample = None, force=False):
#robot.assert_in_known_point()
hexiposi.assert_homed()
if smart_magnet.check_mounted(idle_time=0.5, timeout = 3.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:
smart_magnet.enforce_sample_detection()
if smart_magnet.check_mounted(idle_time=0.5, timeout = 3.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()
robot.get_gonio()
#TODO: Shuld check if smart magnet detection is off?
update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)