armodel 1.8.0__py3-none-any.whl → 1.8.1__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/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +0 -1
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +14 -14
- armodel/models/M2/AUTOSARTemplates/CommonStructure/FlatMap.py +2 -3
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +1 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +7 -7
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +1 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +4 -4
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +3 -3
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/ExecutionOrderConstraint.py +3 -3
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/TimingExtensions.py +3 -3
- armodel/models/M2/AUTOSARTemplates/ECUCDescriptionTemplate.py +86 -9
- armodel/models/M2/AUTOSARTemplates/ECUCParameterDefTemplate.py +1249 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py +13 -10
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +238 -225
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ArObject.py +5 -4
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +46 -25
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +33 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +18 -20
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +23 -19
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +4 -4
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +71 -27
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +9 -9
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +172 -128
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +11 -11
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +8 -8
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +2 -2
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/NetworkManagement.py +6 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +6 -6
- armodel/models/M2/MSR/AsamHdo/AdminData.py +101 -8
- armodel/parser/abstract_arxml_parser.py +8 -5
- armodel/parser/arxml_parser.py +332 -16
- armodel/tests/test_armodel/models/test_ECUCParameterDefTemplate.py +116 -0
- armodel/tests/test_armodel/models/test_Identifiable.py +85 -0
- armodel/tests/test_armodel/models/test_ar_object.py +85 -86
- armodel/tests/test_armodel/models/test_ar_package.py +70 -70
- armodel/tests/test_armodel/models/test_ar_ref.py +36 -36
- armodel/tests/test_armodel/models/test_common_structure.py +37 -35
- armodel/tests/test_armodel/models/test_datatype.py +4 -4
- armodel/tests/test_armodel/models/test_general_structure.py +19 -18
- armodel/tests/test_armodel/models/test_port_interface.py +2 -6
- armodel/tests/test_armodel/parser/test_arxml_parser.py +8 -8
- armodel/writer/abstract_arxml_writer.py +6 -2
- armodel/writer/arxml_writer.py +376 -29
- {armodel-1.8.0.dist-info → armodel-1.8.1.dist-info}/METADATA +17 -1
- {armodel-1.8.0.dist-info → armodel-1.8.1.dist-info}/RECORD +49 -46
- {armodel-1.8.0.dist-info → armodel-1.8.1.dist-info}/LICENSE +0 -0
- {armodel-1.8.0.dist-info → armodel-1.8.1.dist-info}/WHEEL +0 -0
- {armodel-1.8.0.dist-info → armodel-1.8.1.dist-info}/entry_points.txt +0 -0
- {armodel-1.8.0.dist-info → armodel-1.8.1.dist-info}/top_level.txt +0 -0
|
@@ -116,7 +116,6 @@ class AbstractAUTOSAR(CollectableElement):
|
|
|
116
116
|
return CollectableElement.getElement(self, short_name)
|
|
117
117
|
|
|
118
118
|
def getARPackages(self) -> List[ARPackage]:
|
|
119
|
-
# return list(filter(lambda e: isinstance(e, ARPackage), self.elements.values()))
|
|
120
119
|
return list(sorted(self.arPackages.values(), key=lambda a: a.short_name))
|
|
121
120
|
|
|
122
121
|
def createARPackage(self, short_name: str) -> ARPackage:
|
|
@@ -171,7 +171,7 @@ class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
|
171
171
|
access = BswVariableAccess(self, short_name)
|
|
172
172
|
self.addElement(access)
|
|
173
173
|
self.dataReceivePoints.append(access)
|
|
174
|
-
return self.getElement(short_name)
|
|
174
|
+
return self.getElement(short_name, BswVariableAccess)
|
|
175
175
|
|
|
176
176
|
def getDataSendPoints(self):
|
|
177
177
|
return self.dataSendPoints
|
|
@@ -181,7 +181,7 @@ class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
|
181
181
|
access = BswVariableAccess(self, short_name)
|
|
182
182
|
self.addElement(access)
|
|
183
183
|
self.dataSendPoints.append(access)
|
|
184
|
-
return self.getElement(short_name)
|
|
184
|
+
return self.getElement(short_name, BswVariableAccess)
|
|
185
185
|
|
|
186
186
|
def getImplementedEntryRef(self):
|
|
187
187
|
return self.implementedEntryRef
|
|
@@ -673,7 +673,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
673
673
|
return self.getElement(short_name)
|
|
674
674
|
|
|
675
675
|
def getBswCalledEntities(self) -> List[BswCalledEntity]:
|
|
676
|
-
return list(filter(lambda a: isinstance(a, BswCalledEntity), self.elements
|
|
676
|
+
return list(filter(lambda a: isinstance(a, BswCalledEntity), self.elements))
|
|
677
677
|
|
|
678
678
|
def createBswSchedulableEntity(self, short_name: str) -> BswSchedulableEntity:
|
|
679
679
|
if not self.IsElementExists(short_name):
|
|
@@ -683,7 +683,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
683
683
|
return self.getElement(short_name)
|
|
684
684
|
|
|
685
685
|
def getBswSchedulableEntities(self) -> List[BswSchedulableEntity]:
|
|
686
|
-
return list(filter(lambda a: isinstance(a, BswSchedulableEntity), self.elements
|
|
686
|
+
return list(filter(lambda a: isinstance(a, BswSchedulableEntity), self.elements))
|
|
687
687
|
|
|
688
688
|
def createBswInterruptEntity(self, short_name: str) -> BswInterruptEntity:
|
|
689
689
|
if not self.IsElementExists(short_name):
|
|
@@ -693,10 +693,10 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
693
693
|
return self.getElement(short_name)
|
|
694
694
|
|
|
695
695
|
def getBswInterruptEntities(self) -> List[BswInterruptEntity]:
|
|
696
|
-
return list(filter(lambda a: isinstance(a, BswInterruptEntity), self.elements
|
|
696
|
+
return list(filter(lambda a: isinstance(a, BswInterruptEntity), self.elements))
|
|
697
697
|
|
|
698
698
|
def getBswModuleEntities(self) -> List[BswModuleEntity]:
|
|
699
|
-
return list(filter(lambda a: isinstance(a, BswModuleEntity), self.elements
|
|
699
|
+
return list(filter(lambda a: isinstance(a, BswModuleEntity), self.elements))
|
|
700
700
|
|
|
701
701
|
def createBswModeSwitchEvent(self, short_name: str) -> BswModeSwitchEvent:
|
|
702
702
|
if not self.IsElementExists(short_name):
|
|
@@ -706,7 +706,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
706
706
|
return self.getElement(short_name)
|
|
707
707
|
|
|
708
708
|
def getBswModeSwitchEvents(self) -> List[BswModeSwitchEvent]:
|
|
709
|
-
return list(filter(lambda a: isinstance(a, BswModeSwitchEvent), self.elements
|
|
709
|
+
return list(filter(lambda a: isinstance(a, BswModeSwitchEvent), self.elements))
|
|
710
710
|
|
|
711
711
|
def createBswTimingEvent(self, short_name: str) -> BswTimingEvent:
|
|
712
712
|
if not self.IsElementExists(short_name):
|
|
@@ -716,7 +716,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
716
716
|
return self.getElement(short_name)
|
|
717
717
|
|
|
718
718
|
def getBswTimingEvents(self) -> List[BswTimingEvent]:
|
|
719
|
-
return list(filter(lambda a: isinstance(a, BswTimingEvent), self.elements
|
|
719
|
+
return list(filter(lambda a: isinstance(a, BswTimingEvent), self.elements))
|
|
720
720
|
|
|
721
721
|
def createBswDataReceivedEvent(self, short_name: str) -> BswDataReceivedEvent:
|
|
722
722
|
if not self.IsElementExists(short_name):
|
|
@@ -726,7 +726,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
726
726
|
return self.getElement(short_name)
|
|
727
727
|
|
|
728
728
|
def getBswDataReceivedEvents(self) -> List[BswDataReceivedEvent]:
|
|
729
|
-
return list(filter(lambda a: isinstance(a, BswDataReceivedEvent), self.elements
|
|
729
|
+
return list(filter(lambda a: isinstance(a, BswDataReceivedEvent), self.elements))
|
|
730
730
|
|
|
731
731
|
def createBswInternalTriggerOccurredEvent(self, short_name: str) -> BswInternalTriggerOccurredEvent:
|
|
732
732
|
if not self.IsElementExists(short_name):
|
|
@@ -736,7 +736,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
736
736
|
return self.getElement(short_name)
|
|
737
737
|
|
|
738
738
|
def getBswInternalTriggerOccurredEvents(self) -> List[BswInternalTriggerOccurredEvent]:
|
|
739
|
-
return list(filter(lambda a: isinstance(a, BswInternalTriggerOccurredEvent), self.elements
|
|
739
|
+
return list(filter(lambda a: isinstance(a, BswInternalTriggerOccurredEvent), self.elements))
|
|
740
740
|
|
|
741
741
|
def createBswExternalTriggerOccurredEvent(self, short_name: str) -> BswExternalTriggerOccurredEvent:
|
|
742
742
|
if not self.IsElementExists(short_name):
|
|
@@ -746,7 +746,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
746
746
|
return self.getElement(short_name)
|
|
747
747
|
|
|
748
748
|
def getBswOperationInvokedEvents(self) -> List[BswOperationInvokedEvent]:
|
|
749
|
-
return list(filter(lambda a: isinstance(a, BswOperationInvokedEvent), self.elements
|
|
749
|
+
return list(filter(lambda a: isinstance(a, BswOperationInvokedEvent), self.elements))
|
|
750
750
|
|
|
751
751
|
def createBswOperationInvokedEvent(self, short_name: str) -> BswOperationInvokedEvent:
|
|
752
752
|
if not self.IsElementExists(short_name):
|
|
@@ -756,7 +756,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
756
756
|
return self.getElement(short_name)
|
|
757
757
|
|
|
758
758
|
def getBswExternalTriggerOccurredEvents(self) -> List[BswExternalTriggerOccurredEvent]:
|
|
759
|
-
return list(filter(lambda a: isinstance(a, BswExternalTriggerOccurredEvent), self.elements
|
|
759
|
+
return list(filter(lambda a: isinstance(a, BswExternalTriggerOccurredEvent), self.elements))
|
|
760
760
|
|
|
761
761
|
def createBswBackgroundEvent(self, short_name: str) -> BswBackgroundEvent:
|
|
762
762
|
if not self.IsElementExists(short_name):
|
|
@@ -766,10 +766,10 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
766
766
|
return self.getElement(short_name)
|
|
767
767
|
|
|
768
768
|
def getBswBackgroundEvents(self) -> List[BswBackgroundEvent]:
|
|
769
|
-
return list(filter(lambda a: isinstance(a, BswBackgroundEvent), self.elements
|
|
769
|
+
return list(filter(lambda a: isinstance(a, BswBackgroundEvent), self.elements))
|
|
770
770
|
|
|
771
771
|
def getBswEvents(self) -> List[BswEvent]:
|
|
772
|
-
return list(filter(lambda a: isinstance(a, BswEvent), self.elements
|
|
772
|
+
return list(filter(lambda a: isinstance(a, BswEvent), self.elements))
|
|
773
773
|
|
|
774
774
|
def addIncludedModeDeclarationGroupSet(self, group_set: IncludedModeDeclarationGroupSet):
|
|
775
775
|
self.includedModeDeclarationGroupSets.append(group_set)
|
|
@@ -5,6 +5,7 @@ from ....M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AnyInstan
|
|
|
5
5
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
6
6
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Identifiable
|
|
7
7
|
|
|
8
|
+
|
|
8
9
|
class FlatInstanceDescriptor(Identifiable):
|
|
9
10
|
def __init__(self, parent: ARObject, short_name: str):
|
|
10
11
|
super().__init__(parent, short_name)
|
|
@@ -58,7 +59,7 @@ class FlatMap(ARElement):
|
|
|
58
59
|
self.instances = [] # type: List[FlatInstanceDescriptor]
|
|
59
60
|
|
|
60
61
|
def getInstances(self):
|
|
61
|
-
return list(sorted(filter(lambda a: isinstance(a, FlatInstanceDescriptor), self.elements
|
|
62
|
+
return list(sorted(filter(lambda a: isinstance(a, FlatInstanceDescriptor), self.elements), key=lambda o: o.short_name))
|
|
62
63
|
|
|
63
64
|
def createFlatInstanceDescriptor(self, short_name: str):
|
|
64
65
|
if (short_name not in self.elements):
|
|
@@ -66,5 +67,3 @@ class FlatMap(ARElement):
|
|
|
66
67
|
self.addElement(element)
|
|
67
68
|
self.instances.append(element)
|
|
68
69
|
return self.getElement(short_name)
|
|
69
|
-
|
|
70
|
-
|
|
@@ -134,7 +134,7 @@ class Implementation(PackageableElement, metaclass=ABCMeta):
|
|
|
134
134
|
return self
|
|
135
135
|
|
|
136
136
|
def getCodeDescriptors(self) -> List[Code]:
|
|
137
|
-
return list(filter(lambda a: isinstance(a, Code), self.elements
|
|
137
|
+
return list(filter(lambda a: isinstance(a, Code), self.elements))
|
|
138
138
|
|
|
139
139
|
def createCodeDescriptor(self, short_name: str) -> Code:
|
|
140
140
|
if (short_name not in self.elements):
|
|
@@ -76,14 +76,14 @@ class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
|
76
76
|
self.swDataDefProps = value
|
|
77
77
|
return self
|
|
78
78
|
|
|
79
|
-
def createImplementationDataTypeElement(self, short_name: str)
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
self.
|
|
83
|
-
return self.
|
|
79
|
+
def createImplementationDataTypeElement(self, short_name: str) -> "ImplementationDataTypeElement":
|
|
80
|
+
if (not self.IsElementExists(short_name)):
|
|
81
|
+
type_element = ImplementationDataTypeElement(self, short_name)
|
|
82
|
+
self.addElement(type_element)
|
|
83
|
+
return self.getElement(short_name, ImplementationDataTypeElement)
|
|
84
84
|
|
|
85
|
-
def getImplementationDataTypeElements(self)
|
|
86
|
-
return list(filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements
|
|
85
|
+
def getImplementationDataTypeElements(self) -> List["ImplementationDataTypeElement"]:
|
|
86
|
+
return list(filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements))
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
class AbstractImplementationDataType(AutosarDataType, metaclass=ABCMeta):
|
|
@@ -109,7 +109,7 @@ class InternalBehavior(Identifiable, metaclass=ABCMeta):
|
|
|
109
109
|
return self.getElement(short_name)
|
|
110
110
|
|
|
111
111
|
def getExclusiveAreas(self) -> List[ExclusiveArea]:
|
|
112
|
-
return list(filter(lambda c: isinstance(c, ExclusiveArea), self.elements
|
|
112
|
+
return list(filter(lambda c: isinstance(c, ExclusiveArea), self.elements))
|
|
113
113
|
|
|
114
114
|
def getStaticMemories(self):
|
|
115
115
|
return self.staticMemories
|
|
@@ -85,13 +85,13 @@ class ModeDeclarationGroup(Identifiable):
|
|
|
85
85
|
self.onTransitionValue = None # type: PositiveInteger
|
|
86
86
|
|
|
87
87
|
def createModeDeclaration(self, short_name: str) -> ModeDeclaration:
|
|
88
|
-
if
|
|
88
|
+
if not self.IsElementExists(short_name):
|
|
89
89
|
spec = ModeDeclaration(self, short_name)
|
|
90
|
-
self.
|
|
91
|
-
return self.
|
|
90
|
+
self.addElement(spec)
|
|
91
|
+
return self.getElement(short_name, ModeDeclaration)
|
|
92
92
|
|
|
93
93
|
def getModeDeclarations(self) -> List[ModeDeclaration]:
|
|
94
|
-
return list(sorted(filter(lambda a: isinstance(a, ModeDeclaration), self.elements
|
|
94
|
+
return list(sorted(filter(lambda a: isinstance(a, ModeDeclaration), self.elements), key=lambda o: o.short_name))
|
|
95
95
|
|
|
96
96
|
def setInitialModeRef(self, ref: RefType):
|
|
97
97
|
self.initialModeRef = ref
|
|
@@ -24,10 +24,10 @@ class ResourceConsumption(Identifiable):
|
|
|
24
24
|
return self.getElement(short_name)
|
|
25
25
|
|
|
26
26
|
def getMemorySections(self) -> List[MemorySection]:
|
|
27
|
-
return list(sorted(filter(lambda a: isinstance(a, MemorySection), self.elements
|
|
27
|
+
return list(sorted(filter(lambda a: isinstance(a, MemorySection), self.elements), key= lambda o:o.short_name))
|
|
28
28
|
|
|
29
29
|
def getMemorySection(self, short_name: str) -> MemorySection:
|
|
30
|
-
return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements
|
|
30
|
+
return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements), None)
|
|
31
31
|
|
|
32
32
|
def createMeasuredStackUsage(self, short_name: str) -> MeasuredStackUsage:
|
|
33
33
|
if (short_name not in self.elements):
|
|
@@ -51,4 +51,4 @@ class ResourceConsumption(Identifiable):
|
|
|
51
51
|
return self.getElement(short_name)
|
|
52
52
|
|
|
53
53
|
def getStackUsages(self) -> List[StackUsage]:
|
|
54
|
-
return list(sorted(filter(lambda a: isinstance(a, StackUsage), self.elements
|
|
54
|
+
return list(sorted(filter(lambda a: isinstance(a, StackUsage), self.elements), key= lambda o:o.short_name))
|
|
@@ -35,11 +35,11 @@ class ExecutionOrderConstraint(TimingConstraint):
|
|
|
35
35
|
self.ordered_elements = [] # type: List[EOCExecutableEntityRefAbstract]
|
|
36
36
|
|
|
37
37
|
def createEOCExecutableEntityRef(self, short_name: str)-> EOCExecutableEntityRef:
|
|
38
|
-
if
|
|
38
|
+
if not self.IsElementExists(short_name):
|
|
39
39
|
entity_ref = EOCExecutableEntityRef(self, short_name)
|
|
40
|
-
self.
|
|
40
|
+
self.addElement(entity_ref)
|
|
41
41
|
self.ordered_elements.append(entity_ref)
|
|
42
|
-
return self.
|
|
42
|
+
return self.getElement(short_name, EOCExecutableEntityRef)
|
|
43
43
|
|
|
44
44
|
def getOrderedElements(self) -> List[EOCExecutableEntityRefAbstract]:
|
|
45
45
|
return self.ordered_elements
|
armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/TimingExtensions.py
CHANGED
|
@@ -18,11 +18,11 @@ class TimingExtension(Identifiable):
|
|
|
18
18
|
self.timing_requirements = [] # Type: List[TimingConstraint]
|
|
19
19
|
|
|
20
20
|
def createExecutionOrderConstraint(self, short_name: str)-> ExecutionOrderConstraint:
|
|
21
|
-
if
|
|
21
|
+
if not self.IsElementExists(short_name):
|
|
22
22
|
constraint = ExecutionOrderConstraint(self, short_name)
|
|
23
|
-
self.
|
|
23
|
+
self.addElement(constraint)
|
|
24
24
|
self.timing_requirements.append(constraint)
|
|
25
|
-
return self.
|
|
25
|
+
return self.getElement(short_name, ExecutionOrderConstraint)
|
|
26
26
|
|
|
27
27
|
def getTimingRequirements(self) -> List[TimingConstraint]:
|
|
28
28
|
return self.timing_requirements
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
2
|
from typing import List
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
from ...M2.AUTOSARTemplates.ECUCParameterDefTemplate import EcucChoiceContainerDef, EcucContainerDef, EcucDefinitionElement, EcucParamConfContainerDef
|
|
5
|
+
from ...M2.MSR.Documentation.TextModel.BlockElements import DocumentationBlock
|
|
4
6
|
from ...M2.MSR.Documentation.Annotation import Annotation
|
|
5
7
|
from ...M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AnyInstanceRef
|
|
6
8
|
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
7
|
-
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical,
|
|
9
|
+
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import AREnum, ARLiteral, ARNumerical, Boolean, CIdentifier, String
|
|
10
|
+
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean, RefType
|
|
8
11
|
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
9
12
|
|
|
10
13
|
|
|
@@ -205,11 +208,11 @@ class EcucContainerValue(ARElement, EcucIndexableValue):
|
|
|
205
208
|
return self.subContainers
|
|
206
209
|
|
|
207
210
|
def createSubContainer(self, short_name):
|
|
208
|
-
if
|
|
211
|
+
if not self.IsElementExists(short_name):
|
|
209
212
|
container_value = EcucContainerValue(self, short_name)
|
|
210
|
-
self.
|
|
213
|
+
self.addElement(container_value)
|
|
211
214
|
self.subContainers.append(container_value)
|
|
212
|
-
return self.
|
|
215
|
+
return self.getElement(short_name, EcucContainerValue)
|
|
213
216
|
|
|
214
217
|
|
|
215
218
|
class EcucModuleConfigurationValues(ARElement):
|
|
@@ -224,14 +227,14 @@ class EcucModuleConfigurationValues(ARElement):
|
|
|
224
227
|
self.postBuildVariantUsed = None # type: ARBoolean
|
|
225
228
|
|
|
226
229
|
def createContainer(self, short_name: str) -> EcucContainerValue:
|
|
227
|
-
if
|
|
230
|
+
if not self.IsElementExists(short_name):
|
|
228
231
|
container = EcucContainerValue(self, short_name)
|
|
229
|
-
self.
|
|
232
|
+
self.addElement(container)
|
|
230
233
|
self.containers.append(container)
|
|
231
|
-
return self.
|
|
234
|
+
return self.getElement(short_name, EcucContainerValue)
|
|
232
235
|
|
|
233
236
|
def getContainers(self) -> List[EcucContainerValue]:
|
|
234
|
-
return list(sorted(filter(lambda a: isinstance(a, EcucContainerValue), self.elements
|
|
237
|
+
return list(sorted(filter(lambda a: isinstance(a, EcucContainerValue), self.elements), key=lambda o: o.short_name))
|
|
235
238
|
|
|
236
239
|
def getDefinitionRef(self) -> RefType:
|
|
237
240
|
return self.definitionRef
|
|
@@ -267,3 +270,77 @@ class EcucModuleConfigurationValues(ARElement):
|
|
|
267
270
|
def setPostBuildVariantUsed(self, value: ARBoolean):
|
|
268
271
|
self.postBuildVariantUsed = value
|
|
269
272
|
return self
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
class EcucConditionSpecification(ARObject):
|
|
276
|
+
def __init__(self):
|
|
277
|
+
super().__init__()
|
|
278
|
+
|
|
279
|
+
# self.conditionFormula: EcucConditionFormula = None # 0..1 aggr Definition of the formula used to define existence dependencies.
|
|
280
|
+
# self.ecucQueries: List[EcucQuery] = [] # * aggr Query to the ECU Configuration Description.
|
|
281
|
+
# self.informalFormula: MlFormula = None # 0..1 aggr Informal description of the condition used to to define existence dependencies. # noqa E501
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
class EcucConfigurationVariantEnum(AREnum):
|
|
285
|
+
def __init__(self):
|
|
286
|
+
super().__init__([])
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
class EcucModuleDef(EcucDefinitionElement):
|
|
290
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
291
|
+
super().__init__(parent, short_name)
|
|
292
|
+
|
|
293
|
+
self.apiServicePrefix: CIdentifier = None
|
|
294
|
+
self.containers: List[EcucContainerDef] = []
|
|
295
|
+
self.postBuildVariantSupport: Boolean = None
|
|
296
|
+
self.refinedModuleDefRef: RefType = None
|
|
297
|
+
self.supportedConfigVariants: List[EcucConfigurationVariantEnum] = []
|
|
298
|
+
|
|
299
|
+
def getApiServicePrefix(self) -> CIdentifier:
|
|
300
|
+
return self.apiServicePrefix
|
|
301
|
+
|
|
302
|
+
def setApiServicePrefix(self, value: CIdentifier):
|
|
303
|
+
if value is not None:
|
|
304
|
+
self.apiServicePrefix = value
|
|
305
|
+
return self
|
|
306
|
+
|
|
307
|
+
def getContainers(self) -> List[EcucContainerDef]:
|
|
308
|
+
return self.containers
|
|
309
|
+
|
|
310
|
+
def createEcucParamConfContainerDef(self, short_name: str) -> EcucParamConfContainerDef:
|
|
311
|
+
if (not self.IsElementExists(short_name)):
|
|
312
|
+
container_def = EcucParamConfContainerDef(self, short_name)
|
|
313
|
+
self.addElement(container_def)
|
|
314
|
+
self.containers.append(container_def)
|
|
315
|
+
return self.getElement(short_name)
|
|
316
|
+
|
|
317
|
+
def createEcucChoiceContainerDef(self, short_name: str) -> EcucChoiceContainerDef:
|
|
318
|
+
if (not self.IsElementExists(short_name)):
|
|
319
|
+
container_def = EcucChoiceContainerDef(self, short_name)
|
|
320
|
+
self.addElement(container_def)
|
|
321
|
+
self.containers.append(container_def)
|
|
322
|
+
return self.getElement(short_name)
|
|
323
|
+
|
|
324
|
+
def getPostBuildVariantSupport(self) -> Boolean:
|
|
325
|
+
return self.postBuildVariantSupport
|
|
326
|
+
|
|
327
|
+
def setPostBuildVariantSupport(self, value: Boolean):
|
|
328
|
+
if value is not None:
|
|
329
|
+
self.postBuildVariantSupport = value
|
|
330
|
+
return self
|
|
331
|
+
|
|
332
|
+
def getRefinedModuleDefRef(self) -> RefType:
|
|
333
|
+
return self.refinedModuleDefRef
|
|
334
|
+
|
|
335
|
+
def setRefinedModuleDefRef(self, value: RefType):
|
|
336
|
+
if value is not None:
|
|
337
|
+
self.refinedModuleDefRef = value
|
|
338
|
+
return self
|
|
339
|
+
|
|
340
|
+
def getSupportedConfigVariants(self) -> List[EcucConfigurationVariantEnum]:
|
|
341
|
+
return self.supportedConfigVariants
|
|
342
|
+
|
|
343
|
+
def addSupportedConfigVariant(self, value: EcucConfigurationVariantEnum):
|
|
344
|
+
if value is not None:
|
|
345
|
+
self.supportedConfigVariants.append(value)
|
|
346
|
+
return self
|