65 |
65 |
66 MATIEC_ERROR_MODEL = re.compile(".*\.st:(\d+)-(\d+)\.\.(\d+)-(\d+): (?:error)|(?:warning) : (.*)$") |
66 MATIEC_ERROR_MODEL = re.compile(".*\.st:(\d+)-(\d+)\.\.(\d+)-(\d+): (?:error)|(?:warning) : (.*)$") |
67 |
67 |
68 ITEM_CONFNODE = 25 |
68 ITEM_CONFNODE = 25 |
69 |
69 |
|
70 |
70 def ExtractChildrenTypesFromCatalog(catalog): |
71 def ExtractChildrenTypesFromCatalog(catalog): |
71 children_types = [] |
72 children_types = [] |
72 for n,d,h,c in catalog: |
73 for n,d,h,c in catalog: |
73 if isinstance(c, ListType): |
74 if isinstance(c, ListType): |
74 children_types.extend(ExtractChildrenTypesFromCatalog(c)) |
75 children_types.extend(ExtractChildrenTypesFromCatalog(c)) |
75 else: |
76 else: |
76 children_types.append((n, GetClassImporter(c), d)) |
77 children_types.append((n, GetClassImporter(c), d)) |
77 return children_types |
78 return children_types |
|
79 |
78 |
80 |
79 def ExtractMenuItemsFromCatalog(catalog): |
81 def ExtractMenuItemsFromCatalog(catalog): |
80 menu_items = [] |
82 menu_items = [] |
81 for n,d,h,c in catalog: |
83 for n,d,h,c in catalog: |
82 if isinstance(c, ListType): |
84 if isinstance(c, ListType): |
84 else: |
86 else: |
85 children = [] |
87 children = [] |
86 menu_items.append((n, d, h, children)) |
88 menu_items.append((n, d, h, children)) |
87 return menu_items |
89 return menu_items |
88 |
90 |
|
91 |
89 def GetAddMenuItems(): |
92 def GetAddMenuItems(): |
90 return ExtractMenuItemsFromCatalog(features.catalog) |
93 return ExtractMenuItemsFromCatalog(features.catalog) |
|
94 |
91 |
95 |
92 class Iec2CSettings(): |
96 class Iec2CSettings(): |
93 def __init__(self): |
97 def __init__(self): |
94 self.iec2c = None |
98 self.iec2c = None |
95 self.iec2c_buildopts = None |
99 self.iec2c_buildopts = None |
167 if self.ieclib_c_path is None: |
171 if self.ieclib_c_path is None: |
168 self.ieclib_c_path = self.findLibCPath() |
172 self.ieclib_c_path = self.findLibCPath() |
169 return self.ieclib_c_path |
173 return self.ieclib_c_path |
170 |
174 |
171 iec2c_cfg = Iec2CSettings() |
175 iec2c_cfg = Iec2CSettings() |
|
176 |
172 |
177 |
173 class ProjectController(ConfigTreeNode, PLCControler): |
178 class ProjectController(ConfigTreeNode, PLCControler): |
174 """ |
179 """ |
175 This class define Root object of the confnode tree. |
180 This class define Root object of the confnode tree. |
176 It is responsible of : |
181 It is responsible of : |