armodel 1.7.2__py3-none-any.whl → 1.7.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. armodel/cli/arxml_dump_cli.py +1 -1
  2. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +44 -20
  3. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +104 -30
  4. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +12 -16
  5. armodel/models/M2/AUTOSARTemplates/CommonStructure/FlatMap.py +70 -0
  6. armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +12 -9
  7. armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +29 -22
  8. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/HardwareConfiguration.py +33 -0
  9. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/HeapUsage.py +10 -0
  10. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/SoftwareContext.py +23 -0
  11. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/StackUsage.py +93 -0
  12. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +39 -5
  13. armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +28 -5
  14. armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +48 -6
  15. armodel/models/M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py +5 -5
  16. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +27 -1
  17. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +39 -0
  18. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +17 -1
  19. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +8 -0
  20. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +196 -5
  21. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AutosarVariableRef.py +31 -0
  22. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py +4 -3
  23. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py +17 -32
  24. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/RTEEvents.py +4 -0
  25. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +17 -2
  26. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +81 -34
  27. armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +10 -1
  28. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetCommunication.py +229 -0
  29. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetTopology.py +167 -0
  30. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/NetworkEndpoint.py +225 -0
  31. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/ServiceInstances.py +96 -7
  32. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +47 -4
  33. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +18 -5
  34. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/Timing.py +7 -12
  35. armodel/models/M2/MSR/AsamHdo/BaseTypes.py +0 -1
  36. armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +16 -1
  37. armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +34 -3
  38. armodel/models/M2/MSR/DataDictionary/DataDefProperties.py +7 -0
  39. armodel/models/M2/MSR/DataDictionary/ServiceProcessTask.py +33 -0
  40. armodel/models/__init__.py +6 -0
  41. armodel/parser/abstract_arxml_parser.py +4 -14
  42. armodel/parser/arxml_parser.py +567 -224
  43. armodel/tests/test_armodel/models/test_ar_object.py +6 -2
  44. armodel/tests/test_armodel/models/test_ar_ref.py +2 -2
  45. armodel/tests/test_armodel/models/test_port_interface.py +4 -4
  46. armodel/tests/test_armodel/parser/test_parse_bswmd.py +48 -48
  47. armodel/writer/abstract_arxml_writer.py +2 -3
  48. armodel/writer/arxml_writer.py +566 -288
  49. {armodel-1.7.2.dist-info → armodel-1.7.4.dist-info}/METADATA +30 -2
  50. {armodel-1.7.2.dist-info → armodel-1.7.4.dist-info}/RECORD +54 -44
  51. {armodel-1.7.2.dist-info → armodel-1.7.4.dist-info}/LICENSE +0 -0
  52. {armodel-1.7.2.dist-info → armodel-1.7.4.dist-info}/WHEEL +0 -0
  53. {armodel-1.7.2.dist-info → armodel-1.7.4.dist-info}/entry_points.txt +0 -0
  54. {armodel-1.7.2.dist-info → armodel-1.7.4.dist-info}/top_level.txt +0 -0
@@ -3,9 +3,9 @@ from typing import List
3
3
 
4
4
  from .....M2.AUTOSARTemplates.CommonStructure import TextValueSpecification
5
5
  from .....M2.AUTOSARTemplates.CommonStructure.TriggerDeclaration import Trigger
6
- from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
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, PositiveInteger
8
+ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical, ArgumentDirectionEnum, PositiveInteger
9
9
  from .....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ParameterDataPrototype, VariableDataPrototype, AutosarDataPrototype
10
10
  from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
11
11
  from .....M2.AUTOSARTemplates.CommonStructure.ModeDeclaration import ModeDeclarationGroupPrototype
@@ -183,8 +183,24 @@ class SenderReceiverInterface(DataInterface):
183
183
  class ArgumentDataPrototype(AutosarDataPrototype):
184
184
  def __init__(self, parent: ARObject, short_name: str):
185
185
  super().__init__(parent, short_name)
