armodel 1.4.3__py3-none-any.whl → 1.6.0__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.
- armodel/cli/arxml_dump_cli.py +14 -14
- armodel/cli/memory_section_cli.py +76 -0
- armodel/cli/system_signal_cli.py +74 -0
- armodel/lib/__init__.py +2 -1
- armodel/lib/system_signal.py +37 -0
- armodel/models/__init__.py +6 -3
- armodel/models/annotation.py +27 -3
- armodel/models/ar_object.py +18 -6
- armodel/models/ar_package.py +248 -30
- armodel/models/ar_ref.py +115 -45
- armodel/models/bsw_module_template.py +66 -28
- armodel/models/common_structure.py +150 -150
- armodel/models/communication.py +1 -1
- armodel/models/data_prototype.py +41 -6
- armodel/models/datatype.py +11 -5
- armodel/models/fibex/__init__.py +0 -0
- armodel/models/fibex/can_communication.py +122 -0
- armodel/models/fibex/fibex_4_can/__init__.py +0 -0
- armodel/models/fibex/fibex_4_lin/__init__.py +0 -0
- armodel/models/fibex/fibex_4_multiplatform.py +138 -0
- armodel/models/fibex/fibex_core/__init__.py +0 -0
- armodel/models/fibex/fibex_core/core_communication.py +627 -0
- armodel/models/fibex/fibex_core/core_topology.py +180 -0
- armodel/models/fibex/fibex_core.py +341 -0
- armodel/models/fibex/lin_communication.py +38 -0
- armodel/models/fibex/lin_topology.py +7 -0
- armodel/models/general_structure.py +119 -10
- armodel/models/implementation.py +4 -5
- armodel/models/internal_behavior.py +63 -0
- armodel/models/m2/__init__.py +0 -0
- armodel/models/m2/autosar_templates/__init__.py +0 -0
- armodel/models/m2/autosar_templates/common_structure/__init__.py +188 -0
- armodel/models/m2/autosar_templates/common_structure/constants.py +0 -0
- armodel/models/m2/autosar_templates/ecuc_description_template.py +268 -0
- armodel/models/m2/autosar_templates/sw_component_template/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/communication.py +316 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/instance_refs.py +149 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface.py +236 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/__init__.py +203 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py +13 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py +54 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py +39 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py +26 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/trigger.py +10 -0
- armodel/models/m2/autosar_templates/system_template/__init__.py +321 -0
- armodel/models/m2/autosar_templates/system_template/data_mapping.py +88 -0
- armodel/models/m2/autosar_templates/system_template/network_management.py +554 -0
- armodel/models/m2/autosar_templates/system_template/transport_protocols.py +7 -0
- armodel/models/m2/msr/__init__.py +0 -0
- armodel/models/m2/msr/asam_hdo/__init__.py +0 -0
- armodel/models/m2/msr/asam_hdo/units.py +105 -0
- armodel/models/m2/msr/data_dictionary/__init__.py +0 -0
- armodel/models/m2/msr/data_dictionary/auxillary_objects.py +42 -0
- armodel/models/m2/msr/data_dictionary/data_def_properties.py +295 -0
- armodel/models/m2/msr/documentation/__init__.py +0 -0
- armodel/models/m2/msr/documentation/block_elements.py +18 -0
- armodel/models/mode_declaration.py +8 -0
- armodel/models/multilanguage_data.py +15 -0
- armodel/models/per_instance_memory.py +34 -6
- armodel/models/port_prototype.py +15 -159
- armodel/models/rpt_scenario.py +20 -0
- armodel/models/sw_component.py +48 -187
- armodel/models/system_template/__init__.py +0 -0
- armodel/models/system_template/network_management.py +7 -0
- armodel/models/system_template/transport_protocols.py +7 -0
- armodel/models/timing.py +91 -0
- armodel/parser/abstract_arxml_parser.py +11 -2
- armodel/parser/arxml_parser.py +1101 -227
- armodel/tests/test_armodel/models/test_ar_package.py +1 -1
- armodel/tests/test_armodel/models/test_ar_ref.py +3 -3
- armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -5
- armodel/tests/test_armodel/models/test_common_structure.py +3 -3
- armodel/tests/test_armodel/models/test_data_dictionary.py +5 -5
- armodel/tests/test_armodel/models/test_data_prototype.py +2 -2
- armodel/tests/test_armodel/models/test_datatype.py +8 -8
- armodel/tests/test_armodel/models/test_port_interface.py +6 -6
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +16 -8
- armodel/tests/test_armodel/parser/test_sw_components.py +6 -6
- armodel/writer/arxml_writer.py +1046 -181
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/METADATA +48 -1
- armodel-1.6.0.dist-info/RECORD +127 -0
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/entry_points.txt +3 -1
- armodel-1.4.3.dist-info/RECORD +0 -78
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/LICENSE +0 -0
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/WHEEL +0 -0
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from ...autosar_templates.common_structure import ValueSpecification
|
|
4
|
+
from ....calibration import SwCalprmAxisSet
|
|
5
|
+
from ....ar_ref import RefType
|
|
6
|
+
from ....annotation import Annotation
|
|
7
|
+
from ....ar_object import ARFloat, ARLiteral, ARObject
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SwDataDefPropsConditional(ARObject):
|
|
11
|
+
'''
|
|
12
|
+
Patch for the time-stamp
|
|
13
|
+
'''
|
|
14
|
+
def __init__(self):
|
|
15
|
+
super().__init__()
|
|
16
|
+
|
|
17
|
+
class SwDataDefProps(ARObject):
|
|
18
|
+
def __init__(self):
|
|
19
|
+
super().__init__()
|
|
20
|
+
|
|
21
|
+
self.additionalNativeTypeQualifier = None
|
|
22
|
+
self.annotations = [] # type: List[Annotation]
|
|
23
|
+
self.baseTypeRef = None # type: RefType
|
|
24
|
+
self.compuMethodRef = None # type: RefType
|
|
25
|
+
self.dataConstrRef = None # type: RefType
|
|
26
|
+
self.displayFormat = None # type: ARLiteral
|
|
27
|
+
self.displayPresentation = None # type: ARLiteral
|
|
28
|
+
self.implementationDataTypeRef = None # type: RefType
|
|
29
|
+
self.invalidValue = None # type: ValueSpecification
|
|
30
|
+
self.stepSize = None # type: ARFloat
|
|
31
|
+
self.swAddrMethodRef = None # type: RefType
|
|
32
|
+
self.swAlignment = None # type: ARLiteral
|
|
33
|
+
self.swBitRepresentation = None # type: ARLiteral
|
|
34
|
+
self.swCalibrationAccess = None # type: ARLiteral
|
|
35
|
+
self.swCalprmAxisSet = None # type: SwCalprmAxisSet
|
|
36
|
+
self.swComparisonVariables = []
|
|
37
|
+
self.swDataDependency = None
|
|
38
|
+
self.swHostVariable = None
|
|
39
|
+
self.swImplPolicy = None # type: ARLiteral
|
|
40
|
+
self.swIntendedResolution = None
|
|
41
|
+
self.swInterpolationMethod = None
|
|
42
|
+
self.swIsVirtual = None
|
|
43
|
+
self.swPointerTargetProps = None # type: SwPointerTargetProps
|
|
44
|
+
self.swRecordLayoutRef = None # type: RefType
|
|
45
|
+
self.swRefreshTiming = None
|
|
46
|
+
self.swTextProps = None
|
|
47
|
+
self.swValueBlockSize = None
|
|
48
|
+
self.swValueBlockSizeMults = []
|
|
49
|
+
self.unitRef = None # type: RefType
|
|
50
|
+
self.valueAxisDataTypeRef = None # type: RefType
|
|
51
|
+
|
|
52
|
+
self.conditional = SwDataDefPropsConditional() # type: SwDataDefPropsConditional
|
|
53
|
+
|
|
54
|
+
def getAdditionalNativeTypeQualifier(self):
|
|
55
|
+
return self.additionalNativeTypeQualifier
|
|
56
|
+
|
|
57
|
+
def setAdditionalNativeTypeQualifier(self, value):
|
|
58
|
+
self.additionalNativeTypeQualifier = value
|
|
59
|
+
return self
|
|
60
|
+
|
|
61
|
+
def getAnnotations(self) -> List[Annotation]:
|
|
62
|
+
return self.annotations
|
|
63
|
+
|
|
64
|
+
def addAnnotation(self, annotation: Annotation):
|
|
65
|
+
self.annotations.append(annotation)
|
|
66
|
+
return self
|
|
67
|
+
|
|
68
|
+
def getBaseTypeRef(self):
|
|
69
|
+
return self.baseTypeRef
|
|
70
|
+
|
|
71
|
+
def setBaseTypeRef(self, value):
|
|
72
|
+
self.baseTypeRef = value
|
|
73
|
+
return self
|
|
74
|
+
|
|
75
|
+
def getCompuMethodRef(self):
|
|
76
|
+
return self.compuMethodRef
|
|
77
|
+
|
|
78
|
+
def setCompuMethodRef(self, value):
|
|
79
|
+
self.compuMethodRef = value
|
|
80
|
+
return self
|
|
81
|
+
|
|
82
|
+
def getDataConstrRef(self):
|
|
83
|
+
return self.dataConstrRef
|
|
84
|
+
|
|
85
|
+
def setDataConstrRef(self, value):
|
|
86
|
+
self.dataConstrRef = value
|
|
87
|
+
return self
|
|
88
|
+
|
|
89
|
+
def getDisplayFormat(self):
|
|
90
|
+
return self.displayFormat
|
|
91
|
+
|
|
92
|
+
def setDisplayFormat(self, value):
|
|
93
|
+
self.displayFormat = value
|
|
94
|
+
return self
|
|
95
|
+
|
|
96
|
+
def getDisplayPresentation(self):
|
|
97
|
+
return self.displayPresentation
|
|
98
|
+
|
|
99
|
+
def setDisplayPresentation(self, value):
|
|
100
|
+
self.displayPresentation = value
|
|
101
|
+
return self
|
|
102
|
+
|
|
103
|
+
def getImplementationDataTypeRef(self):
|
|
104
|
+
return self.implementationDataTypeRef
|
|
105
|
+
|
|
106
|
+
def setImplementationDataTypeRef(self, value):
|
|
107
|
+
self.implementationDataTypeRef = value
|
|
108
|
+
return self
|
|
109
|
+
|
|
110
|
+
def getInvalidValue(self):
|
|
111
|
+
return self.invalidValue
|
|
112
|
+
|
|
113
|
+
def setInvalidValue(self, value):
|
|
114
|
+
self.invalidValue = value
|
|
115
|
+
return self
|
|
116
|
+
|
|
117
|
+
def getStepSize(self):
|
|
118
|
+
return self.stepSize
|
|
119
|
+
|
|
120
|
+
def setStepSize(self, value):
|
|
121
|
+
self.stepSize = value
|
|
122
|
+
return self
|
|
123
|
+
|
|
124
|
+
def getSwAddrMethodRef(self):
|
|
125
|
+
return self.swAddrMethodRef
|
|
126
|
+
|
|
127
|
+
def setSwAddrMethodRef(self, value):
|
|
128
|
+
self.swAddrMethodRef = value
|
|
129
|
+
return self
|
|
130
|
+
|
|
131
|
+
def getSwAlignment(self):
|
|
132
|
+
return self.swAlignment
|
|
133
|
+
|
|
134
|
+
def setSwAlignment(self, value):
|
|
135
|
+
self.swAlignment = value
|
|
136
|
+
return self
|
|
137
|
+
|
|
138
|
+
def getSwBitRepresentation(self):
|
|
139
|
+
return self.swBitRepresentation
|
|
140
|
+
|
|
141
|
+
def setSwBitRepresentation(self, value):
|
|
142
|
+
self.swBitRepresentation = value
|
|
143
|
+
return self
|
|
144
|
+
|
|
145
|
+
def getSwCalibrationAccess(self):
|
|
146
|
+
return self.swCalibrationAccess
|
|
147
|
+
|
|
148
|
+
def setSwCalibrationAccess(self, value):
|
|
149
|
+
self.swCalibrationAccess = value
|
|
150
|
+
return self
|
|
151
|
+
|
|
152
|
+
def getSwCalprmAxisSet(self):
|
|
153
|
+
return self.swCalprmAxisSet
|
|
154
|
+
|
|
155
|
+
def setSwCalprmAxisSet(self, value):
|
|
156
|
+
self.swCalprmAxisSet = value
|
|
157
|
+
return self
|
|
158
|
+
|
|
159
|
+
def getSwComparisonVariables(self):
|
|
160
|
+
return self.swComparisonVariables
|
|
161
|
+
|
|
162
|
+
def setSwComparisonVariables(self, value):
|
|
163
|
+
self.swComparisonVariables = value
|
|
164
|
+
return self
|
|
165
|
+
|
|
166
|
+
def getSwDataDependency(self):
|
|
167
|
+
return self.swDataDependency
|
|
168
|
+
|
|
169
|
+
def setSwDataDependency(self, value):
|
|
170
|
+
self.swDataDependency = value
|
|
171
|
+
return self
|
|
172
|
+
|
|
173
|
+
def getSwHostVariable(self):
|
|
174
|
+
return self.swHostVariable
|
|
175
|
+
|
|
176
|
+
def setSwHostVariable(self, value):
|
|
177
|
+
self.swHostVariable = value
|
|
178
|
+
return self
|
|
179
|
+
|
|
180
|
+
def getSwImplPolicy(self):
|
|
181
|
+
return self.swImplPolicy
|
|
182
|
+
|
|
183
|
+
def setSwImplPolicy(self, value):
|
|
184
|
+
self.swImplPolicy = value
|
|
185
|
+
return self
|
|
186
|
+
|
|
187
|
+
def getSwIntendedResolution(self):
|
|
188
|
+
return self.swIntendedResolution
|
|
189
|
+
|
|
190
|
+
def setSwIntendedResolution(self, value):
|
|
191
|
+
self.swIntendedResolution = value
|
|
192
|
+
return self
|
|
193
|
+
|
|
194
|
+
def getSwInterpolationMethod(self):
|
|
195
|
+
return self.swInterpolationMethod
|
|
196
|
+
|
|
197
|
+
def setSwInterpolationMethod(self, value):
|
|
198
|
+
self.swInterpolationMethod = value
|
|
199
|
+
return self
|
|
200
|
+
|
|
201
|
+
def getSwIsVirtual(self):
|
|
202
|
+
return self.swIsVirtual
|
|
203
|
+
|
|
204
|
+
def setSwIsVirtual(self, value):
|
|
205
|
+
self.swIsVirtual = value
|
|
206
|
+
return self
|
|
207
|
+
|
|
208
|
+
def getSwPointerTargetProps(self):
|
|
209
|
+
return self.swPointerTargetProps
|
|
210
|
+
|
|
211
|
+
def setSwPointerTargetProps(self, value):
|
|
212
|
+
self.swPointerTargetProps = value
|
|
213
|
+
return self
|
|
214
|
+
|
|
215
|
+
def getSwRecordLayoutRef(self):
|
|
216
|
+
return self.swRecordLayoutRef
|
|
217
|
+
|
|
218
|
+
def setSwRecordLayoutRef(self, value):
|
|
219
|
+
self.swRecordLayoutRef = value
|
|
220
|
+
return self
|
|
221
|
+
|
|
222
|
+
def getSwRefreshTiming(self):
|
|
223
|
+
return self.swRefreshTiming
|
|
224
|
+
|
|
225
|
+
def setSwRefreshTiming(self, value):
|
|
226
|
+
self.swRefreshTiming = value
|
|
227
|
+
return self
|
|
228
|
+
|
|
229
|
+
def getSwTextProps(self):
|
|
230
|
+
return self.swTextProps
|
|
231
|
+
|
|
232
|
+
def setSwTextProps(self, value):
|
|
233
|
+
self.swTextProps = value
|
|
234
|
+
return self
|
|
235
|
+
|
|
236
|
+
def getSwValueBlockSize(self):
|
|
237
|
+
return self.swValueBlockSize
|
|
238
|
+
|
|
239
|
+
def setSwValueBlockSize(self, value):
|
|
240
|
+
self.swValueBlockSize = value
|
|
241
|
+
return self
|
|
242
|
+
|
|
243
|
+
def getSwValueBlockSizeMults(self):
|
|
244
|
+
return self.swValueBlockSizeMults
|
|
245
|
+
|
|
246
|
+
def setSwValueBlockSizeMults(self, value):
|
|
247
|
+
self.swValueBlockSizeMults = value
|
|
248
|
+
return self
|
|
249
|
+
|
|
250
|
+
def getUnitRef(self):
|
|
251
|
+
return self.unitRef
|
|
252
|
+
|
|
253
|
+
def setUnitRef(self, value):
|
|
254
|
+
self.unitRef = value
|
|
255
|
+
return self
|
|
256
|
+
|
|
257
|
+
def getValueAxisDataTypeRef(self):
|
|
258
|
+
return self.valueAxisDataTypeRef
|
|
259
|
+
|
|
260
|
+
def setValueAxisDataTypeRef(self, value):
|
|
261
|
+
self.valueAxisDataTypeRef = value
|
|
262
|
+
return self
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class SwPointerTargetProps(ARObject):
|
|
268
|
+
def __init__(self):
|
|
269
|
+
super().__init__()
|
|
270
|
+
|
|
271
|
+
self.functionPointerSignatureRef = None # type: RefType
|
|
272
|
+
self.swDataDefProps = None # type: SwDataDefProps
|
|
273
|
+
self.targetCategory = None # type: ARLiteral
|
|
274
|
+
|
|
275
|
+
def getFunctionPointerSignatureRef(self):
|
|
276
|
+
return self.functionPointerSignatureRef
|
|
277
|
+
|
|
278
|
+
def setFunctionPointerSignatureRef(self, value):
|
|
279
|
+
self.functionPointerSignatureRef = value
|
|
280
|
+
return self
|
|
281
|
+
|
|
282
|
+
def getSwDataDefProps(self):
|
|
283
|
+
return self.swDataDefProps
|
|
284
|
+
|
|
285
|
+
def setSwDataDefProps(self, value):
|
|
286
|
+
self.swDataDefProps = value
|
|
287
|
+
return self
|
|
288
|
+
|
|
289
|
+
def getTargetCategory(self):
|
|
290
|
+
return self.targetCategory
|
|
291
|
+
|
|
292
|
+
def setTargetCategory(self, value):
|
|
293
|
+
self.targetCategory = value
|
|
294
|
+
return self
|
|
295
|
+
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
from .....models.multilanguage_data import MultiLanguageParagraph
|
|
3
|
+
from .....models.ar_object import ARObject
|
|
4
|
+
|
|
5
|
+
class DocumentationBlock(ARObject):
|
|
6
|
+
def __init__(self):
|
|
7
|
+
super().__init__()
|
|
8
|
+
|
|
9
|
+
self.ps = [] # type: List[MultiLanguageParagraph]
|
|
10
|
+
|
|
11
|
+
def addP(self, p: MultiLanguageParagraph):
|
|
12
|
+
self.ps.append(p)
|
|
13
|
+
return self
|
|
14
|
+
|
|
15
|
+
def getPs(self) -> List[MultiLanguageParagraph]:
|
|
16
|
+
return self.ps
|
|
17
|
+
|
|
18
|
+
|
|
@@ -25,9 +25,23 @@ class MultilanguageLongName(ARObject):
|
|
|
25
25
|
|
|
26
26
|
def addL4(self, l4: LLongName):
|
|
27
27
|
self.l4.append(l4)
|
|
28
|
+
return self
|
|
28
29
|
|
|
29
30
|
def getL4s(self) -> List[LLongName]:
|
|
30
31
|
return self.l4
|
|
32
|
+
|
|
33
|
+
class MultiLanguageParagraph(ARObject):
|
|
34
|
+
def __init__(self):
|
|
35
|
+
super().__init__()
|
|
36
|
+
|
|
37
|
+
self.l1 = [] # type: List[LLongName]
|
|
38
|
+
|
|
39
|
+
def addL1(self, l1: LLongName):
|
|
40
|
+
self.l1.append(l1)
|
|
41
|
+
return self
|
|
42
|
+
|
|
43
|
+
def getL1s(self) -> List[LLongName]:
|
|
44
|
+
return self.l1
|
|
31
45
|
|
|
32
46
|
class MultiLanguageOverviewParagraph(ARObject):
|
|
33
47
|
def __init__(self):
|
|
@@ -37,6 +51,7 @@ class MultiLanguageOverviewParagraph(ARObject):
|
|
|
37
51
|
|
|
38
52
|
def addL2(self, l2: LOverviewParagraph):
|
|
39
53
|
self.l2.append(l2)
|
|
54
|
+
return self
|
|
40
55
|
|
|
41
56
|
def getL2s(self) -> List[LOverviewParagraph]:
|
|
42
57
|
return self.l2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
from .data_dictionary import SwDataDefProps
|
|
3
|
-
from .ar_object import ARObject
|
|
2
|
+
from .m2.msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
3
|
+
from .ar_object import ARLiteral, ARObject
|
|
4
4
|
from .general_structure import Identifiable
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,7 +8,35 @@ class PerInstanceMemory(Identifiable):
|
|
|
8
8
|
def __init__(self, parent: ARObject, short_name: str):
|
|
9
9
|
super().__init__(parent, short_name)
|
|
10
10
|
|
|
11
|
-
self.
|
|
12
|
-
self.
|
|
13
|
-
self.type = None # type:
|
|
14
|
-
self.
|
|
11
|
+
self.initValue = None # type: ARLiteral
|
|
12
|
+
self.swDataDefProps = None # type: SwDataDefProps
|
|
13
|
+
self.type = None # type: ARLiteral
|
|
14
|
+
self.typeDefinition = None # type: ARLiteral
|
|
15
|
+
|
|
16
|
+
def getInitValue(self):
|
|
17
|
+
return self.initValue
|
|
18
|
+
|
|
19
|
+
def setInitValue(self, value):
|
|
20
|
+
self.initValue = value
|
|
21
|
+
return self
|
|
22
|
+
|
|
23
|
+
def getSwDataDefProps(self):
|
|
24
|
+
return self.swDataDefProps
|
|
25
|
+
|
|
26
|
+
def setSwDataDefProps(self, value):
|
|
27
|
+
self.swDataDefProps = value
|
|
28
|
+
return self
|
|
29
|
+
|
|
30
|
+
def getType(self):
|
|
31
|
+
return self.type
|
|
32
|
+
|
|
33
|
+
def setType(self, value):
|
|
34
|
+
self.type = value
|
|
35
|
+
return self
|
|
36
|
+
|
|
37
|
+
def getTypeDefinition(self):
|
|
38
|
+
return self.typeDefinition
|
|
39
|
+
|
|
40
|
+
def setTypeDefinition(self, value):
|
|
41
|
+
self.typeDefinition = value
|
|
42
|
+
return self
|
armodel/models/port_prototype.py
CHANGED
|
@@ -1,156 +1,8 @@
|
|
|
1
1
|
from typing import List
|
|
2
2
|
|
|
3
|
-
from .
|
|
4
|
-
from .data_dictionary import SwDataDefProps
|
|
3
|
+
from .m2.autosar_templates.sw_component_template.communication import ClientComSpec, ModeSwitchReceiverComSpec, ModeSwitchSenderComSpec, NonqueuedReceiverComSpec, NonqueuedSenderComSpec, PPortComSpec, QueuedReceiverComSpec, QueuedSenderComSpec, RPortComSpec, ServerComSpec
|
|
5
4
|
from .general_structure import ARObject, Identifiable
|
|
6
|
-
from .ar_ref import
|
|
7
|
-
from .communication import CompositeNetworkRepresentation, TransmissionAcknowledgementRequest
|
|
8
|
-
from .common_structure import ValueSpecification
|
|
9
|
-
|
|
10
|
-
from abc import ABCMeta
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class PPortComSpec(ARObject, metaclass=ABCMeta):
|
|
14
|
-
"""
|
|
15
|
-
Communication attributes of a provided PortPrototype. This class will contain attributes that are valid for
|
|
16
|
-
all kinds of provide ports, independent of client-server or sender-receiver communication patterns.
|
|
17
|
-
|
|
18
|
-
Abstract Class
|
|
19
|
-
|
|
20
|
-
Package: M2::AUTOSARTemplates::SWComponentTemplate::Communication
|
|
21
|
-
Base: ARObject
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
def __init__(self):
|
|
25
|
-
if type(self) == PPortComSpec:
|
|
26
|
-
raise NotImplementedError("PPortComSpec is an abstract class.")
|
|
27
|
-
super().__init__()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class RPortComSpec(ARObject, metaclass=ABCMeta):
|
|
31
|
-
"""
|
|
32
|
-
Communication attributes of a provided PortPrototype. This class will contain attributes that are valid for
|
|
33
|
-
all kinds of provide ports, independent of client-server or sender-receiver communication patterns.
|
|
34
|
-
|
|
35
|
-
Abstract Class
|
|
36
|
-
|
|
37
|
-
Package: M2::AUTOSARTemplates::SWComponentTemplate::Communication
|
|
38
|
-
Base: ARObject
|
|
39
|
-
"""
|
|
40
|
-
|
|
41
|
-
def __init__(self):
|
|
42
|
-
if type(self) == RPortComSpec:
|
|
43
|
-
raise NotImplementedError("RPortComSpec is an abstract class.")
|
|
44
|
-
super().__init__()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
class ClientComSpec(RPortComSpec):
|
|
48
|
-
def __init__(self):
|
|
49
|
-
super().__init__()
|
|
50
|
-
|
|
51
|
-
self.operation_ref = None # type: RefType
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class ModeSwitchReceiverComSpec(RPortComSpec):
|
|
55
|
-
def __init__(self):
|
|
56
|
-
super().__init__()
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class NvRequireComSpec(RPortComSpec):
|
|
60
|
-
def __init__(self):
|
|
61
|
-
super().__init__()
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class ParameterRequireComSpec(RPortComSpec):
|
|
65
|
-
def __init__(self):
|
|
66
|
-
super().__init__()
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class ReceiverComSpec(RPortComSpec):
|
|
70
|
-
__metaclass__ = ABCMeta
|
|
71
|
-
|
|
72
|
-
def __init__(self):
|
|
73
|
-
super().__init__()
|
|
74
|
-
|
|
75
|
-
self._composite_network_representation = [] # type: List[CompositeNetworkRepresentation]
|
|
76
|
-
self.data_element_ref = None # type: RefType
|
|
77
|
-
self.network_representation = None # type: SwDataDefProps
|
|
78
|
-
self.handle_out_of_range = None # type: str
|
|
79
|
-
self.uses_end_to_end_protection = None # type: ARBoolean
|
|
80
|
-
|
|
81
|
-
def addCompositeNetworkRepresentation(self, representation: CompositeNetworkRepresentation):
|
|
82
|
-
self._composite_network_representation.append(representation)
|
|
83
|
-
|
|
84
|
-
def getCompositeNetworkRepresentations(self) -> List[CompositeNetworkRepresentation]:
|
|
85
|
-
return self._composite_network_representation
|
|
86
|
-
|
|
87
|
-
class ModeSwitchSenderComSpec(RPortComSpec):
|
|
88
|
-
def __init__(self):
|
|
89
|
-
super().__init__()
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class ParameterProvideComSpec(RPortComSpec):
|
|
93
|
-
def __init__(self):
|
|
94
|
-
super().__init__()
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class SenderComSpec(PPortComSpec):
|
|
98
|
-
__metaclass__ = ABCMeta
|
|
99
|
-
|
|
100
|
-
def __init__(self):
|
|
101
|
-
super().__init__()
|
|
102
|
-
self._composite_network_representation = [] # type: List[CompositeNetworkRepresentation]
|
|
103
|
-
self.data_element_ref = None # type: RefType
|
|
104
|
-
self.network_representation = None # type: SwDataDefProps
|
|
105
|
-
self.handle_out_of_range = None # type: str
|
|
106
|
-
self.transmission_acknowledge = None # type: TransmissionAcknowledgementRequest
|
|
107
|
-
self.uses_end_to_end_protection = None # type: ARBoolean
|
|
108
|
-
|
|
109
|
-
def addCompositeNetworkRepresentation(self, representation: CompositeNetworkRepresentation):
|
|
110
|
-
self._composite_network_representation.append(representation)
|
|
111
|
-
|
|
112
|
-
def getCompositeNetworkRepresentations(self) -> List[CompositeNetworkRepresentation]:
|
|
113
|
-
return self._composite_network_representation
|
|
114
|
-
|
|
115
|
-
class QueuedSenderComSpec(PPortComSpec):
|
|
116
|
-
def __init__(self):
|
|
117
|
-
super().__init__()
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class NonqueuedSenderComSpec(SenderComSpec):
|
|
121
|
-
def __init__(self):
|
|
122
|
-
super().__init__()
|
|
123
|
-
# (required)
|
|
124
|
-
self.init_value = None # type: ValueSpecification
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
class ServerComSpec(PPortComSpec):
|
|
128
|
-
def __init__(self):
|
|
129
|
-
super().__init__()
|
|
130
|
-
|
|
131
|
-
self.operation_ref = None # type: RefType
|
|
132
|
-
self.queue_length = None # type: int
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class NonqueuedReceiverComSpec(ReceiverComSpec):
|
|
136
|
-
def __init__(self):
|
|
137
|
-
super().__init__()
|
|
138
|
-
|
|
139
|
-
self.alive_timeout = 0
|
|
140
|
-
self.enable_updated = None # type: ARBoolean
|
|
141
|
-
self.filter = None # type: DataFilter
|
|
142
|
-
self.handle_data_status = None # type: bool
|
|
143
|
-
self.handle_never_received = None # type: ARBoolean
|
|
144
|
-
self.handel_timeout_type = ""
|
|
145
|
-
self.init_value = None # type: ValueSpecification
|
|
146
|
-
self.timeout_substitution = None # type: ValueSpecification
|
|
147
|
-
|
|
148
|
-
class QueuedReceiverComSpec(ReceiverComSpec):
|
|
149
|
-
def __init__(self):
|
|
150
|
-
super().__init__()
|
|
151
|
-
|
|
152
|
-
self.queue_length = 0
|
|
153
|
-
|
|
5
|
+
from .ar_ref import TRefType
|
|
154
6
|
|
|
155
7
|
class PortPrototype(Identifiable):
|
|
156
8
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -164,14 +16,18 @@ class AbstractProvidedPortPrototype(PortPrototype):
|
|
|
164
16
|
|
|
165
17
|
def _validateRPortComSpec(self, com_spec: PPortComSpec):
|
|
166
18
|
if isinstance(com_spec, NonqueuedSenderComSpec):
|
|
167
|
-
if com_spec.
|
|
19
|
+
if com_spec.dataElementRef == None:
|
|
168
20
|
raise ValueError(
|
|
169
21
|
"operation of NonqueuedSenderComSpec is invalid")
|
|
170
|
-
if com_spec.
|
|
22
|
+
if com_spec.dataElementRef.dest != "VARIABLE-DATA-PROTOTYPE":
|
|
171
23
|
raise ValueError(
|
|
172
24
|
"Invalid operation dest of NonqueuedSenderComSpec")
|
|
173
25
|
elif isinstance(com_spec, ServerComSpec):
|
|
174
26
|
pass
|
|
27
|
+
elif isinstance(com_spec, QueuedSenderComSpec):
|
|
28
|
+
pass
|
|
29
|
+
elif isinstance(com_spec, ModeSwitchSenderComSpec):
|
|
30
|
+
pass
|
|
175
31
|
else:
|
|
176
32
|
raise ValueError("Unsupported com spec")
|
|
177
33
|
|
|
@@ -194,22 +50,24 @@ class AbstractRequiredPortPrototype(PortPrototype):
|
|
|
194
50
|
|
|
195
51
|
def _validateRPortComSpec(self, com_spec: RPortComSpec):
|
|
196
52
|
if (isinstance(com_spec, ClientComSpec)):
|
|
197
|
-
if (com_spec.
|
|
53
|
+
if (com_spec.operationRef == None):
|
|
198
54
|
raise ValueError(
|
|
199
55
|
"The operation reference of ClientComSpec has not been defined.")
|
|
200
|
-
if (com_spec.
|
|
56
|
+
if (com_spec.operationRef.dest != "CLIENT-SERVER-OPERATION"):
|
|
201
57
|
raise ValueError("Invalid operation dest of ClientComSpec.")
|
|
202
58
|
elif (isinstance(com_spec, NonqueuedReceiverComSpec)):
|
|
203
|
-
if (com_spec.
|
|
59
|
+
if (com_spec.dataElementRef == None):
|
|
204
60
|
raise ValueError(
|
|
205
61
|
"The data element reference of NonqueuedReceiverComSpec has not been defined.")
|
|
206
|
-
if (com_spec.
|
|
62
|
+
if (com_spec.dataElementRef.dest != "VARIABLE-DATA-PROTOTYPE"):
|
|
207
63
|
raise ValueError(
|
|
208
64
|
"Invalid date element dest of NonqueuedReceiverComSpec.")
|
|
209
65
|
elif isinstance(com_spec, QueuedReceiverComSpec):
|
|
210
66
|
pass
|
|
67
|
+
elif isinstance(com_spec, ModeSwitchReceiverComSpec):
|
|
68
|
+
pass
|
|
211
69
|
else:
|
|
212
|
-
raise ValueError("Unsupported RPortComSpec")
|
|
70
|
+
raise ValueError("Unsupported RPortComSpec <%s>" % type(com_spec))
|
|
213
71
|
|
|
214
72
|
def addRequiredComSpec(self, com_spec: RPortComSpec):
|
|
215
73
|
self._validateRPortComSpec(com_spec)
|
|
@@ -230,8 +88,6 @@ class PPortPrototype(AbstractProvidedPortPrototype):
|
|
|
230
88
|
super().__init__(parent, short_name)
|
|
231
89
|
|
|
232
90
|
self.provided_interface_tref = TRefType()
|
|
233
|
-
|
|
234
|
-
|
|
235
91
|
class RPortPrototype(AbstractRequiredPortPrototype):
|
|
236
92
|
def __init__(self, parent: ARObject, short_name: str):
|
|
237
93
|
super().__init__(parent, short_name)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
from abc import ABCMeta
|
|
3
|
+
from .ar_object import ARObject
|
|
4
|
+
from .general_structure import Identifiable
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class IdentCaption(Identifiable):
|
|
8
|
+
|
|
9
|
+
__metaclass__ = ABCMeta
|
|
10
|
+
|
|
11
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
12
|
+
if type(self) == IdentCaption:
|
|
13
|
+
raise NotImplementedError("IdentCaption is an abstract class.")
|
|
14
|
+
|
|
15
|
+
super().__init__(parent, short_name)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ModeAccessPointIdent(IdentCaption):
|
|
19
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
20
|
+
super().__init__(parent, short_name)
|