armodel 1.4.3__py3-none-any.whl → 1.6.0__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 +14 -14
- armodel/cli/memory_section_cli.py +76 -0
- armodel/cli/system_signal_cli.py +74 -0
- armodel/lib/__init__.py +2 -1
- armodel/lib/system_signal.py +37 -0
- armodel/models/__init__.py +6 -3
- armodel/models/annotation.py +27 -3
- armodel/models/ar_object.py +18 -6
- armodel/models/ar_package.py +248 -30
- armodel/models/ar_ref.py +115 -45
- armodel/models/bsw_module_template.py +66 -28
- armodel/models/common_structure.py +150 -150
- armodel/models/communication.py +1 -1
- armodel/models/data_prototype.py +41 -6
- armodel/models/datatype.py +11 -5
- armodel/models/fibex/__init__.py +0 -0
- armodel/models/fibex/can_communication.py +122 -0
- armodel/models/fibex/fibex_4_can/__init__.py +0 -0
- armodel/models/fibex/fibex_4_lin/__init__.py +0 -0
- armodel/models/fibex/fibex_4_multiplatform.py +138 -0
- armodel/models/fibex/fibex_core/__init__.py +0 -0
- armodel/models/fibex/fibex_core/core_communication.py +627 -0
- armodel/models/fibex/fibex_core/core_topology.py +180 -0
- armodel/models/fibex/fibex_core.py +341 -0
- armodel/models/fibex/lin_communication.py +38 -0
- armodel/models/fibex/lin_topology.py +7 -0
- armodel/models/general_structure.py +119 -10
- armodel/models/implementation.py +4 -5
- armodel/models/internal_behavior.py +63 -0
- armodel/models/m2/__init__.py +0 -0
- armodel/models/m2/autosar_templates/__init__.py +0 -0
- armodel/models/m2/autosar_templates/common_structure/__init__.py +188 -0
- armodel/models/m2/autosar_templates/common_structure/constants.py +0 -0
- armodel/models/m2/autosar_templates/ecuc_description_template.py +268 -0
- armodel/models/m2/autosar_templates/sw_component_template/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/communication.py +316 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/instance_refs.py +149 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface.py +236 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/__init__.py +203 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py +13 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py +54 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py +39 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py +26 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/trigger.py +10 -0
- armodel/models/m2/autosar_templates/system_template/__init__.py +321 -0
- armodel/models/m2/autosar_templates/system_template/data_mapping.py +88 -0
- armodel/models/m2/autosar_templates/system_template/network_management.py +554 -0
- armodel/models/m2/autosar_templates/system_template/transport_protocols.py +7 -0
- armodel/models/m2/msr/__init__.py +0 -0
- armodel/models/m2/msr/asam_hdo/__init__.py +0 -0
- armodel/models/m2/msr/asam_hdo/units.py +105 -0
- armodel/models/m2/msr/data_dictionary/__init__.py +0 -0
- armodel/models/m2/msr/data_dictionary/auxillary_objects.py +42 -0
- armodel/models/m2/msr/data_dictionary/data_def_properties.py +295 -0
- armodel/models/m2/msr/documentation/__init__.py +0 -0
- armodel/models/m2/msr/documentation/block_elements.py +18 -0
- armodel/models/mode_declaration.py +8 -0
- armodel/models/multilanguage_data.py +15 -0
- armodel/models/per_instance_memory.py +34 -6
- armodel/models/port_prototype.py +15 -159
- armodel/models/rpt_scenario.py +20 -0
- armodel/models/sw_component.py +48 -187
- armodel/models/system_template/__init__.py +0 -0
- armodel/models/system_template/network_management.py +7 -0
- armodel/models/system_template/transport_protocols.py +7 -0
- armodel/models/timing.py +91 -0
- armodel/parser/abstract_arxml_parser.py +11 -2
- armodel/parser/arxml_parser.py +1101 -227
- armodel/tests/test_armodel/models/test_ar_package.py +1 -1
- armodel/tests/test_armodel/models/test_ar_ref.py +3 -3
- armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -5
- armodel/tests/test_armodel/models/test_common_structure.py +3 -3
- armodel/tests/test_armodel/models/test_data_dictionary.py +5 -5
- armodel/tests/test_armodel/models/test_data_prototype.py +2 -2
- armodel/tests/test_armodel/models/test_datatype.py +8 -8
- armodel/tests/test_armodel/models/test_port_interface.py +6 -6
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +16 -8
- armodel/tests/test_armodel/parser/test_sw_components.py +6 -6
- armodel/writer/arxml_writer.py +1046 -181
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/METADATA +48 -1
- armodel-1.6.0.dist-info/RECORD +127 -0
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/entry_points.txt +3 -1
- armodel-1.4.3.dist-info/RECORD +0 -78
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/LICENSE +0 -0
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/WHEEL +0 -0
- {armodel-1.4.3.dist-info → armodel-1.6.0.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
2
|
from typing import Dict, List
|
|
3
|
+
|
|
4
|
+
from .internal_behavior import IncludedDataTypeSet, InternalBehavior
|
|
3
5
|
from .general_structure import AtpStructureElement, ARObject, ARElement
|
|
4
6
|
from .ar_object import ARBoolean, ARFloat, ARLiteral, ARNumerical, ARPositiveInteger
|
|
5
|
-
from .common_structure import ExecutableEntity,
|
|
7
|
+
from .common_structure import ExecutableEntity, IncludedModeDeclarationGroupSet, ModeDeclarationGroupPrototype, Identifiable
|
|
6
8
|
from .ar_ref import RefType
|
|
7
9
|
|
|
8
10
|
class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
@@ -13,14 +15,35 @@ class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
|
13
15
|
|
|
14
16
|
self.accessedModeGroupRefs = [] # type: List[RefType]
|
|
15
17
|
self.activationPointRefs = [] # type: List[RefType]
|
|
16
|
-
self.
|
|
17
|
-
self.
|
|
18
|
+
self.implementedEntryRef = None # type: RefType
|
|
19
|
+
self.managedModeGroupRefs = [] # type: List[RefType]
|
|
20
|
+
|
|
21
|
+
def getAccessedModeGroupRefs(self):
|
|
22
|
+
return self.accessedModeGroupRefs
|
|
23
|
+
|
|
24
|
+
def addAccessedModeGroupRefs(self, value):
|
|
25
|
+
self.accessedModeGroupRefs.append(value)
|
|
26
|
+
return self
|
|
27
|
+
|
|
28
|
+
def getActivationPointRefs(self):
|
|
29
|
+
return self.activationPointRefs
|
|
30
|
+
|
|
31
|
+
def addActivationPointRefs(self, value):
|
|
32
|
+
self.activationPointRefs.append(value)
|
|
33
|
+
return self
|
|
34
|
+
|
|
35
|
+
def getImplementedEntryRef(self):
|
|
36
|
+
return self.implementedEntryRef
|
|
37
|
+
|
|
38
|
+
def setImplementedEntryRef(self, value):
|
|
39
|
+
self.implementedEntryRef = value
|
|
40
|
+
return self
|
|
18
41
|
|
|
19
42
|
def addManagedModeGroupRef(self, ref: RefType):
|
|
20
|
-
self.
|
|
43
|
+
self.managedModeGroupRefs.append(ref)
|
|
21
44
|
|
|
22
45
|
def getManagedModeGroupRefs(self) -> List[RefType]:
|
|
23
|
-
return self.
|
|
46
|
+
return self.managedModeGroupRefs
|
|
24
47
|
|
|
25
48
|
class BswCalledEntity(BswModuleEntity):
|
|
26
49
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -105,7 +128,6 @@ class BswInternalTriggerOccurredEvent(BswScheduleEvent):
|
|
|
105
128
|
|
|
106
129
|
self.event_source_ref = None # type: RefType
|
|
107
130
|
|
|
108
|
-
|
|
109
131
|
class BswModeSwitchAckRequest(ARObject):
|
|
110
132
|
def __init__(self):
|
|
111
133
|
super().__init__()
|
|
@@ -144,21 +166,23 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
144
166
|
def __init__(self, parent: ARObject, short_name: str):
|
|
145
167
|
super().__init__(parent, short_name)
|
|
146
168
|
|
|
147
|
-
self.
|
|
148
|
-
self.
|
|
149
|
-
self.
|
|
169
|
+
self.entities = [] # type: List[BswModuleEntity]
|
|
170
|
+
self.events = [] # type: List[BswEvent]
|
|
171
|
+
self.mode_sender_policies = [] # type: List[BswModeSenderPolicy]
|
|
172
|
+
self.included_mode_declaration_group_sets = [] # type: List[IncludedModeDeclarationGroupSet]
|
|
173
|
+
self.included_data_type_sets = [] # type: List[IncludedDataTypeSet]
|
|
150
174
|
|
|
151
175
|
def addModeSenderPolicy(self, policy: BswModeSenderPolicy):
|
|
152
|
-
self.
|
|
176
|
+
self.mode_sender_policies.append(policy)
|
|
153
177
|
|
|
154
178
|
def getModeSenderPolicies(self) -> List[BswModeSenderPolicy]:
|
|
155
|
-
return self.
|
|
179
|
+
return self.mode_sender_policies
|
|
156
180
|
|
|
157
181
|
def createBswCalledEntity(self, short_name: str) -> BswCalledEntity:
|
|
158
182
|
if (short_name not in self.elements):
|
|
159
183
|
event = BswCalledEntity(self, short_name)
|
|
160
184
|
self.elements[short_name] = event
|
|
161
|
-
self.
|
|
185
|
+
self.entities.append(event)
|
|
162
186
|
return self.elements[short_name]
|
|
163
187
|
|
|
164
188
|
def getBswCalledEntities(self) -> List[BswCalledEntity]:
|
|
@@ -168,7 +192,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
168
192
|
if (short_name not in self.elements):
|
|
169
193
|
event = BswSchedulableEntity(self, short_name)
|
|
170
194
|
self.elements[short_name] = event
|
|
171
|
-
self.
|
|
195
|
+
self.entities.append(event)
|
|
172
196
|
return self.elements[short_name]
|
|
173
197
|
|
|
174
198
|
def getBswSchedulableEntities(self) -> List[BswSchedulableEntity]:
|
|
@@ -181,7 +205,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
181
205
|
if (short_name not in self.elements):
|
|
182
206
|
event = BswModeSwitchEvent(self, short_name)
|
|
183
207
|
self.elements[short_name] = event
|
|
184
|
-
self.
|
|
208
|
+
self.events.append(event)
|
|
185
209
|
return self.elements[short_name]
|
|
186
210
|
|
|
187
211
|
def getBswModeSwitchEvents(self) -> List[BswModeSwitchEvent]:
|
|
@@ -191,7 +215,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
191
215
|
if (short_name not in self.elements):
|
|
192
216
|
event = BswTimingEvent(self, short_name)
|
|
193
217
|
self.elements[short_name] = event
|
|
194
|
-
self.
|
|
218
|
+
self.events.append(event)
|
|
195
219
|
return self.elements[short_name]
|
|
196
220
|
|
|
197
221
|
def getBswTimingEvents(self) -> List[BswTimingEvent]:
|
|
@@ -201,7 +225,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
201
225
|
if (short_name not in self.elements):
|
|
202
226
|
event = BswDataReceivedEvent(self, short_name)
|
|
203
227
|
self.elements[short_name] = event
|
|
204
|
-
self.
|
|
228
|
+
self.events.append(event)
|
|
205
229
|
return self.elements[short_name]
|
|
206
230
|
|
|
207
231
|
def getBswDataReceivedEvents(self) -> List[BswDataReceivedEvent]:
|
|
@@ -211,7 +235,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
211
235
|
if (short_name not in self.elements):
|
|
212
236
|
event = BswInternalTriggerOccurredEvent(self, short_name)
|
|
213
237
|
self.elements[short_name] = event
|
|
214
|
-
self.
|
|
238
|
+
self.events.append(event)
|
|
215
239
|
return self.elements[short_name]
|
|
216
240
|
|
|
217
241
|
def getBswInternalTriggerOccurredEvents(self) -> List[BswInternalTriggerOccurredEvent]:
|
|
@@ -219,8 +243,20 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
219
243
|
|
|
220
244
|
def getBswEvents(self) -> List[BswEvent]:
|
|
221
245
|
return list(filter(lambda a: isinstance(a, BswEvent), self.elements.values()))
|
|
246
|
+
|
|
247
|
+
def addIncludedModeDeclarationGroupSet(self, group_set: IncludedModeDeclarationGroupSet):
|
|
248
|
+
self.included_mode_declaration_group_sets.append(group_set)
|
|
222
249
|
|
|
223
|
-
|
|
250
|
+
def getIncludedModeDeclarationGroupSets(self) -> List[IncludedModeDeclarationGroupSet]:
|
|
251
|
+
return self.included_mode_declaration_group_sets
|
|
252
|
+
|
|
253
|
+
def addIncludedDataTypeSet(self, type_set: IncludedDataTypeSet):
|
|
254
|
+
self.included_data_type_sets.append(type_set)
|
|
255
|
+
|
|
256
|
+
def getIncludedDataTypeSets(self) -> List[IncludedDataTypeSet]:
|
|
257
|
+
return self.included_data_type_sets
|
|
258
|
+
|
|
259
|
+
class BswModuleDescription(ARElement):
|
|
224
260
|
'''
|
|
225
261
|
Root element for the description of a single BSW module or BSW cluster. In case it
|
|
226
262
|
describes a BSW module, the short name of this element equals the name of the
|
|
@@ -239,7 +275,7 @@ class BswModuleDescription(AtpStructureElement):
|
|
|
239
275
|
self._implementedEntryRefs = [] # type: List[RefType]
|
|
240
276
|
|
|
241
277
|
self.providedModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
242
|
-
self.requiredModeGroups = {} #
|
|
278
|
+
self.requiredModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
243
279
|
|
|
244
280
|
def addImplementedEntry(self, entry_ref: RefType):
|
|
245
281
|
self._implementedEntryRefs.append(entry_ref)
|
|
@@ -247,15 +283,17 @@ class BswModuleDescription(AtpStructureElement):
|
|
|
247
283
|
def getImplementedEntries(self) -> List[RefType]:
|
|
248
284
|
return self._implementedEntryRefs
|
|
249
285
|
|
|
250
|
-
|
|
251
|
-
def category(self) -> str:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
def category(self, value:str):
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
286
|
+
#@property
|
|
287
|
+
#def category(self) -> str:
|
|
288
|
+
# return ARElement.getCategory(self)
|
|
289
|
+
|
|
290
|
+
#@category.setter
|
|
291
|
+
#def category(self, value:str):
|
|
292
|
+
# if value is None:
|
|
293
|
+
# return
|
|
294
|
+
# if value not in ("BSW_MODULE", "BSW_CLUSTER", "LIBRARY"):
|
|
295
|
+
# raise ValueError("Invalid category <%s> of BswModuleDescription <%s>" % (value, self.short_name))
|
|
296
|
+
# ARElement.setCategory(self, value)
|
|
259
297
|
|
|
260
298
|
def createProvidedModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
261
299
|
if (short_name not in self.elements):
|
|
@@ -3,141 +3,72 @@
|
|
|
3
3
|
from abc import ABCMeta
|
|
4
4
|
from typing import List
|
|
5
5
|
|
|
6
|
-
from .ar_object import ARFloat, ARLiteral, ARNumerical
|
|
7
|
-
from .general_structure import ARObject,
|
|
8
|
-
from .data_dictionary import SwDataDefProps
|
|
6
|
+
from .ar_object import ARBoolean, ARFloat, ARLiteral, ARNumerical
|
|
7
|
+
from .general_structure import ARObject, Identifiable
|
|
8
|
+
from .m2.msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
9
9
|
from .ar_ref import RefType, TRefType
|
|
10
10
|
|
|
11
11
|
import re
|
|
12
12
|
|
|
13
|
-
class
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Base : ARObject
|
|
18
|
-
Subclasses : AbstractRuleBasedValueSpecification, ApplicationValueSpecification, CompositeValueSpecification,
|
|
19
|
-
ConstantReference, NotAvailableValueSpecification, NumericalValueSpecification, ReferenceValueSpecification,
|
|
20
|
-
TextValueSpecification
|
|
21
|
-
'''
|
|
22
|
-
def __init__(self):
|
|
23
|
-
if type(self) == ValueSpecification:
|
|
24
|
-
raise NotImplementedError("ValueSpecification is an abstract class.")
|
|
25
|
-
|
|
26
|
-
super().__init__()
|
|
27
|
-
|
|
28
|
-
self.short_label = None
|
|
29
|
-
|
|
30
|
-
class CompositeRuleBasedValueArgument(ValueSpecification, metaclass=ABCMeta):
|
|
31
|
-
'''
|
|
32
|
-
This meta-class has the ability to serve as the abstract base class for ValueSpecifications that can be
|
|
33
|
-
used for compound primitive data types.
|
|
34
|
-
|
|
35
|
-
Base : ARObject
|
|
36
|
-
Subclasses : ApplicationRuleBasedValueSpecification, ApplicationValueSpecification
|
|
37
|
-
'''
|
|
38
|
-
def __init__(self):
|
|
39
|
-
if type(self) == CompositeRuleBasedValueArgument:
|
|
40
|
-
raise NotImplementedError("CompositeRuleBasedValueArgument is an abstract class.")
|
|
41
|
-
|
|
42
|
-
super().__init__()
|
|
43
|
-
|
|
44
|
-
class CompositeValueSpecification(ValueSpecification, metaclass=ABCMeta):
|
|
45
|
-
'''
|
|
46
|
-
This abstract meta-class acts a base class for ValueSpecifications that have a composite form.
|
|
47
|
-
|
|
48
|
-
Base : ARObject, ValueSpecification
|
|
49
|
-
Subclasses : ArrayValueSpecification, RecordValueSpecification
|
|
50
|
-
'''
|
|
51
|
-
def __init__(self):
|
|
52
|
-
if type(self) == CompositeValueSpecification:
|
|
53
|
-
raise NotImplementedError("CompositeValueSpecification is an abstract class.")
|
|
54
|
-
|
|
55
|
-
super().__init__()
|
|
56
|
-
|
|
57
|
-
class ApplicationValueSpecification(CompositeRuleBasedValueArgument):
|
|
58
|
-
'''
|
|
59
|
-
This meta-class represents values for DataPrototypes typed by ApplicationDataTypes (this includes in
|
|
60
|
-
particular compound primitives).
|
|
61
|
-
For further details refer to ASAM CDF 2.0. This meta-class corresponds to some extent with
|
|
62
|
-
SW-INSTANCE in ASAM CDF 2.0.
|
|
63
|
-
|
|
64
|
-
Base ARObject, CompositeRuleBasedValueArgument, ValueSpecification
|
|
65
|
-
'''
|
|
66
|
-
def __init__(self):
|
|
67
|
-
super().__init__()
|
|
68
|
-
|
|
69
|
-
self.category = None
|
|
70
|
-
self.sw_Axis_cont = []
|
|
71
|
-
self.sw_value_cont = None
|
|
72
|
-
|
|
73
|
-
class RecordValueSpecification(CompositeValueSpecification):
|
|
74
|
-
'''
|
|
75
|
-
Specifies the values for a record.
|
|
76
|
-
|
|
77
|
-
Base : ARObject, CompositeValueSpecification, ValueSpecification
|
|
78
|
-
'''
|
|
79
|
-
def __init__(self):
|
|
80
|
-
super().__init__()
|
|
81
|
-
|
|
82
|
-
self._fields = []
|
|
83
|
-
|
|
84
|
-
def add_field(self, field: ValueSpecification):
|
|
85
|
-
self._fields.append(field)
|
|
86
|
-
|
|
87
|
-
def get_fields(self) -> List[ValueSpecification]:
|
|
88
|
-
return self._fields
|
|
89
|
-
|
|
90
|
-
class TextValueSpecification(ValueSpecification):
|
|
91
|
-
def __init__(self):
|
|
92
|
-
super().__init__()
|
|
13
|
+
class AbstractImplementationDataTypeElement(Identifiable):
|
|
14
|
+
def __init__(self, parent, short_name: str):
|
|
15
|
+
super().__init__(parent, short_name)
|
|
93
16
|
|
|
94
|
-
|
|
17
|
+
class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
18
|
+
ARRAY_SIZE_SEMANTICS_FIXED_SIZE = "FIXED-SIZE"
|
|
19
|
+
ARRAY_SIZE_SEMANTICS_VARIABLE_SIZE = "VARIABLE_SIZE"
|
|
95
20
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
super().__init__()
|
|
21
|
+
def __init__(self, parent, short_name: str):
|
|
22
|
+
super().__init__(parent, short_name)
|
|
99
23
|
|
|
100
|
-
self.
|
|
24
|
+
self.arrayImplPolicy = None # type: ARLiteral
|
|
25
|
+
self.arraySize = None # type: ARNumerical
|
|
26
|
+
self.arraySizeHandling = None # type: ARLiteral
|
|
27
|
+
self.arraySizeSemantics = None # type: ARLiteral
|
|
28
|
+
self.isOptional = None # type: ARBoolean
|
|
29
|
+
self.swDataDefProps = None # type: SwDataDefProps
|
|
101
30
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
super().__init__()
|
|
31
|
+
def getArrayImplPolicy(self):
|
|
32
|
+
return self.arrayImplPolicy
|
|
105
33
|
|
|
106
|
-
|
|
34
|
+
def setArrayImplPolicy(self, value):
|
|
35
|
+
self.arrayImplPolicy = value
|
|
36
|
+
return self
|
|
107
37
|
|
|
108
|
-
def
|
|
109
|
-
self.
|
|
38
|
+
def getArraySize(self):
|
|
39
|
+
return self.arraySize
|
|
110
40
|
|
|
111
|
-
def
|
|
112
|
-
|
|
41
|
+
def setArraySize(self, value):
|
|
42
|
+
self.arraySize = value
|
|
43
|
+
return self
|
|
113
44
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
super().__init__(parent, short_name)
|
|
45
|
+
def getArraySizeHandling(self):
|
|
46
|
+
return self.arraySizeHandling
|
|
117
47
|
|
|
118
|
-
|
|
48
|
+
def setArraySizeHandling(self, value):
|
|
49
|
+
self.arraySizeHandling = value
|
|
50
|
+
return self
|
|
119
51
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
super().__init__()
|
|
52
|
+
def getArraySizeSemantics(self):
|
|
53
|
+
return self.arraySizeSemantics
|
|
123
54
|
|
|
124
|
-
|
|
55
|
+
def setArraySizeSemantics(self, value):
|
|
56
|
+
self.arraySizeSemantics = value
|
|
57
|
+
return self
|
|
125
58
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
super().__init__(parent, short_name)
|
|
59
|
+
def getIsOptional(self):
|
|
60
|
+
return self.isOptional
|
|
129
61
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
62
|
+
def setIsOptional(self, value):
|
|
63
|
+
self.isOptional = value
|
|
64
|
+
return self
|
|
133
65
|
|
|
134
|
-
def
|
|
135
|
-
|
|
66
|
+
def getSwDataDefProps(self):
|
|
67
|
+
return self.swDataDefProps
|
|
136
68
|
|
|
137
|
-
|
|
138
|
-
self.
|
|
139
|
-
self
|
|
140
|
-
self.sw_data_def_props = None # type: SwDataDefProps
|
|
69
|
+
def setSwDataDefProps(self, value):
|
|
70
|
+
self.swDataDefProps = value
|
|
71
|
+
return self
|
|
141
72
|
|
|
142
73
|
def createImplementationDataTypeElement(self, short_name: str): # type: (...) -> ImplementationDataTypeElement
|
|
143
74
|
if (short_name not in self.elements):
|
|
@@ -152,29 +83,27 @@ class ExclusiveArea(Identifiable):
|
|
|
152
83
|
def __init__(self, parent: ARObject, short_name: str):
|
|
153
84
|
super().__init__(parent, short_name)
|
|
154
85
|
|
|
155
|
-
class
|
|
156
|
-
def __init__(self
|
|
157
|
-
|
|
158
|
-
raise NotImplementedError("InternalBehavior is an abstract class.")
|
|
159
|
-
super().__init__(parent, short_name)
|
|
160
|
-
|
|
161
|
-
self._dataTypeMappingRefs = [] # type: List[RefType]
|
|
162
|
-
|
|
163
|
-
def addDataTypeMappingRef(self, ref: RefType):
|
|
164
|
-
self._dataTypeMappingRefs.append(ref)
|
|
86
|
+
class IncludedModeDeclarationGroupSet(ARObject):
|
|
87
|
+
def __init__(self):
|
|
88
|
+
super().__init__()
|
|
165
89
|
|
|
166
|
-
|
|
167
|
-
|
|
90
|
+
self.mode_declaration_group_refs = [] # type: List[RefType]
|
|
91
|
+
self.prefix = None # type: ARLiteral
|
|
168
92
|
|
|
169
|
-
def
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
self.elements[short_name] = event
|
|
173
|
-
return self.elements[short_name]
|
|
93
|
+
def addModeDeclarationGroupRef(self, ref: RefType):
|
|
94
|
+
self.mode_declaration_group_refs.append(ref)
|
|
95
|
+
return self
|
|
174
96
|
|
|
175
|
-
def
|
|
176
|
-
return
|
|
97
|
+
def getModeDeclarationGroupRefs(self) -> List[RefType]:
|
|
98
|
+
return self.mode_declaration_group_refs
|
|
177
99
|
|
|
100
|
+
def setPrefix(self, prefix: str):
|
|
101
|
+
self.prefix = prefix
|
|
102
|
+
return self
|
|
103
|
+
|
|
104
|
+
def getPrefix(self) -> ARLiteral:
|
|
105
|
+
return self.prefix
|
|
106
|
+
|
|
178
107
|
class ModeDeclaration(Identifiable):
|
|
179
108
|
def __init__(self, parent: ARObject, short_name: str):
|
|
180
109
|
super().__init__(parent, short_name)
|
|
@@ -192,24 +121,54 @@ class ExecutableEntity(Identifiable, metaclass=ABCMeta):
|
|
|
192
121
|
def __init__(self, parent: ARObject, short_name: str):
|
|
193
122
|
if type(self) == ExecutableEntity:
|
|
194
123
|
raise NotImplementedError("ExecutableEntity is an abstract class.")
|
|
124
|
+
|
|
195
125
|
super().__init__(parent, short_name)
|
|
196
126
|
|
|
197
|
-
self.
|
|
198
|
-
self.
|
|
199
|
-
self.
|
|
200
|
-
self.
|
|
127
|
+
self.activationReason = None # *
|
|
128
|
+
self.minimumStartInterval = None # type: ARFloat
|
|
129
|
+
self.reentrancyLevel = None #
|
|
130
|
+
self.canEnterExclusiveAreaRefs = [] # type: List[RefType]
|
|
131
|
+
self.swAddrMethodRef = None # type: RefType
|
|
132
|
+
|
|
133
|
+
def getActivationReason(self):
|
|
134
|
+
return self.activationReason
|
|
135
|
+
|
|
136
|
+
def setActivationReason(self, value):
|
|
137
|
+
self.activationReason = value
|
|
138
|
+
return self
|
|
139
|
+
|
|
140
|
+
def getMinimumStartInterval(self):
|
|
141
|
+
return self.minimumStartInterval
|
|
142
|
+
|
|
143
|
+
def setMinimumStartInterval(self, value):
|
|
144
|
+
self.minimumStartInterval = value
|
|
145
|
+
return self
|
|
146
|
+
|
|
147
|
+
def getReentrancyLevel(self):
|
|
148
|
+
return self.reentrancyLevel
|
|
149
|
+
|
|
150
|
+
def setReentrancyLevel(self, value):
|
|
151
|
+
self.reentrancyLevel = value
|
|
152
|
+
return self
|
|
153
|
+
|
|
154
|
+
def getSwAddrMethodRef(self):
|
|
155
|
+
return self.swAddrMethodRef
|
|
156
|
+
|
|
157
|
+
def setSwAddrMethodRef(self, value):
|
|
158
|
+
self.swAddrMethodRef = value
|
|
159
|
+
return self
|
|
201
160
|
|
|
202
161
|
@property
|
|
203
|
-
def
|
|
204
|
-
if self.
|
|
205
|
-
return int(self.
|
|
162
|
+
def minimumStartIntervalMs(self) -> int:
|
|
163
|
+
if self.minimumStartInterval is not None:
|
|
164
|
+
return int(self.minimumStartInterval.getValue() * 1000)
|
|
206
165
|
return None
|
|
207
166
|
|
|
208
167
|
def addCanEnterExclusiveAreaRef(self, ref: RefType):
|
|
209
|
-
self.
|
|
168
|
+
self.canEnterExclusiveAreaRefs.append(ref)
|
|
210
169
|
|
|
211
170
|
def getCanEnterExclusiveAreaRefs(self):
|
|
212
|
-
return self.
|
|
171
|
+
return self.canEnterExclusiveAreaRefs
|
|
213
172
|
|
|
214
173
|
class ModeDeclarationGroupPrototype(Identifiable):
|
|
215
174
|
"""
|
|
@@ -232,21 +191,57 @@ class ModeDeclarationGroupPrototype(Identifiable):
|
|
|
232
191
|
raise ValueError("Invalid SwCalibrationAccess <%s> of ModeDeclarationGroupPrototype <%s>" % (value, self.short_name))
|
|
233
192
|
self._swCalibrationAccess = value
|
|
234
193
|
|
|
194
|
+
def getSwCalibrationAccess(self):
|
|
195
|
+
return self.swCalibrationAccess
|
|
196
|
+
|
|
197
|
+
def setSwCalibrationAccess(self, value):
|
|
198
|
+
self.swCalibrationAccess = value
|
|
199
|
+
return self
|
|
200
|
+
|
|
201
|
+
def getTypeTRef(self):
|
|
202
|
+
return self.typeTRef
|
|
203
|
+
|
|
204
|
+
def setTypeTRef(self, value):
|
|
205
|
+
self.typeTRef = value
|
|
206
|
+
return self
|
|
207
|
+
|
|
235
208
|
class MemorySection(Identifiable):
|
|
236
209
|
def __init__(self, parent: ARObject, short_name: str):
|
|
237
210
|
super().__init__(parent, short_name)
|
|
238
211
|
|
|
239
212
|
self._alignment = None # type: ARLiteral
|
|
240
213
|
self.size = None
|
|
241
|
-
self.
|
|
214
|
+
self.options = [] # type: List[ARLiteral]
|
|
242
215
|
self.swAddrMethodRef = None # type: RefType
|
|
243
216
|
self.symbol = None # type: ARLiteral
|
|
244
217
|
|
|
245
|
-
def
|
|
246
|
-
self.
|
|
218
|
+
def getAlignment(self):
|
|
219
|
+
return self.alignment
|
|
247
220
|
|
|
248
|
-
def
|
|
249
|
-
|
|
221
|
+
def setAlignment(self, value):
|
|
222
|
+
self.alignment = value
|
|
223
|
+
return self
|
|
224
|
+
|
|
225
|
+
def getSize(self):
|
|
226
|
+
return self.size
|
|
227
|
+
|
|
228
|
+
def setSize(self, value):
|
|
229
|
+
self.size = value
|
|
230
|
+
return self
|
|
231
|
+
|
|
232
|
+
def getSwAddrMethodRef(self):
|
|
233
|
+
return self.swAddrMethodRef
|
|
234
|
+
|
|
235
|
+
def setSwAddrMethodRef(self, value):
|
|
236
|
+
self.swAddrMethodRef = value
|
|
237
|
+
return self
|
|
238
|
+
|
|
239
|
+
def getSymbol(self):
|
|
240
|
+
return self.symbol
|
|
241
|
+
|
|
242
|
+
def setSymbol(self, value):
|
|
243
|
+
self.symbol = value
|
|
244
|
+
return self
|
|
250
245
|
|
|
251
246
|
@property
|
|
252
247
|
def alignment(self) -> ARLiteral:
|
|
@@ -267,7 +262,12 @@ class MemorySection(Identifiable):
|
|
|
267
262
|
|
|
268
263
|
if not match:
|
|
269
264
|
raise ValueError("Invalid alignment <%s> of memory section <%s>" % (value, self.short_name))
|
|
270
|
-
|
|
265
|
+
|
|
266
|
+
def addOption(self, option: ARLiteral):
|
|
267
|
+
self.options.append(option)
|
|
268
|
+
|
|
269
|
+
def getOptions(self) -> List[ARLiteral]:
|
|
270
|
+
return self.options
|
|
271
271
|
|
|
272
272
|
class ResourceConsumption(Identifiable):
|
|
273
273
|
def __init__(self, parent: ARObject, short_name: str):
|
armodel/models/communication.py
CHANGED
armodel/models/data_prototype.py
CHANGED
|
@@ -2,8 +2,8 @@ from abc import ABCMeta
|
|
|
2
2
|
|
|
3
3
|
from .ar_object import ARNumerical
|
|
4
4
|
from .ar_ref import RefType
|
|
5
|
-
from .data_dictionary import SwDataDefProps
|
|
6
|
-
from .common_structure import ValueSpecification
|
|
5
|
+
from .m2.msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
6
|
+
from .m2.autosar_templates.common_structure import ValueSpecification
|
|
7
7
|
from .general_structure import AtpFeature, ARObject
|
|
8
8
|
|
|
9
9
|
class AtpPrototype(AtpFeature, metaclass = ABCMeta):
|
|
@@ -20,8 +20,14 @@ class DataPrototype(AtpPrototype, metaclass = ABCMeta):
|
|
|
20
20
|
|
|
21
21
|
super().__init__(parent, short_name)
|
|
22
22
|
|
|
23
|
-
self.
|
|
23
|
+
self.swDataDefProps = None # type: SwDataDefProps
|
|
24
24
|
|
|
25
|
+
def getSwDataDefProps(self):
|
|
26
|
+
return self.swDataDefProps
|
|
27
|
+
|
|
28
|
+
def setSwDataDefProps(self, value):
|
|
29
|
+
self.swDataDefProps = value
|
|
30
|
+
return self
|
|
25
31
|
class AutosarDataPrototype(DataPrototype, metaclass = ABCMeta):
|
|
26
32
|
def __init__(self, parent:ARObject, short_name: str):
|
|
27
33
|
if type(self) == AutosarDataPrototype:
|
|
@@ -29,13 +35,27 @@ class AutosarDataPrototype(DataPrototype, metaclass = ABCMeta):
|
|
|
29
35
|
|
|
30
36
|
super().__init__(parent, short_name)
|
|
31
37
|
|
|
32
|
-
self.
|
|
38
|
+
self.typeTRef = None
|
|
39
|
+
|
|
40
|
+
def getTypeTRef(self):
|
|
41
|
+
return self.typeTRef
|
|
42
|
+
|
|
43
|
+
def setTypeTRef(self, value):
|
|
44
|
+
self.typeTRef = value
|
|
45
|
+
return self
|
|
33
46
|
|
|
34
47
|
class VariableDataPrototype(AutosarDataPrototype):
|
|
35
48
|
def __init__(self, parent:ARObject, short_name: str):
|
|
36
49
|
super().__init__(parent, short_name)
|
|
37
50
|
|
|
38
|
-
self.
|
|
51
|
+
self.initValue = None # type: ValueSpecification
|
|
52
|
+
|
|
53
|
+
def getInitValue(self):
|
|
54
|
+
return self.initValue
|
|
55
|
+
|
|
56
|
+
def setInitValue(self, value):
|
|
57
|
+
self.initValue = value
|
|
58
|
+
return self
|
|
39
59
|
|
|
40
60
|
class ApplicationCompositeElementDataPrototype(DataPrototype, metaclass = ABCMeta):
|
|
41
61
|
def __init__(self, parent:ARObject, short_name: str):
|
|
@@ -46,6 +66,14 @@ class ApplicationCompositeElementDataPrototype(DataPrototype, metaclass = ABCMet
|
|
|
46
66
|
|
|
47
67
|
self.typeTRef = None # type: RefType
|
|
48
68
|
|
|
69
|
+
def getTypeTRef(self):
|
|
70
|
+
return self.typeTRef
|
|
71
|
+
|
|
72
|
+
def setTypeTRef(self, value):
|
|
73
|
+
self.typeTRef = value
|
|
74
|
+
return self
|
|
75
|
+
|
|
76
|
+
|
|
49
77
|
class ApplicationArrayElement(ApplicationCompositeElementDataPrototype):
|
|
50
78
|
def __init__(self, parent:ARObject, short_name: str):
|
|
51
79
|
super().__init__(parent, short_name)
|
|
@@ -65,4 +93,11 @@ class ParameterDataPrototype(AutosarDataPrototype):
|
|
|
65
93
|
def __init__(self, parent: ARObject, short_name: str):
|
|
66
94
|
super().__init__(parent, short_name)
|
|
67
95
|
|
|
68
|
-
self.
|
|
96
|
+
self.initValue = None # type: ValueSpecification
|
|
97
|
+
|
|
98
|
+
def getInitValue(self):
|
|
99
|
+
return self.initValue
|
|
100
|
+
|
|
101
|
+
def setInitValue(self, value):
|
|
102
|
+
self.initValue = value
|
|
103
|
+
return self
|