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
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
from .....ar_ref import AtpInstanceRef, RefType
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ModeGroupInAtomicSwcInstanceRef(AtpInstanceRef, metaclass = ABCMeta):
|
|
6
|
+
def __init__(self):
|
|
7
|
+
|
|
8
|
+
if type(self) == ModeGroupInAtomicSwcInstanceRef:
|
|
9
|
+
raise NotImplementedError("ModeGroupInAtomicSwcInstanceRef is an abstract class.")
|
|
10
|
+
|
|
11
|
+
super().__init__()
|
|
12
|
+
|
|
13
|
+
self.baseRef = None # type: RefType
|
|
14
|
+
self.contextPortRef = None # type: RefType
|
|
15
|
+
self.targetRef = None # type: RefType
|
|
16
|
+
|
|
17
|
+
def getBaseRef(self):
|
|
18
|
+
return self.baseRef
|
|
19
|
+
|
|
20
|
+
def setBaseRef(self, value):
|
|
21
|
+
self.baseRef = value
|
|
22
|
+
return self
|
|
23
|
+
|
|
24
|
+
def getContextPortRef(self):
|
|
25
|
+
return self.contextPortRef
|
|
26
|
+
|
|
27
|
+
def setContextPortRef(self, value):
|
|
28
|
+
self.contextPortRef = value
|
|
29
|
+
return self
|
|
30
|
+
|
|
31
|
+
def getTargetRef(self):
|
|
32
|
+
return self.targetRef
|
|
33
|
+
|
|
34
|
+
def setTargetRef(self, value):
|
|
35
|
+
self.targetRef = value
|
|
36
|
+
return self
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class PModeGroupInAtomicSwcInstanceRef(ModeGroupInAtomicSwcInstanceRef):
|
|
40
|
+
def __init__(self):
|
|
41
|
+
super().__init__()
|
|
42
|
+
|
|
43
|
+
self.contextPPortRef = None # type: RefType
|
|
44
|
+
self.targetModeGroupRef = None # type: RefType
|
|
45
|
+
|
|
46
|
+
def getContextPPortRef(self):
|
|
47
|
+
return self.contextPPortRef
|
|
48
|
+
|
|
49
|
+
def setContextPPortRef(self, value):
|
|
50
|
+
self.contextPPortRef = value
|
|
51
|
+
return self
|
|
52
|
+
|
|
53
|
+
def getTargetModeGroupRef(self):
|
|
54
|
+
return self.targetModeGroupRef
|
|
55
|
+
|
|
56
|
+
def setTargetModeGroupRef(self, value):
|
|
57
|
+
self.targetModeGroupRef = value
|
|
58
|
+
return self
|
|
59
|
+
|
|
60
|
+
class RModeGroupInAtomicSWCInstanceRef(ModeGroupInAtomicSwcInstanceRef):
|
|
61
|
+
def __init__(self):
|
|
62
|
+
super().__init__()
|
|
63
|
+
|
|
64
|
+
self.contextRPortRef = None # type: RefType
|
|
65
|
+
self.targetModeGroupRef = None # type: RefType
|
|
66
|
+
|
|
67
|
+
def getContextRPortRef(self):
|
|
68
|
+
return self.contextRPortRef
|
|
69
|
+
|
|
70
|
+
def setContextRPortRef(self, value):
|
|
71
|
+
self.contextRPortRef = value
|
|
72
|
+
return self
|
|
73
|
+
|
|
74
|
+
def getTargetModeGroupRef(self):
|
|
75
|
+
return self.targetModeGroupRef
|
|
76
|
+
|
|
77
|
+
def setTargetModeGroupRef(self, value):
|
|
78
|
+
self.targetModeGroupRef = value
|
|
79
|
+
return self
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class RModeInAtomicSwcInstanceRef(AtpInstanceRef):
|
|
83
|
+
def __init__(self):
|
|
84
|
+
super().__init__()
|
|
85
|
+
|
|
86
|
+
self.baseRef = None # type: RefType
|
|
87
|
+
self.contextModeDeclarationGroupPrototypeRef = None # type: RefType
|
|
88
|
+
self.contextPortRef = None # type: RefType
|
|
89
|
+
self.targetModeDeclarationRef = None # type: RefType
|
|
90
|
+
|
|
91
|
+
def getBaseRef(self):
|
|
92
|
+
return self.baseRef
|
|
93
|
+
|
|
94
|
+
def setBaseRef(self, value):
|
|
95
|
+
self.baseRef = value
|
|
96
|
+
return self
|
|
97
|
+
|
|
98
|
+
def getContextModeDeclarationGroupPrototypeRef(self):
|
|
99
|
+
return self.contextModeDeclarationGroupPrototypeRef
|
|
100
|
+
|
|
101
|
+
def setContextModeDeclarationGroupPrototypeRef(self, value):
|
|
102
|
+
self.contextModeDeclarationGroupPrototypeRef = value
|
|
103
|
+
return self
|
|
104
|
+
|
|
105
|
+
def getContextPortRef(self):
|
|
106
|
+
return self.contextPortRef
|
|
107
|
+
|
|
108
|
+
def setContextPortRef(self, value):
|
|
109
|
+
self.contextPortRef = value
|
|
110
|
+
return self
|
|
111
|
+
|
|
112
|
+
def getTargetModeDeclarationRef(self):
|
|
113
|
+
return self.targetModeDeclarationRef
|
|
114
|
+
|
|
115
|
+
def setTargetModeDeclarationRef(self, value):
|
|
116
|
+
self.targetModeDeclarationRef = value
|
|
117
|
+
return self
|
|
118
|
+
|
|
119
|
+
class VariableInAtomicSwcInstanceRef(AtpInstanceRef, metaclass = ABCMeta):
|
|
120
|
+
def __init__(self):
|
|
121
|
+
if type(self) == VariableInAtomicSwcInstanceRef:
|
|
122
|
+
raise NotImplementedError("VariableInAtomicSwcInstanceRef is an abstract class.")
|
|
123
|
+
|
|
124
|
+
super().__init__()
|
|
125
|
+
|
|
126
|
+
self.abstractTargetDataElementRef = None # type: RefType
|
|
127
|
+
self.baseRef = None # type: RefType
|
|
128
|
+
self.contextPortRef = None # type: RefType
|
|
129
|
+
|
|
130
|
+
class RVariableInAtomicSwcInstanceRef(VariableInAtomicSwcInstanceRef):
|
|
131
|
+
def __init__(self):
|
|
132
|
+
super().__init__()
|
|
133
|
+
|
|
134
|
+
self.contextRPortRef = None # type: RefType
|
|
135
|
+
self.targetDataElementRef = None # type: RefType
|
|
136
|
+
|
|
137
|
+
def getContextRPortRef(self):
|
|
138
|
+
return self.contextRPortRef
|
|
139
|
+
|
|
140
|
+
def setContextRPortRef(self, value):
|
|
141
|
+
self.contextRPortRef = value
|
|
142
|
+
return self
|
|
143
|
+
|
|
144
|
+
def getTargetDataElementRef(self):
|
|
145
|
+
return self.targetDataElementRef
|
|
146
|
+
|
|
147
|
+
def setTargetDataElementRef(self, value):
|
|
148
|
+
self.targetDataElementRef = value
|
|
149
|
+
return self
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from ....ar_object import ARBoolean, ARLiteral, ARNumerical
|
|
5
|
+
from ....common_structure import ModeDeclarationGroupPrototype, Trigger
|
|
6
|
+
from ....datatype import AtpType
|
|
7
|
+
from ....general_structure import ARObject, Identifiable, AtpFeature
|
|
8
|
+
from ....data_prototype import ParameterDataPrototype, VariableDataPrototype, AutosarDataPrototype
|
|
9
|
+
from ....ar_ref import RefType
|
|
10
|
+
|
|
11
|
+
class PortInterface(AtpType, metaclass = ABCMeta):
|
|
12
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
13
|
+
if type(self) == PortInterface:
|
|
14
|
+
raise NotImplementedError("PortInterface is an abstract class.")
|
|
15
|
+
super().__init__(parent, short_name)
|
|
16
|
+
|
|
17
|
+
self.isService = None # type: ARBoolean
|
|
18
|
+
self.serviceKind = None # type: ARLiteral
|
|
19
|
+
|
|
20
|
+
def getIsService(self):
|
|
21
|
+
return self.isService
|
|
22
|
+
|
|
23
|
+
def setIsService(self, value):
|
|
24
|
+
self.isService = value
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def getServiceKind(self):
|
|
28
|
+
return self.serviceKind
|
|
29
|
+
|
|
30
|
+
def setServiceKind(self, value):
|
|
31
|
+
self.serviceKind = value
|
|
32
|
+
return self
|
|
33
|
+
|
|
34
|
+
class DataInterface(PortInterface, metaclass = ABCMeta):
|
|
35
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
36
|
+
if type(self) == DataInterface:
|
|
37
|
+
raise NotImplementedError("DataInterface is an abstract class.")
|
|
38
|
+
super().__init__(parent, short_name)
|
|
39
|
+
|
|
40
|
+
class NvDataInterface(DataInterface):
|
|
41
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
42
|
+
super().__init__(parent, short_name)
|
|
43
|
+
|
|
44
|
+
self.nvDatas = [] # type: List[VariableDataPrototype]
|
|
45
|
+
|
|
46
|
+
def getNvDatas(self):
|
|
47
|
+
return self.nvDatas
|
|
48
|
+
|
|
49
|
+
def setNvData(self, value):
|
|
50
|
+
self.nvDatas.append(value)
|
|
51
|
+
return self
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class ParameterInterface(DataInterface):
|
|
55
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
56
|
+
super().__init__(parent, short_name)
|
|
57
|
+
|
|
58
|
+
self.parameters = [] # type: List[ParameterDataPrototype]
|
|
59
|
+
|
|
60
|
+
def getParameters(self):
|
|
61
|
+
return self.parameters
|
|
62
|
+
|
|
63
|
+
def addParameter(self, value):
|
|
64
|
+
self.parameters.append(value)
|
|
65
|
+
return self
|
|
66
|
+
|
|
67
|
+
class InvalidationPolicy(ARObject):
|
|
68
|
+
def __init__(self):
|
|
69
|
+
super().__init__()
|
|
70
|
+
|
|
71
|
+
self.dataElementRef = None # type: RefType
|
|
72
|
+
self.handleInvalid = None # type: ARLiteral
|
|
73
|
+
|
|
74
|
+
def getDataElementRef(self):
|
|
75
|
+
return self.dataElementRef
|
|
76
|
+
|
|
77
|
+
def setDataElementRef(self, value):
|
|
78
|
+
self.dataElementRef = value
|
|
79
|
+
return self
|
|
80
|
+
|
|
81
|
+
def getHandleInvalid(self):
|
|
82
|
+
return self.handleInvalid
|
|
83
|
+
|
|
84
|
+
def setHandleInvalid(self, value):
|
|
85
|
+
self.handleInvalid = value
|
|
86
|
+
return self
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class SenderReceiverInterface(DataInterface):
|
|
91
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
92
|
+
super().__init__(parent, short_name)
|
|
93
|
+
|
|
94
|
+
self.invalidationPolicies = [] # type: List[InvalidationPolicy]
|
|
95
|
+
self.metaDataItemSets = [] # type: List[MetaDataItemSet]
|
|
96
|
+
|
|
97
|
+
def getInvalidationPolicies(self):
|
|
98
|
+
return self.invalidationPolicies
|
|
99
|
+
|
|
100
|
+
def addInvalidationPolicy(self, value):
|
|
101
|
+
self.invalidationPolicies.append(value)
|
|
102
|
+
return self
|
|
103
|
+
|
|
104
|
+
def getMetaDataItemSets(self):
|
|
105
|
+
return self.metaDataItemSets
|
|
106
|
+
|
|
107
|
+
def addMetaDataItemSet(self, value):
|
|
108
|
+
self.metaDataItemSets.append(value)
|
|
109
|
+
return self
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def createDataElement(self, short_name) -> VariableDataPrototype:
|
|
113
|
+
if (short_name not in self.elements):
|
|
114
|
+
data_element = VariableDataPrototype(self, short_name)
|
|
115
|
+
self.elements[short_name] = data_element
|
|
116
|
+
return self.elements[short_name]
|
|
117
|
+
|
|
118
|
+
def getDataElements(self) -> List[VariableDataPrototype]:
|
|
119
|
+
return list(filter(lambda c: isinstance(c, VariableDataPrototype), self.elements.values()))
|
|
120
|
+
|
|
121
|
+
def getDataElement(self, short_name) -> VariableDataPrototype:
|
|
122
|
+
if (short_name in self.elements):
|
|
123
|
+
data_element = self.elements[short_name]
|
|
124
|
+
#if (not isinstance(data_element, VariableDataPrototype)):
|
|
125
|
+
# raise IndexError("%s is not data element." % short_name)
|
|
126
|
+
return data_element
|
|
127
|
+
raise IndexError("data element <%s> can not be found." % short_name)
|
|
128
|
+
|
|
129
|
+
class ArgumentDataPrototype(AutosarDataPrototype):
|
|
130
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
131
|
+
super().__init__(parent, short_name)
|
|
132
|
+
self.direction = ""
|
|
133
|
+
self.server_argument_impl_policy = ""
|
|
134
|
+
|
|
135
|
+
class ApplicationError(Identifiable):
|
|
136
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
137
|
+
super().__init__(parent, short_name)
|
|
138
|
+
|
|
139
|
+
self.error_code = None # type: ARNumerical
|
|
140
|
+
|
|
141
|
+
class ClientServerOperation(AtpFeature):
|
|
142
|
+
"""
|
|
143
|
+
An operation declared within the scope of a client/server interface.
|
|
144
|
+
Package: M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
|
|
145
|
+
Base: ARObject, AtpClassifier , AtpFeature, AtpStructureElement, Identifiable, MultilanguageReferrable, Referrable
|
|
146
|
+
|
|
147
|
+
Attributes:
|
|
148
|
+
-----------
|
|
149
|
+
_argument: ArgumentDataPrototype (optional)
|
|
150
|
+
An argument of this ClientServerOperation
|
|
151
|
+
|
|
152
|
+
_possibleError: RefType -> ApplicationError (optional)
|
|
153
|
+
Possible errors that may by raised by the referring operation
|
|
154
|
+
|
|
155
|
+
Methods:
|
|
156
|
+
--------
|
|
157
|
+
addArgumentDataPrototype add the argument
|
|
158
|
+
getArgumentDataPrototypes get the arguments
|
|
159
|
+
addPossibleErrorRef add the possible error
|
|
160
|
+
getPossbileErrorRefs get the possible errors
|
|
161
|
+
|
|
162
|
+
"""
|
|
163
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
164
|
+
super().__init__(parent, short_name)
|
|
165
|
+
|
|
166
|
+
self._arguments = []
|
|
167
|
+
self._possible_error_refs = [] # type: List[RefType]
|
|
168
|
+
|
|
169
|
+
def addArgumentDataPrototype(self, prototype: ArgumentDataPrototype):
|
|
170
|
+
self._arguments.append(prototype)
|
|
171
|
+
|
|
172
|
+
def getArgumentDataPrototypes(self) -> List[ArgumentDataPrototype]:
|
|
173
|
+
return self._arguments
|
|
174
|
+
|
|
175
|
+
def addPossibleErrorRef(self, possible_error_ref: RefType):
|
|
176
|
+
self._possible_error_refs.append(possible_error_ref)
|
|
177
|
+
|
|
178
|
+
def getPossbileErrorRefs(self) -> List[RefType]:
|
|
179
|
+
return self._possible_error_refs
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class ClientServerInterface(PortInterface):
|
|
183
|
+
"""
|
|
184
|
+
A client/server interface declares a number of operations that can be invoked on a server by a client.
|
|
185
|
+
Package: M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
|
|
186
|
+
Base: ARElement, ARObject, AtpBlueprint, AtpBlueprintable, AtpClassifier , AtpType, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, PortInterface, Referrable
|
|
187
|
+
|
|
188
|
+
Methods:
|
|
189
|
+
--------
|
|
190
|
+
createOperation create ClientServerOperation(s) of this ClientServerInterface.
|
|
191
|
+
createApplicationError create Application errors that are defined as part of this interface
|
|
192
|
+
getOperations get all ClientServerOperation(s) of this ClientServerInterface
|
|
193
|
+
getPossibleErrors get all Application error(s) of this ClientServerInterface
|
|
194
|
+
|
|
195
|
+
"""
|
|
196
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
197
|
+
super().__init__(parent, short_name)
|
|
198
|
+
|
|
199
|
+
def createOperation(self, short_name: str) -> ClientServerOperation:
|
|
200
|
+
if (short_name not in self.elements):
|
|
201
|
+
operation = ClientServerOperation(self, short_name)
|
|
202
|
+
self.elements[short_name] = operation
|
|
203
|
+
return self.elements[short_name]
|
|
204
|
+
|
|
205
|
+
def createApplicationError(self, short_name: str) -> ApplicationError:
|
|
206
|
+
if (short_name not in self.elements):
|
|
207
|
+
error = ApplicationError(self, short_name)
|
|
208
|
+
self.elements[short_name] = error
|
|
209
|
+
return self.elements[short_name]
|
|
210
|
+
|
|
211
|
+
def getOperations(self) -> List[ClientServerOperation]:
|
|
212
|
+
return list(filter(lambda c: isinstance(c, ClientServerOperation), self.elements.values()))
|
|
213
|
+
|
|
214
|
+
def getPossibleErrors(self) -> List[ApplicationError]:
|
|
215
|
+
return list(filter(lambda c: isinstance(c, ApplicationError), self.elements.values()))
|
|
216
|
+
|
|
217
|
+
class TriggerInterface(PortInterface):
|
|
218
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
219
|
+
super().__init__(parent, short_name)
|
|
220
|
+
|
|
221
|
+
self._triggers = [] # type: Trigger
|
|
222
|
+
|
|
223
|
+
class ModeSwitchInterface(PortInterface):
|
|
224
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
225
|
+
super().__init__(parent, short_name)
|
|
226
|
+
|
|
227
|
+
self._modeGroup = [] # type: List[ModeDeclarationGroupPrototype]
|
|
228
|
+
|
|
229
|
+
def createModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
230
|
+
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
231
|
+
if (short_name not in self.elements):
|
|
232
|
+
self.elements[short_name] = prototype
|
|
233
|
+
return self.elements[short_name]
|
|
234
|
+
|
|
235
|
+
def getModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
236
|
+
return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key= lambda o: o.short_name))
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
|
|
2
|
+
from typing import Dict, List
|
|
3
|
+
|
|
4
|
+
from .data_elements import ParameterAccess, VariableAccess
|
|
5
|
+
from .server_call import ServerCallPoint
|
|
6
|
+
from .mode_declaration_group import ModeAccessPoint, ModeSwitchPoint
|
|
7
|
+
from .trigger import InternalTriggeringPoint
|
|
8
|
+
|
|
9
|
+
from .....ar_ref import RefType
|
|
10
|
+
from .....ar_object import ARBoolean, ARLiteral
|
|
11
|
+
from .....common_structure import ExecutableEntity
|
|
12
|
+
from .....ar_object import ARObject
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RunnableEntityArgument(ARObject):
|
|
16
|
+
def __init__(self):
|
|
17
|
+
super().__init__()
|
|
18
|
+
|
|
19
|
+
self.symbol = None # type: ARLiteral
|
|
20
|
+
|
|
21
|
+
def getSymbol(self):
|
|
22
|
+
return self.symbol
|
|
23
|
+
|
|
24
|
+
def setSymbol(self, value):
|
|
25
|
+
self.symbol = value
|
|
26
|
+
return self
|
|
27
|
+
|
|
28
|
+
class AsynchronousServerCallPoint(ServerCallPoint):
|
|
29
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
30
|
+
super().__init__(parent, short_name)
|
|
31
|
+
|
|
32
|
+
class AsynchronousServerCallResultPoint(ServerCallPoint):
|
|
33
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
34
|
+
super().__init__(parent, short_name)
|
|
35
|
+
|
|
36
|
+
self.asynchronousServerCallPointRef = None # type: RefType
|
|
37
|
+
|
|
38
|
+
def getAsynchronousServerCallPointRef(self):
|
|
39
|
+
return self.asynchronousServerCallPointRef
|
|
40
|
+
|
|
41
|
+
def setAsynchronousServerCallPointRef(self, value):
|
|
42
|
+
self.asynchronousServerCallPointRef = value
|
|
43
|
+
return self
|
|
44
|
+
|
|
45
|
+
class SynchronousServerCallPoint(ServerCallPoint):
|
|
46
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
47
|
+
super().__init__(parent, short_name)
|
|
48
|
+
|
|
49
|
+
self.calledFromWithinExclusiveAreaRef = None # type: RefType
|
|
50
|
+
|
|
51
|
+
def getCalledFromWithinExclusiveAreaRef(self):
|
|
52
|
+
return self.calledFromWithinExclusiveAreaRef
|
|
53
|
+
|
|
54
|
+
def setCalledFromWithinExclusiveAreaRef(self, value):
|
|
55
|
+
self.calledFromWithinExclusiveAreaRef = value
|
|
56
|
+
return self
|
|
57
|
+
|
|
58
|
+
class RunnableEntity(ExecutableEntity):
|
|
59
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
60
|
+
super().__init__(parent, short_name)
|
|
61
|
+
|
|
62
|
+
self.arguments = [] # type: List[RunnableEntityArgument]
|
|
63
|
+
self.canBeInvokedConcurrently = None # type: ARBoolean
|
|
64
|
+
self.dataReadAccesses = {} # type: Dict[str, VariableAccess]
|
|
65
|
+
self.dataReceivePointByArguments = {} # type: Dict[str, VariableAccess]
|
|
66
|
+
self.dataReceivePointByValues = {} # type: Dict[str, VariableAccess]
|
|
67
|
+
self.dataSendPoints = {} # type: Dict[str, VariableAccess]
|
|
68
|
+
self.dataWriteAccesses = {} # type: Dict[str, VariableAccess]
|
|
69
|
+
self.externalTriggeringPoints = {} # type: Dict[str, ExternalTriggeringPoint]
|
|
70
|
+
self.internalTriggeringPoints = {} # type: Dict[str, InternalTriggeringPoint]
|
|
71
|
+
self.modeAccessPoints = [] # type: List[ModeAccessPoint]
|
|
72
|
+
self.modeSwitchPoints = [] # type: List[ModeSwitchPoint]
|
|
73
|
+
self.parameterAccesses = {} # type: Dict[str, ParameterAccess]
|
|
74
|
+
self.readLocalVariables = {} # type: Dict[str, VariableAccess]
|
|
75
|
+
self.serverCallPoints = {} # type: Dict[str, ServerCallPoint]
|
|
76
|
+
self.symbol = None # type: ARLiteral
|
|
77
|
+
self.waitPoints = {} # type: Dict[str, WaitPoint]
|
|
78
|
+
self.writtenLocalVariables = {} # type: Dict[str, VariableAccess]
|
|
79
|
+
|
|
80
|
+
def _createVariableAccess(self, short_name, variable_accesses: Dict[str, VariableAccess]):
|
|
81
|
+
if (short_name not in self.elements):
|
|
82
|
+
variable_access = VariableAccess(self, short_name)
|
|
83
|
+
variable_accesses[short_name] = variable_access
|
|
84
|
+
return variable_accesses[short_name]
|
|
85
|
+
|
|
86
|
+
def getArguments(self):
|
|
87
|
+
return self.arguments
|
|
88
|
+
|
|
89
|
+
def addArgument(self, value):
|
|
90
|
+
self.arguments.append(value)
|
|
91
|
+
return self
|
|
92
|
+
|
|
93
|
+
def getCanBeInvokedConcurrently(self):
|
|
94
|
+
return self.canBeInvokedConcurrently
|
|
95
|
+
|
|
96
|
+
def setCanBeInvokedConcurrently(self, value):
|
|
97
|
+
self.canBeInvokedConcurrently = value
|
|
98
|
+
return self
|
|
99
|
+
|
|
100
|
+
def createDataReadAccess(self, short_name: str) -> VariableAccess:
|
|
101
|
+
return self._createVariableAccess(short_name, self.dataReadAccesses)
|
|
102
|
+
|
|
103
|
+
def getDataReadAccesses(self) -> List[VariableAccess]:
|
|
104
|
+
return sorted(self.dataReadAccesses.values(), key=lambda v: v.short_name)
|
|
105
|
+
|
|
106
|
+
def createDataWriteAccess(self, short_name: str) -> VariableAccess:
|
|
107
|
+
return self._createVariableAccess(short_name, self.dataWriteAccesses)
|
|
108
|
+
|
|
109
|
+
def getDataWriteAccesses(self) -> List[VariableAccess]:
|
|
110
|
+
return sorted(self.dataWriteAccesses.values(), key=lambda v: v.short_name)
|
|
111
|
+
|
|
112
|
+
def createDataReceivePointByArgument(self, short_name: str) -> VariableAccess:
|
|
113
|
+
return self._createVariableAccess(short_name, self.dataReceivePointByArguments)
|
|
114
|
+
|
|
115
|
+
def getDataReceivePointByArguments(self) -> List[VariableAccess]:
|
|
116
|
+
return sorted(self.dataReceivePointByArguments.values(), key=lambda v: v.short_name)
|
|
117
|
+
|
|
118
|
+
def createDataReceivePointByValue(self, short_name: str) -> VariableAccess:
|
|
119
|
+
return self._createVariableAccess(short_name, self.dataReceivePointByValues)
|
|
120
|
+
|
|
121
|
+
def getDataReceivePointByValues(self) -> List[VariableAccess]:
|
|
122
|
+
return sorted(self.dataReceivePointByValues.values(), key=lambda v: v.short_name)
|
|
123
|
+
|
|
124
|
+
def createDataSendPoint(self, short_name: str) -> VariableAccess:
|
|
125
|
+
return self._createVariableAccess(short_name, self.dataSendPoints)
|
|
126
|
+
|
|
127
|
+
def getDataSendPoints(self) -> List[VariableAccess]:
|
|
128
|
+
return sorted(self.dataSendPoints.values(), key=lambda v: v.short_name)
|
|
129
|
+
|
|
130
|
+
def createReadLocalVariable(self, short_name: str) -> VariableAccess:
|
|
131
|
+
return self._createVariableAccess(short_name, self.readLocalVariables)
|
|
132
|
+
|
|
133
|
+
def getReadLocalVariables(self) -> List[VariableAccess]:
|
|
134
|
+
return sorted(self.readLocalVariables.values(), key=lambda v: v.short_name)
|
|
135
|
+
|
|
136
|
+
def createWrittenLocalVariable(self, short_name: str) -> VariableAccess:
|
|
137
|
+
return self._createVariableAccess(short_name, self.writtenLocalVariables)
|
|
138
|
+
|
|
139
|
+
def getWrittenLocalVariables(self) -> List[VariableAccess]:
|
|
140
|
+
return sorted(self.writtenLocalVariables.values(), key=lambda v: v.short_name)
|
|
141
|
+
|
|
142
|
+
def getParameterAccesses(self) -> List[ParameterAccess]:
|
|
143
|
+
return list(sorted(filter(lambda a: isinstance(a, ParameterAccess), self.elements.values()), key= lambda o:o.short_name))
|
|
144
|
+
|
|
145
|
+
def createParameterAccess(self, short_name: str) -> ParameterAccess:
|
|
146
|
+
if (short_name not in self.elements):
|
|
147
|
+
access = ParameterAccess(self, short_name)
|
|
148
|
+
self.elements[short_name] = access
|
|
149
|
+
return self.elements[short_name]
|
|
150
|
+
|
|
151
|
+
def createSynchronousServerCallPoint(self, short_name: str) -> SynchronousServerCallPoint:
|
|
152
|
+
if (short_name not in self.serverCallPoints):
|
|
153
|
+
server_call_point = SynchronousServerCallPoint(self, short_name)
|
|
154
|
+
self.serverCallPoints[short_name] = server_call_point
|
|
155
|
+
return self.serverCallPoints[short_name]
|
|
156
|
+
|
|
157
|
+
def createAsynchronousServerCallPoint(self, short_name: str) -> AsynchronousServerCallPoint:
|
|
158
|
+
if (short_name not in self.serverCallPoints):
|
|
159
|
+
server_call_point = AsynchronousServerCallPoint(self, short_name)
|
|
160
|
+
self.serverCallPoints[short_name] = server_call_point
|
|
161
|
+
return self.serverCallPoints[short_name]
|
|
162
|
+
|
|
163
|
+
def getSynchronousServerCallPoint(self) -> List[ServerCallPoint]:
|
|
164
|
+
return filter(lambda o: isinstance(o, SynchronousServerCallPoint), self.getServerCallPoints())
|
|
165
|
+
|
|
166
|
+
def getAsynchronousServerCallPoint(self) -> List[ServerCallPoint]:
|
|
167
|
+
return filter(lambda o: isinstance(o, AsynchronousServerCallPoint), self.getServerCallPoints())
|
|
168
|
+
|
|
169
|
+
def getServerCallPoints(self) -> List[ServerCallPoint]:
|
|
170
|
+
return sorted(self.serverCallPoints.values(), key=lambda v: v.short_name)
|
|
171
|
+
|
|
172
|
+
def createInternalTriggeringPoint(self, short_name: str) -> InternalTriggeringPoint:
|
|
173
|
+
if (short_name not in self.elements):
|
|
174
|
+
point = InternalTriggeringPoint(self, short_name)
|
|
175
|
+
self.elements[point.short_name] = point
|
|
176
|
+
return self.elements[point.short_name]
|
|
177
|
+
|
|
178
|
+
def getInternalTriggeringPoints(self) -> List[InternalTriggeringPoint]:
|
|
179
|
+
return filter(lambda o: isinstance(o, InternalTriggeringPoint), self.elements)
|
|
180
|
+
|
|
181
|
+
def getModeAccessPoints(self) -> List[ModeAccessPoint]:
|
|
182
|
+
return self.modeAccessPoints
|
|
183
|
+
|
|
184
|
+
def addModeAccessPoint(self, value):
|
|
185
|
+
self.modeAccessPoints.append(value)
|
|
186
|
+
|
|
187
|
+
def getModeSwitchPoints(self) -> List[ModeSwitchPoint]:
|
|
188
|
+
return list(sorted(filter(lambda a: isinstance(a, ModeSwitchPoint), self.elements.values()), key= lambda o:o.short_name))
|
|
189
|
+
|
|
190
|
+
def createModeSwitchPoint(self, short_name: str) -> ModeSwitchPoint:
|
|
191
|
+
if (short_name not in self.elements):
|
|
192
|
+
access = ModeSwitchPoint(self, short_name)
|
|
193
|
+
self.elements[short_name] = access
|
|
194
|
+
self.modeSwitchPoints.append(access)
|
|
195
|
+
return self.elements[short_name]
|
|
196
|
+
|
|
197
|
+
def getSymbol(self):
|
|
198
|
+
return self.symbol
|
|
199
|
+
|
|
200
|
+
def setSymbol(self, value):
|
|
201
|
+
self.symbol = value
|
|
202
|
+
return self
|
|
203
|
+
|
armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
|
|
3
|
+
from .....general_structure import Identifiable
|
|
4
|
+
from .....ar_object import ARObject
|
|
5
|
+
|
|
6
|
+
class AbstractAccessPoint(Identifiable, metaclass = ABCMeta):
|
|
7
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
8
|
+
if type(self) == AbstractAccessPoint:
|
|
9
|
+
raise NotImplementedError("ARObject is an abstract class.")
|
|
10
|
+
|
|
11
|
+
super().__init__(parent, short_name)
|
|
12
|
+
|
|
13
|
+
self.return_value_provision = None
|
armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
from .access_count import AbstractAccessPoint
|
|
4
|
+
|
|
5
|
+
from .....general_structure import Identifiable
|
|
6
|
+
from ....msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
7
|
+
from .....ar_ref import AutosarParameterRef, AutosarVariableRef
|
|
8
|
+
from .....ar_object import ARObject
|
|
9
|
+
|
|
10
|
+
class ParameterAccess(AbstractAccessPoint):
|
|
11
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
12
|
+
super().__init__(parent, short_name)
|
|
13
|
+
|
|
14
|
+
self.accessedParameter = None # type: AutosarParameterRef
|
|
15
|
+
self.swDataDefProps = None # type: SwDataDefProps
|
|
16
|
+
|
|
17
|
+
def getAccessedParameter(self):
|
|
18
|
+
return self.accessedParameter
|
|
19
|
+
|
|
20
|
+
def setAccessedParameter(self, value):
|
|
21
|
+
self.accessedParameter = value
|
|
22
|
+
return self
|
|
23
|
+
|
|
24
|
+
def getSwDataDefProps(self):
|
|
25
|
+
return self.swDataDefProps
|
|
26
|
+
|
|
27
|
+
def setSwDataDefProps(self, value):
|
|
28
|
+
self.swDataDefProps = value
|
|
29
|
+
return self
|
|
30
|
+
|
|
31
|
+
class VariableAccess(Identifiable):
|
|
32
|
+
def __init__(self, parent: ARObject, short_name):
|
|
33
|
+
super().__init__(parent, short_name)
|
|
34
|
+
|
|
35
|
+
#self.accessedVariableRef = AutosarVariableRef() # type: AutosarVariableRef
|
|
36
|
+
#self.accessedVariableRef.parent = self
|
|
37
|
+
#self.localVariableRef = None # type: RefType
|
|
38
|
+
|
|
39
|
+
self.accessedVariableRef = None # type: AutosarVariableRef
|
|
40
|
+
self.scope = None # type: ARLiteral
|
|
41
|
+
|
|
42
|
+
def getAccessedVariableRef(self):
|
|
43
|
+
return self.accessedVariableRef
|
|
44
|
+
|
|
45
|
+
def setAccessedVariableRef(self, value):
|
|
46
|
+
self.accessedVariableRef = value
|
|
47
|
+
return self
|
|
48
|
+
|
|
49
|
+
def getScope(self):
|
|
50
|
+
return self.scope
|
|
51
|
+
|
|
52
|
+
def setScope(self, value):
|
|
53
|
+
self.scope = value
|
|
54
|
+
return self
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from .access_count import AbstractAccessPoint
|
|
2
|
+
from ...sw_component_template.components.instance_refs import PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef
|
|
3
|
+
from .....rpt_scenario import ModeAccessPointIdent
|
|
4
|
+
from .....ar_object import ARObject
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ModeAccessPoint(ARObject):
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
|
|
11
|
+
self.ident = None # type: ModeAccessPointIdent
|
|
12
|
+
self.modeGroupIRef = None # type: RModeGroupInAtomicSWCInstanceRef
|
|
13
|
+
|
|
14
|
+
def getIdent(self):
|
|
15
|
+
return self.ident
|
|
16
|
+
|
|
17
|
+
def setIdent(self, value):
|
|
18
|
+
self.ident = value
|
|
19
|
+
return self
|
|
20
|
+
|
|
21
|
+
def getModeGroupIRef(self):
|
|
22
|
+
return self.modeGroupIRef
|
|
23
|
+
|
|
24
|
+
def setModeGroupIRef(self, value):
|
|
25
|
+
self.modeGroupIRef = value
|
|
26
|
+
return self
|
|
27
|
+
|
|
28
|
+
class ModeSwitchPoint(AbstractAccessPoint):
|
|
29
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
30
|
+
super().__init__(parent, short_name)
|
|
31
|
+
|
|
32
|
+
self.modeGroupIRef = None # type: PModeGroupInAtomicSwcInstanceRef
|
|
33
|
+
|
|
34
|
+
def getModeGroupIRef(self):
|
|
35
|
+
return self.modeGroupIRef
|
|
36
|
+
|
|
37
|
+
def setModeGroupIRef(self, value):
|
|
38
|
+
self.modeGroupIRef = value
|
|
39
|
+
return self
|