186
- self.direction = ""
187
- self.server_argument_impl_policy = ""
186
+
187
+ self.direction = None # type: ArgumentDirectionEnum
188
+ # type: ServerArgumentImplPolicyEnum
189
+ self.serverArgumentImplPolicy = None
190
+
191
+ def getDirection(self):
192
+ return self.direction
193
+
194
+ def setDirection(self, value):
195
+ self.direction = value
196
+ return self
197
+
198
+ def getServerArgumentImplPolicy(self):
199
+ return self.serverArgumentImplPolicy
200
+
201
+ def setServerArgumentImplPolicy(self, value):
202
+ self.serverArgumentImplPolicy = value
203
+ return self
188
204
 
189
205
  class ApplicationError(Identifiable):
190
206
  def __init__(self, parent: ARObject, short_name: str):
@@ -287,4 +303,179 @@ class ModeSwitchInterface(PortInterface):
287
303
  return self.elements[short_name]
288
304
 
289
305
  def getModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
290
- return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key= lambda o: o.short_name))
306
+ return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key= lambda o: o.short_name))
307
+
308
+ class PortInterfaceMapping(Identifiable, metaclass = ABCMeta):
309
+ def __init__(self, parent: ARObject, short_name: str):
310
+ if type(self) == PortInterface:
311
+ raise NotImplementedError("PortInterfaceMapping is an abstract class.")
312
+ super().__init__(parent, short_name)
313
+
314
+ class ClientServerApplicationErrorMapping(ARObject):
315
+ def __init__(self):
316
+ super().__init__()
317
+
318
+ self.firstApplicationErrorRef = None # type: RefType
319
+ self.secondApplicationErrorRef = None # type: RefType
320
+
321
+ def getFirstApplicationErrorRef(self):
322
+ return self.firstApplicationErrorRef
323
+
324
+ def setFirstApplicationErrorRef(self, value):
325
+ self.firstApplicationErrorRef = value
326
+ return self
327
+
328
+ def getSecondApplicationErrorRef(self):
329
+ return self.secondApplicationErrorRef
330
+
331
+ def setSecondApplicationErrorRef(self, value):
332
+ self.secondApplicationErrorRef = value
333
+ return self
334
+
335
+ class ClientServerOperationMapping(ARObject):
336
+ def __init__(self):
337
+ super().__init__()
338
+
339
+
340
+ self.argumentMappings = [] # type: List[DataPrototypeMapping]
341
+ self.firstOperationRef = None # type: RefType
342
+ self.firstToSecondDataTransformationRef = None # type: RefType
343
+ self.secondOperationRef = None # type: RefType
344
+
345
+ def getArgumentMappings(self):
346
+ return self.argumentMappings
347
+
348
+ def addArgumentMapping(self, value):
349
+ self.argumentMappings.append(value)
350
+ return self
351
+
352
+ def getFirstOperationRef(self):
353
+ return self.firstOperationRef
354
+
355
+ def setFirstOperationRef(self, value):
356
+ self.firstOperationRef = value
357
+ return self
358
+
359
+ def getFirstToSecondDataTransformationRef(self):
360
+ return self.firstToSecondDataTransformationRef
361
+
362
+ def setFirstToSecondDataTransformationRef(self, value):
363
+ self.firstToSecondDataTransformationRef = value
364
+ return self
365
+
366
+ def getSecondOperationRef(self):
367
+ return self.secondOperationRef
368
+
369
+ def setSecondOperationRef(self, value):
370
+ self.secondOperationRef = value
371
+ return self
372
+
373
+
374
+ class DataPrototypeMapping(ARObject):
375
+ def __init__(self):
376
+ super().__init__()
377
+
378
+ self.firstDataPrototypeRef = None # type: RefType
379
+ self.firstToSecondDataTransformationRef = None # type: RefType
380
+ self.secondDataPrototypeRef = None # type: RefType
381
+ self.secondToFirstDataTransformationRef = None # type: RefType
382
+ self.subElementMappings = [] # type: List[SubElementMapping]
383
+ self.textTableMappings = [] # type: List[TextTableMapping]
384
+
385
+ def getFirstDataPrototypeRef(self):
386
+ return self.firstDataPrototypeRef
387
+
388
+ def setFirstDataPrototypeRef(self, value):
389
+ self.firstDataPrototypeRef = value
390
+ return self
391
+
392
+ def getFirstToSecondDataTransformationRef(self):
393
+ return self.firstToSecondDataTransformationRef
394
+
395
+ def setFirstToSecondDataTransformationRef(self, value):
396
+ self.firstToSecondDataTransformationRef = value
397
+ return self
398
+
399
+ def getSecondDataPrototypeRef(self):
400
+ return self.secondDataPrototypeRef
401
+
402
+ def setSecondDataPrototypeRef(self, value):
403
+ self.secondDataPrototypeRef = value
404
+ return self
405
+
406
+ def getSecondToFirstDataTransformationRef(self):
407
+ return self.secondToFirstDataTransformationRef
408
+
409
+ def setSecondToFirstDataTransformationRef(self, value):
410
+ self.secondToFirstDataTransformationRef = value
411
+ return self
412
+
413
+ def getSubElementMappings(self):
414
+ return self.subElementMappings
415
+
416
+ def setSubElementMappings(self, value):
417
+ self.subElementMappings = value
418
+ return self
419
+
420
+ def getTextTableMappings(self):
421
+ return self.textTableMappings
422
+
423
+ def setTextTableMappings(self, value):
424
+ self.textTableMappings = value
425
+ return self
426
+
427
+
428
+
429
+ class ClientServerInterfaceMapping(PortInterfaceMapping):
430
+ def __init__(self, parent: ARObject, short_name: str):
431
+ super().__init__(parent, short_name)
432
+
433
+ # type: ClientServerApplicationErrorMapping
434
+ self.errorMappings = []
435
+ # type: ClientServerOperationMapping
436
+ self.operationMappings = []
437
+
438
+ def getErrorMappings(self):
439
+ return self.errorMappings
440
+
441
+ def setErrorMappings(self, value):
442
+ self.errorMappings = value
443
+ return self
444
+
445
+ def getOperationMappings(self):
446
+ return self.operationMappings
447
+
448
+ def setOperationMappings(self, value):
449
+ self.operationMappings = value
450
+ return self
451
+
452
+
453
+ class VariableAndParameterInterfaceMapping(PortInterfaceMapping):
454
+ def __init__(self, parent: ARObject, short_name: str):
455
+ super().__init__(parent, short_name)
456
+
457
+ self.dataMappings = [] # type: List[DataPrototypeMapping]
458
+
459
+ def getDataMappings(self):
460
+ return self.dataMappings
461
+
462
+ def addDataMapping(self, value):
463
+ self.dataMappings.append(value)
464
+ return self
465
+
466
+
467
+ class PortInterfaceMappingSet(ARElement):
468
+ def __init__(self, parent: ARObject, short_name: str):
469
+ super().__init__(parent, short_name)
470
+
471
+ self.portInterfaceMappings = [] # type: List[PortInterfaceMapping]
472
+
473
+ def getPortInterfaceMappings(self):
474
+ return self.portInterfaceMappings
475
+
476
+ def createVariableAndParameterInterfaceMapping(self, short_name):
477
+ if (short_name not in self.elements):
478
+ mapping = VariableAndParameterInterfaceMapping(self, short_name)
479
+ self.addElement(mapping)
480
+ self.portInterfaceMappings.append(mapping)
481
+ return self.getElement(short_name)
@@ -0,0 +1,31 @@
1
+ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
2
+ from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import ArVariableInImplementationDataInstanceRef, VariableInAtomicSWCTypeInstanceRef
3
+
4
+ class AutosarVariableRef(ARObject):
5
+ def __init__(self):
6
+ super().__init__()
7
+
8
+ self.autosarVariableIRef = None # type: VariableInAtomicSWCTypeInstanceRef
9
+ self.autosarVariableInImplDatatype = None # type: ArVariableInImplementationDataInstanceRef
10
+ self.localVariableRef = None
11
+
12
+ def getAutosarVariableIRef(self):
13
+ return self.autosarVariableIRef
14
+
15
+ def setAutosarVariableIRef(self, value):
16
+ self.autosarVariableIRef = value
17
+ return self
18
+
19
+ def getAutosarVariableInImplDatatype(self):
20
+ return self.autosarVariableInImplDatatype
21
+
22
+ def setAutosarVariableInImplDatatype(self, value):
23
+ self.autosarVariableInImplDatatype = value
24
+ return self
25
+
26
+ def getLocalVariableRef(self):
27
+ return self.localVariableRef
28
+
29
+ def setLocalVariableRef(self, value):
30
+ self.localVariableRef = value
31
+ return self
@@ -1,5 +1,6 @@
1
+ from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import AutosarVariableRef
1
2
  from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AccessCount import AbstractAccessPoint
