2 # -*- coding: utf-8 -*- |
2 # -*- coding: utf-8 -*- |
3 # This file is part of Beremiz. |
3 # This file is part of Beremiz. |
4 # See COPYING file for copyrights details. |
4 # See COPYING file for copyrights details. |
5 |
5 |
6 from __future__ import absolute_import |
6 from __future__ import absolute_import |
7 from plcopen.XSLTModelQuery import XSLTModelQuery |
7 from plcopen.XSLTModelQuery import XSLTModelQuery, _StringValue, _BoolValue, _translate_args |
|
8 from plcopen.types_enums import CLASS_TYPES, POU_TYPES, VAR_CLASS_INFOS |
8 |
9 |
9 def class_extraction(value): |
10 def class_extraction(value): |
10 class_type = { |
11 class_type = CLASS_TYPES.get(value) |
11 "configuration": ITEM_CONFIGURATION, |
|
12 "resource": ITEM_RESOURCE, |
|
13 "action": ITEM_ACTION, |
|
14 "transition": ITEM_TRANSITION, |
|
15 "program": ITEM_PROGRAM}.get(value) |
|
16 if class_type is not None: |
12 if class_type is not None: |
17 return class_type |
13 return class_type |
18 |
14 |
19 pou_type = POU_TYPES.get(value) |
15 pou_type = POU_TYPES.get(value) |
20 if pou_type is not None: |
16 if pou_type is not None: |