armodel 1.7.6__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 +95 -21
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +359 -59
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +134 -35
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Filter.py +17 -7
- 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 +215 -157
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +69 -35
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +17 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +19 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +113 -39
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +3 -2
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py +41 -16
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +10 -3
- 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/RTEEvents.py +26 -8
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +28 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +167 -5
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DoIp.py +29 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/EcuResourceMapping.py +45 -0
- 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/Fibex4Ethernet/EthernetTopology.py +9 -0
- 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 +539 -77
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +158 -40
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +28 -6
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py +2 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/NetworkManagement.py +245 -130
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SWmapping.py +27 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Transformer/__init__.py +524 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/TransportProtocols.py +592 -17
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +33 -21
- armodel/models/M2/MSR/AsamHdo/AdminData.py +1 -2
- armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +3 -1
- armodel/models/M2/MSR/AsamHdo/SpecialData.py +35 -8
- armodel/models/M2/MSR/DataDictionary/RecordLayout.py +0 -3
- armodel/models/__init__.py +8 -0
- armodel/parser/abstract_arxml_parser.py +34 -27
- armodel/parser/arxml_parser.py +1778 -616
- armodel/parser/file_parser.py +5 -3
- armodel/tests/test_armodel/models/test_ar_package.py +6 -11
- armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -3
- armodel/tests/test_armodel/models/test_datatype.py +1 -1
- armodel/tests/test_armodel/models/test_port_interface.py +116 -117
- armodel/tests/test_armodel/parser/test_bsw_module_descriiption.py +218 -0
- armodel/tests/test_armodel/parser/test_sw_components.py +54 -22
- 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 +27 -33
- armodel/writer/arxml_writer.py +1875 -599
- {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/METADATA +81 -3
- {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/RECORD +69 -56
- {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/LICENSE +0 -0
- {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/WHEEL +0 -0
- {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ from .....M2.AUTOSARTemplates.CommonStructure.ModeDeclaration import ModeRequest
|
|
|
3
3
|
from .....M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AtpType
|
|
4
4
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
5
5
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
6
|
-
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, RefType
|
|
6
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, RefType, String
|
|
7
7
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ApplicationArrayElement, ApplicationRecordElement
|
|
8
8
|
from .....M2.MSR.DataDictionary.DataDefProperties import SwDataDefProps
|
|
9
9
|
from abc import ABCMeta
|
|
@@ -50,9 +50,17 @@ class ApplicationArrayDataType(ApplicationCompositeDataType):
|
|
|
50
50
|
def __init__(self, parent: ARObject, short_name: str):
|
|
51
51
|
super().__init__(parent, short_name)
|
|
52
52
|
|
|
53
|
-
self.
|
|
53
|
+
self.dynamicArraySizeProfile = None # type: String
|
|
54
54
|
self.element = None # type: ApplicationArrayElement
|
|
55
55
|
|
|
56
|
+
def getDynamicArraySizeProfile(self):
|
|
57
|
+
return self.dynamicArraySizeProfile
|
|
58
|
+
|
|
59
|
+
def setDynamicArraySizeProfile(self, value):
|
|
60
|
+
if value is not None:
|
|
61
|
+
self.dynamicArraySizeProfile = value
|
|
62
|
+
return self
|
|
63
|
+
|
|
56
64
|
def createApplicationArrayElement(self, short_name: str) -> ApplicationArrayElement:
|
|
57
65
|
if (short_name not in self.elements):
|
|
58
66
|
array_element = ApplicationArrayElement(self, short_name)
|
|
@@ -60,7 +68,6 @@ class ApplicationArrayDataType(ApplicationCompositeDataType):
|
|
|
60
68
|
self.element = self.elements[short_name]
|
|
61
69
|
return self.elements[short_name]
|
|
62
70
|
|
|
63
|
-
|
|
64
71
|
class ApplicationRecordDataType(ApplicationCompositeDataType):
|
|
65
72
|
def __init__(self, parent: ARObject, short_name: str):
|
|
66
73
|
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)
|
|
@@ -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)
|
|
@@ -105,7 +105,7 @@ class DataReceiveErrorEvent(RTEEvent):
|
|
|
105
105
|
def __init__(self, parent: ARObject, short_name: str):
|
|
106
106
|
super().__init__(parent, short_name)
|
|
107
107
|
|
|
108
|
-
self.dataIRef = None
|
|
108
|
+
self.dataIRef = None
|
|
109
109
|
|
|
110
110
|
def getDataIRef(self):
|
|
111
111
|
return self.dataIRef
|
|
@@ -118,13 +118,14 @@ class OperationInvokedEvent(RTEEvent):
|
|
|
118
118
|
def __init__(self, parent: ARObject, short_name: str):
|
|
119
119
|
super().__init__(parent, short_name)
|
|
120
120
|
|
|
121
|
-
self.operationIRef = None
|
|
121
|
+
self.operationIRef = None # type: POperationInAtomicSwcInstanceRef
|
|
122
122
|
|
|
123
123
|
def getOperationIRef(self):
|
|
124
124
|
return self.operationIRef
|
|
125
125
|
|
|
126
126
|
def setOperationIRef(self, value):
|
|
127
|
-
|
|
127
|
+
if value is not None:
|
|
128
|
+
self.operationIRef = value
|
|
128
129
|
return self
|
|
129
130
|
|
|
130
131
|
class InitEvent(RTEEvent):
|
|
@@ -150,29 +151,46 @@ class TimingEvent(RTEEvent):
|
|
|
150
151
|
return self.offset
|
|
151
152
|
|
|
152
153
|
def setOffset(self, value):
|
|
153
|
-
|
|
154
|
+
if value is not None:
|
|
155
|
+
self.offset = value
|
|
154
156
|
return self
|
|
155
157
|
|
|
156
158
|
def getPeriod(self):
|
|
157
159
|
return self.period
|
|
158
160
|
|
|
159
161
|
def setPeriod(self, value):
|
|
160
|
-
|
|
162
|
+
if value is not None:
|
|
163
|
+
self.period = value
|
|
161
164
|
return self
|
|
162
165
|
|
|
163
166
|
class InternalTriggerOccurredEvent(RTEEvent):
|
|
164
167
|
def __init__(self, parent: ARObject, short_name: str):
|
|
165
168
|
super().__init__(parent, short_name)
|
|
166
169
|
|
|
167
|
-
self.eventSourceRef = None
|
|
170
|
+
self.eventSourceRef = None # type: RefType
|
|
168
171
|
|
|
169
172
|
def getEventSourceRef(self):
|
|
170
173
|
return self.eventSourceRef
|
|
171
174
|
|
|
172
175
|
def setEventSourceRef(self, value):
|
|
173
|
-
|
|
176
|
+
if value is not None:
|
|
177
|
+
self.eventSourceRef = value
|
|
174
178
|
return self
|
|
175
179
|
|
|
176
180
|
class BackgroundEvent(RTEEvent):
|
|
177
181
|
def __init__(self, parent: ARObject, short_name: str):
|
|
178
|
-
super().__init__(parent, short_name)
|
|
182
|
+
super().__init__(parent, short_name)
|
|
183
|
+
|
|
184
|
+
class ModeSwitchedAckEvent(RTEEvent):
|
|
185
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
186
|
+
super().__init__(parent, short_name)
|
|
187
|
+
|
|
188
|
+
self.eventSourceRef = None # type: RefType
|
|
189
|
+
|
|
190
|
+
def getEventSourceRef(self):
|
|
191
|
+
return self.eventSourceRef
|
|
192
|
+
|
|
193
|
+
def setEventSourceRef(self, value):
|
|
194
|
+
if value is not None:
|
|
195
|
+
self.eventSourceRef = value
|
|
196
|
+
return self
|
|
@@ -6,12 +6,12 @@ from .....M2.AUTOSARTemplates.CommonStructure.InternalBehavior import InternalBe
|
|
|
6
6
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ParameterDataPrototype, VariableDataPrototype
|
|
7
7
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.IncludedDataTypes import IncludedDataTypeSet
|
|
8
8
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.PerInstanceMemory import PerInstanceMemory
|
|
9
|
-
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import AsynchronousServerCallReturnsEvent, DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent, TimingEvent
|
|
9
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import AsynchronousServerCallReturnsEvent, BackgroundEvent, DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent, ModeSwitchedAckEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent, TimingEvent
|
|
10
10
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServiceMapping import SwcServiceDependency
|
|
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):
|
|
@@ -338,6 +346,18 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
338
346
|
event = SwcServiceDependency(self, short_name)
|
|
339
347
|
self.elements[short_name] = event
|
|
340
348
|
return self.elements[short_name]
|
|
349
|
+
|
|
350
|
+
def createModeSwitchedAckEvent(self, short_name: str) -> ModeSwitchedAckEvent:
|
|
351
|
+
if (short_name not in self.elements):
|
|
352
|
+
event = ModeSwitchedAckEvent(self, short_name)
|
|
353
|
+
self.addElement(event)
|
|
354
|
+
return self.getElement(short_name)
|
|
355
|
+
|
|
356
|
+
def createBackgroundEvent(self, short_name: str) -> BackgroundEvent:
|
|
357
|
+
if (short_name not in self.elements):
|
|
358
|
+
event = BackgroundEvent(self, short_name)
|
|
359
|
+
self.addElement(event)
|
|
360
|
+
return self.getElement(short_name)
|
|
341
361
|
|
|
342
362
|
def getRteEvents(self) -> List[RTEEvent]:
|
|
343
363
|
return sorted(filter(lambda c: isinstance(c, RTEEvent), self.elements.values()), key=lambda e: e.short_name)
|
|
@@ -359,6 +379,12 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
359
379
|
|
|
360
380
|
def getInternalTriggerOccurredEvents(self) -> List[InternalTriggerOccurredEvent]:
|
|
361
381
|
return sorted(filter(lambda c: isinstance(c, InternalTriggerOccurredEvent), self.elements.values()), key= lambda e: e.short_name)
|
|
382
|
+
|
|
383
|
+
def getModeSwitchedAckEvents(self) -> List[ModeSwitchedAckEvent]:
|
|
384
|
+
return sorted(filter(lambda c: isinstance(c, ModeSwitchedAckEvent), self.elements.values()), key= lambda e: e.short_name)
|
|
385
|
+
|
|
386
|
+
def getBackgroundEvents(self) -> List[BackgroundEvent]:
|
|
387
|
+
return sorted(filter(lambda c: isinstance(c, BackgroundEvent), self.elements.values()), key= lambda e: e.short_name)
|
|
362
388
|
|
|
363
389
|
def getSwcServiceDependencies(self) -> List[SwcServiceDependency]:
|
|
364
390
|
return sorted(filter(lambda c: isinstance(c, SwcServiceDependency), self.elements.values()), key= lambda e: e.short_name)
|
|
@@ -367,10 +393,6 @@ class SwcInternalBehavior(InternalBehavior):
|
|
|
367
393
|
if (not isinstance(self.elements[short_name], RTEEvent)):
|
|
368
394
|
raise ValueError("Invalid Event Type <%s> of <%s>" % type(self.elements[short_name]), short_name)
|
|
369
395
|
return self.elements[short_name]
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
396
|
|
|
375
397
|
def createImplicitInterRunnableVariable(self, short_name: str) -> VariableDataPrototype:
|
|
376
398
|
if (short_name not in self.elements):
|