2
- from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef, AutosarVariableRef
3
+ from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef
3
4
  from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
4
5
  from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
5
6
  from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral
@@ -9,8 +10,8 @@ class ParameterAccess(AbstractAccessPoint):
9
10
  def __init__(self, parent: ARObject, short_name: str):
10
11
  super().__init__(parent, short_name)
11
12
 
12
- self.accessedParameter = None # type: AutosarParameterRef
13
- self.swDataDefProps = None # type: SwDataDefProps
13
+ self.accessedParameter = None # type: AutosarParameterRef
14
+ self.swDataDefProps = None # type: SwDataDefProps
14
15
 
15
16
  def getAccessedParameter(self):
16
17
  return self.accessedParameter
@@ -86,36 +86,6 @@ class VariableInAtomicSWCTypeInstanceRef(AtpInstanceRef):
86
86
  self.targetDataPrototypeRef = value
87
87
  return self
88
88
 
89
- class AutosarVariableRef(ARObject):
90
- def __init__(self):
91
- super().__init__()
92
-
93
- self.autosarVariableIRef = None # type: VariableInAtomicSWCTypeInstanceRef
94
- self.autosarVariableInImplDatatype = None # type: ArVariableInImplementationDataInstanceRef
95
- self.localVariableRef = None
96
-
97
- def getAutosarVariableIRef(self):
98
- return self.autosarVariableIRef
99
-
100
- def setAutosarVariableIRef(self, value):
101
- self.autosarVariableIRef = value
102
- return self
103
-
104
- def getAutosarVariableInImplDatatype(self):
105
- return self.autosarVariableInImplDatatype
106
-
107
- def setAutosarVariableInImplDatatype(self, value):
108
- self.autosarVariableInImplDatatype = value
109
- return self
110
-
111
- def getLocalVariableRef(self):
112
- return self.localVariableRef
113
-
114
- def setLocalVariableRef(self, value):
115
- self.localVariableRef = value
116
- return self
117
-
118
-
119
89
  class ParameterInAtomicSWCTypeInstanceRef(AtpInstanceRef):
