armodel 1.6.0__py3-none-any.whl → 1.6.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. armodel/cli/arxml_dump_cli.py +25 -22
  2. armodel/cli/arxml_format_cli.py +1 -4
  3. armodel/cli/connector_update_cli.py +1 -1
  4. armodel/cli/swc_list_cli.py +1 -1
  5. armodel/data_models/sw_connector.py +3 -3
  6. armodel/lib/sw_component.py +3 -1
  7. armodel/lib/system_signal.py +3 -1
  8. armodel/models/__init__.py +5 -3
  9. armodel/models/ar_object.py +1 -1
  10. armodel/models/ar_package.py +185 -151
  11. armodel/models/ar_ref.py +0 -202
  12. armodel/models/common_structure.py +3 -71
  13. armodel/models/communication.py +1 -1
  14. armodel/models/datatype.py +7 -72
  15. armodel/models/end_to_end_protection.py +1 -1
  16. armodel/models/general_structure.py +10 -4
  17. armodel/models/internal_behavior.py +1 -1
  18. armodel/models/m2/autosar_templates/autosar_top_level_structure.py +120 -0
  19. armodel/models/m2/autosar_templates/common_structure/implementation.py +21 -0
  20. armodel/models/m2/autosar_templates/common_structure/implementation_data_types.py +154 -0
  21. armodel/models/m2/autosar_templates/ecuc_description_template.py +2 -1
  22. armodel/models/m2/autosar_templates/generic_structure/__init__.py +0 -0
  23. armodel/models/m2/autosar_templates/generic_structure/abstract_structure.py +69 -0
  24. armodel/models/m2/autosar_templates/generic_structure/ar_package.py +528 -0
  25. armodel/models/m2/autosar_templates/sw_component_template/communication.py +44 -0
  26. armodel/models/m2/autosar_templates/sw_component_template/components/__init__.py +246 -0
  27. armodel/models/m2/autosar_templates/sw_component_template/components/instance_refs.py +33 -1
  28. armodel/models/m2/autosar_templates/sw_component_template/composition/__init__.py +154 -0
  29. armodel/models/m2/autosar_templates/sw_component_template/composition/instance_refs.py +157 -0
  30. armodel/models/m2/autosar_templates/sw_component_template/data_type/__init__.py +0 -0
  31. armodel/models/m2/autosar_templates/sw_component_template/data_type/data_prototypes.py +104 -0
  32. armodel/models/m2/autosar_templates/sw_component_template/port_interface/__init__.py +243 -0
  33. armodel/models/m2/autosar_templates/sw_component_template/port_interface/instance_refs.py +39 -0
  34. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py +3 -11
  35. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py +169 -0
  36. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py +1 -2
  37. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py +5 -4
  38. armodel/models/m2/autosar_templates/system_template/instance_refs.py +48 -0
  39. armodel/models/m2_msr.py +1 -0
  40. armodel/models/port_prototype.py +1 -90
  41. armodel/models/service_needs.py +3 -1
  42. armodel/models/sw_component.py +6 -143
  43. armodel/parser/__init__.py +2 -1
  44. armodel/parser/abstract_arxml_parser.py +1 -1
  45. armodel/parser/arxml_parser.py +157 -80
  46. armodel/parser/connector_xlsx_parser.py +3 -1
  47. armodel/parser/file_parser.py +43 -0
  48. armodel/report/connector_xls_report.py +2 -1
  49. armodel/tests/test_armodel/models/test_ar_package.py +6 -3
  50. armodel/tests/test_armodel/models/test_ar_ref.py +15 -13
  51. armodel/tests/test_armodel/models/test_common_structure.py +6 -5
  52. armodel/tests/test_armodel/models/test_data_prototype.py +1 -1
  53. armodel/tests/test_armodel/models/test_datatype.py +9 -9
  54. armodel/tests/test_armodel/models/test_general_structure.py +1 -1
  55. armodel/tests/test_armodel/models/test_implementation.py +1 -1
  56. armodel/tests/test_armodel/models/test_port_interface.py +2 -2
  57. armodel/tests/test_armodel/parser/test_parse_bswmd.py +3 -1
  58. armodel/tests/test_armodel/parser/test_sw_components.py +2 -2
  59. armodel/writer/abstract_arxml_writer.py +5 -1
  60. armodel/writer/arxml_writer.py +70 -60
  61. {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/METADATA +5 -1
  62. {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/RECORD +66 -51
  63. {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/LICENSE +0 -0
  64. {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/WHEEL +0 -0
  65. {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/entry_points.txt +0 -0
  66. {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,154 @@
1
+ from abc import ABCMeta
2
+ from typing import List
3
+
4
+ from ...msr.data_dictionary.data_def_properties import SwDataDefProps
5
+ from ....general_structure import Identifiable
6
+ from ....ar_object import ARBoolean, ARLiteral, ARNumerical, ARObject
7
+ from ....datatype import AutosarDataType
8
+ from ..sw_component_template.components import SymbolProps
9
+
10
+ class AbstractImplementationDataTypeElement(Identifiable):
11
+ def __init__(self, parent, short_name: str):
12
+ super().__init__(parent, short_name)
13
+
14
+ class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
15
+ ARRAY_SIZE_SEMANTICS_FIXED_SIZE = "FIXED-SIZE"
16
+ ARRAY_SIZE_SEMANTICS_VARIABLE_SIZE = "VARIABLE_SIZE"
17
+
18
+ def __init__(self, parent, short_name: str):
19
+ super().__init__(parent, short_name)
20
+
21
+ self.arrayImplPolicy = None # type: ARLiteral
22
+ self.arraySize = None # type: ARNumerical
23
+ self.arraySizeHandling = None # type: ARLiteral
24
+ self.arraySizeSemantics = None # type: ARLiteral
25
+ self.isOptional = None # type: ARBoolean
26
+ self.swDataDefProps = None # type: SwDataDefProps
27
+
28
+ def getArrayImplPolicy(self):
29
+ return self.arrayImplPolicy
30
+
31
+ def setArrayImplPolicy(self, value):
32
+ self.arrayImplPolicy = value
33
+ return self
34
+
35
+ def getArraySize(self):
36
+ return self.arraySize
37
+
38
+ def setArraySize(self, value):
39
+ self.arraySize = value
40
+ return self
41
+
42
+ def getArraySizeHandling(self):
43
+ return self.arraySizeHandling
44
+
45
+ def setArraySizeHandling(self, value):
46
+ self.arraySizeHandling = value
47
+ return self
48
+
49
+ def getArraySizeSemantics(self):
50
+ return self.arraySizeSemantics
51
+
52
+ def setArraySizeSemantics(self, value):
53
+ self.arraySizeSemantics = value
54
+ return self
55
+
56
+ def getIsOptional(self):
57
+ return self.isOptional
58
+
59
+ def setIsOptional(self, value):
60
+ self.isOptional = value
61
+ return self
62
+
63
+ def getSwDataDefProps(self):
64
+ return self.swDataDefProps
65
+
66
+ def setSwDataDefProps(self, value):
67
+ self.swDataDefProps = value
68
+ return self
69
+
70
+ def createImplementationDataTypeElement(self, short_name: str): # type: (...) -> ImplementationDataTypeElement
71
+ if (short_name not in self.elements):
72
+ event = ImplementationDataTypeElement(self, short_name)
73
+ self.elements[short_name] = event
74
+ return self.elements[short_name]
75
+
76
+ def getImplementationDataTypeElements(self): # type:(...) -> List[ImplementationDataTypeElement]
77
+ return list(filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements.values()))
78
+
79
+
80
+ class AbstractImplementationDataType(AutosarDataType, metaclass = ABCMeta):
81
+ def __init__(self, parent: ARObject, short_name: str):
82
+ if type(self) == AbstractImplementationDataType:
83
+ raise NotImplementedError("AbstractImplementationDataType is an abstract class.")
84
+
85
+ super().__init__(parent, short_name)
86
+
87
+ class ImplementationDataType(AbstractImplementationDataType):
88
+
89
+ CATEGORY_TYPE_REFERENCE = "TYPE_REFERENCE"
90
+ CATEGORY_TYPE_VALUE = "VALUE"
91
+ CATEGORY_TYPE_STRUCTURE = "STRUCTURE"
92
+ CATEGORY_DATA_REFERENCE = "DATA_REFERENCE"
93
+ CATEGORY_ARRAY = "ARRAY"
94
+
95
+ def __init__(self, parent: ARObject, short_name: str):
96
+ super().__init__(parent, short_name)
97
+
98
+ self.arrayImplPolicy = None
99
+ self.arraySize = None
100
+ self.arraySizeHandling = None # type: ARLiteral
101
+ self.arraySizeSemantics = None # type: ARLiteral
102
+
103
+ self.subElements = [] # type: List[str]
104
+ self.symbolProps = None # type: SymbolProps
105
+ self._type_emitter = None # type: ARLiteral
106
+
107
+ self._array_type = None # ImplementationDataType
108
+ self._struct_type = None # ImplementationDataType
109
+
110
+
111
+ def createImplementationDataTypeElement(self, short_name: str) -> ImplementationDataTypeElement:
112
+ self.subElements.append(short_name)
113
+ if (short_name not in self.elements):
114
+ event = ImplementationDataTypeElement(self, short_name)
115
+ self.elements[short_name] = event
116
+ return self.elements[short_name]
117
+
118
+ def getImplementationDataTypeElements(self) -> List[ImplementationDataTypeElement]:
119
+ elements = []
120
+ for sub_element in self.subElements:
121
+ elements.append(self.elements[sub_element])
122
+ return elements
123
+ # return filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements.values())
124
+
125
+ def getArrayElementType(self) -> str:
126
+ return self._array_type
127
+
128
+ def setArrayElementType(self, type: str):
129
+ self._array_type = type
130
+ return self
131
+
132
+ def setTypeEmitter(self, emitter: str):
133
+ self._type_emitter = emitter
134
+ return self
135
+
136
+ def getTypeEmitter(self) -> str:
137
+ return self._type_emitter
138
+
139
+ def setStructElementType(self, type: str):
140
+ self._struct_type = type
141
+ return self
142
+
143
+ def getStructElementType(self) -> str:
144
+ return self._struct_type
145
+
146
+ def createSymbolProps(self, short_name: str) -> SymbolProps:
147
+ if short_name not in self.element:
148
+ symbol_props = SymbolProps(self, short_name)
149
+ self.elements[short_name] = symbol_props
150
+ self.symbolProps = symbol_props
151
+ return self.symbolProps
152
+
153
+ def getSymbolProps(self) -> SymbolProps:
154
+ return self.symbolProps
@@ -1,9 +1,10 @@
1
1
  from abc import ABCMeta
2
2
  from typing import List
3
3
 
4
+ from ..autosar_templates.generic_structure.abstract_structure import AnyInstanceRef
4
5
  from ..msr.documentation.block_elements import DocumentationBlock
5
6
  from ...annotation import Annotation
6
- from ...ar_ref import AnyInstanceRef, RefType
7
+ from ...ar_ref import RefType
7
8
  from ...ar_object import ARBoolean, ARLiteral, ARNumerical, ARObject
8
9
  from ...general_structure import ARElement
9
10
 
@@ -0,0 +1,69 @@
1
+
2
+ from abc import ABCMeta
3
+ from typing import List
4
+
5
+ from ....ar_ref import RefType
6
+ from ....ar_object import ARObject
7
+
8
+
9
+ class AtpInstanceRef(ARObject, metaclass = ABCMeta):
10
+ def __init__(self):
11
+
12
+ if type(self) == AtpInstanceRef:
13
+ raise NotImplementedError("AtpInstanceRef is an abstract class.")
14
+
15
+ super().__init__()
16
+
17
+ self.atpBaseRef = None # type: RefType
18
+ self.atpContextElementRefs = [] # type: List[RefType]
19
+ self.atpTargetRef = None # type: RefType
20
+
21
+ def getAtpBaseRef(self):
22
+ return self.atpBaseRef
23
+
24
+ def setAtpBaseRef(self, value):
25
+ self.atpBaseRef = value
26
+ return self
27
+
28
+ def getAtpContextElementRefs(self):
29
+ return self.atpContextElementRefs
30
+
31
+ def addAtpContextElementRef(self, value):
32
+ self.atpContextElementRefs.append(value)
33
+ return self
34
+
35
+ def getAtpTargetRef(self):
36
+ return self.atpTargetRef
37
+
38
+ def setAtpTargetRef(self, value):
39
+ self.atpTargetRef = value
40
+ return self
41
+
42
+ class AnyInstanceRef(ARObject):
43
+ def __init__(self):
44
+ super().__init__()
45
+
46
+ self.baseRef = None # type: RefType
47
+ self.contextElementRef = None # type: RefType
48
+ self.targetRef = None # type: RefType
49
+
50
+ def getBaseRef(self) -> RefType:
51
+ return self.baseRef
52
+
53
+ def setBaseRef(self, value: RefType):
54
+ self.baseRef = value
55
+ return self
56
+
57
+ def getContextElementRef(self) -> RefType:
58
+ return self.contextElementRef
59
+
60
+ def setContextElementRef(self, value: RefType):
61
+ self.contextElementRef = value
62
+ return self
63
+
64
+ def getTargetRef(self) -> RefType:
65
+ return self.targetRef
66
+
67
+ def setTargetRef(self, value:RefType):
68
+ self.targetRef = value
69
+ return self