PLCControler.py
changeset 1878 fb73a6b6622d
parent 1875 62aaabbf8812
child 1879 4d81c3bcac82
equal deleted inserted replaced
1877:da5f1fa46f2b 1878:fb73a6b6622d
   200     def AddVarToTree(self, context, *args):
   200     def AddVarToTree(self, context, *args):
   201         var = (args[0][0], self.Type, self.GetTree())
   201         var = (args[0][0], self.Type, self.GetTree())
   202         self.TreeStack[-1].append(var)
   202         self.TreeStack[-1].append(var)
   203 
   203 
   204     def AddVariable(self, context, *args):
   204     def AddVariable(self, context, *args):
   205         self.Variables.append(_VariableInfos(*(_translate_args(
   205         self.Variables.append(_VariableInfos(*(
   206             [_StringValue] * 5 + [_BoolValue] + [_StringValue], args) +
   206             _translate_args([_StringValue] * 5 + [_BoolValue] + [_StringValue], args) +
   207             [self.GetType(), self.GetTree()])))
   207             [self.GetType(), self.GetTree()])))
   208 
   208 
   209 # -------------------------------------------------------------------------------
   209 # -------------------------------------------------------------------------------
   210 #            Helpers object for generating pou variable instance list
   210 #            Helpers object for generating pou variable instance list
   211 # -------------------------------------------------------------------------------
   211 # -------------------------------------------------------------------------------
  1588         self.TotalTypes = StdBlckLst[:]
  1588         self.TotalTypes = StdBlckLst[:]
  1589 
  1589 
  1590     def GetConfNodeDataTypes(self, exclude=None, only_locatables=False):
  1590     def GetConfNodeDataTypes(self, exclude=None, only_locatables=False):
  1591         return [{"name": _("%s Data Types") % confnodetypes["name"],
  1591         return [{"name": _("%s Data Types") % confnodetypes["name"],
  1592                  "list": [
  1592                  "list": [
  1593                     datatype.getname()
  1593                      datatype.getname()
  1594                     for datatype in confnodetypes["types"].getdataTypes()
  1594                      for datatype in confnodetypes["types"].getdataTypes()
  1595                     if not only_locatables or self.IsLocatableDataType(datatype)]}
  1595                      if not only_locatables or self.IsLocatableDataType(datatype)]}
  1596                 for confnodetypes in self.ConfNodeTypes]
  1596                 for confnodetypes in self.ConfNodeTypes]
  1597 
  1597 
  1598     def GetVariableLocationTree(self):
  1598     def GetVariableLocationTree(self):
  1599         return []
  1599         return []
  1600 
  1600 
  2987             divergence = PLCOpenParser.CreateElement(
  2987             divergence = PLCOpenParser.CreateElement(
  2988                 {SELECTION_DIVERGENCE: "selectionDivergence",
  2988                 {SELECTION_DIVERGENCE: "selectionDivergence",
  2989                  SELECTION_CONVERGENCE: "selectionConvergence",
  2989                  SELECTION_CONVERGENCE: "selectionConvergence",
  2990                  SIMULTANEOUS_DIVERGENCE: "simultaneousDivergence",
  2990                  SIMULTANEOUS_DIVERGENCE: "simultaneousDivergence",
  2991                  SIMULTANEOUS_CONVERGENCE: "simultaneousConvergence"}.get(
  2991                  SIMULTANEOUS_CONVERGENCE: "simultaneousConvergence"}.get(
  2992                     divergence_type), "sfcObjects")
  2992                      divergence_type), "sfcObjects")
  2993             divergence.setlocalId(id)
  2993             divergence.setlocalId(id)
  2994             element.addinstance(divergence)
  2994             element.addinstance(divergence)
  2995 
  2995 
  2996     DivergenceTypes = [
  2996     DivergenceTypes = [
  2997         (divergence_type,
  2997         (divergence_type,