120
90
  def __init__(self):
121
91
  super().__init__()
@@ -165,5 +135,20 @@ class AutosarParameterRef(ARObject):
165
135
  def __init__(self):
166
136
  super().__init__()
167
137
 
168
- self.autosar_parameter_iref = None # type: ParameterInAtomicSWCTypeInstanceRef
169
- self.local_parameter_ref = None # type: RefType
138
+ # type: ParameterInAtomicSWCTypeInstanceRef
139
+ self.autosarParameterIRef = None
140
+ self.localParameterRef = None # type: RefType
141
+
142
+ def getAutosarParameterIRef(self):
143
+ return self.autosarParameterIRef
144
+
145
+ def setAutosarParameterIRef(self, value):
146
+ self.autosarParameterIRef = value
147
+ return self
148
+
149
+ def getLocalParameterRef(self):
150
+ return self.localParameterRef
151
+
152
+ def setLocalParameterRef(self, value):
153
+ self.localParameterRef = value
154
+ return self
@@ -172,3 +172,7 @@ class InternalTriggerOccurredEvent(RTEEvent):
172
172
  def setEventSourceRef(self, value):
173
173
  self.eventSourceRef = value
174
174
  return self
175
+
176
+ class BackgroundEvent(RTEEvent):
177
+ def __init__(self, parent: ARObject, short_name: str):
178
+ super().__init__(parent, short_name)
@@ -1,5 +1,5 @@
1
1
  from typing import List
2
- from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagnosticCommunicationManagerNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, NvBlockNeeds, RoleBasedDataAssignment, ServiceNeeds
2
+ from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagnosticCommunicationManagerNeeds, DiagnosticEventInfoNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment, ServiceNeeds
3
3
  from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
4
4
  from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Identifier, RefType
5
5
  from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import ServiceDependency
@@ -73,12 +73,24 @@ class SwcServiceDependency(ServiceDependency):
73
73
  self.addElement(needs)
74
74
  return self.getElement(short_name)
75
75
 
