This commit is contained in:
@@ -99,10 +99,10 @@ class SmartMagnet(DeviceBase):
|
||||
self.set_resting_current()
|
||||
|
||||
def is_resting_current(self):
|
||||
return self.get_current() != self.config.getFieldValue("restingCurrent")
|
||||
return self.get_current() == self.config.getFieldValue("restingCurrent")
|
||||
|
||||
|
||||
#Setting resting curren t to better detect sample
|
||||
#Setting resting current to better detect sample
|
||||
def enforce_sample_detection(self):
|
||||
if not self.is_resting_current():
|
||||
self.set_resting_current()
|
||||
|
||||
@@ -97,6 +97,7 @@ run("motion/move_aux")
|
||||
run("motion/get_aux")
|
||||
run("motion/put_aux")
|
||||
run("motion/dry")
|
||||
run("motion/trash")
|
||||
run("motion/homing_hexiposi")
|
||||
run("motion/scan_pin")
|
||||
run("motion/robot_recover")
|
||||
|
||||
18
script/motion/calibrate_tool.py
Normal file
18
script/motion/calibrate_tool.py
Normal file
@@ -0,0 +1,18 @@
|
||||
def calibrate_tool():
|
||||
"""
|
||||
"""
|
||||
print "calibrate_tool"
|
||||
|
||||
#Initial checks
|
||||
robot.assert_no_task()
|
||||
robot.reset_motion()
|
||||
robot.wait_ready()
|
||||
robot.assert_cleared()
|
||||
#robot.assert_in_known_point()
|
||||
|
||||
#Enabling
|
||||
enable_motion()
|
||||
|
||||
if not robot.is_gonio():
|
||||
robot.move_gonio()
|
||||
robot.put_gonio()
|
||||
@@ -9,7 +9,7 @@ def mount(segment, puck, sample, force=False, read_dm=False):
|
||||
|
||||
start = time.time()
|
||||
|
||||
is_aux = segment == AUX_SEGMENT
|
||||
is_aux = (segment == AUX_SEGMENT)
|
||||
puck_address = get_puck_address(puck)
|
||||
if puck_address is None:
|
||||
puck_obj = get_puck_obj_by_id(puck)
|
||||
@@ -46,8 +46,7 @@ def mount(segment, puck, sample, force=False, read_dm=False):
|
||||
robot.move_aux()
|
||||
|
||||
robot.get_aux(sample)
|
||||
robot.move_home()
|
||||
|
||||
|
||||
else:
|
||||
set_hexiposi(segment)
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@ RECOVER_DESC = "mRecovery"
|
||||
RECOVER_TOOL = TOOL_DEFAULT
|
||||
|
||||
known_segments = [ ("pHome", "pPark", 50), \
|
||||
("pHome", "pGonioH", 30), \
|
||||
("pHome", "pGonio", 30), \
|
||||
("pHome", "pScan", 25), \
|
||||
("pHome", "pHeater", 75), \
|
||||
("pHome", "pDewar", 10), \
|
||||
("pHome", "pHelium", 230), \
|
||||
("pGonioH", "pGonioG", 10), \
|
||||
("pGonio", "pGonioG", 10), \
|
||||
("pPark", "pHeat", 40), \
|
||||
("pHeater", "pHeatB", 10), \
|
||||
("pPark", "pAux", 30), \
|
||||
("pPark", "pAux", 50), \
|
||||
]
|
||||
|
||||
def get_dist_to_line(segment):
|
||||
|
||||
@@ -5,6 +5,7 @@ def scan_pin(segment, puck, sample, force=False):
|
||||
#Initial checks
|
||||
assert_valid_address(segment, puck, sample)
|
||||
assert_puck_detected(segment, puck)
|
||||
is_aux = (segment == AUX_SEGMENT)
|
||||
|
||||
robot.assert_no_task()
|
||||
robot.reset_motion()
|
||||
@@ -17,20 +18,31 @@ def scan_pin(segment, puck, sample, force=False):
|
||||
set_status("Scanning pin: " + str(pin_name))
|
||||
|
||||
enable_motion()
|
||||
set_hexiposi(segment)
|
||||
if not force:
|
||||
visual_check_hexiposi(segment)
|
||||
|
||||
if not robot.is_dewar():
|
||||
robot.move_dewar()
|
||||
|
||||
if is_aux:
|
||||
if not robot.is_aux():
|
||||
robot.move_aux()
|
||||
|
||||
robot.get_dewar(segment, puck, sample)
|
||||
|
||||
robot.get_aux(sample)
|
||||
else:
|
||||
set_hexiposi(segment)
|
||||
if not force:
|
||||
visual_check_hexiposi(segment)
|
||||
|
||||
if not robot.is_dewar():
|
||||
robot.move_dewar()
|
||||
|
||||
robot.get_dewar(segment, puck, sample)
|
||||
|
||||
(detected, dm) = move_scanner()
|
||||
update_samples_info_sample_scan(get_puck_name(segment, puck), sample, detected, dm)
|
||||
|
||||
robot.move_dewar()
|
||||
robot.put_dewar(segment, puck, sample)
|
||||
|
||||
if is_aux:
|
||||
robot.move_aux()
|
||||
robot.put_aux( sample)
|
||||
else:
|
||||
robot.move_dewar()
|
||||
robot.put_dewar(segment, puck, sample)
|
||||
ret = "Empty"
|
||||
if detected:
|
||||
if (dm is None) or (len(dm.strip())==0):
|
||||
@@ -41,6 +53,8 @@ def scan_pin(segment, puck, sample, force=False):
|
||||
|
||||
|
||||
def scan_puck(segment, puck, force=False):
|
||||
if segment == AUX_SEGMENT:
|
||||
raise Exception("Cannot scan auxiliary puck")
|
||||
ret = []
|
||||
for i in range(16):
|
||||
ret.append(scan_pin (segment, puck, i+1, force))
|
||||
|
||||
27
script/motion/trash.py
Normal file
27
script/motion/trash.py
Normal file
@@ -0,0 +1,27 @@
|
||||
def trash():
|
||||
"""
|
||||
"""
|
||||
print "trash"
|
||||
|
||||
#Initial checks
|
||||
robot.assert_no_task()
|
||||
robot.reset_motion()
|
||||
robot.wait_ready()
|
||||
robot.assert_cleared()
|
||||
#robot.assert_in_known_point()
|
||||
|
||||
#Enabling
|
||||
enable_motion()
|
||||
|
||||
robot.move_heater(to_bottom = False)
|
||||
robot.move_heater(to_bottom = True)
|
||||
|
||||
for i in range(3):
|
||||
robot.open_tool()
|
||||
time.sleep(1.0)
|
||||
robot.close_tool()
|
||||
|
||||
robot.move_heater(to_bottom = False)
|
||||
robot.move_home()
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ def unmount(segment = None, puck = None, sample = None, force=False):
|
||||
raise Exception("Mounted sample position is not defined")
|
||||
segment, puck , sample = pos[0:1], int(pos[1]), int(pos[2])
|
||||
print "Mounted sample position: ", segment, puck , sample
|
||||
is_aux = segment == AUX_SEGMENT
|
||||
is_aux = (segment == AUX_SEGMENT)
|
||||
|
||||
#Initial checks
|
||||
assert_valid_address(segment, puck, sample)
|
||||
@@ -49,10 +49,8 @@ def unmount(segment = None, puck = None, sample = None, force=False):
|
||||
robot.get_gonio()
|
||||
|
||||
if is_aux:
|
||||
robot.move_dewar()
|
||||
robot.move_aux()
|
||||
robot.put_aux( sample)
|
||||
robot.move_home()
|
||||
else:
|
||||
#TODO: Shuld check if smart magnet detection is off?
|
||||
update_samples_info_sample_unmount(get_puck_name(segment, puck), sample)
|
||||
|
||||
Reference in New Issue
Block a user