# HG changeset patch # User lbessard # Date 1208331915 -7200 # Node ID 8a1ed1959c69335a20ca47f5b1d73c7690769bb3 # Parent 85d721b33574b7dd43f4df08f53e71bed9010288 Pou execution order id management fixed Adding help for text when ST or IL transition created diff -r 85d721b33574 -r 8a1ed1959c69 plcopen/plcopen.py --- a/plcopen/plcopen.py Wed Apr 16 09:42:11 2008 +0200 +++ b/plcopen/plcopen.py Wed Apr 16 09:45:15 2008 +0200 @@ -583,6 +583,10 @@ transition = PLCOpenClasses["transitions_transition"]() transition.setname(name) transition.setbodyType(type) + if type == "ST": + transition.settext(":= ;") + elif type == "IL": + transition.settext("\tST\t%s"%name) self.transitions.appendtransition(transition) setattr(cls, "addtransition", addtransition) @@ -721,11 +725,11 @@ cls.currentExecutionOrderId = 0 def resetcurrentExecutionOrderId(self): - self.currentExecutionOrderId = 0 + object.__setattr__(self, "currentExecutionOrderId", 0) setattr(cls, "resetcurrentExecutionOrderId", resetcurrentExecutionOrderId) def getnewExecutionOrderId(self): - self.currentExecutionOrderId += 1 + object.__setattr__(self, "currentExecutionOrderId", self.currentExecutionOrderId + 1) return self.currentExecutionOrderId setattr(cls, "getnewExecutionOrderId", getnewExecutionOrderId) @@ -745,7 +749,7 @@ self.resetexecutionOrder() self.resetcurrentExecutionOrderId() for element in self.content["value"].getcontent(): - if isinstance(element["value"], PLCOpenClasses.get("fbdObjects_outVariable", None)) and element["value"].getExecutionOrderId() == 0: + if isinstance(element["value"], PLCOpenClasses.get("fbdObjects_outVariable", None)) and element["value"].getexecutionOrderId() == 0: connections = element["value"].connectionPointIn.getconnections() if connections and len(connections) == 1: self.compileelementExecutionOrder(connections[0])