Bug involving possible name conflict between return value and ouputs fixed
authorlbessard
Thu, 25 Sep 2008 10:29:47 +0200
changeset 279 2ad276084038
parent 278 e3ed4747086f
child 280 9ca192486f2f
Bug involving possible name conflict between return value and ouputs fixed
Viewer.py
plcopen/structures.py
--- a/Viewer.py	Thu Sep 25 10:28:24 2008 +0200
+++ b/Viewer.py	Thu Sep 25 10:29:47 2008 +0200
@@ -580,8 +580,9 @@
                         iec_path = "%s.%s.%s"%(self.InstancePath, block.GetName(), connectorname)
                     else:
                         if connectorname == "":
-                            connectorname = "OUT"
-                        iec_path = "%s.%s%d_%s"%(self.InstancePath, block.GetType(), block.GetId(), connectorname)
+                            iec_path = "%s.%s%d"%(self.InstancePath, block.GetType(), block.GetId())
+                        else:
+                            iec_path = "%s.%s%d_%s"%(self.InstancePath, block.GetType(), block.GetId(), connectorname)
                     if self.Controler.SubscribeDebugIECVariable(iec_path.upper(), wire) is not None:
                         self.Subscribed[wire] = iec_path.upper()
                     else:
--- a/plcopen/structures.py	Thu Sep 25 10:28:24 2008 +0200
+++ b/plcopen/structures.py	Thu Sep 25 10:29:47 2008 +0200
@@ -62,7 +62,7 @@
             for i, variable in enumerate(output_variables):
                 parameter = variable.getformalParameter()
                 if variable.getformalParameter() == "":
-                    variable_name = "%s%d_OUT"%(type, block.getlocalId())
+                    variable_name = "%s%d"%(type, block.getlocalId())
                 else:
                     variable_name = "%s%d_%s"%(type, block.getlocalId(), parameter)
                 if generator.Interface[-1][0] != "VAR" or generator.Interface[-1][1] or generator.Interface[-1][2] or generator.Interface[-1][3]:
@@ -94,7 +94,7 @@
                 output_info = (generator.TagName, "block", block.getlocalId(), "output", i)
                 output_name = variable.getformalParameter()
                 if variable.getformalParameter() == "":
-                    output_name = "%s%d_OUT"%(type, block.getlocalId())
+                    output_name = "%s%d"%(type, block.getlocalId())
                 else:
                     output_name = "%s%d_%s"%(type, block.getlocalId(), variable.getformalParameter())
                 return generator.ExtractModifier(variable, [(output_name, output_info)], output_info)