Add marker to temporary variables created while generating ST code out of FBD, so that they can be recognized as such.
authorEdouard Tisserant
Wed, 14 Aug 2019 11:05:17 +0200
changeset 2629 caa43c61f90c
parent 2628 40c4449001df
child 2630 4d5c5e5871ab
Add marker to temporary variables created while generating ST code out of FBD, so that they can be recognized as such.
PLCGenerator.py
--- a/PLCGenerator.py	Mon Aug 12 13:06:11 2019 +0200
+++ b/PLCGenerator.py	Wed Aug 14 11:05:17 2019 +0200
@@ -1160,7 +1160,7 @@
                             if variable.getformalParameter() == "":
                                 variable_name = "%s%d" % (type, block.getlocalId())
                             else:
-                                variable_name = "%s%d_%s" % (type, block.getlocalId(), parameter)
+                                variable_name = "_TMP_%s%d_%s" % (type, block.getlocalId(), parameter)
                             if self.Interface[-1][0] != "VAR" or self.Interface[-1][1] is not None or self.Interface[-1][2]:
                                 self.Interface.append(("VAR", None, False, []))
                             if variable.connectionPointOut in self.ConnectionTypes:
@@ -1253,7 +1253,7 @@
                     if output_parameter == "":
                         output_name = "%s%d" % (type, block.getlocalId())
                     else:
-                        output_name = "%s%d_%s" % (type, block.getlocalId(), output_parameter)
+                        output_name = "_TMP_%s%d_%s" % (type, block.getlocalId(), output_parameter)
                     output_value = [(output_name, output_info)]
                 return self.ExtractModifier(output_variable, output_value, output_info)
             if block_infos["type"] == "functionBlock":