This commit is contained in:
gac-S_Changer
2018-05-22 16:07:56 +02:00
parent 5114bfaf3d
commit 05f982c86b
26 changed files with 595 additions and 221 deletions

16
script/motion/mount.py Normal file
View File

@@ -0,0 +1,16 @@
def mount(segment, puck, sample, unmount = False):
"""
"""
cmd = "firstmount" if unmount else "mount"
assertValidAddress(segment, puck, sample)
hexiposi.move(segment)
img_segment = get_img_cover_pos()
if img_segment != segment:
raise Excepton ("Image detection of cover does not match hexiposi: " + str(img_segment))
if type(segment) == str:
segment = ord(segment.upper()) - ord('A') +1
robot.start_task(cmd,segment, puck, sample)
#robot.mount(segment, puck, sample)

View File

@@ -68,6 +68,15 @@ def update_tool(tool=None, x_offset=0.0, y_offset=0.0, z_offset=0.0):
robot.set_tool_trsf(t, tool)
print "Updated " + (str(robot.tool) if (tool is None) else tool) + ": " + str(t)
robot.save_program()
def assertValidAddress(segment, puck, sample):
if type(segment) == str:
segment = ord(segment.upper()) - ord('A') +1
if segment<=0 or segment >6:
raise Excepton ("Invalid segment")
if puck<=0 or puck >5:
raise Excepton ("Invalid puck")
if sample<=0 or sample >16:
raise Excepton ("Invalid sample")

15
script/motion/unmount.py Normal file
View File

@@ -0,0 +1,15 @@
def unmount(segment, puck, sample):
"""
"""
assertValidAddress(segment, puck, sample)
hexiposi.move(segment)
img_segment = get_img_cover_pos()
if img_segment != segment:
raise Excepton ("Image detection of cover does not match hexiposi: " + str(img_segment))
if type(segment) == str:
segment = ord(segment.upper()) - ord('A') +1
robot.unmount(segment, puck, sample)