armodel 1.5.0__py3-none-any.whl → 1.6.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/cli/arxml_dump_cli.py +13 -13
- armodel/cli/memory_section_cli.py +76 -0
- armodel/cli/system_signal_cli.py +74 -0
- armodel/data_models/sw_connector.py +3 -3
- armodel/lib/__init__.py +2 -1
- armodel/lib/system_signal.py +37 -0
- armodel/models/__init__.py +9 -4
- armodel/models/annotation.py +27 -3
- armodel/models/ar_object.py +18 -6
- armodel/models/ar_package.py +271 -127
- armodel/models/ar_ref.py +11 -166
- armodel/models/bsw_module_template.py +37 -14
- armodel/models/common_structure.py +91 -174
- armodel/models/communication.py +2 -2
- armodel/models/data_prototype.py +41 -6
- armodel/models/datatype.py +16 -74
- armodel/models/end_to_end_protection.py +1 -1
- armodel/models/fibex/can_communication.py +119 -3
- 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 +81 -88
- 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/lin_communication.py +24 -3
- armodel/models/general_structure.py +110 -11
- armodel/models/internal_behavior.py +1 -1
- 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/common_structure/implementation.py +21 -0
- armodel/models/m2/autosar_templates/common_structure/implementation_data_types.py +148 -0
- armodel/models/m2/autosar_templates/ecuc_description_template.py +269 -0
- armodel/models/m2/autosar_templates/generic_structure/__init__.py +0 -0
- armodel/models/m2/autosar_templates/generic_structure/abstract_structure.py +69 -0
- armodel/models/m2/autosar_templates/sw_component_template/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/communication.py +360 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/__init__.py +246 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/instance_refs.py +181 -0
- armodel/models/m2/autosar_templates/sw_component_template/composition/__init__.py +154 -0
- armodel/models/m2/autosar_templates/sw_component_template/composition/instance_refs.py +157 -0
- armodel/models/m2/autosar_templates/sw_component_template/data_type/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/data_type/data_prototypes.py +104 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface/__init__.py +243 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface/instance_refs.py +39 -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 +46 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py +169 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py +38 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py +27 -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/instance_refs.py +48 -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/m2_msr.py +1 -0
- armodel/models/multilanguage_data.py +15 -0
- armodel/models/per_instance_memory.py +34 -6
- armodel/models/port_prototype.py +2 -253
- armodel/models/service_needs.py +3 -1
- armodel/models/sw_component.py +19 -358
- armodel/parser/__init__.py +2 -1
- armodel/parser/abstract_arxml_parser.py +10 -1
- armodel/parser/arxml_parser.py +912 -229
- armodel/parser/file_parser.py +43 -0
- armodel/tests/test_armodel/models/test_ar_package.py +6 -3
- armodel/tests/test_armodel/models/test_ar_ref.py +18 -16
- armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -5
- armodel/tests/test_armodel/models/test_common_structure.py +8 -7
- 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 +9 -9
- armodel/tests/test_armodel/models/test_port_interface.py +2 -2
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +3 -3
- armodel/tests/test_armodel/parser/test_sw_components.py +3 -3
- armodel/writer/abstract_arxml_writer.py +5 -1
- armodel/writer/arxml_writer.py +870 -224
- {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/METADATA +28 -1
- armodel-1.6.1.dist-info/RECORD +140 -0
- {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/entry_points.txt +3 -1
- armodel-1.5.0.dist-info/RECORD +0 -91
- {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/LICENSE +0 -0
- {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/WHEEL +0 -0
- {armodel-1.5.0.dist-info → armodel-1.6.1.dist-info}/top_level.txt +0 -0
armodel/models/ar_ref.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from abc import ABCMeta
|
|
2
|
-
from typing import List
|
|
3
1
|
from .ar_object import ARObject
|
|
4
2
|
|
|
5
3
|
class RefType(ARObject):
|
|
@@ -7,174 +5,21 @@ class RefType(ARObject):
|
|
|
7
5
|
self.dest = ""
|
|
8
6
|
self.value = ""
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
super().__init__()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class AutosarVariableRef(ARObject):
|
|
16
|
-
def __init__(self):
|
|
17
|
-
super().__init__()
|
|
18
|
-
self.autosar_variable_iref = None # type: VariableInAtomicSWCTypeInstanceRef
|
|
19
|
-
self.autosar_variable_in_impl_datatype = None # type: ArVariableInImplementationDataInstanceRef
|
|
20
|
-
self.local_variable_ref = None
|
|
21
|
-
|
|
22
|
-
class AutosarParameterRef(ARObject):
|
|
23
|
-
def __init__(self):
|
|
24
|
-
super().__init__()
|
|
25
|
-
|
|
26
|
-
self.autosar_parameter_iref = None # type: ParameterInAtomicSWCTypeInstanceRef
|
|
27
|
-
self.local_parameter_ref = None # type: RefType
|
|
28
|
-
|
|
29
|
-
class AtpInstanceRef(ARObject, metaclass=ABCMeta):
|
|
30
|
-
def __init__(self):
|
|
31
|
-
if type(self) == AtpInstanceRef:
|
|
32
|
-
raise NotImplementedError("AtpInstanceRef is an abstract class.")
|
|
33
|
-
|
|
34
|
-
super().__init__()
|
|
35
|
-
|
|
36
|
-
class VariableInAtomicSWCTypeInstanceRef(AtpInstanceRef):
|
|
37
|
-
def __init__(self):
|
|
38
|
-
super().__init__()
|
|
39
|
-
|
|
40
|
-
self.base_ref = None # type: RefType
|
|
41
|
-
self.context_data_prototype_ref = None # type: RefType
|
|
42
|
-
self.port_prototype_ref = None # type: RefType
|
|
43
|
-
self.root_variable_data_prototype_ref = None # type: RefType
|
|
44
|
-
self.target_data_prototype_ref = None # type: RefType
|
|
45
|
-
|
|
46
|
-
class PortInCompositionTypeInstanceRef(AtpInstanceRef, metaclass=ABCMeta):
|
|
47
|
-
def __init__(self):
|
|
48
|
-
if type(self) == PortInCompositionTypeInstanceRef:
|
|
49
|
-
raise NotImplementedError("PortInCompositionTypeInstanceRef is an abstract class.")
|
|
50
|
-
super().__init__()
|
|
51
|
-
|
|
52
|
-
self.abstract_context_component_ref = None # type: RefType
|
|
53
|
-
self.base_ref = None # type: RefType
|
|
54
|
-
self.target_port_ref = None # type: RefType
|
|
55
|
-
|
|
56
|
-
class PPortInCompositionInstanceRef(PortInCompositionTypeInstanceRef):
|
|
57
|
-
def __init__(self):
|
|
58
|
-
super().__init__()
|
|
59
|
-
self.context_component_ref = None # type: RefType
|
|
60
|
-
self.target_p_port_ref = None # type: RefType
|
|
61
|
-
|
|
62
|
-
class RPortInCompositionInstanceRef(PortInCompositionTypeInstanceRef):
|
|
63
|
-
def __init__(self):
|
|
64
|
-
super().__init__()
|
|
65
|
-
self.context_component_ref = None # type: RefType
|
|
66
|
-
self.target_r_port_ref = None # type: RefType
|
|
8
|
+
def getDest(self):
|
|
9
|
+
return self.dest
|
|
67
10
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
self.port_prototype_ref = None # type: RefType
|
|
72
|
-
self.target_data_prototype_ref = None # type: RefType
|
|
11
|
+
def setDest(self, value):
|
|
12
|
+
self.dest = value
|
|
13
|
+
return self
|
|
73
14
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if type(self) == OperationInAtomicSwcInstanceRef:
|
|
77
|
-
raise NotImplementedError("OperationInAtomicSwcInstanceRef is an abstract class.")
|
|
78
|
-
super().__init__()
|
|
15
|
+
def getValue(self):
|
|
16
|
+
return self.value
|
|
79
17
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
self.context_p_port_ref = None # type: RefType
|
|
84
|
-
self.target_provided_operation_ref = None # type: RefType
|
|
85
|
-
|
|
86
|
-
class ROperationInAtomicSwcInstanceRef(OperationInAtomicSwcInstanceRef):
|
|
87
|
-
def __init__(self):
|
|
88
|
-
super().__init__()
|
|
89
|
-
self.context_r_port_ref = None # type: RefType
|
|
90
|
-
self.target_required_operation_ref = None # type: RefType
|
|
18
|
+
def setValue(self, value):
|
|
19
|
+
self.value = value
|
|
20
|
+
return self
|
|
91
21
|
|
|
92
|
-
class
|
|
93
|
-
def __init__(self):
|
|
94
|
-
if type(self) == OperationInAtomicSwcInstanceRef:
|
|
95
|
-
raise NotImplementedError("OperationInAtomicSwcInstanceRef is an abstract class.")
|
|
96
|
-
|
|
97
|
-
super().__init__()
|
|
98
|
-
|
|
99
|
-
class RVariableInAtomicSwcInstanceRef(VariableInAtomicSwcInstanceRef):
|
|
100
|
-
def __init__(self):
|
|
101
|
-
super().__init__()
|
|
102
|
-
|
|
103
|
-
self.context_r_port_ref = None # type: RefType
|
|
104
|
-
self.target_data_element_ref = None # type: RefType
|
|
105
|
-
|
|
106
|
-
class RVariableInAtomicSwcInstanceRef(VariableInAtomicSwcInstanceRef):
|
|
107
|
-
def __init__(self):
|
|
108
|
-
super().__init__()
|
|
109
|
-
|
|
110
|
-
self.context_r_port_ref = None # type: RefType
|
|
111
|
-
self.target_data_element_ref = None # type: RefType
|
|
112
|
-
|
|
113
|
-
class RModeInAtomicSwcInstanceRef(AtpInstanceRef):
|
|
114
|
-
def __init__(self):
|
|
115
|
-
super().__init__()
|
|
116
|
-
|
|
117
|
-
self.base_ref = None # type: RefType
|
|
118
|
-
self.context_mode_declaration_group_prototype_ref = None # type: RefType
|
|
119
|
-
self.context_port_ref = None # type: RefType
|
|
120
|
-
self.target_mode_declaration_ref = None # type: RefType
|
|
121
|
-
|
|
122
|
-
class ParameterInAtomicSWCTypeInstanceRef(AtpInstanceRef):
|
|
123
|
-
def __init__(self):
|
|
124
|
-
super().__init__()
|
|
125
|
-
|
|
126
|
-
self.base_ref = None # type: RefType
|
|
127
|
-
self.context_data_prototype_ref = None # type: RefType
|
|
128
|
-
self.port_prototype_ref = None # type: RefType
|
|
129
|
-
self.root_parameter_data_prototype_ref = None # type: RefType
|
|
130
|
-
self.target_data_prototype_ref = None # type: RefType
|
|
131
|
-
|
|
132
|
-
class ApplicationCompositeElementInPortInterfaceInstanceRef(AtpInstanceRef):
|
|
133
|
-
def __init__(self):
|
|
134
|
-
super().__init__()
|
|
135
|
-
|
|
136
|
-
self.base_ref = None # type: RefType
|
|
137
|
-
self.context_data_prototype_ref = None # type: RefType
|
|
138
|
-
self.root_data_prototype_ref = None # type: RefType
|
|
139
|
-
self.target_data_prototype_ref = None # type: RefType
|
|
140
|
-
|
|
141
|
-
class InnerPortGroupInCompositionInstanceRef(AtpInstanceRef):
|
|
142
|
-
def __init__(self):
|
|
143
|
-
super().__init__()
|
|
144
|
-
|
|
145
|
-
self.baseRef = None # type: RefType
|
|
146
|
-
self.contextRef = None # type: RefType
|
|
147
|
-
self.targetRef = None # type: RefType
|
|
148
|
-
|
|
149
|
-
class VariableDataPrototypeInSystemInstanceRef(AtpInstanceRef):
|
|
150
|
-
def __init__(self):
|
|
151
|
-
super().__init__()
|
|
152
|
-
|
|
153
|
-
self.base_ref = None # type: RefType
|
|
154
|
-
self.context_component_refs = [] # type: List[RefType]
|
|
155
|
-
self.context_composition_ref = None # type: RefType
|
|
156
|
-
self.context_port_ref = None # type: RefType
|
|
157
|
-
self.target_data_prototype_ref = None # type: RefType
|
|
158
|
-
|
|
159
|
-
class RModeGroupInAtomicSWCInstanceRef(AtpInstanceRef):
|
|
22
|
+
class TRefType(RefType):
|
|
160
23
|
def __init__(self):
|
|
161
24
|
super().__init__()
|
|
162
25
|
|
|
163
|
-
self.context_r_port = None # type: RefType
|
|
164
|
-
self.target_mode_group = None # type: RefType
|
|
165
|
-
|
|
166
|
-
@property
|
|
167
|
-
def contextRPort(self) -> RefType:
|
|
168
|
-
return self.context_r_port
|
|
169
|
-
|
|
170
|
-
@contextRPort.setter
|
|
171
|
-
def contextRPort(self, value: RefType):
|
|
172
|
-
self.context_r_port = value
|
|
173
|
-
|
|
174
|
-
@property
|
|
175
|
-
def targetModeGroup(self) -> RefType:
|
|
176
|
-
return self.target_mode_group
|
|
177
|
-
|
|
178
|
-
@targetModeGroup.setter
|
|
179
|
-
def targetModeGroup(self, value: RefType):
|
|
180
|
-
self.target_mode_group = value
|
|
@@ -15,14 +15,35 @@ class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
|
15
15
|
|
|
16
16
|
self.accessedModeGroupRefs = [] # type: List[RefType]
|
|
17
17
|
self.activationPointRefs = [] # type: List[RefType]
|
|
18
|
-
self.
|
|
19
|
-
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
|
|
20
41
|
|
|
21
42
|
def addManagedModeGroupRef(self, ref: RefType):
|
|
22
|
-
self.
|
|
43
|
+
self.managedModeGroupRefs.append(ref)
|
|
23
44
|
|
|
24
45
|
def getManagedModeGroupRefs(self) -> List[RefType]:
|
|
25
|
-
return self.
|
|
46
|
+
return self.managedModeGroupRefs
|
|
26
47
|
|
|
27
48
|
class BswCalledEntity(BswModuleEntity):
|
|
28
49
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -235,7 +256,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
235
256
|
def getIncludedDataTypeSets(self) -> List[IncludedDataTypeSet]:
|
|
236
257
|
return self.included_data_type_sets
|
|
237
258
|
|
|
238
|
-
class BswModuleDescription(
|
|
259
|
+
class BswModuleDescription(ARElement):
|
|
239
260
|
'''
|
|
240
261
|
Root element for the description of a single BSW module or BSW cluster. In case it
|
|
241
262
|
describes a BSW module, the short name of this element equals the name of the
|
|
@@ -262,15 +283,17 @@ class BswModuleDescription(AtpStructureElement):
|
|
|
262
283
|
def getImplementedEntries(self) -> List[RefType]:
|
|
263
284
|
return self._implementedEntryRefs
|
|
264
285
|
|
|
265
|
-
|
|
266
|
-
def category(self) -> str:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
def category(self, value:str):
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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)
|
|
274
297
|
|
|
275
298
|
def createProvidedModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
276
299
|
if (short_name not in self.elements):
|
|
@@ -3,150 +3,13 @@
|
|
|
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 ValueSpecification(ARObject, metaclass=ABCMeta):
|
|
14
|
-
'''
|
|
15
|
-
Base class for expressions leading to a value which can be used to initialize a data object.
|
|
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__()
|
|
93
|
-
|
|
94
|
-
self.value = None # type: str
|
|
95
|
-
|
|
96
|
-
class NumericalValueSpecification(ValueSpecification):
|
|
97
|
-
def __init__(self):
|
|
98
|
-
super().__init__()
|
|
99
|
-
|
|
100
|
-
self.value = None # type: ARFloat
|
|
101
|
-
|
|
102
|
-
class ArrayValueSpecification(ValueSpecification):
|
|
103
|
-
def __init__(self):
|
|
104
|
-
super().__init__()
|
|
105
|
-
|
|
106
|
-
self._element = [] # type: List[ValueSpecification]
|
|
107
|
-
|
|
108
|
-
def add_element(self, element: ValueSpecification):
|
|
109
|
-
self._element.append(element)
|
|
110
|
-
|
|
111
|
-
def get_elements(self) -> List[ValueSpecification]:
|
|
112
|
-
return self._element
|
|
113
|
-
|
|
114
|
-
class ConstantSpecification(ARElement):
|
|
115
|
-
def __init__(self, parent, short_name):
|
|
116
|
-
super().__init__(parent, short_name)
|
|
117
|
-
|
|
118
|
-
self.value_spec = None # type: ValueSpecification
|
|
119
|
-
|
|
120
|
-
class ConstantReference(ValueSpecification):
|
|
121
|
-
def __init__(self):
|
|
122
|
-
super().__init__()
|
|
123
|
-
|
|
124
|
-
self.constant_ref = None
|
|
125
|
-
|
|
126
|
-
class AbstractImplementationDataTypeElement(Identifiable):
|
|
127
|
-
def __init__(self, parent, short_name: str):
|
|
128
|
-
super().__init__(parent, short_name)
|
|
129
|
-
|
|
130
|
-
class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
131
|
-
ARRAY_SIZE_SEMANTICS_FIXED_SIZE = "FIXED-SIZE"
|
|
132
|
-
ARRAY_SIZE_SEMANTICS_VARIABLE_SIZE = "VARIABLE_SIZE"
|
|
133
|
-
|
|
134
|
-
def __init__(self, parent, short_name: str):
|
|
135
|
-
super().__init__(parent, short_name)
|
|
136
|
-
|
|
137
|
-
self.arraySize = None # type: int
|
|
138
|
-
self.array_size_semantics = None # type: str
|
|
139
|
-
self.isOptional = None # type: bool
|
|
140
|
-
self.sw_data_def_props = None # type: SwDataDefProps
|
|
141
|
-
|
|
142
|
-
def createImplementationDataTypeElement(self, short_name: str): # type: (...) -> ImplementationDataTypeElement
|
|
143
|
-
if (short_name not in self.elements):
|
|
144
|
-
event = ImplementationDataTypeElement(self, short_name)
|
|
145
|
-
self.elements[short_name] = event
|
|
146
|
-
return self.elements[short_name]
|
|
147
|
-
|
|
148
|
-
def getImplementationDataTypeElements(self): # type:(...) -> List[ImplementationDataTypeElement]
|
|
149
|
-
return list(filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements.values()))
|
|
150
13
|
|
|
151
14
|
class ExclusiveArea(Identifiable):
|
|
152
15
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -190,41 +53,54 @@ class ExecutableEntity(Identifiable, metaclass=ABCMeta):
|
|
|
190
53
|
def __init__(self, parent: ARObject, short_name: str):
|
|
191
54
|
if type(self) == ExecutableEntity:
|
|
192
55
|
raise NotImplementedError("ExecutableEntity is an abstract class.")
|
|
56
|
+
|
|
193
57
|
super().__init__(parent, short_name)
|
|
194
58
|
|
|
195
|
-
self.
|
|
196
|
-
self.
|
|
197
|
-
self.
|
|
198
|
-
self.
|
|
199
|
-
self.
|
|
59
|
+
self.activationReason = None # *
|
|
60
|
+
self.minimumStartInterval = None # type: ARFloat
|
|
61
|
+
self.reentrancyLevel = None #
|
|
62
|
+
self.canEnterExclusiveAreaRefs = [] # type: List[RefType]
|
|
63
|
+
self.swAddrMethodRef = None # type: RefType
|
|
64
|
+
|
|
65
|
+
def getActivationReason(self):
|
|
66
|
+
return self.activationReason
|
|
67
|
+
|
|
68
|
+
def setActivationReason(self, value):
|
|
69
|
+
self.activationReason = value
|
|
70
|
+
return self
|
|
71
|
+
|
|
72
|
+
def getMinimumStartInterval(self):
|
|
73
|
+
return self.minimumStartInterval
|
|
74
|
+
|
|
75
|
+
def setMinimumStartInterval(self, value):
|
|
76
|
+
self.minimumStartInterval = value
|
|
77
|
+
return self
|
|
78
|
+
|
|
79
|
+
def getReentrancyLevel(self):
|
|
80
|
+
return self.reentrancyLevel
|
|
81
|
+
|
|
82
|
+
def setReentrancyLevel(self, value):
|
|
83
|
+
self.reentrancyLevel = value
|
|
84
|
+
return self
|
|
85
|
+
|
|
86
|
+
def getSwAddrMethodRef(self):
|
|
87
|
+
return self.swAddrMethodRef
|
|
88
|
+
|
|
89
|
+
def setSwAddrMethodRef(self, value):
|
|
90
|
+
self.swAddrMethodRef = value
|
|
91
|
+
return self
|
|
200
92
|
|
|
201
93
|
@property
|
|
202
94
|
def minimumStartIntervalMs(self) -> int:
|
|
203
|
-
if self.
|
|
204
|
-
return int(self.
|
|
95
|
+
if self.minimumStartInterval is not None:
|
|
96
|
+
return int(self.minimumStartInterval.getValue() * 1000)
|
|
205
97
|
return None
|
|
206
98
|
|
|
207
|
-
@property
|
|
208
|
-
def minimumStartInterval(self) -> ARFloat:
|
|
209
|
-
return self.minimum_start_interval
|
|
210
|
-
|
|
211
|
-
@minimumStartInterval.setter
|
|
212
|
-
def minimumStartInterval(self, value: ARFloat):
|
|
213
|
-
self.minimum_start_interval = value
|
|
214
|
-
|
|
215
|
-
@property
|
|
216
|
-
def swAddrMethodRef(self) -> RefType:
|
|
217
|
-
return self.sw_addr_method_ref
|
|
218
|
-
|
|
219
|
-
@swAddrMethodRef.setter
|
|
220
|
-
def swAddrMethodRef(self, ref: RefType):
|
|
221
|
-
self.sw_addr_method_ref = ref
|
|
222
|
-
|
|
223
99
|
def addCanEnterExclusiveAreaRef(self, ref: RefType):
|
|
224
|
-
self.
|
|
100
|
+
self.canEnterExclusiveAreaRefs.append(ref)
|
|
225
101
|
|
|
226
102
|
def getCanEnterExclusiveAreaRefs(self):
|
|
227
|
-
return self.
|
|
103
|
+
return self.canEnterExclusiveAreaRefs
|
|
228
104
|
|
|
229
105
|
class ModeDeclarationGroupPrototype(Identifiable):
|
|
230
106
|
"""
|
|
@@ -247,21 +123,57 @@ class ModeDeclarationGroupPrototype(Identifiable):
|
|
|
247
123
|
raise ValueError("Invalid SwCalibrationAccess <%s> of ModeDeclarationGroupPrototype <%s>" % (value, self.short_name))
|
|
248
124
|
self._swCalibrationAccess = value
|
|
249
125
|
|
|
126
|
+
def getSwCalibrationAccess(self):
|
|
127
|
+
return self.swCalibrationAccess
|
|
128
|
+
|
|
129
|
+
def setSwCalibrationAccess(self, value):
|
|
130
|
+
self.swCalibrationAccess = value
|
|
131
|
+
return self
|
|
132
|
+
|
|
133
|
+
def getTypeTRef(self):
|
|
134
|
+
return self.typeTRef
|
|
135
|
+
|
|
136
|
+
def setTypeTRef(self, value):
|
|
137
|
+
self.typeTRef = value
|
|
138
|
+
return self
|
|
139
|
+
|
|
250
140
|
class MemorySection(Identifiable):
|
|
251
141
|
def __init__(self, parent: ARObject, short_name: str):
|
|
252
142
|
super().__init__(parent, short_name)
|
|
253
143
|
|
|
254
144
|
self._alignment = None # type: ARLiteral
|
|
255
145
|
self.size = None
|
|
256
|
-
self.
|
|
146
|
+
self.options = [] # type: List[ARLiteral]
|
|
257
147
|
self.swAddrMethodRef = None # type: RefType
|
|
258
148
|
self.symbol = None # type: ARLiteral
|
|
259
149
|
|
|
260
|
-
def
|
|
261
|
-
self.
|
|
150
|
+
def getAlignment(self):
|
|
151
|
+
return self.alignment
|
|
262
152
|
|
|
263
|
-
def
|
|
264
|
-
|
|
153
|
+
def setAlignment(self, value):
|
|
154
|
+
self.alignment = value
|
|
155
|
+
return self
|
|
156
|
+
|
|
157
|
+
def getSize(self):
|
|
158
|
+
return self.size
|
|
159
|
+
|
|
160
|
+
def setSize(self, value):
|
|
161
|
+
self.size = value
|
|
162
|
+
return self
|
|
163
|
+
|
|
164
|
+
def getSwAddrMethodRef(self):
|
|
165
|
+
return self.swAddrMethodRef
|
|
166
|
+
|
|
167
|
+
def setSwAddrMethodRef(self, value):
|
|
168
|
+
self.swAddrMethodRef = value
|
|
169
|
+
return self
|
|
170
|
+
|
|
171
|
+
def getSymbol(self):
|
|
172
|
+
return self.symbol
|
|
173
|
+
|
|
174
|
+
def setSymbol(self, value):
|
|
175
|
+
self.symbol = value
|
|
176
|
+
return self
|
|
265
177
|
|
|
266
178
|
@property
|
|
267
179
|
def alignment(self) -> ARLiteral:
|
|
@@ -269,9 +181,9 @@ class MemorySection(Identifiable):
|
|
|
269
181
|
|
|
270
182
|
@alignment.setter
|
|
271
183
|
def alignment(self, value: ARLiteral):
|
|
272
|
-
if value is not None:
|
|
184
|
+
if value is not None and value.getValue() != "":
|
|
273
185
|
match = False
|
|
274
|
-
if value.
|
|
186
|
+
if value.getValue() in ("UNKNOWN", "UNSPECIFIED", "BOOLEAN", "PTR"):
|
|
275
187
|
self._alignment = value
|
|
276
188
|
match = True
|
|
277
189
|
else:
|
|
@@ -281,8 +193,13 @@ class MemorySection(Identifiable):
|
|
|
281
193
|
match = True
|
|
282
194
|
|
|
283
195
|
if not match:
|
|
284
|
-
raise ValueError("Invalid alignment <%s> of memory section <%s>" % (value, self.
|
|
285
|
-
|
|
196
|
+
raise ValueError("Invalid alignment <%s> of memory section <%s>" % (value, self.getShortName()))
|
|
197
|
+
|
|
198
|
+
def addOption(self, option: ARLiteral):
|
|
199
|
+
self.options.append(option)
|
|
200
|
+
|
|
201
|
+
def getOptions(self) -> List[ARLiteral]:
|
|
202
|
+
return self.options
|
|
286
203
|
|
|
287
204
|
class ResourceConsumption(Identifiable):
|
|
288
205
|
def __init__(self, parent: ARObject, short_name: str):
|
armodel/models/communication.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
from .
|
|
3
|
-
from .
|
|
2
|
+
from .m2.autosar_templates.sw_component_template.port_interface.instance_refs import ApplicationCompositeElementInPortInterfaceInstanceRef
|
|
3
|
+
from .m2.msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
4
4
|
from .ar_object import ARObject
|
|
5
5
|
|
|
6
6
|
class TransmissionAcknowledgementRequest(ARObject):
|
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
|