Script execution
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
class RobotTCP(TcpDevice):
|
||||
class RobotTCP(TcpDevice, Stoppable):
|
||||
def __init__(self, name, server, timeout = 500, retries = 1):
|
||||
TcpDevice.__init__(self, name, server)
|
||||
self.timeout = timeout
|
||||
@@ -183,6 +183,20 @@ class RobotTCP(TcpDevice):
|
||||
self.working_mode = "invalid"
|
||||
return self.working_mode
|
||||
|
||||
#Motion control
|
||||
def stop(self):
|
||||
self.evaluate("stopMove()")
|
||||
|
||||
def resume(self):
|
||||
self.evaluate("restartMove()")
|
||||
|
||||
def resetMotion(self):
|
||||
self.evaluate("resetMotion()")
|
||||
|
||||
def wait_end_move(self):
|
||||
self.evaluate("waitEndMove()")
|
||||
|
||||
|
||||
#Updating
|
||||
def update_status(self):
|
||||
self.read_working_mode()
|
||||
@@ -197,9 +211,11 @@ class RobotTCP(TcpDevice):
|
||||
|
||||
def doUpdate(self):
|
||||
try:
|
||||
start = time.time()
|
||||
self.update_status()
|
||||
self.poll_events()
|
||||
self.setState(State.Ready)
|
||||
self.setState(State.Busy if self.status=="move" else State.Ready)
|
||||
print time.time() - start
|
||||
except:
|
||||
self.setState(State.Offline)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user