This commit is contained in:
@@ -256,6 +256,31 @@ def get_pin_offset():
|
||||
log("Error getting pin offset: " + str(sys.exc_info()[1]), False)
|
||||
return 0.0
|
||||
|
||||
def is_force_dry():
|
||||
try:
|
||||
dry_mount_counter = int(get_setting("dry_mount_counter"))
|
||||
except:
|
||||
dry_mount_counter = 0
|
||||
|
||||
try:
|
||||
dry_timespan = time.time() - float( get_setting("dry_timestamp"))
|
||||
except:
|
||||
dry_timespan = 3600
|
||||
|
||||
try:
|
||||
force_dry_mount_count = int(get_setting("force_dry_mount_count"))
|
||||
if force_dry_mount_count>0 and dry_mount_counter>=force_dry_mount_count:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
force_dry_timeout = float(get_setting("force_dry_timeout"))
|
||||
if force_dry_timeout>0 and dry_timespan>=force_dry_timeout:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
update()
|
||||
|
||||
@@ -29,6 +29,10 @@ def dry(heat_time=30.0, speed=0.5, wait_cold = 30.0):
|
||||
set_heater(False)
|
||||
set_air_stream(False)
|
||||
|
||||
|
||||
set_setting("dry_mount_counter", 0)
|
||||
set_setting("dry_timestamp",time.time())
|
||||
|
||||
if wait_cold >=0 :
|
||||
robot.move_cold()
|
||||
time.sleep(wait_cold)
|
||||
|
||||
@@ -46,6 +46,7 @@ def mount(segment, puck, sample, force=False, read_dm=False):
|
||||
robot.move_dewar()
|
||||
|
||||
robot.get_dewar(segment, puck, sample)
|
||||
|
||||
|
||||
set_setting("mounted_sample_position", get_sample_name(segment, puck, sample))
|
||||
|
||||
@@ -64,7 +65,18 @@ def mount(segment, puck, sample, force=False, read_dm=False):
|
||||
|
||||
smart_magnet.set_mount_current()
|
||||
|
||||
robot.put_gonio()
|
||||
robot.put_gonio()
|
||||
|
||||
|
||||
try:
|
||||
dry_mount_count = int(get_setting("dry_mount_counter"))
|
||||
except:
|
||||
dry_mount_count = 0
|
||||
set_setting("dry_mount_counter", dry_mount_count+1)
|
||||
#TODO: Auto-dry procedure
|
||||
if is_force_dry():
|
||||
pass
|
||||
|
||||
robot.move_dewar()
|
||||
mount_sample_detected = smart_magnet.check_mounted(idle_time=0.25, timeout = 1.0)
|
||||
#TODO: Should do on finally?
|
||||
|
||||
Reference in New Issue
Block a user