Closedown

This commit is contained in:
gac-S_Changer
2017-03-29 15:39:18 +02:00
parent b91f8d17db
commit 7fa3aa151d

View File

@@ -363,6 +363,7 @@ class RobotTCP(TcpDevice, Stoppable):
self.getLogger().info(ev)
self.on_event(ev)
if (self.current_task is not None) and (self.get_task_status(self.current_task)[0]<0):
print "Resetting", self.get_task_status(self.current_task)
self.current_task = None
self._update_state()
self.setCache({"powered": self.powered,
@@ -382,6 +383,7 @@ class RobotTCP(TcpDevice, Stoppable):
for task in (self.high_level_tasks + [program]):
if (task is not None) and (self.get_task_status(task)[0]>=0):
raise Exception("Ongoing high-level task: " + task)
print "Setting ", self.current_task
self.current_task = program
self.task_create(program, *args, **kwargs)