This commit is contained in:
@@ -38,7 +38,12 @@ class TellClient(PShellClient):
|
||||
if self.state != "Ready":
|
||||
raise Exception("Invalid state: " + str(self.state))
|
||||
|
||||
|
||||
def set_in_mount_position(self, value):
|
||||
self.eval("in_mount_position = " + str(value) +"&")
|
||||
|
||||
def is_in_mount_position(self):
|
||||
return self.eval("in_mount_position&").lower()=="true"
|
||||
|
||||
def get_samples_info(self):
|
||||
return json.loads(self.eval("get_samples_info()&"))
|
||||
|
||||
@@ -89,6 +94,11 @@ class TellClient(PShellClient):
|
||||
self.abort()
|
||||
self.eval("robot.stop_task()&")
|
||||
|
||||
def set_gonio_mount_position(homing = False):
|
||||
if homing:
|
||||
self.eval("home_fast_table()")
|
||||
self.eval("set_mount_position()")
|
||||
|
||||
def get_mounted_sample(self):
|
||||
ret = self.eval("get_setting('mounted_sample_position')&").strip()
|
||||
return None if len(ret)==0 else ret
|
||||
@@ -111,14 +121,21 @@ class TellClient(PShellClient):
|
||||
def get_detected_pucks(self):
|
||||
return self.eval("get_detected_pucks()&")
|
||||
|
||||
def set_pin_offset(self, value):
|
||||
self.eval("set_pin_offset(" + str(value)+ ")&")
|
||||
|
||||
def get_pin_offset(self):
|
||||
return self.eval("get_pin_offset()&")
|
||||
|
||||
def print_info(self):
|
||||
print ("State: " + str(self.get_state()))
|
||||
print ("Mounted Sample: " + str(self.get_mounted_sample()))
|
||||
print ("System Check: " + str(self.get_system_check()))
|
||||
print ("Mounted sample: " + str(self.get_mounted_sample()))
|
||||
print ("System check: " + str(self.get_system_check()))
|
||||
print ("Robot state: " + str(self.get_robot_state()))
|
||||
print ("Robot status: " + str(self.get_robot_status()))
|
||||
print ("Detected Pucks: " + str(self.get_detected_pucks()))
|
||||
print ("Detected pucks: " + str(self.get_detected_pucks()))
|
||||
print ("Pin offset: " + str(self.get_pin_offset()))
|
||||
print ("Mount position: " + str(self.is_in_mount_position()))
|
||||
print ("")
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -14,18 +14,20 @@ def info():
|
||||
|
||||
def help():
|
||||
print ("Commands: \n\thelp()\n\tinfo()\n\tmount(segment, puck, sample)\n\tunmount() \n\tdry() " \
|
||||
"\n\tscan(segment, puck, sample=None) \n\tmove_cold() \n\ttrash() \n\tabort()\n")
|
||||
"\n\tscan(segment, puck, sample=None) \n\tmove_cold() \n\ttrash() \n\tabort() " \
|
||||
"\n\tset_pin_offset(value)")
|
||||
|
||||
def set_gonio():
|
||||
pass
|
||||
def assert_transfer_allowed():
|
||||
if not tell.is_in_mount_position():
|
||||
raise Exception("Gonio is not in mount position")
|
||||
|
||||
def mount(segment, puck, sample):
|
||||
set_gonio()
|
||||
assert_transfer_allowed()
|
||||
cmd = tell.mount(segment, puck, sample, True, True, True)
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
def unmount():
|
||||
set_gonio()
|
||||
assert_transfer_allowed()
|
||||
cmd=tell.unmount(force=True)
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
@@ -51,6 +53,9 @@ def scan(segment, puck, sample=None):
|
||||
def abort():
|
||||
tell.abort_cmd()
|
||||
|
||||
def set_pin_offset(value):
|
||||
tell.set_pin_offset(value)
|
||||
|
||||
info()
|
||||
help()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user