This commit is contained in:
@@ -63,9 +63,9 @@ class TellClient(PShellClient):
|
||||
raise Exception(result["exception"] )
|
||||
return result["return"]
|
||||
|
||||
def mount(self, segment, puck, sample, force=False, read_dm=False):
|
||||
def mount(self, segment, puck, sample, force=False, read_dm=False, auto_unmount=False):
|
||||
#return self.run("motion/mount", pars= [segment,puck, sample, force, read_dm], background=True)
|
||||
return self.start_cmd("mount", segment, puck, sample, force, read_dm)
|
||||
return self.start_cmd("mount", segment, puck, sample, force, read_dm, auto_unmount)
|
||||
|
||||
def unmount(self, segment = None, puck = None, sample = None, force=False):
|
||||
return self.start_cmd("unmount", segment, puck, sample, force)
|
||||
@@ -76,7 +76,7 @@ class TellClient(PShellClient):
|
||||
def scan_puck(self, segment, puck, force=False):
|
||||
return self.start_cmd("scan_puck", segment, puck, force)
|
||||
|
||||
def dry(heat_time=30.0, speed=0.5, wait_cold = 30.0):
|
||||
def dry(self, heat_time=30.0, speed=0.5, wait_cold = 30.0):
|
||||
return self.start_cmd("dry", heat_time, speed, wait_cold)
|
||||
|
||||
def move_cold(self):
|
||||
|
||||
@@ -1,35 +1,55 @@
|
||||
import sys
|
||||
from TellClient import TellClient
|
||||
import os
|
||||
import code
|
||||
import readline
|
||||
import rlcompleter
|
||||
import atexit
|
||||
|
||||
tell = TellClient("http://Alexandres-MBP.psi.ch:8080")
|
||||
from TellClient import TellClient
|
||||
|
||||
tell = TellClient("http://PC12288:8080")
|
||||
|
||||
def info():
|
||||
tell.print_info()
|
||||
|
||||
def help():
|
||||
print ("Commands: help(), info(), mount(segment, puck, sample), unmount(), scan(segment, puck, sample=None), move_cold(), trash(), abort()\n")
|
||||
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")
|
||||
|
||||
def set_gonio():
|
||||
pass
|
||||
|
||||
def mount(segment, puck, sample):
|
||||
tell.mount(segment, puck, sample, True, True)
|
||||
|
||||
def move_cold():
|
||||
tell.mount(force=True)
|
||||
set_gonio()
|
||||
cmd = tell.mount(segment, puck, sample, True, True, True)
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
def unmount():
|
||||
tell.move_cold()
|
||||
set_gonio()
|
||||
cmd=tell.unmount(force=True)
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
def move_cold():
|
||||
cmd=tell.move_cold()
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
def trash():
|
||||
tell.trash()
|
||||
cmd=tell.trash()
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
def dry():
|
||||
cmd=tell.dry()
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
def scan(segment, puck, sample=None):
|
||||
if sample is None:
|
||||
cmd=tell.scan_puck(segment, puck, True)
|
||||
else:
|
||||
cmd=tell.scan_pin(segment, puck, sample, True)
|
||||
print (tell.wait_cmd(cmd))
|
||||
|
||||
def abort():
|
||||
tell.abort_cmd()
|
||||
|
||||
def scan(segment, puck, sample=None):
|
||||
if sample is None:
|
||||
tell.scan_pin(segment, puck, True)
|
||||
else:
|
||||
tell.scan_pin(segment, puck, sample, True)
|
||||
|
||||
info()
|
||||
help()
|
||||
@@ -38,5 +58,17 @@ help()
|
||||
# tell.print_info()
|
||||
#print ("", end='\r> ')
|
||||
|
||||
code.interact(local=locals())
|
||||
historyPath = os.path.expanduser("./.history")
|
||||
def save_history(historyPath=historyPath):
|
||||
readline.write_history_file(historyPath)
|
||||
if os.path.exists(historyPath):
|
||||
readline.read_history_file(historyPath)
|
||||
atexit.register(save_history)
|
||||
|
||||
#vars = globals(); vars.update(locals())
|
||||
vars =locals()
|
||||
readline.set_completer(rlcompleter.Completer(vars).complete)
|
||||
readline.parse_and_bind("tab: complete")
|
||||
|
||||
code.interact(banner = "", local=vars)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user