Fix bug when using feedback loop in SFC program instead of jump
authorLaurent Bessard
Mon, 03 Dec 2012 10:09:17 +0100
changeset 889 ac18acb6917f
parent 888 baf5dbfd28f4
child 890 b3cafb73c5e9
Fix bug when using feedback loop in SFC program instead of jump
PLCGenerator.py
--- a/PLCGenerator.py	Sun Nov 25 19:32:53 2012 +0100
+++ b/PLCGenerator.py	Mon Dec 03 10:09:17 2012 +0100
@@ -1105,6 +1105,7 @@
                           "initial" : step.getinitialStep(), 
                           "transitions" : [], 
                           "actions" : []}
+            self.SFCNetworks["Steps"][step_name] = step_infos
             if step.connectionPointIn:
                 instances = []
                 connections = step.connectionPointIn.getconnections()
@@ -1130,7 +1131,6 @@
                     if instance in self.SFCNetworks["Transitions"].keys():
                         target_info = (self.TagName, "transition", instance.getlocalId(), "to", step_infos["id"])
                         self.SFCNetworks["Transitions"][instance]["to"].append([(step_name, target_info)])
-            self.SFCNetworks["Steps"][step_name] = step_infos
     
     def GenerateSFCJump(self, jump, pou):
         jump_target = jump.gettargetName()
@@ -1227,6 +1227,7 @@
                                 "priority": transition.getpriority(), 
                                 "from": [], 
                                 "to" : []}
+            self.SFCNetworks["Transitions"][transition] = transition_infos
             transitionValues = transition.getconditionContent()
             if transitionValues["type"] == "inline":
                 transition_infos["content"] = [("\n%s:= "%self.CurrentIndent, ()),
@@ -1273,7 +1274,6 @@
                 if step_name in self.SFCNetworks["Steps"].keys():
                     transition_infos["from"].append([(step_name, (self.TagName, "transition", transition.getlocalId(), "from", step.getlocalId()))])
                     self.SFCNetworks["Steps"][step_name]["transitions"].append(transition)
-            self.SFCNetworks["Transitions"][transition] = transition_infos
 
     def ComputeSFCStep(self, step_name):
         if step_name in self.SFCNetworks["Steps"].keys():