diff --git a/script/RobotTCP.py b/script/RobotTCP.py index 001a15b..57f8a76 100644 --- a/script/RobotTCP.py +++ b/script/RobotTCP.py @@ -261,12 +261,12 @@ class RobotTCP(TcpDevice, Stoppable): #Tool #This function can timeout since it synchronizes move. #Better check state before otherwise it can freeze the communication - def open(self, tool): + def open_tool(self, tool): return self.evaluate("open(" + tool + " )", timeout=3000) #This function can timeout since it synchronizes move. Better check state before #Better check state before otherwise it can freeze the communication - def close(self, tool): + def close_tool(self, tool): return self.evaluate("close(" + tool + " )", timeout=3000) #Arm position @@ -334,6 +334,8 @@ class RobotTCP(TcpDevice, Stoppable): def _update_state(self): #self.setState(State.Busy if self.status=="move" else State.Ready) + if self.state==State.Offline: + print "Communication resumed" if not self.settled: self.setState(State.Busy) if not self.empty: self.setState(State.Paused) else: self.setState(State.Ready) @@ -355,7 +357,8 @@ class RobotTCP(TcpDevice, Stoppable): self._update_state() #print time.time() - start except: - print >> sys.stderr, "Update error: " + str(sys.exc_info()[1]) + if self.state != State.Offline: + print >> sys.stderr, "Update error: " + str(sys.exc_info()[1]) self.setState(State.Offline)