plcopen/plcopen.py
changeset 1765 ccf59c1f0b45
parent 1763 bcc07ff2362c
child 1766 c1e5b9f19483
equal deleted inserted replaced
1764:d5df428640ff 1765:ccf59c1f0b45
   448 
   448 
   449     setattr(cls, "getdataType", gettypeElementFunc("dataType"))
   449     setattr(cls, "getdataType", gettypeElementFunc("dataType"))
   450 
   450 
   451     def appenddataType(self, name):
   451     def appenddataType(self, name):
   452         if self.getdataType(name) is not None:
   452         if self.getdataType(name) is not None:
   453             raise ValueError, "\"%s\" Data Type already exists !!!" % name
   453             raise ValueError("\"%s\" Data Type already exists !!!" % name)
   454         self.types.appenddataTypeElement(name)
   454         self.types.appenddataTypeElement(name)
   455     setattr(cls, "appenddataType", appenddataType)
   455     setattr(cls, "appenddataType", appenddataType)
   456 
   456 
   457     def insertdataType(self, index, datatype):
   457     def insertdataType(self, index, datatype):
   458         self.types.insertdataTypeElement(index, datatype)
   458         self.types.insertdataTypeElement(index, datatype)
   503         return None
   503         return None
   504     setattr(cls, "getconfiguration", getconfiguration)
   504     setattr(cls, "getconfiguration", getconfiguration)
   505 
   505 
   506     def addconfiguration(self, name):
   506     def addconfiguration(self, name):
   507         if self.getconfiguration(name) is not None:
   507         if self.getconfiguration(name) is not None:
   508             raise ValueError, _("\"%s\" configuration already exists !!!") % name
   508             raise ValueError(_("\"%s\" configuration already exists !!!") % name)
   509         new_configuration = PLCOpenParser.CreateElement("configuration", "configurations")
   509         new_configuration = PLCOpenParser.CreateElement("configuration", "configurations")
   510         new_configuration.setname(name)
   510         new_configuration.setname(name)
   511         self.instances.configurations.appendconfiguration(new_configuration)
   511         self.instances.configurations.appendconfiguration(new_configuration)
   512     setattr(cls, "addconfiguration", addconfiguration)
   512     setattr(cls, "addconfiguration", addconfiguration)
   513 
   513 
   514     def removeconfiguration(self, name):
   514     def removeconfiguration(self, name):
   515         configuration = self.getconfiguration(name)
   515         configuration = self.getconfiguration(name)
   516         if configuration is None:
   516         if configuration is None:
   517             raise ValueError, ("\"%s\" configuration doesn't exist !!!") % name
   517             raise ValueError(_("\"%s\" configuration doesn't exist !!!") % name)
   518         self.instances.configurations.remove(configuration)
   518         self.instances.configurations.remove(configuration)
   519     setattr(cls, "removeconfiguration", removeconfiguration)
   519     setattr(cls, "removeconfiguration", removeconfiguration)
   520 
   520 
   521     resources_xpath = PLCOpen_XPath(
   521     resources_xpath = PLCOpen_XPath(
   522         "ppx:instances/ppx:configurations/ppx:configuration[@name=$configname]/ppx:resource[@name=$name]")
   522         "ppx:instances/ppx:configurations/ppx:configuration[@name=$configname]/ppx:resource[@name=$name]")
   528         return None
   528         return None
   529     setattr(cls, "getconfigurationResource", getconfigurationResource)
   529     setattr(cls, "getconfigurationResource", getconfigurationResource)
   530 
   530 
   531     def addconfigurationResource(self, config_name, name):
   531     def addconfigurationResource(self, config_name, name):
   532         if self.getconfigurationResource(config_name, name) is not None:
   532         if self.getconfigurationResource(config_name, name) is not None:
   533             msg = _("\"{a1}\" resource already exists in \"{a2}\" configuration !!!").format(a1=name, a2=config_name)
   533             raise ValueError(
   534             raise ValueError, msg
   534                 _("\"{a1}\" resource already exists in \"{a2}\" configuration !!!").
       
   535                 format(a1=name, a2=config_name))
       
   536 
   535         configuration = self.getconfiguration(config_name)
   537         configuration = self.getconfiguration(config_name)
   536         if configuration is not None:
   538         if configuration is not None:
   537             new_resource = PLCOpenParser.CreateElement("resource", "configuration")
   539             new_resource = PLCOpenParser.CreateElement("resource", "configuration")
   538             new_resource.setname(name)
   540             new_resource.setname(name)
   539             configuration.appendresource(new_resource)
   541             configuration.appendresource(new_resource)
   546             resource = self.getconfigurationResource(config_name, name)
   548             resource = self.getconfigurationResource(config_name, name)
   547             if resource is not None:
   549             if resource is not None:
   548                 configuration.remove(resource)
   550                 configuration.remove(resource)
   549                 found = True
   551                 found = True
   550         if not found:
   552         if not found:
   551             msg = _("\"{a1}\" resource doesn't exist in \"{a2}\" configuration !!!").format(a1=name, a2=config_name)
   553             raise ValueError(
   552             raise ValueError, msg
   554                 _("\"{a1}\" resource doesn't exist in \"{a2}\" configuration !!!").
       
   555                 format(a1=name, a2=config_name))
       
   556 
   553     setattr(cls, "removeconfigurationResource", removeconfigurationResource)
   557     setattr(cls, "removeconfigurationResource", removeconfigurationResource)
   554 
   558 
   555     def updateElementName(self, old_name, new_name):
   559     def updateElementName(self, old_name, new_name):
   556         for datatype in self.getdataTypes():
   560         for datatype in self.getdataTypes():
   557             datatype.updateElementName(old_name, new_name)
   561             datatype.updateElementName(old_name, new_name)
   926             if TextMatched(element.getname(), name):
   930             if TextMatched(element.getname(), name):
   927                 self.dataTypes.remove(element)
   931                 self.dataTypes.remove(element)
   928                 found = True
   932                 found = True
   929                 break
   933                 break
   930         if not found:
   934         if not found:
   931             raise ValueError, _("\"%s\" Data Type doesn't exist !!!") % name
   935             raise ValueError(_("\"%s\" Data Type doesn't exist !!!") % name)
   932     setattr(cls, "removedataTypeElement", removedataTypeElement)
   936     setattr(cls, "removedataTypeElement", removedataTypeElement)
   933 
   937 
   934     def getpouElements(self):
   938     def getpouElements(self):
   935         return self.pous.getpou()
   939         return self.pous.getpou()
   936     setattr(cls, "getpouElements", getpouElements)
   940     setattr(cls, "getpouElements", getpouElements)
   944     setattr(cls, "getpouElement", getpouElement)
   948     setattr(cls, "getpouElement", getpouElement)
   945 
   949 
   946     def appendpouElement(self, name, pou_type, body_type):
   950     def appendpouElement(self, name, pou_type, body_type):
   947         for element in self.pous.getpou():
   951         for element in self.pous.getpou():
   948             if TextMatched(element.getname(), name):
   952             if TextMatched(element.getname(), name):
   949                 raise ValueError, _("\"%s\" POU already exists !!!") % name
   953                 raise ValueError(_("\"%s\" POU already exists !!!") % name)
   950         new_pou = PLCOpenParser.CreateElement("pou", "pous")
   954         new_pou = PLCOpenParser.CreateElement("pou", "pous")
   951         self.pous.appendpou(new_pou)
   955         self.pous.appendpou(new_pou)
   952         new_pou.setname(name)
   956         new_pou.setname(name)
   953         new_pou.setpouType(pou_type)
   957         new_pou.setpouType(pou_type)
   954         new_pou.appendbody(PLCOpenParser.CreateElement("body", "pou"))
   958         new_pou.appendbody(PLCOpenParser.CreateElement("body", "pou"))
   965             if TextMatched(element.getname(), name):
   969             if TextMatched(element.getname(), name):
   966                 self.pous.remove(element)
   970                 self.pous.remove(element)
   967                 found = True
   971                 found = True
   968                 break
   972                 break
   969         if not found:
   973         if not found:
   970             raise ValueError, _("\"%s\" POU doesn't exist !!!") % name
   974             raise ValueError(_("\"%s\" POU doesn't exist !!!") % name)
   971     setattr(cls, "removepouElement", removepouElement)
   975     setattr(cls, "removepouElement", removepouElement)
   972 
   976 
   973     def Search(self, criteria, parent_infos=[]):
   977     def Search(self, criteria, parent_infos=[]):
   974         search_result = []
   978         search_result = []
   975         filter = criteria["filter"]
   979         filter = criteria["filter"]
  1151     def setbodyType(self, body_type):
  1155     def setbodyType(self, body_type):
  1152         if len(self.body) > 0:
  1156         if len(self.body) > 0:
  1153             if body_type in ["IL", "ST", "LD", "FBD", "SFC"]:
  1157             if body_type in ["IL", "ST", "LD", "FBD", "SFC"]:
  1154                 self.body[0].setcontent(PLCOpenParser.CreateElement(body_type, "body"))
  1158                 self.body[0].setcontent(PLCOpenParser.CreateElement(body_type, "body"))
  1155             else:
  1159             else:
  1156                 raise ValueError, "%s isn't a valid body type!" % type
  1160                 raise ValueError("%s isn't a valid body type!" % type)
  1157     setattr(cls, "setbodyType", setbodyType)
  1161     setattr(cls, "setbodyType", setbodyType)
  1158 
  1162 
  1159     def getbodyType(self):
  1163     def getbodyType(self):
  1160         if len(self.body) > 0:
  1164         if len(self.body) > 0:
  1161             return self.body[0].getcontent().getLocalTag()
  1165             return self.body[0].getcontent().getLocalTag()
  1371                                                   instance.getinstanceName())
  1375                                                   instance.getinstanceName())
  1372                     self.transitions.remove(transition)
  1376                     self.transitions.remove(transition)
  1373                     removed = True
  1377                     removed = True
  1374                     break
  1378                     break
  1375             if not removed:
  1379             if not removed:
  1376                 raise ValueError, _("Transition with name %s doesn't exist!") % name
  1380                 raise ValueError(_("Transition with name %s doesn't exist!") % name)
  1377     setattr(cls, "removetransition", removetransition)
  1381     setattr(cls, "removetransition", removetransition)
  1378 
  1382 
  1379     def addaction(self, name, body_type):
  1383     def addaction(self, name, body_type):
  1380         if self.actions is None:
  1384         if self.actions is None:
  1381             self.addactions()
  1385             self.addactions()
  1412                                                   instance.getinstanceName())
  1416                                                   instance.getinstanceName())
  1413                     self.actions.remove(action)
  1417                     self.actions.remove(action)
  1414                     removed = True
  1418                     removed = True
  1415                     break
  1419                     break
  1416             if not removed:
  1420             if not removed:
  1417                 raise ValueError, _("Action with name %s doesn't exist!") % name
  1421                 raise ValueError(_("Action with name %s doesn't exist!") % name)
  1418     setattr(cls, "removeaction", removeaction)
  1422     setattr(cls, "removeaction", removeaction)
  1419 
  1423 
  1420     def updateElementName(self, old_name, new_name):
  1424     def updateElementName(self, old_name, new_name):
  1421         if self.interface is not None:
  1425         if self.interface is not None:
  1422             for content in self.interface.getcontent():
  1426             for content in self.interface.getcontent():
  1505 
  1509 
  1506 def setbodyType(self, body_type):
  1510 def setbodyType(self, body_type):
  1507     if body_type in ["IL", "ST", "LD", "FBD", "SFC"]:
  1511     if body_type in ["IL", "ST", "LD", "FBD", "SFC"]:
  1508         self.body.setcontent(PLCOpenParser.CreateElement(body_type, "body"))
  1512         self.body.setcontent(PLCOpenParser.CreateElement(body_type, "body"))
  1509     else:
  1513     else:
  1510         raise ValueError, "%s isn't a valid body type!" % type
  1514         raise ValueError("%s isn't a valid body type!" % type)
  1511 
  1515 
  1512 
  1516 
  1513 def getbodyType(self):
  1517 def getbodyType(self):
  1514     return self.body.getcontent().getLocalTag()
  1518     return self.body.getcontent().getLocalTag()
  1515 
  1519 
  1654                                             PLCOpenParser.GetElementClass("connector", "commonObjects"),
  1658                                             PLCOpenParser.GetElementClass("connector", "commonObjects"),
  1655                                             PLCOpenParser.GetElementClass("continuation", "commonObjects"))):
  1659                                             PLCOpenParser.GetElementClass("continuation", "commonObjects"))):
  1656                     element.setexecutionOrderId(0)
  1660                     element.setexecutionOrderId(0)
  1657             self.checkedBlocksDict.clear()
  1661             self.checkedBlocksDict.clear()
  1658         else:
  1662         else:
  1659             raise TypeError, _("Can only generate execution order on FBD networks!")
  1663             raise TypeError(_("Can only generate execution order on FBD networks!"))
  1660     setattr(cls, "resetexecutionOrder", resetexecutionOrder)
  1664     setattr(cls, "resetexecutionOrder", resetexecutionOrder)
  1661 
  1665 
  1662     def compileexecutionOrder(self):
  1666     def compileexecutionOrder(self):
  1663         if self.content.getLocalTag() == "FBD":
  1667         if self.content.getLocalTag() == "FBD":
  1664             self.resetexecutionOrder()
  1668             self.resetexecutionOrder()
  1668                     connections = element.connectionPointIn.getconnections()
  1672                     connections = element.connectionPointIn.getconnections()
  1669                     if connections and len(connections) == 1:
  1673                     if connections and len(connections) == 1:
  1670                         self.compileelementExecutionOrder(connections[0])
  1674                         self.compileelementExecutionOrder(connections[0])
  1671                     element.setexecutionOrderId(self.getnewExecutionOrderId())
  1675                     element.setexecutionOrderId(self.getnewExecutionOrderId())
  1672         else:
  1676         else:
  1673             raise TypeError, _("Can only generate execution order on FBD networks!")
  1677             raise TypeError(_("Can only generate execution order on FBD networks!"))
  1674     setattr(cls, "compileexecutionOrder", compileexecutionOrder)
  1678     setattr(cls, "compileexecutionOrder", compileexecutionOrder)
  1675 
  1679 
  1676     def compileelementExecutionOrder(self, link):
  1680     def compileelementExecutionOrder(self, link):
  1677         if self.content.getLocalTag() == "FBD":
  1681         if self.content.getLocalTag() == "FBD":
  1678             localid = link.getrefLocalId()
  1682             localid = link.getrefLocalId()
  1692                         TextMatched(tmp_instance.getname(), instance.getname()) and tmp_instance.getexecutionOrderId() == 0):
  1696                         TextMatched(tmp_instance.getname(), instance.getname()) and tmp_instance.getexecutionOrderId() == 0):
  1693                         connections = tmp_instance.connectionPointIn.getconnections()
  1697                         connections = tmp_instance.connectionPointIn.getconnections()
  1694                         if connections and len(connections) == 1:
  1698                         if connections and len(connections) == 1:
  1695                             self.compileelementExecutionOrder(connections[0])
  1699                             self.compileelementExecutionOrder(connections[0])
  1696         else:
  1700         else:
  1697             raise TypeError, _("Can only generate execution order on FBD networks!")
  1701             raise TypeError(_("Can only generate execution order on FBD networks!"))
  1698     setattr(cls, "compileelementExecutionOrder", compileelementExecutionOrder)
  1702     setattr(cls, "compileelementExecutionOrder", compileelementExecutionOrder)
  1699 
  1703 
  1700     def setelementExecutionOrder(self, instance, new_executionOrder):
  1704     def setelementExecutionOrder(self, instance, new_executionOrder):
  1701         if self.content.getLocalTag() == "FBD":
  1705         if self.content.getLocalTag() == "FBD":
  1702             old_executionOrder = instance.getexecutionOrderId()
  1706             old_executionOrder = instance.getexecutionOrderId()
  1708                             element.setexecutionOrderId(element_executionOrder - 1)
  1712                             element.setexecutionOrderId(element_executionOrder - 1)
  1709                         if new_executionOrder <= element_executionOrder <= old_executionOrder:
  1713                         if new_executionOrder <= element_executionOrder <= old_executionOrder:
  1710                             element.setexecutionOrderId(element_executionOrder + 1)
  1714                             element.setexecutionOrderId(element_executionOrder + 1)
  1711             instance.setexecutionOrderId(new_executionOrder)
  1715             instance.setexecutionOrderId(new_executionOrder)
  1712         else:
  1716         else:
  1713             raise TypeError, _("Can only generate execution order on FBD networks!")
  1717             raise TypeError(_("Can only generate execution order on FBD networks!"))
  1714     setattr(cls, "setelementExecutionOrder", setelementExecutionOrder)
  1718     setattr(cls, "setelementExecutionOrder", setelementExecutionOrder)
  1715 
  1719 
  1716     def appendcontentInstance(self, instance):
  1720     def appendcontentInstance(self, instance):
  1717         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1721         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1718             self.content.appendcontent(instance)
  1722             self.content.appendcontent(instance)
  1719         else:
  1723         else:
  1720             raise TypeError, _("%s body don't have instances!") % self.content.getLocalTag()
  1724             raise TypeError(_("%s body don't have instances!") % self.content.getLocalTag())
  1721     setattr(cls, "appendcontentInstance", appendcontentInstance)
  1725     setattr(cls, "appendcontentInstance", appendcontentInstance)
  1722 
  1726 
  1723     def getcontentInstances(self):
  1727     def getcontentInstances(self):
  1724         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1728         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1725             return self.content.getcontent()
  1729             return self.content.getcontent()
  1726         else:
  1730         else:
  1727             raise TypeError, _("%s body don't have instances!") % self.content.getLocalTag()
  1731             raise TypeError(_("%s body don't have instances!") % self.content.getLocalTag())
  1728     setattr(cls, "getcontentInstances", getcontentInstances)
  1732     setattr(cls, "getcontentInstances", getcontentInstances)
  1729 
  1733 
  1730     instance_by_id_xpath = PLCOpen_XPath("*[@localId=$localId]")
  1734     instance_by_id_xpath = PLCOpen_XPath("*[@localId=$localId]")
  1731     instance_by_name_xpath = PLCOpen_XPath("ppx:block[@instanceName=$name]")
  1735     instance_by_name_xpath = PLCOpen_XPath("ppx:block[@instanceName=$name]")
  1732 
  1736 
  1735             instance = instance_by_id_xpath(self.content, localId=local_id)
  1739             instance = instance_by_id_xpath(self.content, localId=local_id)
  1736             if len(instance) > 0:
  1740             if len(instance) > 0:
  1737                 return instance[0]
  1741                 return instance[0]
  1738             return None
  1742             return None
  1739         else:
  1743         else:
  1740             raise TypeError, _("%s body don't have instances!") % self.content.getLocalTag()
  1744             raise TypeError(_("%s body don't have instances!") % self.content.getLocalTag())
  1741     setattr(cls, "getcontentInstance", getcontentInstance)
  1745     setattr(cls, "getcontentInstance", getcontentInstance)
  1742 
  1746 
  1743     def getcontentInstancesIds(self):
  1747     def getcontentInstancesIds(self):
  1744         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1748         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1745             return OrderedDict([(instance.getlocalId(), True)
  1749             return OrderedDict([(instance.getlocalId(), True)
  1746                                 for instance in self.content])
  1750                                 for instance in self.content])
  1747         else:
  1751         else:
  1748             raise TypeError, _("%s body don't have instances!") % self.content.getLocalTag()
  1752             raise TypeError(_("%s body don't have instances!") % self.content.getLocalTag())
  1749     setattr(cls, "getcontentInstancesIds", getcontentInstancesIds)
  1753     setattr(cls, "getcontentInstancesIds", getcontentInstancesIds)
  1750 
  1754 
  1751     def getcontentInstanceByName(self, name):
  1755     def getcontentInstanceByName(self, name):
  1752         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1756         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1753             instance = instance_by_name_xpath(self.content)
  1757             instance = instance_by_name_xpath(self.content)
  1754             if len(instance) > 0:
  1758             if len(instance) > 0:
  1755                 return instance[0]
  1759                 return instance[0]
  1756             return None
  1760             return None
  1757         else:
  1761         else:
  1758             raise TypeError, _("%s body don't have instances!") % self.content.getLocalTag()
  1762             raise TypeError(_("%s body don't have instances!") % self.content.getLocalTag())
  1759     setattr(cls, "getcontentInstanceByName", getcontentInstanceByName)
  1763     setattr(cls, "getcontentInstanceByName", getcontentInstanceByName)
  1760 
  1764 
  1761     def removecontentInstance(self, local_id):
  1765     def removecontentInstance(self, local_id):
  1762         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1766         if self.content.getLocalTag() in ["LD", "FBD", "SFC"]:
  1763             instance = instance_by_id_xpath(self.content, localId=local_id)
  1767             instance = instance_by_id_xpath(self.content, localId=local_id)
  1764             if len(instance) > 0:
  1768             if len(instance) > 0:
  1765                 self.content.remove(instance[0])
  1769                 self.content.remove(instance[0])
  1766             else:
  1770             else:
  1767                 raise ValueError, _("Instance with id %d doesn't exist!") % id
  1771                 raise ValueError(_("Instance with id %d doesn't exist!") % id)
  1768         else:
  1772         else:
  1769             raise TypeError, "%s body don't have instances!" % self.content.getLocalTag()
  1773             raise TypeError(_("%s body don't have instances!") % self.content.getLocalTag())
  1770     setattr(cls, "removecontentInstance", removecontentInstance)
  1774     setattr(cls, "removecontentInstance", removecontentInstance)
  1771 
  1775 
  1772     def settext(self, text):
  1776     def settext(self, text):
  1773         if self.content.getLocalTag() in ["IL", "ST"]:
  1777         if self.content.getLocalTag() in ["IL", "ST"]:
  1774             self.content.setanyText(text)
  1778             self.content.setanyText(text)
  1775         else:
  1779         else:
  1776             raise TypeError, _("%s body don't have text!") % self.content.getLocalTag()
  1780             raise TypeError(_("%s body don't have text!") % self.content.getLocalTag())
  1777     setattr(cls, "settext", settext)
  1781     setattr(cls, "settext", settext)
  1778 
  1782 
  1779     def gettext(self):
  1783     def gettext(self):
  1780         if self.content.getLocalTag() in ["IL", "ST"]:
  1784         if self.content.getLocalTag() in ["IL", "ST"]:
  1781             return self.content.getanyText()
  1785             return self.content.getanyText()
  1782         else:
  1786         else:
  1783             raise TypeError, _("%s body don't have text!") % self.content.getLocalTag()
  1787             raise TypeError(_("%s body don't have text!") % self.content.getLocalTag())
  1784     setattr(cls, "gettext", gettext)
  1788     setattr(cls, "gettext", gettext)
  1785 
  1789 
  1786     def hasblock(self, block_type):
  1790     def hasblock(self, block_type):
  1787         if self.content.getLocalTag() in ["IL", "ST"]:
  1791         if self.content.getLocalTag() in ["IL", "ST"]:
  1788             return self.content.hasblock(block_type)
  1792             return self.content.hasblock(block_type)
  1789         else:
  1793         else:
  1790             raise TypeError, _("%s body don't have text!") % self.content.getLocalTag()
  1794             raise TypeError(_("%s body don't have text!") % self.content.getLocalTag())
  1791     setattr(cls, "hasblock", hasblock)
  1795     setattr(cls, "hasblock", hasblock)
  1792 
  1796 
  1793     def updateElementName(self, old_name, new_name):
  1797     def updateElementName(self, old_name, new_name):
  1794         if self.content.getLocalTag() in ["IL", "ST"]:
  1798         if self.content.getLocalTag() in ["IL", "ST"]:
  1795             self.content.updateElementName(old_name, new_name)
  1799             self.content.updateElementName(old_name, new_name)
  2519         if opened > closed:
  2523         if opened > closed:
  2520             items[i - 1] = ','.join([items[i - 1], items.pop(i)])
  2524             items[i - 1] = ','.join([items[i - 1], items.pop(i)])
  2521         elif opened == closed:
  2525         elif opened == closed:
  2522             i += 1
  2526             i += 1
  2523         else:
  2527         else:
  2524             raise ValueError, _("\"%s\" is an invalid value!") % value
  2528             raise ValueError(_("\"%s\" is an invalid value!") % value)
  2525     return items
  2529     return items
  2526 
  2530 
  2527 
  2531 
  2528 cls = PLCOpenParser.GetElementClass("arrayValue", "value")
  2532 cls = PLCOpenParser.GetElementClass("arrayValue", "value")
  2529 if cls:
  2533 if cls: