armodel 1.5.0__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 +13 -13
- 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 +124 -14
- armodel/models/ar_ref.py +109 -62
- armodel/models/bsw_module_template.py +37 -14
- armodel/models/common_structure.py +132 -147
- armodel/models/communication.py +1 -1
- armodel/models/data_prototype.py +41 -6
- armodel/models/datatype.py +11 -5
- armodel/models/fibex/can_communication.py +119 -3
- 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 +81 -88
- 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/lin_communication.py +24 -3
- armodel/models/general_structure.py +101 -8
- 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/multilanguage_data.py +15 -0
- armodel/models/per_instance_memory.py +34 -6
- armodel/models/port_prototype.py +12 -174
- armodel/models/sw_component.py +14 -216
- armodel/parser/abstract_arxml_parser.py +10 -1
- armodel/parser/arxml_parser.py +803 -186
- 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 +1 -1
- armodel/tests/test_armodel/models/test_datatype.py +1 -1
- armodel/tests/test_armodel/models/test_port_interface.py +1 -1
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +3 -3
- armodel/tests/test_armodel/parser/test_sw_components.py +2 -2
- armodel/writer/arxml_writer.py +832 -196
- {armodel-1.5.0.dist-info → armodel-1.6.0.dist-info}/METADATA +24 -1
- armodel-1.6.0.dist-info/RECORD +127 -0
- {armodel-1.5.0.dist-info → armodel-1.6.0.dist-info}/entry_points.txt +3 -1
- armodel-1.5.0.dist-info/RECORD +0 -91
- {armodel-1.5.0.dist-info → armodel-1.6.0.dist-info}/LICENSE +0 -0
- {armodel-1.5.0.dist-info → armodel-1.6.0.dist-info}/WHEEL +0 -0
- {armodel-1.5.0.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,172 +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
|
-
@property
|
|
54
|
-
def operationRef(self) -> RefType:
|
|
55
|
-
return self.operation_ref
|
|
56
|
-
|
|
57
|
-
@operationRef.setter
|
|
58
|
-
def operationRef(self, value:RefType):
|
|
59
|
-
self.operation_ref = value
|
|
60
|
-
|
|
61
|
-
class ModeSwitchReceiverComSpec(RPortComSpec):
|
|
62
|
-
def __init__(self):
|
|
63
|
-
super().__init__()
|
|
64
|
-
|
|
65
|
-
self.mode_group_ref = None # type: RefType
|
|
66
|
-
|
|
67
|
-
@property
|
|
68
|
-
def modeGroupRef(self) -> RefType:
|
|
69
|
-
return self.mode_group_ref
|
|
70
|
-
|
|
71
|
-
@modeGroupRef.setter
|
|
72
|
-
def modeGroupRef(self, value: RefType):
|
|
73
|
-
self.mode_group_ref = value
|
|
74
|
-
|
|
75
|
-
class NvRequireComSpec(RPortComSpec):
|
|
76
|
-
def __init__(self):
|
|
77
|
-
super().__init__()
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
class ParameterRequireComSpec(RPortComSpec):
|
|
81
|
-
def __init__(self):
|
|
82
|
-
super().__init__()
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class ReceiverComSpec(RPortComSpec):
|
|
86
|
-
__metaclass__ = ABCMeta
|
|
87
|
-
|
|
88
|
-
def __init__(self):
|
|
89
|
-
super().__init__()
|
|
90
|
-
|
|
91
|
-
self._composite_network_representation = [] # type: List[CompositeNetworkRepresentation]
|
|
92
|
-
self.data_element_ref = None # type: RefType
|
|
93
|
-
self.network_representation = None # type: SwDataDefProps
|
|
94
|
-
self.handle_out_of_range = None # type: str
|
|
95
|
-
self.uses_end_to_end_protection = None # type: ARBoolean
|
|
96
|
-
|
|
97
|
-
def addCompositeNetworkRepresentation(self, representation: CompositeNetworkRepresentation):
|
|
98
|
-
self._composite_network_representation.append(representation)
|
|
99
|
-
|
|
100
|
-
def getCompositeNetworkRepresentations(self) -> List[CompositeNetworkRepresentation]:
|
|
101
|
-
return self._composite_network_representation
|
|
102
|
-
|
|
103
|
-
class ModeSwitchSenderComSpec(RPortComSpec):
|
|
104
|
-
def __init__(self):
|
|
105
|
-
super().__init__()
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class ParameterProvideComSpec(RPortComSpec):
|
|
109
|
-
def __init__(self):
|
|
110
|
-
super().__init__()
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
class SenderComSpec(PPortComSpec):
|
|
114
|
-
__metaclass__ = ABCMeta
|
|
115
|
-
|
|
116
|
-
def __init__(self):
|
|
117
|
-
super().__init__()
|
|
118
|
-
self._composite_network_representation = [] # type: List[CompositeNetworkRepresentation]
|
|
119
|
-
self.data_element_ref = None # type: RefType
|
|
120
|
-
self.network_representation = None # type: SwDataDefProps
|
|
121
|
-
self.handle_out_of_range = None # type: str
|
|
122
|
-
self.transmission_acknowledge = None # type: TransmissionAcknowledgementRequest
|
|
123
|
-
self.uses_end_to_end_protection = None # type: ARBoolean
|
|
124
|
-
|
|
125
|
-
def addCompositeNetworkRepresentation(self, representation: CompositeNetworkRepresentation):
|
|
126
|
-
self._composite_network_representation.append(representation)
|
|
127
|
-
|
|
128
|
-
def getCompositeNetworkRepresentations(self) -> List[CompositeNetworkRepresentation]:
|
|
129
|
-
return self._composite_network_representation
|
|
130
|
-
|
|
131
|
-
class QueuedSenderComSpec(PPortComSpec):
|
|
132
|
-
def __init__(self):
|
|
133
|
-
super().__init__()
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
class NonqueuedSenderComSpec(SenderComSpec):
|
|
137
|
-
def __init__(self):
|
|
138
|
-
super().__init__()
|
|
139
|
-
# (required)
|
|
140
|
-
self.init_value = None # type: ValueSpecification
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
class ServerComSpec(PPortComSpec):
|
|
144
|
-
def __init__(self):
|
|
145
|
-
super().__init__()
|
|
146
|
-
|
|
147
|
-
self.operation_ref = None # type: RefType
|
|
148
|
-
self.queue_length = None # type: int
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
class NonqueuedReceiverComSpec(ReceiverComSpec):
|
|
152
|
-
def __init__(self):
|
|
153
|
-
super().__init__()
|
|
154
|
-
|
|
155
|
-
self.alive_timeout = 0
|
|
156
|
-
self.enable_updated = None # type: ARBoolean
|
|
157
|
-
self.filter = None # type: DataFilter
|
|
158
|
-
self.handle_data_status = None # type: bool
|
|
159
|
-
self.handle_never_received = None # type: ARBoolean
|
|
160
|
-
self.handel_timeout_type = ""
|
|
161
|
-
self.init_value = None # type: ValueSpecification
|
|
162
|
-
self.timeout_substitution = None # type: ValueSpecification
|
|
163
|
-
|
|
164
|
-
class QueuedReceiverComSpec(ReceiverComSpec):
|
|
165
|
-
def __init__(self):
|
|
166
|
-
super().__init__()
|
|
167
|
-
|
|
168
|
-
self.queue_length = 0
|
|
169
|
-
|
|
5
|
+
from .ar_ref import TRefType
|
|
170
6
|
|
|
171
7
|
class PortPrototype(Identifiable):
|
|
172
8
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -180,14 +16,18 @@ class AbstractProvidedPortPrototype(PortPrototype):
|
|
|
180
16
|
|
|
181
17
|
def _validateRPortComSpec(self, com_spec: PPortComSpec):
|
|
182
18
|
if isinstance(com_spec, NonqueuedSenderComSpec):
|
|
183
|
-
if com_spec.
|
|
19
|
+
if com_spec.dataElementRef == None:
|
|
184
20
|
raise ValueError(
|
|
185
21
|
"operation of NonqueuedSenderComSpec is invalid")
|
|
186
|
-
if com_spec.
|
|
22
|
+
if com_spec.dataElementRef.dest != "VARIABLE-DATA-PROTOTYPE":
|
|
187
23
|
raise ValueError(
|
|
188
24
|
"Invalid operation dest of NonqueuedSenderComSpec")
|
|
189
25
|
elif isinstance(com_spec, ServerComSpec):
|
|
190
26
|
pass
|
|
27
|
+
elif isinstance(com_spec, QueuedSenderComSpec):
|
|
28
|
+
pass
|
|
29
|
+
elif isinstance(com_spec, ModeSwitchSenderComSpec):
|
|
30
|
+
pass
|
|
191
31
|
else:
|
|
192
32
|
raise ValueError("Unsupported com spec")
|
|
193
33
|
|
|
@@ -210,16 +50,16 @@ class AbstractRequiredPortPrototype(PortPrototype):
|
|
|
210
50
|
|
|
211
51
|
def _validateRPortComSpec(self, com_spec: RPortComSpec):
|
|
212
52
|
if (isinstance(com_spec, ClientComSpec)):
|
|
213
|
-
if (com_spec.
|
|
53
|
+
if (com_spec.operationRef == None):
|
|
214
54
|
raise ValueError(
|
|
215
55
|
"The operation reference of ClientComSpec has not been defined.")
|
|
216
|
-
if (com_spec.
|
|
56
|
+
if (com_spec.operationRef.dest != "CLIENT-SERVER-OPERATION"):
|
|
217
57
|
raise ValueError("Invalid operation dest of ClientComSpec.")
|
|
218
58
|
elif (isinstance(com_spec, NonqueuedReceiverComSpec)):
|
|
219
|
-
if (com_spec.
|
|
59
|
+
if (com_spec.dataElementRef == None):
|
|
220
60
|
raise ValueError(
|
|
221
61
|
"The data element reference of NonqueuedReceiverComSpec has not been defined.")
|
|
222
|
-
if (com_spec.
|
|
62
|
+
if (com_spec.dataElementRef.dest != "VARIABLE-DATA-PROTOTYPE"):
|
|
223
63
|
raise ValueError(
|
|
224
64
|
"Invalid date element dest of NonqueuedReceiverComSpec.")
|
|
225
65
|
elif isinstance(com_spec, QueuedReceiverComSpec):
|
|
@@ -248,8 +88,6 @@ class PPortPrototype(AbstractProvidedPortPrototype):
|
|
|
248
88
|
super().__init__(parent, short_name)
|
|
249
89
|
|
|
250
90
|
self.provided_interface_tref = TRefType()
|
|
251
|
-
|
|
252
|
-
|
|
253
91
|
class RPortPrototype(AbstractRequiredPortPrototype):
|
|
254
92
|
def __init__(self, parent: ARObject, short_name: str):
|
|
255
93
|
super().__init__(parent, short_name)
|