This commit is contained in:
gac-S_Changer
2017-02-27 08:53:46 +01:00
parent 8612d75bf8
commit 5fae1834a9
4 changed files with 18 additions and 9 deletions

View File

@@ -179,10 +179,21 @@
tx = tx + toString(".4", t.ry) + "|"
tx = tx + toString(".4", t.rz) + "|"
break
case "get_help"
toNum(args[0], aux, ok)
if ok == true
tx = help(aux)
else
ex = "Invalid code: " + args[0]
endIf
break
default
//App specific
call onCommandTcp(cmd,args, tx, ex)
break
if ((len(tx) == 0) and (len(ex) == 0))
ex = "Invalid command: " + cmd
endIf
break
endSwitch
last_id = msg_id
endIf

View File

@@ -22,9 +22,6 @@
tx = "Mounting sample " + toString("", puck) + ":" + toString("", sample)
//taskCreate "mount",10,mount(puck, sample)
break
default
ex = "Invalid command: " + cmd
break
endSwitch
end]]></Code>
</Program>

View File

@@ -314,8 +314,11 @@ class RobotTCP(TcpDevice, Stoppable):
code = self.eval_int('taskStatus("' + str(name)+ '")')
#TODO: String assignments in $exec causes application to freeze
#status = self.eval_str('help(' + str(code)+ ')')
status = get_help.evaluate('get_help("' + str(code)+ '")')')
return code
if code== -1: status = "Stopped"
elif code== 0: status = "Paused"
elif code== 1: status = "Running"
else: status = self.execute('get_help', code)
return (code,status)
#Updating
def update_status(self):

View File

@@ -1,5 +1,4 @@
"""
#robot_tcp.task_create("simulateEvents",3, name = "test", priority = 20)
robot_tcp.task_create("simulateEvents",3, name = "test", priority = 20)
print robot_tcp.get_task_status("test")
print robot_tcp.get_task_status("tests")
@@ -10,7 +9,6 @@ print robot_tcp.get_task_status("test")
robot_tcp.task_kill("test")
print robot_tcp.get_task_status("test")
"""
print robot_tcp.is_powered()