Second guiding tool

This commit is contained in:
gac-S_Changer
2021-08-03 15:18:30 +02:00
parent ac1719b6af
commit 4239b7fb57
149 changed files with 3566 additions and 3606 deletions

View File

@@ -62,21 +62,11 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
assert_mount_position()
do_unmount = False
print "%4.1f s asserted " % (tg() - t1,)
# detect sample before moving to cold
if smart_magnet.get_supress() == True:
smart_magnet.set_supress(False)
time.sleep(0.2)
sample_det = smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0)
Controller.getInstance().logEvent("Sample Detection", str(sample_det))
print "%4.1f s SMC checked" % (tg() - t1,)
mounting_in_same_segment = False
try:
if sample_det == True:
if previous_mounted is not None:
if was_warm and previous_segment in COLD_SEGMENTS:
print " was warm previous %s %s %s" % (previous_segment, COLD_SEGMENTS, previous_mounted)
robot.move_cold()
@@ -91,9 +81,6 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
print "%4.1f s ....done" % (tg() - t1,)
do_unmount = True
if sample_det == True:
raise Exception("Pin detected on gonio")
if is_normal and not robot.is_cold():
print "mount():83 needs_chilling"
@@ -130,7 +117,7 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
if (not robot.is_dewar()) and (not mounting_in_same_segment):
robot.move_dewar()
print "%4.1f s get_dewar" % (tg() - t1,)
robot.get_dewar(segment, puck, sample, mounting_in_same_segment=mounting_in_same_segment)
robot.get_dewar(segment, puck, sample)
if read_dm:
@@ -192,22 +179,14 @@ def mount(segment, puck, sample, force=False, read_dm=False, auto_unmount=False)
else:
robot.move_cold()
mount_sample_detected = smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0)
Controller.getInstance().logEvent("Sample Detection", str(mount_sample_detected))
update_samples_info_sample_mount(get_puck_name(segment, puck), sample, mount_sample_detected, mount_sample_id)
if mount_sample_detected == False:
raise Exception("No pin detected on gonio")
update_samples_info_sample_mount(get_puck_name(segment, puck), sample, True, mount_sample_id)
if is_force_dry():
smart_magnet.set_default_current()
print "%4.1f Auto dry async" % (tg() - t1,)
log("Starting auto dry", False)
set_exec_pars(then = "dry()")
set_setting("mounted_sample_position", get_sample_name(segment, puck, sample))
return [mount_sample_detected, mount_sample_id]
return [True, mount_sample_id]
finally:
print "%4.1f s magnet suppress/default current" % (tg() - t1,)
smart_magnet.set_default_current()
smart_magnet.set_supress(True)
pass