76
+ def createDiagnosticEventInfoNeeds(self, short_name: str) -> DiagnosticEventInfoNeeds:
77
+ if (short_name not in self.elements):
78
+ needs = DiagnosticEventInfoNeeds(self, short_name)
79
+ self.addElement(needs)
80
+ return self.getElement(short_name)
81
+
76
82
  def createCryptoServiceNeeds(self, short_name: str) -> CryptoServiceNeeds:
77
83
  if (short_name not in self.elements):
78
84
  needs = CryptoServiceNeeds(self, short_name)
79
85
  self.addElement(needs)
80
86
  return self.getElement(short_name)
81
-
87
+
88
+ def createEcuStateMgrUserNeeds(self, short_name: str) -> EcuStateMgrUserNeeds:
89
+ if (short_name not in self.elements):
90
+ needs = EcuStateMgrUserNeeds(self, short_name)
91
+ self.addElement(needs)
92
+ return self.getElement(short_name)
93
+
82
94
  def getNvBlockNeeds(self) -> List[NvBlockNeeds]:
83
95
  return sorted(filter(lambda c: isinstance(c, NvBlockNeeds), self.elements.values()), key=lambda e: e.short_name)
84
96
 
@@ -93,6 +105,9 @@ class SwcServiceDependency(ServiceDependency):
93
105
 
94
106
  def getCryptoServiceNeeds(self) -> List[CryptoServiceNeeds]:
95
107
  return sorted(filter(lambda c: isinstance(c, CryptoServiceNeeds), self.elements.values()), key=lambda e: e.short_name)
108
+
109
+ def getEcuStateMgrUserNeeds(self) -> List[EcuStateMgrUserNeeds]:
110
+ return sorted(filter(lambda c: isinstance(c, EcuStateMgrUserNeeds), self.elements.values()), key=lambda e: e.short_name)
96
111
 
97
112
  def getServiceNeeds(self) -> List[ServiceNeeds]:
98
113
  return sorted(filter(lambda c: isinstance(c, ServiceNeeds), self.elements.values()), key=lambda e: e.short_name)
@@ -8,7 +8,7 @@ from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.IncludedDa
8
8
  from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.PerInstanceMemory import PerInstanceMemory
9
9
  from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import AsynchronousServerCallReturnsEvent, DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent, TimingEvent
10
10
  from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServiceMapping import SwcServiceDependency
11
- from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, RefType, ARBoolean
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
14
  from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import ModeAccessPoint, ModeSwitchPoint
@@ -224,38 +224,72 @@ class SwcInternalBehavior(InternalBehavior):
224
224
  def __init__(self, parent: ARObject, short_name: str):
225
225
  super().__init__(parent, short_name)
226
226
 
227
- self.handle_termination_and_restart = None # type: str
228
- self.supports_multiple_instantiation = None # type: ARBoolean
229
- self.explicit_inter_runnable_variables = [] # type: List[VariableDataPrototype]
230
- self.implicit_inter_runnable_variables = [] # type: List[VariableDataPrototype]
231
- self.per_instance_memories = [] # type: List[PerInstanceMemory]
232
- self.per_instance_parameters = [] # type: List[ParameterDataPrototype]
233
- self.port_api_options = [] # type: List[PortAPIOption]
234
- self.included_data_type_sets = [] # type: List[IncludedDataTypeSet]
227
+ self.arTypedPerInstanceMemories = [] # type: List[VariableDataPrototype]
228
+ self.events = [] # type: List[RTEEvent]
229
+ self.exclusiveAreaPolicies = [] # type: List[SwcExclusiveAreaPolicy]
230
+ self.explicitInterRunnableVariables = [] # type: List[VariableDataPrototype]
231
+ self.handleTerminationAndRestart = None # type: str
232
+ self.implicitInterRunnableVariables = [] # type: List[VariableDataPrototype]
233
+ self.includedDataTypeSets = [] # type: List[IncludedDataTypeSet]
234
+ self.includedModeDeclarationGroupSets = [] # type: List[IncludedModeDeclarationGroupSet]
235
+ self.instantiationDataDefProps = [] # type: List[InstantiationDataDefProps]
236
+ self.perInstanceMemories = [] # type: List[PerInstanceMemory]
237
+ self.perInstanceParameters = [] # type: List[ParameterDataPrototype]
238
+ self.portAPIOptions = [] # type: List[PortAPIOption]
239
+ self.runnables = [] # type: List[RunnableEntity]
240
+ self.serviceDependencies = [] # type: List[SwcServiceDependency]
241
+ self.sharedParameters = [] # type: List[ParameterDataPrototype]
242
+ self.supportsMultipleInstantiation = None # type: Boolean
243
+ self.variationPointProxies = [] # type: VariationPointProxy
244
+
245
+ def getArTypedPerInstanceMemories(self) -> List[VariableDataPrototype]:
246
+ return self.arTypedPerInstanceMemories
247
+
248
+ def createArTypedPerInstanceMemory(self, short_name: str) -> VariableDataPrototype:
249
+ if (short_name not in self.elements):
250
+ prototype = VariableDataPrototype(self, short_name)
251
+ self.addElement(prototype)
252
+ self.arTypedPerInstanceMemories.append(prototype)
253
+ return self.getElement(short_name)
235
254
 
