336 xml_declaration=True, |
336 xml_declaration=True, |
337 encoding='utf-8')) |
337 encoding='utf-8')) |
338 project_file.close() |
338 project_file.close() |
339 |
339 |
340 |
340 |
341 cls = PLCOpenParser.GetElementClass("formattedText") |
341 # ---------------------------------------------------------------------- |
342 if cls: |
342 |
|
343 |
|
344 def _updateFormattedTextClass(cls): |
343 def updateElementName(self, old_name, new_name): |
345 def updateElementName(self, old_name, new_name): |
344 text = self.getanyText() |
346 text = self.getanyText() |
345 pattern = re.compile('\\b' + old_name + '\\b', re.IGNORECASE) |
347 pattern = re.compile('\\b' + old_name + '\\b', re.IGNORECASE) |
346 text = pattern.sub(new_name, text) |
348 text = pattern.sub(new_name, text) |
347 self.setanyText(text) |
349 self.setanyText(text) |
368 |
370 |
369 def Search(self, criteria, parent_infos): |
371 def Search(self, criteria, parent_infos): |
370 return [(tuple(parent_infos),) + result for result in TestTextElement(self.getanyText(), criteria)] |
372 return [(tuple(parent_infos),) + result for result in TestTextElement(self.getanyText(), criteria)] |
371 setattr(cls, "Search", Search) |
373 setattr(cls, "Search", Search) |
372 |
374 |
373 cls = PLCOpenParser.GetElementClass("project") |
375 |
374 if cls: |
376 cls = PLCOpenParser.GetElementClass("formattedText") |
375 |
377 if cls: |
|
378 _updateFormattedTextClass(cls) |
|
379 |
|
380 |
|
381 # ---------------------------------------------------------------------- |
|
382 |
|
383 |
|
384 def _updateProjectClass(cls): |
376 def setname(self, name): |
385 def setname(self, name): |
377 self.contentHeader.setname(name) |
386 self.contentHeader.setname(name) |
378 setattr(cls, "setname", setname) |
387 setattr(cls, "setname", setname) |
379 |
388 |
380 def getname(self): |
389 def getname(self): |
612 for configuration in self.instances.configurations.getconfiguration(): |
621 for configuration in self.instances.configurations.getconfiguration(): |
613 result.extend(configuration.Search(criteria, parent_infos)) |
622 result.extend(configuration.Search(criteria, parent_infos)) |
614 return result |
623 return result |
615 setattr(cls, "Search", Search) |
624 setattr(cls, "Search", Search) |
616 |
625 |
617 cls = PLCOpenParser.GetElementClass("contentHeader", "project") |
626 |
618 if cls: |
627 cls = PLCOpenParser.GetElementClass("project") |
619 |
628 if cls: |
|
629 _updateProjectClass(cls) |
|
630 |
|
631 |
|
632 # ---------------------------------------------------------------------- |
|
633 |
|
634 |
|
635 def _updateContentHeaderProjectClass(cls): |
620 def setpageSize(self, width, height): |
636 def setpageSize(self, width, height): |
621 self.coordinateInfo.setpageSize(width, height) |
637 self.coordinateInfo.setpageSize(width, height) |
622 setattr(cls, "setpageSize", setpageSize) |
638 setattr(cls, "setpageSize", setpageSize) |
623 |
639 |
624 def getpageSize(self): |
640 def getpageSize(self): |
636 scaling["LD"] = self.coordinateInfo.getscaling("LD") |
652 scaling["LD"] = self.coordinateInfo.getscaling("LD") |
637 scaling["SFC"] = self.coordinateInfo.getscaling("SFC") |
653 scaling["SFC"] = self.coordinateInfo.getscaling("SFC") |
638 return scaling |
654 return scaling |
639 setattr(cls, "getscaling", getscaling) |
655 setattr(cls, "getscaling", getscaling) |
640 |
656 |
641 cls = PLCOpenParser.GetElementClass("coordinateInfo", "contentHeader") |
657 |
642 if cls: |
658 cls = PLCOpenParser.GetElementClass("contentHeader", "project") |
|
659 if cls: |
|
660 _updateContentHeaderProjectClass(cls) |
|
661 |
|
662 |
|
663 # ---------------------------------------------------------------------- |
|
664 |
|
665 |
|
666 def _updateCoordinateInfoContentHeaderClass(cls): |
643 def setpageSize(self, width, height): |
667 def setpageSize(self, width, height): |
644 if width == 0 and height == 0: |
668 if width == 0 and height == 0: |
645 self.deletepageSize() |
669 self.deletepageSize() |
646 else: |
670 else: |
647 if self.pageSize is None: |
671 if self.pageSize is None: |
675 return self.ld.scaling.getx(), self.ld.scaling.gety() |
699 return self.ld.scaling.getx(), self.ld.scaling.gety() |
676 elif language == "SFC": |
700 elif language == "SFC": |
677 return self.sfc.scaling.getx(), self.sfc.scaling.gety() |
701 return self.sfc.scaling.getx(), self.sfc.scaling.gety() |
678 return 0, 0 |
702 return 0, 0 |
679 setattr(cls, "getscaling", getscaling) |
703 setattr(cls, "getscaling", getscaling) |
|
704 |
|
705 |
|
706 cls = PLCOpenParser.GetElementClass("coordinateInfo", "contentHeader") |
|
707 if cls: |
|
708 _updateCoordinateInfoContentHeaderClass(cls) |
|
709 |
|
710 |
|
711 # ---------------------------------------------------------------------- |
680 |
712 |
681 |
713 |
682 def _Search(attributes, criteria, parent_infos): |
714 def _Search(attributes, criteria, parent_infos): |
683 search_result = [] |
715 search_result = [] |
684 for attr, value in attributes: |
716 for attr, value in attributes: |
742 search_result.extend(variable.Search(criteria, parent_infos + [variable_type, var_number])) |
774 search_result.extend(variable.Search(criteria, parent_infos + [variable_type, var_number])) |
743 var_number += 1 |
775 var_number += 1 |
744 return search_result |
776 return search_result |
745 |
777 |
746 |
778 |
747 cls = PLCOpenParser.GetElementClass("configuration", "configurations") |
779 # ---------------------------------------------------------------------- |
748 if cls: |
780 |
749 |
781 |
|
782 def _updateConfigurationConfigurationsClass(cls): |
750 def addglobalVar(self, var_type, name, location="", description=""): |
783 def addglobalVar(self, var_type, name, location="", description=""): |
751 globalvars = self.getglobalVars() |
784 globalvars = self.getglobalVars() |
752 if len(globalvars) == 0: |
785 if len(globalvars) == 0: |
753 globalvars.append(PLCOpenParser.CreateElement("varList")) |
786 globalvars.append(PLCOpenParser.CreateElement("varList")) |
754 var = PLCOpenParser.CreateElement("variable", "varListPlain") |
787 var = PLCOpenParser.CreateElement("variable", "varListPlain") |
787 for resource in self.getresource(): |
820 for resource in self.getresource(): |
788 search_result.extend(resource.Search(criteria, parent_infos)) |
821 search_result.extend(resource.Search(criteria, parent_infos)) |
789 return search_result |
822 return search_result |
790 setattr(cls, "Search", Search) |
823 setattr(cls, "Search", Search) |
791 |
824 |
792 cls = PLCOpenParser.GetElementClass("resource", "configuration") |
825 |
793 if cls: |
826 cls = PLCOpenParser.GetElementClass("configuration", "configurations") |
|
827 if cls: |
|
828 _updateConfigurationConfigurationsClass(cls) |
|
829 |
|
830 |
|
831 # ---------------------------------------------------------------------- |
|
832 |
|
833 |
|
834 def _updateResourceConfigurationClass(cls): |
794 def updateElementName(self, old_name, new_name): |
835 def updateElementName(self, old_name, new_name): |
795 _updateConfigurationResourceElementName(self, old_name, new_name) |
836 _updateConfigurationResourceElementName(self, old_name, new_name) |
796 for instance in self.getpouInstance(): |
837 for instance in self.getpouInstance(): |
797 instance.updateElementName(old_name, new_name) |
838 instance.updateElementName(old_name, new_name) |
798 for task in self.gettask(): |
839 for task in self.gettask(): |
828 search_result.extend(instance.Search(criteria, parent_infos + ["instance", instance_number])) |
869 search_result.extend(instance.Search(criteria, parent_infos + ["instance", instance_number])) |
829 instance_number += 1 |
870 instance_number += 1 |
830 return search_result |
871 return search_result |
831 setattr(cls, "Search", Search) |
872 setattr(cls, "Search", Search) |
832 |
873 |
833 cls = PLCOpenParser.GetElementClass("task", "resource") |
874 |
834 if cls: |
875 cls = PLCOpenParser.GetElementClass("resource", "configuration") |
|
876 if cls: |
|
877 _updateResourceConfigurationClass(cls) |
|
878 |
|
879 |
|
880 # ---------------------------------------------------------------------- |
|
881 |
|
882 |
|
883 def _updateTaskResourceClass(cls): |
835 def updateElementName(self, old_name, new_name): |
884 def updateElementName(self, old_name, new_name): |
836 if TextMatched(self.single, old_name): |
885 if TextMatched(self.single, old_name): |
837 self.single = new_name |
886 self.single = new_name |
838 if TextMatched(self.interval, old_name): |
887 if TextMatched(self.interval, old_name): |
839 self.interval = new_name |
888 self.interval = new_name |
853 ("interval", self.getinterval()), |
902 ("interval", self.getinterval()), |
854 ("priority", str(self.getpriority()))], |
903 ("priority", str(self.getpriority()))], |
855 criteria, parent_infos) |
904 criteria, parent_infos) |
856 setattr(cls, "Search", Search) |
905 setattr(cls, "Search", Search) |
857 |
906 |
858 cls = PLCOpenParser.GetElementClass("pouInstance") |
907 |
859 if cls: |
908 cls = PLCOpenParser.GetElementClass("task", "resource") |
|
909 if cls: |
|
910 _updateTaskResourceClass(cls) |
|
911 |
|
912 |
|
913 # ---------------------------------------------------------------------- |
|
914 |
|
915 |
|
916 def _updatePouInstanceClass(cls): |
860 def updateElementName(self, old_name, new_name): |
917 def updateElementName(self, old_name, new_name): |
861 if TextMatched(self.typeName, old_name): |
918 if TextMatched(self.typeName, old_name): |
862 self.typeName = new_name |
919 self.typeName = new_name |
863 setattr(cls, "updateElementName", updateElementName) |
920 setattr(cls, "updateElementName", updateElementName) |
864 |
921 |
866 return _Search([("name", self.getname()), |
923 return _Search([("name", self.getname()), |
867 ("type", self.gettypeName())], |
924 ("type", self.gettypeName())], |
868 criteria, parent_infos) |
925 criteria, parent_infos) |
869 setattr(cls, "Search", Search) |
926 setattr(cls, "Search", Search) |
870 |
927 |
871 cls = PLCOpenParser.GetElementClass("variable", "varListPlain") |
928 |
872 if cls: |
929 cls = PLCOpenParser.GetElementClass("pouInstance") |
|
930 if cls: |
|
931 _updatePouInstanceClass(cls) |
|
932 |
|
933 |
|
934 # ---------------------------------------------------------------------- |
|
935 |
|
936 |
|
937 def _updateVariableVarListPlain(cls): |
873 def gettypeAsText(self): |
938 def gettypeAsText(self): |
874 vartype_content = self.gettype().getcontent() |
939 vartype_content = self.gettype().getcontent() |
875 vartype_content_name = vartype_content.getLocalTag() |
940 vartype_content_name = vartype_content.getLocalTag() |
876 # Variable type is a user data type |
941 # Variable type is a user data type |
877 if vartype_content_name == "derived": |
942 if vartype_content_name == "derived": |
909 if doc is not None: |
974 if doc is not None: |
910 search_result.extend(doc.Search(criteria, parent_infos + ["documentation"])) |
975 search_result.extend(doc.Search(criteria, parent_infos + ["documentation"])) |
911 return search_result |
976 return search_result |
912 setattr(cls, "Search", Search) |
977 setattr(cls, "Search", Search) |
913 |
978 |
914 cls = PLCOpenParser.GetElementClass("types", "project") |
979 |
915 if cls: |
980 cls = PLCOpenParser.GetElementClass("variable", "varListPlain") |
|
981 if cls: |
|
982 _updateVariableVarListPlain(cls) |
|
983 |
|
984 |
|
985 # ---------------------------------------------------------------------- |
|
986 |
|
987 |
|
988 def _updateTypesProjectClass(cls): |
916 def getdataTypeElements(self): |
989 def getdataTypeElements(self): |
917 return self.dataTypes.getdataType() |
990 return self.dataTypes.getdataType() |
918 setattr(cls, "getdataTypeElements", getdataTypeElements) |
991 setattr(cls, "getdataTypeElements", getdataTypeElements) |
919 |
992 |
920 def getdataTypeElement(self, name): |
993 def getdataTypeElement(self, name): |
995 search_result.extend(pou.Search(criteria, parent_infos)) |
1068 search_result.extend(pou.Search(criteria, parent_infos)) |
996 return search_result |
1069 return search_result |
997 setattr(cls, "Search", Search) |
1070 setattr(cls, "Search", Search) |
998 |
1071 |
999 |
1072 |
|
1073 cls = PLCOpenParser.GetElementClass("types", "project") |
|
1074 if cls: |
|
1075 _updateTypesProjectClass(cls) |
|
1076 |
|
1077 |
|
1078 # ---------------------------------------------------------------------- |
|
1079 |
|
1080 |
1000 def _updateBaseTypeElementName(self, old_name, new_name): |
1081 def _updateBaseTypeElementName(self, old_name, new_name): |
1001 self.baseType.updateElementName(old_name, new_name) |
1082 self.baseType.updateElementName(old_name, new_name) |
1002 |
1083 |
1003 |
1084 |
1004 cls = PLCOpenParser.GetElementClass("dataType", "dataTypes") |
1085 def _updateDataTypeDataTypesClass(cls): |
1005 if cls: |
|
1006 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1086 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1007 |
1087 |
1008 def Search(self, criteria, parent_infos=[]): |
1088 def Search(self, criteria, parent_infos=[]): |
1009 search_result = [] |
1089 search_result = [] |
1010 filter = criteria["filter"] |
1090 filter = criteria["filter"] |
1015 if self.initialValue is not None: |
1095 if self.initialValue is not None: |
1016 search_result.extend(_Search([("initial", self.initialValue.getvalue())], criteria, parent_infos)) |
1096 search_result.extend(_Search([("initial", self.initialValue.getvalue())], criteria, parent_infos)) |
1017 return search_result |
1097 return search_result |
1018 setattr(cls, "Search", Search) |
1098 setattr(cls, "Search", Search) |
1019 |
1099 |
1020 cls = PLCOpenParser.GetElementClass("dataType") |
1100 |
1021 if cls: |
1101 cls = PLCOpenParser.GetElementClass("dataType", "dataTypes") |
1022 |
1102 if cls: |
|
1103 _updateDataTypeDataTypesClass(cls) |
|
1104 |
|
1105 |
|
1106 # ---------------------------------------------------------------------- |
|
1107 |
|
1108 |
|
1109 def _updateDataTypeClass(cls): |
1023 def updateElementName(self, old_name, new_name): |
1110 def updateElementName(self, old_name, new_name): |
1024 content_name = self.content.getLocalTag() |
1111 content_name = self.content.getLocalTag() |
1025 if content_name in ["derived", "array", "subrangeSigned", "subrangeUnsigned"]: |
1112 if content_name in ["derived", "array", "subrangeSigned", "subrangeUnsigned"]: |
1026 self.content.updateElementName(old_name, new_name) |
1113 self.content.updateElementName(old_name, new_name) |
1027 elif content_name == "struct": |
1114 elif content_name == "struct": |
1042 content_name = content_name.upper() |
1129 content_name = content_name.upper() |
1043 search_result.extend(_Search([("base", content_name)], criteria, parent_infos)) |
1130 search_result.extend(_Search([("base", content_name)], criteria, parent_infos)) |
1044 return search_result |
1131 return search_result |
1045 setattr(cls, "Search", Search) |
1132 setattr(cls, "Search", Search) |
1046 |
1133 |
1047 cls = PLCOpenParser.GetElementClass("derived", "dataType") |
1134 |
1048 if cls: |
1135 cls = PLCOpenParser.GetElementClass("dataType") |
|
1136 if cls: |
|
1137 _updateDataTypeClass(cls) |
|
1138 |
|
1139 |
|
1140 # ---------------------------------------------------------------------- |
|
1141 |
|
1142 |
|
1143 def _updateDerivedDataTypeClass(cls): |
1049 def updateElementName(self, old_name, new_name): |
1144 def updateElementName(self, old_name, new_name): |
1050 if TextMatched(self.name, old_name): |
1145 if TextMatched(self.name, old_name): |
1051 self.name = new_name |
1146 self.name = new_name |
1052 setattr(cls, "updateElementName", updateElementName) |
1147 setattr(cls, "updateElementName", updateElementName) |
1053 |
1148 |
1054 def Search(self, criteria, parent_infos=[]): |
1149 def Search(self, criteria, parent_infos=[]): |
1055 return [(tuple(parent_infos),) + result for result in TestTextElement(self.name, criteria)] |
1150 return [(tuple(parent_infos),) + result for result in TestTextElement(self.name, criteria)] |
1056 setattr(cls, "Search", Search) |
1151 setattr(cls, "Search", Search) |
1057 |
1152 |
1058 cls = PLCOpenParser.GetElementClass("array", "dataType") |
1153 |
1059 if cls: |
1154 cls = PLCOpenParser.GetElementClass("derived", "dataType") |
|
1155 if cls: |
|
1156 _updateDerivedDataTypeClass(cls) |
|
1157 |
|
1158 |
|
1159 # ---------------------------------------------------------------------- |
|
1160 |
|
1161 |
|
1162 def _updateArrayDataTypeClass(cls): |
1060 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1163 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1061 |
1164 |
1062 def Search(self, criteria, parent_infos=[]): |
1165 def Search(self, criteria, parent_infos=[]): |
1063 search_result = self.baseType.Search(criteria, parent_infos) |
1166 search_result = self.baseType.Search(criteria, parent_infos) |
1064 for i, dimension in enumerate(self.getdimension()): |
1167 for i, dimension in enumerate(self.getdimension()): |
1067 criteria, parent_infos + ["range", i])) |
1170 criteria, parent_infos + ["range", i])) |
1068 return search_result |
1171 return search_result |
1069 setattr(cls, "Search", Search) |
1172 setattr(cls, "Search", Search) |
1070 |
1173 |
1071 |
1174 |
|
1175 cls = PLCOpenParser.GetElementClass("array", "dataType") |
|
1176 if cls: |
|
1177 _updateArrayDataTypeClass(cls) |
|
1178 |
|
1179 |
|
1180 # ---------------------------------------------------------------------- |
|
1181 |
|
1182 |
1072 def _SearchInSubrange(self, criteria, parent_infos=[]): |
1183 def _SearchInSubrange(self, criteria, parent_infos=[]): |
1073 search_result = self.baseType.Search(criteria, parent_infos) |
1184 search_result = self.baseType.Search(criteria, parent_infos) |
1074 search_result.extend(_Search([("lower", self.range.getlower()), |
1185 search_result.extend(_Search([("lower", self.range.getlower()), |
1075 ("upper", self.range.getupper())], |
1186 ("upper", self.range.getupper())], |
1076 criteria, parent_infos)) |
1187 criteria, parent_infos)) |
1080 cls = PLCOpenParser.GetElementClass("subrangeSigned", "dataType") |
1191 cls = PLCOpenParser.GetElementClass("subrangeSigned", "dataType") |
1081 if cls: |
1192 if cls: |
1082 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1193 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1083 setattr(cls, "Search", _SearchInSubrange) |
1194 setattr(cls, "Search", _SearchInSubrange) |
1084 |
1195 |
|
1196 |
|
1197 # ---------------------------------------------------------------------- |
|
1198 |
|
1199 |
1085 cls = PLCOpenParser.GetElementClass("subrangeUnsigned", "dataType") |
1200 cls = PLCOpenParser.GetElementClass("subrangeUnsigned", "dataType") |
1086 if cls: |
1201 if cls: |
1087 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1202 setattr(cls, "updateElementName", _updateBaseTypeElementName) |
1088 setattr(cls, "Search", _SearchInSubrange) |
1203 setattr(cls, "Search", _SearchInSubrange) |
1089 |
1204 |
1090 cls = PLCOpenParser.GetElementClass("enum", "dataType") |
1205 |
1091 if cls: |
1206 # ---------------------------------------------------------------------- |
1092 |
1207 |
|
1208 |
|
1209 def _updateEnumDataTypeClass(cls): |
1093 def updateElementName(self, old_name, new_name): |
1210 def updateElementName(self, old_name, new_name): |
1094 pass |
1211 pass |
1095 setattr(cls, "updateElementName", updateElementName) |
1212 setattr(cls, "updateElementName", updateElementName) |
1096 |
1213 |
1097 enumerated_datatype_values_xpath = PLCOpen_XPath("ppx:values/ppx:value") |
1214 enumerated_datatype_values_xpath = PLCOpen_XPath("ppx:values/ppx:value") |
1103 search_result.append((tuple(parent_infos + ["value", i]),) + result) |
1220 search_result.append((tuple(parent_infos + ["value", i]),) + result) |
1104 return search_result |
1221 return search_result |
1105 setattr(cls, "Search", Search) |
1222 setattr(cls, "Search", Search) |
1106 |
1223 |
1107 |
1224 |
|
1225 cls = PLCOpenParser.GetElementClass("enum", "dataType") |
|
1226 if cls: |
|
1227 _updateEnumDataTypeClass(cls) |
|
1228 |
|
1229 |
|
1230 # ---------------------------------------------------------------------- |
|
1231 |
|
1232 |
1108 def _getvariableTypeinfos(variable_type): |
1233 def _getvariableTypeinfos(variable_type): |
1109 type_content = variable_type.getcontent() |
1234 type_content = variable_type.getcontent() |
1110 type_content_type = type_content.getLocalTag() |
1235 type_content_type = type_content.getLocalTag() |
1111 if type_content_type == "derived": |
1236 if type_content_type == "derived": |
1112 return type_content.getname() |
1237 return type_content.getname() |
1113 return type_content_type.upper() |
1238 return type_content_type.upper() |
1114 |
1239 |
1115 |
1240 |
1116 cls = PLCOpenParser.GetElementClass("pou", "pous") |
1241 def _updatePouPousClass(cls): |
1117 if cls: |
|
1118 |
|
1119 block_inputs_xpath = PLCOpen_XPath( |
|
1120 "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars]/ppx:variable") |
|
1121 block_outputs_xpath = PLCOpen_XPath( |
|
1122 "ppx:interface/*[self::ppx:outputVars or self::ppx:inOutVars]/ppx:variable") |
|
1123 |
|
1124 def getblockInfos(self): |
1242 def getblockInfos(self): |
1125 block_infos = { |
1243 block_infos = { |
1126 "name": self.getname(), |
1244 "name": self.getname(), |
1127 "type": self.getpouType(), |
1245 "type": self.getpouType(), |
1128 "extensible": False, |
1246 "extensible": False, |
1518 search_result.extend(transition.Search(criteria, parent_infos)) |
1636 search_result.extend(transition.Search(criteria, parent_infos)) |
1519 return search_result |
1637 return search_result |
1520 setattr(cls, "Search", Search) |
1638 setattr(cls, "Search", Search) |
1521 |
1639 |
1522 |
1640 |
|
1641 cls = PLCOpenParser.GetElementClass("pou", "pous") |
|
1642 if cls: |
|
1643 block_inputs_xpath = PLCOpen_XPath( |
|
1644 "ppx:interface/*[self::ppx:inputVars or self::ppx:inOutVars]/ppx:variable") |
|
1645 block_outputs_xpath = PLCOpen_XPath( |
|
1646 "ppx:interface/*[self::ppx:outputVars or self::ppx:inOutVars]/ppx:variable") |
|
1647 _updatePouPousClass(cls) |
|
1648 |
|
1649 |
|
1650 # ---------------------------------------------------------------------- |
|
1651 |
|
1652 |
1523 def setbodyType(self, body_type): |
1653 def setbodyType(self, body_type): |
1524 if body_type in ["IL", "ST", "LD", "FBD", "SFC"]: |
1654 if body_type in ["IL", "ST", "LD", "FBD", "SFC"]: |
1525 self.body.setcontent(PLCOpenParser.CreateElement(body_type, "body")) |
1655 self.body.setcontent(PLCOpenParser.CreateElement(body_type, "body")) |
1526 else: |
1656 else: |
1527 raise ValueError("%s isn't a valid body type!" % type) |
1657 raise ValueError("%s isn't a valid body type!" % type) |
1592 |
1722 |
1593 def updateElementAddress(self, address_model, new_leading): |
1723 def updateElementAddress(self, address_model, new_leading): |
1594 self.body.updateElementAddress(address_model, new_leading) |
1724 self.body.updateElementAddress(address_model, new_leading) |
1595 |
1725 |
1596 |
1726 |
1597 cls = PLCOpenParser.GetElementClass("transition", "transitions") |
1727 # ---------------------------------------------------------------------- |
1598 if cls: |
1728 |
|
1729 def _updateTransitionTransitionsClass(cls): |
1599 setattr(cls, "setbodyType", setbodyType) |
1730 setattr(cls, "setbodyType", setbodyType) |
1600 setattr(cls, "getbodyType", getbodyType) |
1731 setattr(cls, "getbodyType", getbodyType) |
1601 setattr(cls, "resetexecutionOrder", resetexecutionOrder) |
1732 setattr(cls, "resetexecutionOrder", resetexecutionOrder) |
1602 setattr(cls, "compileexecutionOrder", compileexecutionOrder) |
1733 setattr(cls, "compileexecutionOrder", compileexecutionOrder) |
1603 setattr(cls, "setelementExecutionOrder", setelementExecutionOrder) |
1734 setattr(cls, "setelementExecutionOrder", setelementExecutionOrder) |
1620 search_result.append((tuple(parent_infos + ["name"]),) + result) |
1751 search_result.append((tuple(parent_infos + ["name"]),) + result) |
1621 search_result.extend(self.body.Search(criteria, parent_infos)) |
1752 search_result.extend(self.body.Search(criteria, parent_infos)) |
1622 return search_result |
1753 return search_result |
1623 setattr(cls, "Search", Search) |
1754 setattr(cls, "Search", Search) |
1624 |
1755 |
1625 cls = PLCOpenParser.GetElementClass("action", "actions") |
1756 |
1626 if cls: |
1757 cls = PLCOpenParser.GetElementClass("transition", "transitions") |
|
1758 if cls: |
|
1759 _updateTransitionTransitionsClass(cls) |
|
1760 |
|
1761 |
|
1762 # ---------------------------------------------------------------------- |
|
1763 |
|
1764 |
|
1765 def _updateActionActionsClass(cls): |
1627 setattr(cls, "setbodyType", setbodyType) |
1766 setattr(cls, "setbodyType", setbodyType) |
1628 setattr(cls, "getbodyType", getbodyType) |
1767 setattr(cls, "getbodyType", getbodyType) |
1629 setattr(cls, "resetexecutionOrder", resetexecutionOrder) |
1768 setattr(cls, "resetexecutionOrder", resetexecutionOrder) |
1630 setattr(cls, "compileexecutionOrder", compileexecutionOrder) |
1769 setattr(cls, "compileexecutionOrder", compileexecutionOrder) |
1631 setattr(cls, "setelementExecutionOrder", setelementExecutionOrder) |
1770 setattr(cls, "setelementExecutionOrder", setelementExecutionOrder) |
1648 search_result.append((tuple(parent_infos + ["name"]),) + result) |
1787 search_result.append((tuple(parent_infos + ["name"]),) + result) |
1649 search_result.extend(self.body.Search(criteria, parent_infos)) |
1788 search_result.extend(self.body.Search(criteria, parent_infos)) |
1650 return search_result |
1789 return search_result |
1651 setattr(cls, "Search", Search) |
1790 setattr(cls, "Search", Search) |
1652 |
1791 |
1653 cls = PLCOpenParser.GetElementClass("body") |
1792 |
1654 if cls: |
1793 cls = PLCOpenParser.GetElementClass("action", "actions") |
|
1794 if cls: |
|
1795 _updateActionActionsClass(cls) |
|
1796 |
|
1797 |
|
1798 # ---------------------------------------------------------------------- |
|
1799 |
|
1800 |
|
1801 def _updateBodyClass(cls): |
1655 cls.currentExecutionOrderId = 0 |
1802 cls.currentExecutionOrderId = 0 |
1656 cls.checkedBlocksDict = {} |
1803 cls.checkedBlocksDict = {} |
1657 |
1804 |
1658 def resetcurrentExecutionOrderId(self): |
1805 def resetcurrentExecutionOrderId(self): |
1659 object.__setattr__(self, "currentExecutionOrderId", 0) |
1806 object.__setattr__(self, "currentExecutionOrderId", 0) |
1999 setattr(cls, "updateConnectionsId", _connectionsFunctions["update"][connectionPointInType]) |
2154 setattr(cls, "updateConnectionsId", _connectionsFunctions["update"][connectionPointInType]) |
2000 setattr(cls, "Search", _SearchInElement) |
2155 setattr(cls, "Search", _SearchInElement) |
2001 return cls |
2156 return cls |
2002 |
2157 |
2003 |
2158 |
2004 cls = _initElementClass("comment", "commonObjects") |
2159 # ---------------------------------------------------------------------- |
2005 if cls: |
2160 |
|
2161 |
|
2162 def _updateCommentCommonObjectsClass(cls): |
2006 def setcontentText(self, text): |
2163 def setcontentText(self, text): |
2007 self.content.setanyText(text) |
2164 self.content.setanyText(text) |
2008 setattr(cls, "setcontentText", setcontentText) |
2165 setattr(cls, "setcontentText", setcontentText) |
2009 |
2166 |
2010 def getcontentText(self): |
2167 def getcontentText(self): |
2021 |
2178 |
2022 def Search(self, criteria, parent_infos=[]): |
2179 def Search(self, criteria, parent_infos=[]): |
2023 return self.content.Search(criteria, parent_infos + ["comment", self.getlocalId(), "content"]) |
2180 return self.content.Search(criteria, parent_infos + ["comment", self.getlocalId(), "content"]) |
2024 setattr(cls, "Search", Search) |
2181 setattr(cls, "Search", Search) |
2025 |
2182 |
2026 cls = _initElementClass("block", "fbdObjects") |
2183 |
2027 if cls: |
2184 cls = _initElementClass("comment", "commonObjects") |
|
2185 if cls: |
|
2186 _updateCommentCommonObjectsClass(cls) |
|
2187 |
|
2188 |
|
2189 # ---------------------------------------------------------------------- |
|
2190 |
|
2191 |
|
2192 def _updateBlockFbdObjectsClass(cls): |
2028 def getBoundingBox(self): |
2193 def getBoundingBox(self): |
2029 bbox = _getBoundingBox(self) |
2194 bbox = _getBoundingBox(self) |
2030 for input in self.inputVariables.getvariable(): |
2195 for input in self.inputVariables.getvariable(): |
2031 bbox.union(_getConnectionsBoundingBox(input.connectionPointIn)) |
2196 bbox.union(_getConnectionsBoundingBox(input.connectionPointIn)) |
2032 return bbox |
2197 return bbox |
2067 for result in TestTextElement(variable.getformalParameter(), criteria): |
2232 for result in TestTextElement(variable.getformalParameter(), criteria): |
2068 search_result.append((tuple(parent_infos + ["output", i]),) + result) |
2233 search_result.append((tuple(parent_infos + ["output", i]),) + result) |
2069 return search_result |
2234 return search_result |
2070 setattr(cls, "Search", Search) |
2235 setattr(cls, "Search", Search) |
2071 |
2236 |
|
2237 |
|
2238 cls = _initElementClass("block", "fbdObjects") |
|
2239 if cls: |
|
2240 _updateBlockFbdObjectsClass(cls) |
|
2241 |
|
2242 |
|
2243 # ---------------------------------------------------------------------- |
|
2244 |
|
2245 |
2072 _initElementClass("leftPowerRail", "ldObjects") |
2246 _initElementClass("leftPowerRail", "ldObjects") |
2073 _initElementClass("rightPowerRail", "ldObjects", "multiple") |
2247 _initElementClass("rightPowerRail", "ldObjects", "multiple") |
2074 |
2248 |
2075 |
2249 |
2076 def _UpdateLDElementName(self, old_name, new_name): |
2250 def _UpdateLDElementName(self, old_name, new_name): |
2086 def SearchInLDElement(self, criteria, parent_infos=[]): |
2260 def SearchInLDElement(self, criteria, parent_infos=[]): |
2087 return _Search([("reference", self.variable)], criteria, parent_infos + [ld_element_type, self.getlocalId()]) |
2261 return _Search([("reference", self.variable)], criteria, parent_infos + [ld_element_type, self.getlocalId()]) |
2088 return SearchInLDElement |
2262 return SearchInLDElement |
2089 |
2263 |
2090 |
2264 |
|
2265 # ---------------------------------------------------------------------- |
|
2266 |
|
2267 |
2091 cls = _initElementClass("contact", "ldObjects", "single") |
2268 cls = _initElementClass("contact", "ldObjects", "single") |
2092 if cls: |
2269 if cls: |
2093 setattr(cls, "updateElementName", _UpdateLDElementName) |
2270 setattr(cls, "updateElementName", _UpdateLDElementName) |
2094 setattr(cls, "updateElementAddress", _UpdateLDElementAddress) |
2271 setattr(cls, "updateElementAddress", _UpdateLDElementAddress) |
2095 setattr(cls, "Search", _getSearchInLDElement("contact")) |
2272 setattr(cls, "Search", _getSearchInLDElement("contact")) |
2096 |
2273 |
|
2274 |
|
2275 # ---------------------------------------------------------------------- |
|
2276 |
|
2277 |
2097 cls = _initElementClass("coil", "ldObjects", "single") |
2278 cls = _initElementClass("coil", "ldObjects", "single") |
2098 if cls: |
2279 if cls: |
2099 setattr(cls, "updateElementName", _UpdateLDElementName) |
2280 setattr(cls, "updateElementName", _UpdateLDElementName) |
2100 setattr(cls, "updateElementAddress", _UpdateLDElementAddress) |
2281 setattr(cls, "updateElementAddress", _UpdateLDElementAddress) |
2101 setattr(cls, "Search", _getSearchInLDElement("coil")) |
2282 setattr(cls, "Search", _getSearchInLDElement("coil")) |
2102 |
2283 |
2103 cls = _initElementClass("step", "sfcObjects", "single") |
2284 |
2104 if cls: |
2285 # ---------------------------------------------------------------------- |
|
2286 |
|
2287 |
|
2288 def _updateStepSfcObjectSingleClass(cls): |
2105 def Search(self, criteria, parent_infos=[]): |
2289 def Search(self, criteria, parent_infos=[]): |
2106 return _Search([("name", self.getname())], criteria, parent_infos + ["step", self.getlocalId()]) |
2290 return _Search([("name", self.getname())], criteria, parent_infos + ["step", self.getlocalId()]) |
2107 setattr(cls, "Search", Search) |
2291 setattr(cls, "Search", Search) |
2108 |
2292 |
2109 cls = _initElementClass("transition", "sfcObjects") |
2293 |
2110 if cls: |
2294 cls = _initElementClass("step", "sfcObjects", "single") |
|
2295 if cls: |
|
2296 _updateStepSfcObjectSingleClass(cls) |
|
2297 |
|
2298 |
|
2299 # ---------------------------------------------------------------------- |
|
2300 |
|
2301 |
|
2302 def _updateTransitionSfcObjectsClass(cls): |
2111 def setconditionContent(self, condition_type, value): |
2303 def setconditionContent(self, condition_type, value): |
2112 if self.condition is None: |
2304 if self.condition is None: |
2113 self.addcondition() |
2305 self.addcondition() |
2114 if condition_type == "connection": |
2306 if condition_type == "connection": |
2115 condition = PLCOpenParser.CreateElement("connectionPointIn", "condition") |
2307 condition = PLCOpenParser.CreateElement("connectionPointIn", "condition") |
2216 elif content_name == "inline": |
2408 elif content_name == "inline": |
2217 search_result.extend(content.Search(criteria, parent_infos + ["inline"])) |
2409 search_result.extend(content.Search(criteria, parent_infos + ["inline"])) |
2218 return search_result |
2410 return search_result |
2219 setattr(cls, "Search", Search) |
2411 setattr(cls, "Search", Search) |
2220 |
2412 |
|
2413 |
|
2414 cls = _initElementClass("transition", "sfcObjects") |
|
2415 if cls: |
|
2416 _updateTransitionSfcObjectsClass(cls) |
|
2417 |
|
2418 |
|
2419 # ---------------------------------------------------------------------- |
|
2420 |
|
2421 |
2221 _initElementClass("selectionDivergence", "sfcObjects", "single") |
2422 _initElementClass("selectionDivergence", "sfcObjects", "single") |
2222 _initElementClass("selectionConvergence", "sfcObjects", "multiple") |
2423 _initElementClass("selectionConvergence", "sfcObjects", "multiple") |
2223 _initElementClass("simultaneousDivergence", "sfcObjects", "single") |
2424 _initElementClass("simultaneousDivergence", "sfcObjects", "single") |
2224 _initElementClass("simultaneousConvergence", "sfcObjects", "multiple") |
2425 _initElementClass("simultaneousConvergence", "sfcObjects", "multiple") |
2225 |
2426 |
2226 cls = _initElementClass("jumpStep", "sfcObjects", "single") |
2427 |
2227 if cls: |
2428 def _updateJumpStepSfcObjectSingleClass(cls): |
2228 def Search(self, criteria, parent_infos): |
2429 def Search(self, criteria, parent_infos): |
2229 return _Search([("target", self.gettargetName())], criteria, parent_infos + ["jump", self.getlocalId()]) |
2430 return _Search([("target", self.gettargetName())], criteria, parent_infos + ["jump", self.getlocalId()]) |
2230 setattr(cls, "Search", Search) |
2431 setattr(cls, "Search", Search) |
2231 |
2432 |
2232 cls = PLCOpenParser.GetElementClass("action", "actionBlock") |
2433 |
2233 if cls: |
2434 cls = _initElementClass("jumpStep", "sfcObjects", "single") |
|
2435 if cls: |
|
2436 _updateJumpStepSfcObjectSingleClass(cls) |
|
2437 |
|
2438 |
|
2439 # ---------------------------------------------------------------------- |
|
2440 |
|
2441 |
|
2442 def _updateActionActionBlockClass(cls): |
2234 def setreferenceName(self, name): |
2443 def setreferenceName(self, name): |
2235 if self.reference is not None: |
2444 if self.reference is not None: |
2236 self.reference.setname(name) |
2445 self.reference.setname(name) |
2237 setattr(cls, "setreferenceName", setreferenceName) |
2446 setattr(cls, "setreferenceName", setreferenceName) |
2238 |
2447 |
2278 ("duration", self.getduration()), |
2487 ("duration", self.getduration()), |
2279 ("indicator", self.getindicator())], |
2488 ("indicator", self.getindicator())], |
2280 criteria, parent_infos) |
2489 criteria, parent_infos) |
2281 setattr(cls, "Search", Search) |
2490 setattr(cls, "Search", Search) |
2282 |
2491 |
2283 cls = _initElementClass("actionBlock", "commonObjects", "single") |
2492 |
2284 if cls: |
2493 cls = PLCOpenParser.GetElementClass("action", "actionBlock") |
|
2494 if cls: |
|
2495 _updateActionActionBlockClass(cls) |
|
2496 |
|
2497 |
|
2498 # ---------------------------------------------------------------------- |
|
2499 |
|
2500 |
|
2501 def _updateActionBlockCommonObjectsSingleClass(cls): |
2285 def setactions(self, actions): |
2502 def setactions(self, actions): |
2286 self.action = [] |
2503 self.action = [] |
2287 for params in actions: |
2504 for params in actions: |
2288 action = PLCOpenParser.CreateElement("action", "actionBlock") |
2505 action = PLCOpenParser.CreateElement("action", "actionBlock") |
2289 self.appendaction(action) |
2506 self.appendaction(action) |
2340 search_result.extend(action.Search(criteria, parent_infos + ["action", idx])) |
2557 search_result.extend(action.Search(criteria, parent_infos + ["action", idx])) |
2341 return search_result |
2558 return search_result |
2342 setattr(cls, "Search", Search) |
2559 setattr(cls, "Search", Search) |
2343 |
2560 |
2344 |
2561 |
|
2562 cls = _initElementClass("actionBlock", "commonObjects", "single") |
|
2563 if cls: |
|
2564 _updateActionBlockCommonObjectsSingleClass(cls) |
|
2565 |
|
2566 |
|
2567 # ---------------------------------------------------------------------- |
|
2568 |
|
2569 |
2345 def _SearchInIOVariable(self, criteria, parent_infos=[]): |
2570 def _SearchInIOVariable(self, criteria, parent_infos=[]): |
2346 return _Search([("expression", self.expression)], criteria, parent_infos + ["io_variable", self.getlocalId()]) |
2571 return _Search([("expression", self.expression)], criteria, parent_infos + ["io_variable", self.getlocalId()]) |
2347 |
2572 |
2348 |
2573 |
2349 def _UpdateIOElementName(self, old_name, new_name): |
2574 def _UpdateIOElementName(self, old_name, new_name): |
2376 |
2601 |
2377 def _SearchInConnector(self, criteria, parent_infos=[]): |
2602 def _SearchInConnector(self, criteria, parent_infos=[]): |
2378 return _Search([("name", self.getname())], criteria, parent_infos + ["connector", self.getlocalId()]) |
2603 return _Search([("name", self.getname())], criteria, parent_infos + ["connector", self.getlocalId()]) |
2379 |
2604 |
2380 |
2605 |
2381 cls = _initElementClass("continuation", "commonObjects") |
2606 # ---------------------------------------------------------------------- |
2382 if cls: |
2607 |
|
2608 |
|
2609 def _updateContinuationCommonObjectsClass(cls): |
2383 setattr(cls, "Search", _SearchInConnector) |
2610 setattr(cls, "Search", _SearchInConnector) |
2384 |
2611 |
2385 def updateElementName(self, old_name, new_name): |
2612 def updateElementName(self, old_name, new_name): |
2386 if TextMatched(self.name, old_name): |
2613 if TextMatched(self.name, old_name): |
2387 self.name = new_name |
2614 self.name = new_name |
2388 setattr(cls, "updateElementName", updateElementName) |
2615 setattr(cls, "updateElementName", updateElementName) |
2389 |
2616 |
2390 cls = _initElementClass("connector", "commonObjects", "single") |
2617 |
2391 if cls: |
2618 cls = _initElementClass("continuation", "commonObjects") |
|
2619 if cls: |
|
2620 _updateContinuationCommonObjectsClass(cls) |
|
2621 |
|
2622 |
|
2623 # ---------------------------------------------------------------------- |
|
2624 |
|
2625 |
|
2626 def _updateConnectorCommonObjectsSingleClass(cls): |
2392 setattr(cls, "Search", _SearchInConnector) |
2627 setattr(cls, "Search", _SearchInConnector) |
2393 |
2628 |
2394 def updateElementName(self, old_name, new_name): |
2629 def updateElementName(self, old_name, new_name): |
2395 if TextMatched(self.name, old_name): |
2630 if TextMatched(self.name, old_name): |
2396 self.name = new_name |
2631 self.name = new_name |
2397 setattr(cls, "updateElementName", updateElementName) |
2632 setattr(cls, "updateElementName", updateElementName) |
2398 |
2633 |
2399 cls = PLCOpenParser.GetElementClass("connection") |
2634 |
2400 if cls: |
2635 cls = _initElementClass("connector", "commonObjects", "single") |
|
2636 if cls: |
|
2637 _updateConnectorCommonObjectsSingleClass(cls) |
|
2638 |
|
2639 |
|
2640 # ---------------------------------------------------------------------- |
|
2641 |
|
2642 |
|
2643 def _updateConnectionClass(cls): |
2401 def setpoints(self, points): |
2644 def setpoints(self, points): |
2402 positions = [] |
2645 positions = [] |
2403 for point in points: |
2646 for point in points: |
2404 position = PLCOpenParser.CreateElement("position", "connection") |
2647 position = PLCOpenParser.CreateElement("position", "connection") |
2405 position.setx(point.x) |
2648 position.setx(point.x) |
2413 for position in self.position: |
2656 for position in self.position: |
2414 points.append((position.getx(), position.gety())) |
2657 points.append((position.getx(), position.gety())) |
2415 return points |
2658 return points |
2416 setattr(cls, "getpoints", getpoints) |
2659 setattr(cls, "getpoints", getpoints) |
2417 |
2660 |
2418 cls = PLCOpenParser.GetElementClass("connectionPointIn") |
2661 |
2419 if cls: |
2662 cls = PLCOpenParser.GetElementClass("connection") |
|
2663 if cls: |
|
2664 _updateConnectionClass(cls) |
|
2665 |
|
2666 |
|
2667 # ---------------------------------------------------------------------- |
|
2668 |
|
2669 |
|
2670 def _updateConnectionPointInClass(cls): |
2420 def setrelPositionXY(self, x, y): |
2671 def setrelPositionXY(self, x, y): |
2421 self.relPosition = PLCOpenParser.CreateElement("relPosition", "connectionPointIn") |
2672 self.relPosition = PLCOpenParser.CreateElement("relPosition", "connectionPointIn") |
2422 self.relPosition.setx(x) |
2673 self.relPosition.setx(x) |
2423 self.relPosition.sety(y) |
2674 self.relPosition.sety(y) |
2424 setattr(cls, "setrelPositionXY", setrelPositionXY) |
2675 setattr(cls, "setrelPositionXY", setrelPositionXY) |
2493 if connection is not None: |
2744 if connection is not None: |
2494 return connection.getformalParameter() |
2745 return connection.getformalParameter() |
2495 return None |
2746 return None |
2496 setattr(cls, "getconnectionParameter", getconnectionParameter) |
2747 setattr(cls, "getconnectionParameter", getconnectionParameter) |
2497 |
2748 |
|
2749 |
2498 cls = PLCOpenParser.GetElementClass("connectionPointOut") |
2750 cls = PLCOpenParser.GetElementClass("connectionPointOut") |
2499 if cls: |
2751 if cls: |
2500 def setrelPositionXY(self, x, y): |
2752 def setrelPositionXY(self, x, y): |
2501 self.relPosition = PLCOpenParser.CreateElement("relPosition", "connectionPointOut") |
2753 self.relPosition = PLCOpenParser.CreateElement("relPosition", "connectionPointOut") |
2502 self.relPosition.setx(x) |
2754 self.relPosition.setx(x) |
2507 if self.relPosition is not None: |
2759 if self.relPosition is not None: |
2508 return self.relPosition.getx(), self.relPosition.gety() |
2760 return self.relPosition.getx(), self.relPosition.gety() |
2509 return self.relPosition |
2761 return self.relPosition |
2510 setattr(cls, "getrelPositionXY", getrelPositionXY) |
2762 setattr(cls, "getrelPositionXY", getrelPositionXY) |
2511 |
2763 |
2512 cls = PLCOpenParser.GetElementClass("value") |
2764 |
2513 if cls: |
2765 cls = PLCOpenParser.GetElementClass("connectionPointIn") |
|
2766 if cls: |
|
2767 _updateConnectionPointInClass(cls) |
|
2768 |
|
2769 |
|
2770 # ---------------------------------------------------------------------- |
|
2771 |
|
2772 |
|
2773 def _updateValueClass(cls): |
2514 def setvalue(self, value): |
2774 def setvalue(self, value): |
2515 value = value.strip() |
2775 value = value.strip() |
2516 if value.startswith("[") and value.endswith("]"): |
2776 if value.startswith("[") and value.endswith("]"): |
2517 content = PLCOpenParser.CreateElement("arrayValue", "value") |
2777 content = PLCOpenParser.CreateElement("arrayValue", "value") |
2518 elif value.startswith("(") and value.endswith(")"): |
2778 elif value.startswith("(") and value.endswith(")"): |
2578 else: |
2843 else: |
2579 values.append(element.getvalue()) |
2844 values.append(element.getvalue()) |
2580 return "[%s]" % ", ".join(values) |
2845 return "[%s]" % ", ".join(values) |
2581 setattr(cls, "getvalue", getvalue) |
2846 setattr(cls, "getvalue", getvalue) |
2582 |
2847 |
2583 cls = PLCOpenParser.GetElementClass("structValue", "value") |
2848 |
2584 if cls: |
2849 cls = PLCOpenParser.GetElementClass("arrayValue", "value") |
2585 structValue_model = re.compile("(.*):=(.*)") |
2850 if cls: |
2586 |
2851 arrayValue_model = re.compile("([0-9]+)\((.*)\)$") |
|
2852 _updateArrayValueValueClass(cls) |
|
2853 |
|
2854 # ---------------------------------------------------------------------- |
|
2855 |
|
2856 |
|
2857 def _updateStructValueValueClass(cls): |
2587 def setvalue(self, value): |
2858 def setvalue(self, value): |
2588 elements = [] |
2859 elements = [] |
2589 for item in extractValues(value[1:-1]): |
2860 for item in extractValues(value[1:-1]): |
2590 result = structValue_model.match(item) |
2861 result = structValue_model.match(item) |
2591 if result is not None: |
2862 if result is not None: |