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
|
@@ -8,10 +8,11 @@ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveT
|
|
|
8
8
|
from abc import ABCMeta
|
|
9
9
|
from typing import List
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
class Referrable(ARObject, metaclass=ABCMeta):
|
|
12
13
|
def __init__(self, parent: ARObject, short_name: str):
|
|
13
14
|
|
|
14
|
-
if type(self)
|
|
15
|
+
if type(self) is Referrable:
|
|
15
16
|
raise NotImplementedError("Referrable is an abstract class.")
|
|
16
17
|
|
|
17
18
|
ARObject.__init__(self)
|
|
@@ -40,14 +41,15 @@ class Referrable(ARObject, metaclass = ABCMeta):
|
|
|
40
41
|
def getFullName(self) -> str:
|
|
41
42
|
return self.full_name
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
|
|
45
|
+
class MultilanguageReferrable(Referrable, metaclass=ABCMeta):
|
|
44
46
|
def __init__(self, parent: ARObject, short_name: str):
|
|
45
|
-
if type(self)
|
|
47
|
+
if type(self) is MultilanguageReferrable:
|
|
46
48
|
raise NotImplementedError("MultilanguageReferrable is an abstract class.")
|
|
47
49
|
|
|
48
50
|
super().__init__(parent, short_name)
|
|
49
51
|
|
|
50
|
-
#self._parent = parent
|
|
52
|
+
# self._parent = parent
|
|
51
53
|
self.longName = None # type: MultilanguageLongName
|
|
52
54
|
|
|
53
55
|
def getLongName(self) -> MultilanguageLongName:
|
|
@@ -58,15 +60,15 @@ class MultilanguageReferrable(Referrable, metaclass = ABCMeta):
|
|
|
58
60
|
return self
|
|
59
61
|
|
|
60
62
|
|
|
61
|
-
class CollectableElement(ARObject, metaclass
|
|
63
|
+
class CollectableElement(ARObject, metaclass=ABCMeta):
|
|
62
64
|
def __init__(self):
|
|
63
|
-
if type(self)
|
|
65
|
+
if type(self) is CollectableElement:
|
|
64
66
|
raise NotImplementedError("CollectableElement is an abstract class.")
|
|
65
67
|
|
|
66
68
|
self.elements = {} # type: dict[str, Referrable]
|
|
67
69
|
|
|
68
70
|
def getTotalElement(self) -> int:
|
|
69
|
-
#return len(list(filter(lambda a: not isinstance(a, ARPackage) , self.elements.values())))
|
|
71
|
+
# return len(list(filter(lambda a: not isinstance(a, ARPackage) , self.elements.values())))
|
|
70
72
|
return len(self.elements.values())
|
|
71
73
|
|
|
72
74
|
def removeElement(self, key):
|
|
@@ -78,7 +80,9 @@ class CollectableElement(ARObject, metaclass = ABCMeta):
|
|
|
78
80
|
return self.elements.values()
|
|
79
81
|
|
|
80
82
|
def addElement(self, element: Referrable):
|
|
81
|
-
|
|
83
|
+
short_name = element.getShortName()
|
|
84
|
+
if not self.IsElementExists(short_name):
|
|
85
|
+
self.elements[short_name] = element
|
|
82
86
|
|
|
83
87
|
def getElement(self, short_name: str) -> Referrable:
|
|
84
88
|
if (short_name not in self.elements):
|
|
@@ -88,9 +92,10 @@ class CollectableElement(ARObject, metaclass = ABCMeta):
|
|
|
88
92
|
def IsElementExists(self, short_name: str) -> bool:
|
|
89
93
|
return short_name in self.elements
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
|
|
96
|
+
class Identifiable(MultilanguageReferrable, CollectableElement, metaclass=ABCMeta):
|
|
92
97
|
def __init__(self, parent: ARObject, short_name: str):
|
|
93
|
-
if type(self)
|
|
98
|
+
if type(self) is Identifiable:
|
|
94
99
|
raise NotImplementedError("Identifiable is an abstract class.")
|
|
95
100
|
|
|
96
101
|
MultilanguageReferrable.__init__(self, parent, short_name)
|
|
@@ -106,8 +111,12 @@ class Identifiable(MultilanguageReferrable, CollectableElement, metaclass = ABCM
|
|
|
106
111
|
return self.adminData
|
|
107
112
|
|
|
108
113
|
def setAdminData(self, value):
|
|
109
|
-
|
|
114
|
+
if value is not None:
|
|
115
|
+
self.adminData = value
|
|
110
116
|
return self
|
|
117
|
+
|
|
118
|
+
def removeAdminData(self):
|
|
119
|
+
self.adminData = None
|
|
111
120
|
|
|
112
121
|
def getDesc(self):
|
|
113
122
|
return self.desc
|
|
@@ -133,7 +142,6 @@ class Identifiable(MultilanguageReferrable, CollectableElement, metaclass = ABCM
|
|
|
133
142
|
self.introduction = value
|
|
134
143
|
return self
|
|
135
144
|
|
|
136
|
-
|
|
137
145
|
def addAnnotation(self, annotation: Annotation):
|
|
138
146
|
self.annotations.append(annotation)
|
|
139
147
|
return self
|
|
@@ -144,44 +152,64 @@ class Identifiable(MultilanguageReferrable, CollectableElement, metaclass = ABCM
|
|
|
144
152
|
|
|
145
153
|
class PackageableElement(Identifiable, metaclass=ABCMeta):
|
|
146
154
|
def __init__(self, parent: ARObject, short_name: str):
|
|
147
|
-
if type(self)
|
|
155
|
+
if type(self) is PackageableElement:
|
|
148
156
|
raise NotImplementedError("PackageableElement is an abstract class.")
|
|
149
157
|
super().__init__(parent, short_name)
|
|
150
158
|
|
|
151
159
|
|
|
152
160
|
class ARElement(PackageableElement, metaclass=ABCMeta):
|
|
153
161
|
def __init__(self, parent: ARObject, short_name: str):
|
|
154
|
-
if type(self)
|
|
162
|
+
if type(self) is ARElement:
|
|
155
163
|
raise NotImplementedError("ARElement is an abstract class.")
|
|
156
164
|
super().__init__(parent, short_name)
|
|
157
165
|
|
|
158
166
|
|
|
159
167
|
class Describable(ARObject, metaclass=ABCMeta):
|
|
160
168
|
def __init__(self):
|
|
161
|
-
if type(self)
|
|
169
|
+
if type(self) is Describable:
|
|
162
170
|
raise NotImplementedError("Describable is an abstract class.")
|
|
163
171
|
|
|
164
172
|
super().__init__()
|
|
165
173
|
|
|
166
|
-
self.
|
|
167
|
-
self.
|
|
168
|
-
self.
|
|
169
|
-
self.
|
|
174
|
+
self.desc = None
|
|
175
|
+
self.category = None
|
|
176
|
+
self.adminData = None
|
|
177
|
+
self.introduction = None
|
|
170
178
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return self._desc
|
|
179
|
+
def getDesc(self):
|
|
180
|
+
return self.desc
|
|
174
181
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
182
|
+
def setDesc(self, value):
|
|
183
|
+
if value is not None:
|
|
184
|
+
self.desc = value
|
|
185
|
+
return self
|
|
178
186
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
187
|
+
def getCategory(self):
|
|
188
|
+
return self.category
|
|
189
|
+
|
|
190
|
+
def setCategory(self, value):
|
|
191
|
+
if value is not None:
|
|
192
|
+
self.category = value
|
|
193
|
+
return self
|
|
182
194
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
self._category = value
|
|
195
|
+
def getAdminData(self):
|
|
196
|
+
return self.adminData
|
|
186
197
|
|
|
198
|
+
def setAdminData(self, value):
|
|
199
|
+
if value is not None:
|
|
200
|
+
self.adminData = value
|
|
201
|
+
return self
|
|
202
|
+
|
|
203
|
+
def removeAdminData(self):
|
|
204
|
+
self.adminData = None
|
|
187
205
|
|
|
206
|
+
def getIntroduction(self):
|
|
207
|
+
return self.introduction
|
|
208
|
+
|
|
209
|
+
def setIntroduction(self, value):
|
|
210
|
+
if value is not None:
|
|
211
|
+
self.introduction = value
|
|
212
|
+
return self
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
@@ -8,12 +8,17 @@ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiab
|
|
|
8
8
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
9
9
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import TRefType
|
|
10
10
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean, RefType
|
|
11
|
-
from .....M2.AUTOSARTemplates.SWComponentTemplate.Communication import ClientComSpec, ModeSwitchReceiverComSpec, ModeSwitchSenderComSpec
|
|
11
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.Communication import ClientComSpec, ModeSwitchReceiverComSpec, ModeSwitchSenderComSpec
|
|
12
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.Communication import NonqueuedReceiverComSpec, NonqueuedSenderComSpec, PPortComSpec
|
|
13
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.Communication import ParameterRequireComSpec, QueuedReceiverComSpec, QueuedSenderComSpec
|
|
14
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.Communication import RPortComSpec, ServerComSpec
|
|
15
|
+
|
|
12
16
|
|
|
13
17
|
class SymbolProps(ImplementationProps):
|
|
14
18
|
def __init__(self, parent: ARObject, short_name: str):
|
|
15
19
|
super().__init__(parent, short_name)
|
|
16
20
|
|
|
21
|
+
|
|
17
22
|
class PortPrototype(Identifiable):
|
|
18
23
|
def __init__(self, parent: ARObject, short_name: str):
|
|
19
24
|
super().__init__(parent, short_name)
|
|
@@ -83,6 +88,7 @@ class PortPrototype(Identifiable):
|
|
|
83
88
|
self.triggerPortAnnotations.append(value)
|
|
84
89
|
return self
|
|
85
90
|
|
|
91
|
+
|
|
86
92
|
class AbstractProvidedPortPrototype(PortPrototype):
|
|
87
93
|
def __init__(self, parent: ARObject, short_name: str):
|
|
88
94
|
super().__init__(parent, short_name)
|
|
@@ -91,7 +97,7 @@ class AbstractProvidedPortPrototype(PortPrototype):
|
|
|
91
97
|
|
|
92
98
|
def _validateRPortComSpec(self, com_spec: PPortComSpec):
|
|
93
99
|
if isinstance(com_spec, NonqueuedSenderComSpec):
|
|
94
|
-
if com_spec.dataElementRef
|
|
100
|
+
if com_spec.dataElementRef is None:
|
|
95
101
|
raise ValueError(
|
|
96
102
|
"operation of NonqueuedSenderComSpec is invalid")
|
|
97
103
|
if com_spec.dataElementRef.dest != "VARIABLE-DATA-PROTOTYPE":
|
|
@@ -170,6 +176,7 @@ class PPortPrototype(AbstractProvidedPortPrototype):
|
|
|
170
176
|
self.providedInterfaceTRef = value
|
|
171
177
|
return self
|
|
172
178
|
|
|
179
|
+
|
|
173
180
|
class RPortPrototype(AbstractRequiredPortPrototype):
|
|
174
181
|
def __init__(self, parent: ARObject, short_name: str):
|
|
175
182
|
super().__init__(parent, short_name)
|
|
@@ -191,6 +198,7 @@ class RPortPrototype(AbstractRequiredPortPrototype):
|
|
|
191
198
|
self.requiredInterfaceTRef = value
|
|
192
199
|
return self
|
|
193
200
|
|
|
201
|
+
|
|
194
202
|
class PRPortPrototype(PortPrototype):
|
|
195
203
|
def __init__(self, parent, short_name):
|
|
196
204
|
super().__init__(parent, short_name)
|
|
@@ -220,6 +228,7 @@ class PRPortPrototype(PortPrototype):
|
|
|
220
228
|
self.providedRequiredInterface = value
|
|
221
229
|
return self
|
|
222
230
|
|
|
231
|
+
|
|
223
232
|
class PortGroup(Identifiable):
|
|
224
233
|
def __init__(self, parent: ARObject, short_name: str):
|
|
225
234
|
super().__init__(parent, short_name)
|
|
@@ -239,51 +248,58 @@ class PortGroup(Identifiable):
|
|
|
239
248
|
def getOuterPortRefs(self) -> List[RefType]:
|
|
240
249
|
return self._outer_port_ref
|
|
241
250
|
|
|
242
|
-
|
|
251
|
+
|
|
252
|
+
class SwComponentType(ARElement, metaclass=ABCMeta):
|
|
243
253
|
def __init__(self, parent: ARObject, short_name: str):
|
|
244
254
|
super().__init__(parent, short_name)
|
|
245
255
|
|
|
256
|
+
self.ports = [] # type: List[PortPrototype]
|
|
257
|
+
self.portGroups = [] # type: List[PortGroup]
|
|
258
|
+
|
|
259
|
+
def getPorts(self):
|
|
260
|
+
return self.ports
|
|
261
|
+
|
|
246
262
|
def createPPortPrototype(self, short_name: str) -> PPortPrototype:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return
|
|
263
|
+
prototype = PPortPrototype(self, short_name)
|
|
264
|
+
self.addElement(prototype)
|
|
265
|
+
self.ports.append(prototype)
|
|
266
|
+
return prototype
|
|
251
267
|
|
|
252
268
|
def createRPortPrototype(self, short_name) -> RPortPrototype:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return
|
|
269
|
+
prototype = RPortPrototype(self, short_name)
|
|
270
|
+
self.addElement(prototype)
|
|
271
|
+
self.ports.append(prototype)
|
|
272
|
+
return prototype
|
|
257
273
|
|
|
258
274
|
def createPRPortPrototype(self, short_name) -> PRPortPrototype:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return
|
|
275
|
+
prototype = PRPortPrototype(self, short_name)
|
|
276
|
+
self.addElement(prototype)
|
|
277
|
+
self.ports.append(prototype)
|
|
278
|
+
return prototype
|
|
263
279
|
|
|
264
|
-
def createPortGroup(self, short_name) -> PortGroup:
|
|
265
|
-
port_group = PortGroup(self, short_name)
|
|
266
|
-
if (short_name not in self.elements):
|
|
267
|
-
self.elements[short_name] = port_group
|
|
268
|
-
return self.elements[short_name]
|
|
269
|
-
|
|
270
280
|
def getPPortPrototypes(self) -> List[PPortPrototype]:
|
|
271
|
-
return list(sorted(filter(lambda c: isinstance(c, PPortPrototype), self.
|
|
281
|
+
return list(sorted(filter(lambda c: isinstance(c, PPortPrototype), self.ports), key=lambda o: o.short_name))
|
|
272
282
|
|
|
273
283
|
def getRPortPrototypes(self) -> List[RPortPrototype]:
|
|
274
|
-
return list(sorted(filter(lambda c: isinstance(c, RPortPrototype), self.
|
|
284
|
+
return list(sorted(filter(lambda c: isinstance(c, RPortPrototype), self.ports), key=lambda o: o.short_name))
|
|
275
285
|
|
|
276
286
|
def getPRPortPrototypes(self) -> List[PRPortPrototype]:
|
|
277
|
-
return list(sorted(filter(lambda c: isinstance(c, PRPortPrototype), self.
|
|
287
|
+
return list(sorted(filter(lambda c: isinstance(c, PRPortPrototype), self.ports), key=lambda o: o.short_name))
|
|
278
288
|
|
|
279
289
|
def getPortPrototypes(self) -> List[PortPrototype]:
|
|
280
|
-
return list(sorted(filter(lambda c: isinstance(c, PortPrototype), self.
|
|
281
|
-
|
|
290
|
+
return list(sorted(filter(lambda c: isinstance(c, PortPrototype), self.ports), key=lambda o: o.short_name))
|
|
291
|
+
|
|
282
292
|
def getPortGroups(self) -> List[PortGroup]:
|
|
283
|
-
return
|
|
293
|
+
return self.portGroups
|
|
284
294
|
|
|
295
|
+
def createPortGroup(self, short_name) -> PortGroup:
|
|
296
|
+
port_group = PortGroup(self, short_name)
|
|
297
|
+
self.addElement(port_group)
|
|
298
|
+
self.portGroups.append(port_group)
|
|
299
|
+
return port_group
|
|
300
|
+
|
|
285
301
|
|
|
286
|
-
class AtomicSwComponentType(SwComponentType, metaclass
|
|
302
|
+
class AtomicSwComponentType(SwComponentType, metaclass=ABCMeta):
|
|
287
303
|
def __init__(self, parent: ARObject, short_name: str):
|
|
288
304
|
super().__init__(parent, short_name)
|
|
289
305
|
|
|
@@ -316,8 +332,9 @@ class AtomicSwComponentType(SwComponentType, metaclass = ABCMeta):
|
|
|
316
332
|
return next(filter(lambda e: isinstance(e, SwcInternalBehavior), self.elements.values()))
|
|
317
333
|
'''
|
|
318
334
|
|
|
335
|
+
|
|
319
336
|
class EcuAbstractionSwComponentType(AtomicSwComponentType):
|
|
320
|
-
def __init__(self, parent:ARObject, short_name: str):
|
|
337
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
321
338
|
super().__init__(parent, short_name)
|
|
322
339
|
|
|
323
340
|
self.hardwareElementRefs = [] # List[RefType]
|
|
@@ -329,7 +346,8 @@ class EcuAbstractionSwComponentType(AtomicSwComponentType):
|
|
|
329
346
|
if value is not None:
|
|
330
347
|
self.hardwareElementRefs.append(value)
|
|
331
348
|
return self
|
|
332
|
-
|
|
349
|
+
|
|
350
|
+
|
|
333
351
|
class ApplicationSwComponentType(AtomicSwComponentType):
|
|
334
352
|
def __init__(self, parent: ARObject, short_name: str):
|
|
335
353
|
super().__init__(parent, short_name)
|
|
@@ -348,7 +366,8 @@ class ComplexDeviceDriverSwComponentType(AtomicSwComponentType):
|
|
|
348
366
|
if value is not None:
|
|
349
367
|
self.hardwareElementRefs.append(value)
|
|
350
368
|
return self
|
|
351
|
-
|
|
369
|
+
|
|
370
|
+
|
|
352
371
|
class NvBlockSwComponentType(AtomicSwComponentType):
|
|
353
372
|
def __init__(self, parent: ARObject, short_name: str):
|
|
354
373
|
super().__init__(parent, short_name)
|
|
@@ -371,7 +390,8 @@ class NvBlockSwComponentType(AtomicSwComponentType):
|
|
|
371
390
|
if value is not None:
|
|
372
391
|
self.nvBlockDescriptors.append(value)
|
|
373
392
|
return self
|
|
374
|
-
|
|
393
|
+
|
|
394
|
+
|
|
375
395
|
class SensorActuatorSwComponentType(AtomicSwComponentType):
|
|
376
396
|
def __init__(self, parent: ARObject, short_name: str):
|
|
377
397
|
super().__init__(parent, short_name)
|
|
@@ -391,6 +411,7 @@ class CompositionSwComponentType(SwComponentType):
|
|
|
391
411
|
def __init__(self, parent: ARObject, short_name: str):
|
|
392
412
|
super().__init__(parent, short_name)
|
|
393
413
|
|
|
414
|
+
self.components = [] # type: List[SwComponentPrototype]
|
|
394
415
|
self.constantValueMappingRefs = [] # type: List[RefType]
|
|
395
416
|
self.dataTypeMappingRefs = [] # type: List[RefType]
|
|
396
417
|
self.instantiationRTEEventProps = [] # type: List[InstantiationRTEEventProps]
|
|
@@ -416,26 +437,26 @@ class CompositionSwComponentType(SwComponentType):
|
|
|
416
437
|
return self.elements[short_name]
|
|
417
438
|
|
|
418
439
|
def getAssemblySwConnectors(self) -> List[AssemblySwConnector]:
|
|
419
|
-
return list(sorted(filter(lambda e: isinstance(e, AssemblySwConnector), self.elements.values()), key
|
|
440
|
+
return list(sorted(filter(lambda e: isinstance(e, AssemblySwConnector), self.elements.values()), key=lambda c: c.short_name))
|
|
420
441
|
|
|
421
442
|
def getDelegationSwConnectors(self) -> List[DelegationSwConnector]:
|
|
422
|
-
return list(sorted(filter(lambda e: isinstance(e, DelegationSwConnector), self.elements.values()), key
|
|
443
|
+
return list(sorted(filter(lambda e: isinstance(e, DelegationSwConnector), self.elements.values()), key=lambda c: c.short_name))
|
|
423
444
|
|
|
424
445
|
def getSwConnectors(self) -> List[SwConnector]:
|
|
425
|
-
return list(sorted(filter(lambda e: isinstance(e, SwConnector), self.elements.values()), key
|
|
446
|
+
return list(sorted(filter(lambda e: isinstance(e, SwConnector), self.elements.values()), key=lambda c: c.short_name))
|
|
426
447
|
|
|
427
448
|
def createSwComponentPrototype(self, short_name: str) -> SwComponentPrototype:
|
|
428
|
-
if (
|
|
429
|
-
|
|
430
|
-
self.
|
|
431
|
-
|
|
449
|
+
if (not self.IsElementExists(short_name)):
|
|
450
|
+
prototype = SwComponentPrototype(self, short_name)
|
|
451
|
+
self.addElement(prototype)
|
|
452
|
+
self.components.append(prototype)
|
|
453
|
+
return self.getElement(short_name)
|
|
432
454
|
|
|
433
|
-
def
|
|
434
|
-
return
|
|
455
|
+
def getComponents(self) -> List[SwComponentPrototype]:
|
|
456
|
+
return self.components
|
|
435
457
|
|
|
436
458
|
def addDataTypeMapping(self, data_type_mapping_ref: RefType):
|
|
437
459
|
self.dataTypeMappingRefs.append(data_type_mapping_ref)
|
|
438
460
|
|
|
439
461
|
def getDataTypeMappings(self) -> List[RefType]:
|
|
440
462
|
return self.dataTypeMappingRefs
|
|
441
|
-
|
|
@@ -4,6 +4,7 @@ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveT
|
|
|
4
4
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
5
5
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
class SwComponentPrototype(Identifiable):
|
|
8
9
|
def __init__(self, parent: ARObject, short_name: str):
|
|
9
10
|
super().__init__(parent, short_name)
|
|
@@ -4,6 +4,7 @@ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Integer, Na
|
|
|
4
4
|
from ..SystemTemplate.InstanceRefs import VariableDataPrototypeInSystemInstanceRef
|
|
5
5
|
from typing import List
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
class EndToEndDescription(ARObject):
|
|
8
9
|
def __init__(self):
|
|
9
10
|
super().__init__()
|
|
@@ -41,7 +42,8 @@ class EndToEndDescription(ARObject):
|
|
|
41
42
|
return self
|
|
42
43
|
|
|
43
44
|
def getDataIds(self) -> List[PositiveInteger]:
|
|
44
|
-
return sorted(self.dataIds, key = lambda a: a)
|
|
45
|
+
# return sorted(self.dataIds, key = lambda a: a.getValue())
|
|
46
|
+
return self.dataIds
|
|
45
47
|
|
|
46
48
|
def addDataId(self, id: PositiveInteger):
|
|
47
49
|
self.dataIds.append(id)
|
|
@@ -104,6 +106,7 @@ class EndToEndProtectionVariablePrototype(ARObject):
|
|
|
104
106
|
def getReceiverIrefs(self) -> List[VariableDataPrototypeInSystemInstanceRef]:
|
|
105
107
|
return self._receiverIRefs
|
|
106
108
|
|
|
109
|
+
|
|
107
110
|
class EndToEndProtectionISignalIPdu(ARObject):
|
|
108
111
|
def __init__(self):
|
|
109
112
|
super().__init__()
|
|
@@ -146,21 +149,25 @@ class EndToEndProtection(Identifiable):
|
|
|
146
149
|
return self.endToEndProfile
|
|
147
150
|
|
|
148
151
|
def setEndToEndProfile(self, value):
|
|
149
|
-
|
|
152
|
+
if value is not None:
|
|
153
|
+
self.endToEndProfile = value
|
|
150
154
|
return self
|
|
151
155
|
|
|
152
156
|
def getEndToEndProtectionISignalIPdus(self):
|
|
153
157
|
return self.endToEndProtectionISignalIPdus
|
|
154
158
|
|
|
155
159
|
def addEndToEndProtectionISignalIPdu(self, value):
|
|
156
|
-
|
|
160
|
+
if value is not None:
|
|
161
|
+
self.endToEndProtectionISignalIPdus.append(value)
|
|
157
162
|
return self
|
|
158
163
|
|
|
159
164
|
def getEndToEndProtectionVariablePrototypes(self) -> List[EndToEndProtectionVariablePrototype]:
|
|
160
165
|
return self.endToEndProtectionVariablePrototypes
|
|
161
166
|
|
|
162
|
-
def addEndToEndProtectionVariablePrototype(self,
|
|
163
|
-
|
|
167
|
+
def addEndToEndProtectionVariablePrototype(self, value: EndToEndProtectionVariablePrototype):
|
|
168
|
+
if value is not None:
|
|
169
|
+
self.endToEndProtectionVariablePrototypes.append(value)
|
|
170
|
+
return self
|
|
164
171
|
|
|
165
172
|
|
|
166
173
|
class EndToEndProtectionSet(Identifiable):
|
|
@@ -174,4 +181,4 @@ class EndToEndProtectionSet(Identifiable):
|
|
|
174
181
|
return self.elements[short_name]
|
|
175
182
|
|
|
176
183
|
def getEndToEndProtections(self) -> List[EndToEndProtection]:
|
|
177
|
-
return sorted(filter(lambda c: isinstance(c, EndToEndProtection), self.elements.values()), key=
|
|
184
|
+
return sorted(filter(lambda c: isinstance(c, EndToEndProtection), self.elements.values()), key=lambda e: e.short_name)
|