236
255
  def getExplicitInterRunnableVariables(self) -> List[VariableDataPrototype]:
237
- return self.explicit_inter_runnable_variables
256
+ return self.explicitInterRunnableVariables
257
+
258
+ def createExplicitInterRunnableVariable(self, short_name: str) -> VariableDataPrototype:
259
+ if (short_name not in self.elements):
260
+ prototype = VariableDataPrototype(self, short_name)
261
+ self.addElement(prototype)
262
+ self.explicitInterRunnableVariables.append(prototype)
263
+ return self.getElement(short_name)
264
+
265
+ def getHandleTerminationAndRestart(self):
266
+ return self.handleTerminationAndRestart
267
+
268
+ def setHandleTerminationAndRestart(self, value):
269
+ self.handleTerminationAndRestart = value
270
+ return self
271
+
238
272
 
239
273
  def getImplicitInterRunnableVariables(self) -> List[VariableDataPrototype]:
240
- return self.implicit_inter_runnable_variables
274
+ return self.implicitInterRunnableVariables
241
275
 
242
276
  def getPerInstanceMemories(self) -> List[PerInstanceMemory]:
243
- return self.per_instance_memories
277
+ return self.perInstanceMemories
244
278
 
245
279
  def getPerInstanceParameters(self) -> List[ParameterDataPrototype]:
246
- return self.per_instance_parameters
280
+ return self.perInstanceParameters
247
281
 
248
282
  def addPortAPIOption(self, option: PortAPIOption):
249
- self.port_api_options.append(option)
283
+ self.portAPIOptions.append(option)
250
284
 
251
285
  def getPortAPIOptions(self) -> List[PortAPIOption]:
252
- return self.port_api_options
286
+ return self.portAPIOptions
253
287
 
254
288
  def addIncludedDataTypeSet(self, set: IncludedDataTypeSet):
255
- self.included_data_type_sets.append(set)
289
+ self.includedDataTypeSets.append(set)
256
290
 
257
291
  def getIncludedDataTypeSets(self) -> List[IncludedDataTypeSet]:
258
- return self.included_data_type_sets
292
+ return self.includedDataTypeSets
259
293
 
260
294
  def createOperationInvokedEvent(self, short_name: str) -> OperationInvokedEvent:
261
295
  if (short_name not in self.elements):
@@ -333,34 +367,31 @@ class SwcInternalBehavior(InternalBehavior):
333
367
  if (not isinstance(self.elements[short_name], RTEEvent)):
334
368
  raise ValueError("Invalid Event Type <%s> of <%s>" % type(self.elements[short_name]), short_name)
335
369
  return self.elements[short_name]
370
+
371
+
336
372
 
337
- def createExplicitInterRunnableVariable(self, short_name: str) -> VariableDataPrototype:
338
- if (short_name not in self.elements):
339
- prototype = VariableDataPrototype(self, short_name)
340
- self.elements[short_name] = prototype
341
- self.explicit_inter_runnable_variables.append(prototype)
342
- return self.elements[short_name]
373
+
343
374
 
344
375
  def createImplicitInterRunnableVariable(self, short_name: str) -> VariableDataPrototype:
345
376
  if (short_name not in self.elements):
346
377
  prototype = VariableDataPrototype(self, short_name)
