From 7224708dd7c6dc2fd40285cd2cf83d509e2c99e6 Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Mon, 25 Jul 2016 11:57:06 +0200 Subject: [PATCH] Script execution --- script/local.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/script/local.py b/script/local.py index b47ce2f..7b5ba98 100644 --- a/script/local.py +++ b/script/local.py @@ -11,7 +11,21 @@ class RobotTCP(TcpDevice): def __init__(self, name, server): TcpDevice.__init__(self, name, server) - def run(self): - print "Done" + def execute(self, system, command, *argv): + #print "Done" + cmd = str(system) + "," + str(command) + for arg in argv: + cmd = cmd + "," + str(arg) + cmd = cmd + "\n\r" + ret = "" + try: + ret = robot.write(cmd) + finally: + getLogger().info(cmd + " ret = " + ret) + return ret -#add_device(RobotTCP("robot_tcp", "127.0.0.1:3333"), force = True) \ No newline at end of file + def mount(self, puck, sample): + return self.execute('1', '1', puck, sample) + + +add_device(RobotTCP("robot_tcp", "127.0.0.1:3333"), force = True) \ No newline at end of file