PLCGenerator.py
changeset 1740 b789b695b5c6
parent 1739 ec153828ded2
child 1742 92932cd370a4
equal deleted inserted replaced
1739:ec153828ded2 1740:b789b695b5c6
   158                 datatype_def += [(basetype_name, (tagname, "base")),
   158                 datatype_def += [(basetype_name, (tagname, "base")),
   159                                  (" (", ()),
   159                                  (" (", ()),
   160                                  ("%s" % min_value, (tagname, "lower")),
   160                                  ("%s" % min_value, (tagname, "lower")),
   161                                  ("..", ()),
   161                                  ("..", ()),
   162                                  ("%s" % max_value, (tagname, "upper")),
   162                                  ("%s" % max_value, (tagname, "upper")),
   163                                  (")",())]
   163                                  (")", ())]
   164             # Data type is an enumerated type
   164             # Data type is an enumerated type
   165             elif basetype_content_type == "enum":
   165             elif basetype_content_type == "enum":
   166                 values = [[(value.getname(), (tagname, "value", i))]
   166                 values = [[(value.getname(), (tagname, "value", i))]
   167                           for i, value in enumerate(
   167                           for i, value in enumerate(
   168                               basetype_content.xpath("ppx:values/ppx:value",
   168                               basetype_content.xpath("ppx:values/ppx:value",
   519         self.InitialSteps = []
   519         self.InitialSteps = []
   520         self.ComputedBlocks = {}
   520         self.ComputedBlocks = {}
   521         self.ComputedConnectors = {}
   521         self.ComputedConnectors = {}
   522         self.ConnectionTypes = {}
   522         self.ConnectionTypes = {}
   523         self.RelatedConnections = []
   523         self.RelatedConnections = []
   524         self.SFCNetworks = {"Steps":{}, "Transitions":{}, "Actions":{}}
   524         self.SFCNetworks = {"Steps": {}, "Transitions": {}, "Actions": {}}
   525         self.SFCComputedBlocks = []
   525         self.SFCComputedBlocks = []
   526         self.ActionNumber = 0
   526         self.ActionNumber = 0
   527         self.Program = []
   527         self.Program = []
   528         self.Errors = errors
   528         self.Errors = errors
   529         self.Warnings = warnings
   529         self.Warnings = warnings
   896         body = pou.getbody()
   896         body = pou.getbody()
   897         if isinstance(body, ListType):
   897         if isinstance(body, ListType):
   898             body = body[0]
   898             body = body[0]
   899         body_content = body.getcontent()
   899         body_content = body.getcontent()
   900         body_type = body_content.getLocalTag()
   900         body_type = body_content.getLocalTag()
   901         if body_type in ["IL","ST"]:
   901         if body_type in ["IL", "ST"]:
   902             text = body_content.getanyText()
   902             text = body_content.getanyText()
   903             self.ParentGenerator.GeneratePouProgramInText(text.upper())
   903             self.ParentGenerator.GeneratePouProgramInText(text.upper())
   904             self.Program = [(ReIndentText(text, len(self.CurrentIndent)),
   904             self.Program = [(ReIndentText(text, len(self.CurrentIndent)),
   905                             (self.TagName, "body", len(self.CurrentIndent)))]
   905                             (self.TagName, "body", len(self.CurrentIndent)))]
   906         elif body_type == "SFC":
   906         elif body_type == "SFC":