347
- self.elements[short_name] = prototype
348
- self.implicit_inter_runnable_variables.append(prototype)
349
- return self.elements[short_name]
378
+ self.addElement(prototype)
379
+ self.implicitInterRunnableVariables.append(prototype)
380
+ return self.getElement(short_name)
350
381
 
351
382
  def createPerInstanceMemory(self, short_name: str) -> PerInstanceMemory:
352
383
  if (short_name not in self.elements):
353
384
  memory = PerInstanceMemory(self, short_name)
354
- self.elements[short_name] = memory
355
- self.per_instance_memories.append(memory)
356
- return self.elements[short_name]
385
+ self.addElement(memory)
386
+ self.perInstanceMemories.append(memory)
387
+ return self.getElement(short_name)
357
388
 
358
389
  def createPerInstanceParameter(self, short_name: str) -> ParameterDataPrototype:
359
390
  if (short_name not in self.elements):
360
391
  prototype = ParameterDataPrototype(self, short_name)
361
- self.elements[short_name] = prototype
362
- self.per_instance_parameters.append(prototype)
363
- return self.elements[short_name]
392
+ self.addElement(prototype)
393
+ self.perInstanceParameters.append(prototype)
394
+ return self.getElement(short_name)
364
395
 
365
396
  def getVariableDataPrototypes(self) -> List[VariableDataPrototype]:
366
397
  return sorted(filter(lambda c: isinstance(c, VariableDataPrototype), self.elements.values()), key=lambda e: e.short_name)
@@ -368,12 +399,28 @@ class SwcInternalBehavior(InternalBehavior):
368
399
  def createRunnableEntity(self, short_name: str) -> RunnableEntity:
369
400
  if (short_name not in self.elements):
370
401
  runnable = RunnableEntity(self, short_name)
371
- self.elements[short_name] = runnable
372
- return self.elements[short_name]
402
+ self.addElement(runnable)
403
+ return self.getElement(short_name)
373
404
 
374
405
  def getRunnableEntities(self) -> List[RunnableEntity]:
375
406
  return sorted(filter(lambda c: isinstance(c, RunnableEntity), self.elements.values()), key=lambda r: r.short_name)
376
407
 
377
408
  def getRunnableEntity(self, short_name) -> RunnableEntity:
378
409
  return self.elements[short_name]
410
+
411
+ def getSharedParameters(self) -> List[ParameterDataPrototype]:
412
+ return self.sharedParameters
413
+
414
+ def createSharedParameter(self, short_name: str) -> ParameterDataPrototype:
415
+ if (short_name not in self.elements):
416
+ memory = ParameterDataPrototype(self, short_name)
417
+ self.addElement(memory)
418
+ self.sharedParameters.append(memory)
419
+ return self.getElement(short_name)
379
420
 
421
+ def getSupportsMultipleInstantiation(self):
422
+ return self.supportsMultipleInstantiation
423
+
424
+ def setSupportsMultipleInstantiation(self, value):
425
+ self.supportsMultipleInstantiation = value
426
+ return self
@@ -1,6 +1,8 @@
1
1
  from abc import ABCMeta
2
+
2
3
  from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
3
4
  from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
5
+ from ....M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import CommunicationDirectionType
4
6
 
5
7
  class DataMapping(ARObject, metaclass = ABCMeta):
6
8
  def __init__(self):
@@ -18,16 +20,23 @@ class DataMapping(ARObject, metaclass = ABCMeta):
18
20
  self.introduction = value
19
21
  return self
20
22
 
21
-
22
23
  class SenderReceiverToSignalMapping(DataMapping):
23
24
  def __init__(self):
24
25
  super().__init__()
25
26
 
27
+ self.communicationDirection = None # type: CommunicationDirectionType
26
28
  self.dataElementIRef = None
27
29
  self.senderToSignalTextTableMapping = None
28
30
  self.signalToReceiverTextTableMapping = None
29
31
  self.systemSignalRef = None
30
32
 
33
+ def getCommunicationDirection(self):
34
+ return self.communicationDirection
35
+
36
+ def setCommunicationDirection(self, value):
37
+ self.communicationDirection = value
38
+ return self
39
+
31
40
  def getDataElementIRef(self):
32
41
  return self.dataElementIRef
33
42