armodel 1.7.7__py3-none-any.whl → 1.7.8__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 +33 -22
- armodel/cli/arxml_format_cli.py +25 -13
- armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +64 -29
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +322 -63
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +134 -35
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +10 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +18 -2
- armodel/models/M2/AUTOSARTemplates/ECUCDescriptionTemplate.py +20 -19
- armodel/models/M2/AUTOSARTemplates/EcuResourceTemplate/HwElementCategory.py +59 -0
- armodel/models/M2/AUTOSARTemplates/EcuResourceTemplate/__init__.py +145 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +214 -156
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +60 -32
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +63 -42
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +13 -6
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +111 -38
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AccessCount.py +9 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py +5 -4
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +9 -1
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +167 -5
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/{ECUResourceMapping.py → EcuResourceMapping.py} +4 -3
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanTopology.py +31 -21
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetFrame.py +5 -3
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/FlexrayCommunication.py +76 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/FlexrayTopology.py +654 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/__init__.py +0 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +64 -31
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +158 -40
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +19 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py +2 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Transformer/__init__.py +524 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +15 -13
- armodel/models/__init__.py +5 -1
- armodel/parser/abstract_arxml_parser.py +34 -30
- armodel/parser/arxml_parser.py +1196 -525
- armodel/parser/file_parser.py +5 -3
- armodel/tests/test_armodel/models/test_ar_package.py +6 -11
- armodel/tests/test_armodel/models/test_port_interface.py +116 -117
- armodel/tests/test_armodel/parser/test_bsw_module_descriiption.py +109 -109
- armodel/tests/test_armodel/parser/test_sw_components.py +38 -27
- armodel/tests/test_armodel/parser/test_system.py +2 -8
- armodel/transformer/__init__.py +0 -0
- armodel/transformer/abstract.py +6 -0
- armodel/transformer/admin_data.py +31 -0
- armodel/writer/abstract_arxml_writer.py +22 -29
- armodel/writer/arxml_writer.py +1198 -477
- {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/METADATA +41 -1
- {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/RECORD +52 -43
- {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/LICENSE +0 -0
- {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/WHEEL +0 -0
- {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/top_level.txt +0 -0
|
@@ -5,7 +5,8 @@ from .....M2.AUTOSARTemplates.CommonStructure import TextValueSpecification
|
|
|
5
5
|
from .....M2.AUTOSARTemplates.CommonStructure.TriggerDeclaration import Trigger
|
|
6
6
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Identifiable
|
|
7
7
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
8
|
-
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical, ArgumentDirectionEnum,
|
|
8
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical, ArgumentDirectionEnum, Boolean
|
|
9
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import PositiveInteger
|
|
9
10
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ParameterDataPrototype, VariableDataPrototype, AutosarDataPrototype
|
|
10
11
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
|
|
11
12
|
from .....M2.AUTOSARTemplates.CommonStructure.ModeDeclaration import ModeDeclarationGroupPrototype
|
|
@@ -13,9 +14,10 @@ from .....M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AtpType
|
|
|
13
14
|
from .....M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AtpFeature
|
|
14
15
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
|
|
18
|
+
class PortInterface(AtpType, metaclass=ABCMeta):
|
|
17
19
|
def __init__(self, parent: ARObject, short_name: str):
|
|
18
|
-
if type(self)
|
|
20
|
+
if type(self) is PortInterface:
|
|
19
21
|
raise NotImplementedError("PortInterface is an abstract class.")
|
|
20
22
|
super().__init__(parent, short_name)
|
|
21
23
|
|
|
@@ -36,12 +38,14 @@ class PortInterface(AtpType, metaclass = ABCMeta):
|
|
|
36
38
|
self.serviceKind = value
|
|
37
39
|
return self
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
|
|
42
|
+
class DataInterface(PortInterface, metaclass=ABCMeta):
|
|
40
43
|
def __init__(self, parent: ARObject, short_name: str):
|
|
41
|
-
if type(self)
|
|
44
|
+
if type(self) is DataInterface:
|
|
42
45
|
raise NotImplementedError("DataInterface is an abstract class.")
|
|
43
46
|
super().__init__(parent, short_name)
|
|
44
47
|
|
|
48
|
+
|
|
45
49
|
class NvDataInterface(DataInterface):
|
|
46
50
|
def __init__(self, parent: ARObject, short_name: str):
|
|
47
51
|
super().__init__(parent, short_name)
|
|
@@ -55,6 +59,7 @@ class NvDataInterface(DataInterface):
|
|
|
55
59
|
self.nvDatas.append(value)
|
|
56
60
|
return self
|
|
57
61
|
|
|
62
|
+
|
|
58
63
|
class ParameterInterface(DataInterface):
|
|
59
64
|
def __init__(self, parent: ARObject, short_name: str):
|
|
60
65
|
super().__init__(parent, short_name)
|
|
@@ -62,15 +67,15 @@ class ParameterInterface(DataInterface):
|
|
|
62
67
|
self.parameters = [] # type: List[ParameterDataPrototype]
|
|
63
68
|
|
|
64
69
|
def getParameters(self):
|
|
65
|
-
return
|
|
70
|
+
return self.parameters
|
|
71
|
+
|
|
72
|
+
def createParameterDataPrototype(self, short_name: str) -> ParameterDataPrototype:
|
|
73
|
+
prototype = ParameterDataPrototype(self, short_name)
|
|
74
|
+
self.addElement(prototype)
|
|
75
|
+
self.parameters.append(prototype)
|
|
76
|
+
return prototype
|
|
77
|
+
|
|
66
78
|
|
|
67
|
-
def createParameter(self, short_name: str) -> ParameterDataPrototype:
|
|
68
|
-
if (short_name not in self.elements):
|
|
69
|
-
parameter = ParameterDataPrototype(self, short_name)
|
|
70
|
-
self.elements[short_name] = parameter
|
|
71
|
-
self.parameters.append(parameter)
|
|
72
|
-
return self.elements[short_name]
|
|
73
|
-
|
|
74
79
|
class InvalidationPolicy(ARObject):
|
|
75
80
|
def __init__(self):
|
|
76
81
|
super().__init__()
|
|
@@ -91,7 +96,8 @@ class InvalidationPolicy(ARObject):
|
|
|
91
96
|
def setHandleInvalid(self, value):
|
|
92
97
|
self.handleInvalid = value
|
|
93
98
|
return self
|
|
94
|
-
|
|
99
|
+
|
|
100
|
+
|
|
95
101
|
class MetaDataItem(ARObject):
|
|
96
102
|
def __init__(self):
|
|
97
103
|
super().__init__()
|
|
@@ -112,7 +118,8 @@ class MetaDataItem(ARObject):
|
|
|
112
118
|
def setMetaDataItemType(self, value):
|
|
113
119
|
self.metaDataItemType = value
|
|
114
120
|
return self
|
|
115
|
-
|
|
121
|
+
|
|
122
|
+
|
|
116
123
|
class MetaDataItemSet(ARObject):
|
|
117
124
|
def __init__(self):
|
|
118
125
|
super().__init__()
|
|
@@ -134,6 +141,7 @@ class MetaDataItemSet(ARObject):
|
|
|
134
141
|
self.metaDataItems.append(value)
|
|
135
142
|
return self
|
|
136
143
|
|
|
144
|
+
|
|
137
145
|
class SenderReceiverInterface(DataInterface):
|
|
138
146
|
def __init__(self, parent: ARObject, short_name: str):
|
|
139
147
|
super().__init__(parent, short_name)
|
|
@@ -167,7 +175,7 @@ class SenderReceiverInterface(DataInterface):
|
|
|
167
175
|
def getDataElement(self, short_name) -> VariableDataPrototype:
|
|
168
176
|
if (short_name in self.elements):
|
|
169
177
|
data_element = self.elements[short_name]
|
|
170
|
-
#if (not isinstance(data_element, VariableDataPrototype)):
|
|
178
|
+
# if (not isinstance(data_element, VariableDataPrototype)):
|
|
171
179
|
# raise IndexError("%s is not data element." % short_name)
|
|
172
180
|
return data_element
|
|
173
181
|
raise IndexError("data element <%s> can not be found." % short_name)
|
|
@@ -180,34 +188,38 @@ class SenderReceiverInterface(DataInterface):
|
|
|
180
188
|
def getInvalidationPolicys(self) -> List[InvalidationPolicy]:
|
|
181
189
|
return list(filter(lambda c: isinstance(c, InvalidationPolicy), self.invalidationPolicies))
|
|
182
190
|
|
|
191
|
+
|
|
183
192
|
class ArgumentDataPrototype(AutosarDataPrototype):
|
|
184
193
|
def __init__(self, parent: ARObject, short_name: str):
|
|
185
194
|
super().__init__(parent, short_name)
|
|
186
195
|
|
|
187
196
|
self.direction = None # type: ArgumentDirectionEnum
|
|
188
|
-
# type: ServerArgumentImplPolicyEnum
|
|
189
|
-
self.serverArgumentImplPolicy = None
|
|
197
|
+
self.serverArgumentImplPolicy = None # type: ServerArgumentImplPolicyEnum
|
|
190
198
|
|
|
191
199
|
def getDirection(self):
|
|
192
200
|
return self.direction
|
|
193
201
|
|
|
194
202
|
def setDirection(self, value):
|
|
195
|
-
|
|
203
|
+
if value is not None:
|
|
204
|
+
self.direction = value
|
|
196
205
|
return self
|
|
197
206
|
|
|
198
207
|
def getServerArgumentImplPolicy(self):
|
|
199
208
|
return self.serverArgumentImplPolicy
|
|
200
209
|
|
|
201
210
|
def setServerArgumentImplPolicy(self, value):
|
|
202
|
-
|
|
211
|
+
if value is not None:
|
|
212
|
+
self.serverArgumentImplPolicy = value
|
|
203
213
|
return self
|
|
204
214
|
|
|
215
|
+
|
|
205
216
|
class ApplicationError(Identifiable):
|
|
206
217
|
def __init__(self, parent: ARObject, short_name: str):
|
|
207
218
|
super().__init__(parent, short_name)
|
|
208
219
|
|
|
209
220
|
self.error_code = None # type: ARNumerical
|
|
210
221
|
|
|
222
|
+
|
|
211
223
|
class ClientServerOperation(AtpFeature):
|
|
212
224
|
"""
|
|
213
225
|
An operation declared within the scope of a client/server interface.
|
|
@@ -233,27 +245,34 @@ class ClientServerOperation(AtpFeature):
|
|
|
233
245
|
def __init__(self, parent: ARObject, short_name: str):
|
|
234
246
|
super().__init__(parent, short_name)
|
|
235
247
|
|
|
236
|
-
self.
|
|
237
|
-
self.
|
|
248
|
+
self.arguments = [] # type: List[ArgumentDataPrototype]
|
|
249
|
+
self.possibleErrorRefs = [] # type: List[RefType]
|
|
238
250
|
|
|
239
|
-
def
|
|
240
|
-
self.
|
|
251
|
+
def getArguments(self):
|
|
252
|
+
return self.arguments
|
|
241
253
|
|
|
242
|
-
def
|
|
243
|
-
|
|
254
|
+
def createArgumentDataPrototype(self, short_name):
|
|
255
|
+
if not self.IsElementExists(short_name):
|
|
256
|
+
prototype = ArgumentDataPrototype(self, short_name)
|
|
257
|
+
self.addElement(prototype)
|
|
258
|
+
self.arguments.append(prototype)
|
|
259
|
+
return self.getElement(short_name)
|
|
244
260
|
|
|
245
|
-
def
|
|
246
|
-
self.
|
|
261
|
+
def getPossibleErrorRefs(self):
|
|
262
|
+
return self.possibleErrorRefs
|
|
247
263
|
|
|
248
|
-
def
|
|
249
|
-
|
|
264
|
+
def addPossibleErrorRef(self, value):
|
|
265
|
+
if value is not None:
|
|
266
|
+
self.possibleErrorRefs.append(value)
|
|
267
|
+
return self
|
|
250
268
|
|
|
251
269
|
|
|
252
270
|
class ClientServerInterface(PortInterface):
|
|
253
271
|
"""
|
|
254
272
|
A client/server interface declares a number of operations that can be invoked on a server by a client.
|
|
255
273
|
Package: M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
|
|
256
|
-
Base: ARElement, ARObject, AtpBlueprint, AtpBlueprintable, AtpClassifier , AtpType, CollectableElement, Identifiable, MultilanguageReferrable,
|
|
274
|
+
Base: ARElement, ARObject, AtpBlueprint, AtpBlueprintable, AtpClassifier , AtpType, CollectableElement, Identifiable, MultilanguageReferrable,
|
|
275
|
+
PackageableElement, PortInterface, Referrable
|
|
257
276
|
|
|
258
277
|
Methods:
|
|
259
278
|
--------
|
|
@@ -283,13 +302,15 @@ class ClientServerInterface(PortInterface):
|
|
|
283
302
|
|
|
284
303
|
def getPossibleErrors(self) -> List[ApplicationError]:
|
|
285
304
|
return list(filter(lambda c: isinstance(c, ApplicationError), self.elements.values()))
|
|
286
|
-
|
|
305
|
+
|
|
306
|
+
|
|
287
307
|
class TriggerInterface(PortInterface):
|
|
288
308
|
def __init__(self, parent: ARObject, short_name: str):
|
|
289
309
|
super().__init__(parent, short_name)
|
|
290
310
|
|
|
291
311
|
self._triggers = [] # type: Trigger
|
|
292
312
|
|
|
313
|
+
|
|
293
314
|
class ModeSwitchInterface(PortInterface):
|
|
294
315
|
def __init__(self, parent: ARObject, short_name: str):
|
|
295
316
|
super().__init__(parent, short_name)
|
|
@@ -303,14 +324,16 @@ class ModeSwitchInterface(PortInterface):
|
|
|
303
324
|
return self.elements[short_name]
|
|
304
325
|
|
|
305
326
|
def getModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
306
|
-
return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key=
|
|
327
|
+
return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key=lambda o: o.short_name))
|
|
328
|
+
|
|
307
329
|
|
|
308
|
-
class PortInterfaceMapping(Identifiable, metaclass
|
|
330
|
+
class PortInterfaceMapping(Identifiable, metaclass=ABCMeta):
|
|
309
331
|
def __init__(self, parent: ARObject, short_name: str):
|
|
310
|
-
if type(self)
|
|
332
|
+
if type(self) is PortInterfaceMapping:
|
|
311
333
|
raise NotImplementedError("PortInterfaceMapping is an abstract class.")
|
|
312
334
|
super().__init__(parent, short_name)
|
|
313
335
|
|
|
336
|
+
|
|
314
337
|
class ClientServerApplicationErrorMapping(ARObject):
|
|
315
338
|
def __init__(self):
|
|
316
339
|
super().__init__()
|
|
@@ -331,11 +354,11 @@ class ClientServerApplicationErrorMapping(ARObject):
|
|
|
331
354
|
def setSecondApplicationErrorRef(self, value):
|
|
332
355
|
self.secondApplicationErrorRef = value
|
|
333
356
|
return self
|
|
334
|
-
|
|
357
|
+
|
|
358
|
+
|
|
335
359
|
class ClientServerOperationMapping(ARObject):
|
|
336
360
|
def __init__(self):
|
|
337
361
|
super().__init__()
|
|
338
|
-
|
|
339
362
|
|
|
340
363
|
self.argumentMappings = [] # type: List[DataPrototypeMapping]
|
|
341
364
|
self.firstOperationRef = None # type: RefType
|
|
@@ -425,7 +448,6 @@ class DataPrototypeMapping(ARObject):
|
|
|
425
448
|
return self
|
|
426
449
|
|
|
427
450
|
|
|
428
|
-
|
|
429
451
|
class ClientServerInterfaceMapping(PortInterfaceMapping):
|
|
430
452
|
def __init__(self, parent: ARObject, short_name: str):
|
|
431
453
|
super().__init__(parent, short_name)
|
|
@@ -479,3 +501,54 @@ class PortInterfaceMappingSet(ARElement):
|
|
|
479
501
|
self.addElement(mapping)
|
|
480
502
|
self.portInterfaceMappings.append(mapping)
|
|
481
503
|
return self.getElement(short_name)
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
class TextTableMapping(ARObject):
|
|
507
|
+
def __init__(self):
|
|
508
|
+
super().__init__()
|
|
509
|
+
|
|
510
|
+
self.bitfieldTextTableMaskFirst = None # type: PositiveInteger
|
|
511
|
+
self.bitfieldTextTableMaskSecond = None # type: PositiveInteger
|
|
512
|
+
self.identicalMapping = None # type: Boolean
|
|
513
|
+
self.mappingDirection = None # type: MappingDirectionEnum
|
|
514
|
+
self.valuePairs = [] # type: List[TextTableValuePair]
|
|
515
|
+
|
|
516
|
+
def getBitfieldTextTableMaskFirst(self):
|
|
517
|
+
return self.bitfieldTextTableMaskFirst
|
|
518
|
+
|
|
519
|
+
def setBitfieldTextTableMaskFirst(self, value):
|
|
520
|
+
if value is not None:
|
|
521
|
+
self.bitfieldTextTableMaskFirst = value
|
|
522
|
+
return self
|
|
523
|
+
|
|
524
|
+
def getBitfieldTextTableMaskSecond(self):
|
|
525
|
+
return self.bitfieldTextTableMaskSecond
|
|
526
|
+
|
|
527
|
+
def setBitfieldTextTableMaskSecond(self, value):
|
|
528
|
+
if value is not None:
|
|
529
|
+
self.bitfieldTextTableMaskSecond = value
|
|
530
|
+
return self
|
|
531
|
+
|
|
532
|
+
def getIdenticalMapping(self):
|
|
533
|
+
return self.identicalMapping
|
|
534
|
+
|
|
535
|
+
def setIdenticalMapping(self, value):
|
|
536
|
+
if value is not None:
|
|
537
|
+
self.identicalMapping = value
|
|
538
|
+
return self
|
|
539
|
+
|
|
540
|
+
def getMappingDirection(self):
|
|
541
|
+
return self.mappingDirection
|
|
542
|
+
|
|
543
|
+
def setMappingDirection(self, value):
|
|
544
|
+
if value is not None:
|
|
545
|
+
self.mappingDirection = value
|
|
546
|
+
return self
|
|
547
|
+
|
|
548
|
+
def getValuePairs(self):
|
|
549
|
+
return self.valuePairs
|
|
550
|
+
|
|
551
|
+
def setValuePairs(self, value):
|
|
552
|
+
if value is not None:
|
|
553
|
+
self.valuePairs = value
|
|
554
|
+
return self
|
|
@@ -10,4 +10,12 @@ class AbstractAccessPoint(Identifiable, metaclass = ABCMeta):
|
|
|
10
10
|
|
|
11
11
|
super().__init__(parent, short_name)
|
|
12
12
|
|
|
13
|
-
self.
|
|
13
|
+
self.returnValueProvision = None # type: RteApiReturnValueProvisionEnum
|
|
14
|
+
|
|
15
|
+
def getReturnValueProvision(self):
|
|
16
|
+
return self.returnValueProvision
|
|
17
|
+
|
|
18
|
+
def setReturnValueProvision(self, value):
|
|
19
|
+
if value is not None:
|
|
20
|
+
self.returnValueProvision = value
|
|
21
|
+
return self
|
armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, RefType
|
|
2
1
|
from typing import List
|
|
2
|
+
|
|
3
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, Identifier, RefType
|
|
3
4
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.RPTScenario import ModeAccessPointIdent
|
|
4
5
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef
|
|
5
6
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AccessCount import AbstractAccessPoint
|
|
@@ -30,7 +31,7 @@ class ModeSwitchPoint(AbstractAccessPoint):
|
|
|
30
31
|
def __init__(self, parent: ARObject, short_name: str):
|
|
31
32
|
super().__init__(parent, short_name)
|
|
32
33
|
|
|
33
|
-
self.modeGroupIRef = None
|
|
34
|
+
self.modeGroupIRef = None # type: PModeGroupInAtomicSwcInstanceRef
|
|
34
35
|
|
|
35
36
|
def getModeGroupIRef(self):
|
|
36
37
|
return self.modeGroupIRef
|
|
@@ -44,8 +45,8 @@ class IncludedModeDeclarationGroupSet(ARObject):
|
|
|
44
45
|
def __init__(self):
|
|
45
46
|
super().__init__()
|
|
46
47
|
|
|
47
|
-
self.mode_declaration_group_refs = []
|
|
48
|
-
self.prefix = None
|
|
48
|
+
self.mode_declaration_group_refs = [] # type: List[RefType]
|
|
49
|
+
self.prefix = None # type: Identifier
|
|
49
50
|
|
|
50
51
|
def addModeDeclarationGroupRef(self, ref: RefType):
|
|
51
52
|
self.mode_declaration_group_refs.append(ref)
|
|
@@ -11,7 +11,7 @@ from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServiceMap
|
|
|
11
11
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, Boolean, RefType, ARBoolean
|
|
12
12
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.DataElements import ParameterAccess, VariableAccess
|
|
13
13
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServerCall import ServerCallPoint
|
|
14
|
-
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import ModeAccessPoint, ModeSwitchPoint
|
|
14
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import IncludedModeDeclarationGroupSet, ModeAccessPoint, ModeSwitchPoint
|
|
15
15
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.Trigger import InternalTriggeringPoint
|
|
16
16
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
17
17
|
from .....M2.AUTOSARTemplates.CommonStructure.InternalBehavior import ExecutableEntity
|
|
@@ -290,6 +290,14 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
290
290
|
|
|
291
291
|
def getIncludedDataTypeSets(self) -> List[IncludedDataTypeSet]:
|
|
292
292
|
return self.includedDataTypeSets
|
|
293
|
+
|
|
294
|
+
def getIncludedModeDeclarationGroupSets(self):
|
|
295
|
+
return self.includedModeDeclarationGroupSets
|
|
296
|
+
|
|
297
|
+
def addIncludedModeDeclarationGroupSet(self, value):
|
|
298
|
+
if value is not None:
|
|
299
|
+
self.includedModeDeclarationGroupSets.append(value)
|
|
300
|
+
return self
|
|
293
301
|
|
|
294
302
|
def createOperationInvokedEvent(self, short_name: str) -> OperationInvokedEvent:
|
|
295
303
|
if (short_name not in self.elements):
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
|
+
from typing import List
|
|
2
3
|
|
|
3
|
-
from ....M2.AUTOSARTemplates.
|
|
4
|
+
from ....M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import TextTableMapping
|
|
5
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Integer, RefType
|
|
4
6
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
5
7
|
from ....M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import CommunicationDirectionType
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
|
|
10
|
+
class DataMapping(ARObject, metaclass=ABCMeta):
|
|
8
11
|
def __init__(self):
|
|
9
|
-
if type(self)
|
|
12
|
+
if type(self) is DataMapping:
|
|
10
13
|
raise NotImplementedError("DataMapping is an abstract class.")
|
|
11
14
|
|
|
12
15
|
super().__init__()
|
|
@@ -20,6 +23,7 @@ class DataMapping(ARObject, metaclass = ABCMeta):
|
|
|
20
23
|
self.introduction = value
|
|
21
24
|
return self
|
|
22
25
|
|
|
26
|
+
|
|
23
27
|
class SenderReceiverToSignalMapping(DataMapping):
|
|
24
28
|
def __init__(self):
|
|
25
29
|
super().__init__()
|
|
@@ -65,13 +69,172 @@ class SenderReceiverToSignalMapping(DataMapping):
|
|
|
65
69
|
self.systemSignalRef = value
|
|
66
70
|
return self
|
|
67
71
|
|
|
72
|
+
|
|
73
|
+
class SenderRecCompositeTypeMapping(ARObject, metaclass=ABCMeta):
|
|
74
|
+
def __init__(self):
|
|
75
|
+
if type(self) is SenderRecCompositeTypeMapping:
|
|
76
|
+
raise NotImplementedError("SenderRecCompositeTypeMapping is an abstract class.")
|
|
77
|
+
|
|
78
|
+
super().__init__()
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class SenderRecRecordElementMapping(ARObject):
|
|
82
|
+
def __init__(self):
|
|
83
|
+
super().__init__()
|
|
84
|
+
|
|
85
|
+
self.applicationRecordElementRef = None # type: RefType
|
|
86
|
+
self.complexTypeMapping = None # type: SenderRecCompositeTypeMapping
|
|
87
|
+
self.implementationRecordElementRef = None # type: RefType
|
|
88
|
+
self.senderToSignalTextTableMapping = None # type: TextTableMapping
|
|
89
|
+
self.signalToReceiverTextTableMapping = None # type: TextTableMapping
|
|
90
|
+
self.systemSignalRef = None # type: RefType
|
|
91
|
+
|
|
92
|
+
def getApplicationRecordElementRef(self):
|
|
93
|
+
return self.applicationRecordElementRef
|
|
94
|
+
|
|
95
|
+
def setApplicationRecordElementRef(self, value):
|
|
96
|
+
if value is not None:
|
|
97
|
+
self.applicationRecordElementRef = value
|
|
98
|
+
return self
|
|
99
|
+
|
|
100
|
+
def getComplexTypeMapping(self):
|
|
101
|
+
return self.complexTypeMapping
|
|
102
|
+
|
|
103
|
+
def setComplexTypeMapping(self, value):
|
|
104
|
+
if value is not None:
|
|
105
|
+
self.complexTypeMapping = value
|
|
106
|
+
return self
|
|
107
|
+
|
|
108
|
+
def getImplementationRecordElementRef(self):
|
|
109
|
+
return self.implementationRecordElementRef
|
|
110
|
+
|
|
111
|
+
def setImplementationRecordElementRef(self, value):
|
|
112
|
+
if value is not None:
|
|
113
|
+
self.implementationRecordElementRef = value
|
|
114
|
+
return self
|
|
115
|
+
|
|
116
|
+
def getSenderToSignalTextTableMapping(self):
|
|
117
|
+
return self.senderToSignalTextTableMapping
|
|
118
|
+
|
|
119
|
+
def setSenderToSignalTextTableMapping(self, value):
|
|
120
|
+
if value is not None:
|
|
121
|
+
self.senderToSignalTextTableMapping = value
|
|
122
|
+
return self
|
|
123
|
+
|
|
124
|
+
def getSignalToReceiverTextTableMapping(self):
|
|
125
|
+
return self.signalToReceiverTextTableMapping
|
|
126
|
+
|
|
127
|
+
def setSignalToReceiverTextTableMapping(self, value):
|
|
128
|
+
if value is not None:
|
|
129
|
+
self.signalToReceiverTextTableMapping = value
|
|
130
|
+
return self
|
|
131
|
+
|
|
132
|
+
def getSystemSignalRef(self):
|
|
133
|
+
return self.systemSignalRef
|
|
134
|
+
|
|
135
|
+
def setSystemSignalRef(self, value):
|
|
136
|
+
if value is not None:
|
|
137
|
+
self.systemSignalRef = value
|
|
138
|
+
return self
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class SenderRecRecordTypeMapping(SenderRecCompositeTypeMapping):
|
|
142
|
+
def __init__(self):
|
|
143
|
+
super().__init__()
|
|
144
|
+
|
|
145
|
+
self.recordElementMappings = [] # type: List[SenderRecRecordElementMapping]
|
|
146
|
+
|
|
147
|
+
def getRecordElementMappings(self):
|
|
148
|
+
return self.recordElementMappings
|
|
149
|
+
|
|
150
|
+
def addRecordElementMapping(self, value):
|
|
151
|
+
if value is not None:
|
|
152
|
+
self.recordElementMappings.append(value)
|
|
153
|
+
return self
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class IndexedArrayElement(ARObject):
|
|
157
|
+
def __init__(self):
|
|
158
|
+
super().__init__()
|
|
159
|
+
|
|
160
|
+
self.applicationArrayElementRef = None # type: RefType
|
|
161
|
+
self.implementationArrayElementRef = None # type: RefType
|
|
162
|
+
self.index = None # type: Integer
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class SenderRecArrayElementMapping(ARObject):
|
|
166
|
+
def __init__(self):
|
|
167
|
+
super().__init__()
|
|
168
|
+
|
|
169
|
+
self.complexTypeMapping = None # type: SenderRecCompositeTypeMapping
|
|
170
|
+
self.indexedArrayElement = None # type: IndexedArrayElement
|
|
171
|
+
self.systemSignalRef = None # type: RefType
|
|
172
|
+
|
|
173
|
+
def getComplexTypeMapping(self):
|
|
174
|
+
return self.complexTypeMapping
|
|
175
|
+
|
|
176
|
+
def setComplexTypeMapping(self, value):
|
|
177
|
+
if value is not None:
|
|
178
|
+
self.complexTypeMapping = value
|
|
179
|
+
return self
|
|
180
|
+
|
|
181
|
+
def getIndexedArrayElement(self):
|
|
182
|
+
return self.indexedArrayElement
|
|
183
|
+
|
|
184
|
+
def setIndexedArrayElement(self, value):
|
|
185
|
+
if value is not None:
|
|
186
|
+
self.indexedArrayElement = value
|
|
187
|
+
return self
|
|
188
|
+
|
|
189
|
+
def getSystemSignalRef(self):
|
|
190
|
+
return self.systemSignalRef
|
|
191
|
+
|
|
192
|
+
def setSystemSignalRef(self, value):
|
|
193
|
+
if value is not None:
|
|
194
|
+
self.systemSignalRef = value
|
|
195
|
+
return self
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
class SenderRecArrayTypeMapping(SenderRecCompositeTypeMapping):
|
|
199
|
+
def __init__(self):
|
|
200
|
+
super().__init__()
|
|
201
|
+
|
|
202
|
+
self.arrayElementMappings = [] # type: List[SenderRecArrayElementMapping]
|
|
203
|
+
self.senderToSignal = None # type: TextTableMapping
|
|
204
|
+
self.signalToReceiverTextTableMapping = None # type: TextTableMapping
|
|
205
|
+
|
|
206
|
+
def getArrayElementMappings(self):
|
|
207
|
+
return self.arrayElementMappings
|
|
208
|
+
|
|
209
|
+
def setArrayElementMappings(self, value):
|
|
210
|
+
if value is not None:
|
|
211
|
+
self.arrayElementMappings = value
|
|
212
|
+
return self
|
|
213
|
+
|
|
214
|
+
def getSenderToSignal(self):
|
|
215
|
+
return self.senderToSignal
|
|
216
|
+
|
|
217
|
+
def setSenderToSignal(self, value):
|
|
218
|
+
if value is not None:
|
|
219
|
+
self.senderToSignal = value
|
|
220
|
+
return self
|
|
221
|
+
|
|
222
|
+
def getSignalToReceiverTextTableMapping(self):
|
|
223
|
+
return self.signalToReceiverTextTableMapping
|
|
224
|
+
|
|
225
|
+
def setSignalToReceiverTextTableMapping(self, value):
|
|
226
|
+
if value is not None:
|
|
227
|
+
self.signalToReceiverTextTableMapping = value
|
|
228
|
+
return self
|
|
229
|
+
|
|
230
|
+
|
|
68
231
|
class SenderReceiverToSignalGroupMapping(DataMapping):
|
|
69
232
|
def __init__(self):
|
|
70
233
|
super().__init__()
|
|
71
234
|
|
|
72
235
|
self.dataElementIRef = None # type: RefType
|
|
73
236
|
self.signalGroupRef = None # type: RefType
|
|
74
|
-
self.typeMapping = None
|
|
237
|
+
self.typeMapping = None # type: SenderRecCompositeTypeMapping
|
|
75
238
|
|
|
76
239
|
def getDataElementIRef(self):
|
|
77
240
|
return self.dataElementIRef
|
|
@@ -93,4 +256,3 @@ class SenderReceiverToSignalGroupMapping(DataMapping):
|
|
|
93
256
|
def setTypeMapping(self, value):
|
|
94
257
|
self.typeMapping = value
|
|
95
258
|
return self
|
|
96
|
-
|
armodel/models/M2/AUTOSARTemplates/SystemTemplate/{ECUResourceMapping.py → EcuResourceMapping.py}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import List
|
|
2
|
-
from
|
|
3
|
-
from
|
|
2
|
+
from ..GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
3
|
+
from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
|
|
4
|
+
|
|
4
5
|
|
|
5
6
|
class ECUMapping(Identifiable):
|
|
6
7
|
def __init__(self, parent, short_name):
|
|
@@ -9,7 +10,7 @@ class ECUMapping(Identifiable):
|
|
|
9
10
|
self.commControllerMappings = [] # type: List[CommunicationControllerMapping]
|
|
10
11
|
self.ecuRef = None # type: RefType
|
|
11
12
|
self.ecuInstanceRef = None # type: RefType
|
|
12
|
-
self.hwPortMappings =[]
|
|
13
|
+
self.hwPortMappings = [] # type: List[HwPortMapping]
|
|
13
14
|
|
|
14
15
|
def getCommControllerMappings(self):
|
|
15
16
|
return self.commControllerMappings
|