Closedown

This commit is contained in:
gac-S_Changer
2017-03-01 14:49:49 +01:00
parent 3fc988e04b
commit 06148c7818

View File

@@ -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)