armodel 1.6.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/data_models/sw_connector.py +3 -3
- armodel/models/__init__.py +4 -2
- armodel/models/ar_object.py +1 -1
- armodel/models/ar_package.py +185 -151
- armodel/models/ar_ref.py +0 -202
- armodel/models/common_structure.py +3 -71
- armodel/models/communication.py +1 -1
- armodel/models/datatype.py +5 -69
- armodel/models/end_to_end_protection.py +1 -1
- armodel/models/general_structure.py +10 -4
- armodel/models/internal_behavior.py +1 -1
- 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 +2 -1
- 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/communication.py +44 -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 +33 -1
- 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/swc_internal_behavior/data_elements.py +3 -11
- 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 +1 -2
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py +5 -4
- armodel/models/m2/autosar_templates/system_template/instance_refs.py +48 -0
- armodel/models/m2_msr.py +1 -0
- armodel/models/port_prototype.py +1 -90
- armodel/models/service_needs.py +3 -1
- armodel/models/sw_component.py +6 -143
- armodel/parser/__init__.py +2 -1
- armodel/parser/arxml_parser.py +124 -58
- armodel/parser/file_parser.py +43 -0
- armodel/tests/test_armodel/models/test_ar_package.py +5 -2
- armodel/tests/test_armodel/models/test_ar_ref.py +15 -13
- armodel/tests/test_armodel/models/test_common_structure.py +6 -5
- armodel/tests/test_armodel/models/test_data_prototype.py +1 -1
- armodel/tests/test_armodel/models/test_datatype.py +8 -8
- armodel/tests/test_armodel/models/test_port_interface.py +1 -1
- armodel/tests/test_armodel/parser/test_sw_components.py +1 -1
- armodel/writer/abstract_arxml_writer.py +5 -1
- armodel/writer/arxml_writer.py +68 -58
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/METADATA +5 -1
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/RECORD +52 -39
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/LICENSE +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/WHEEL +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/entry_points.txt +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/top_level.txt +0 -0
armodel/models/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@ from .ar_package import *
|
|
|
7
7
|
from .ar_ref import *
|
|
8
8
|
from .datatype import *
|
|
9
9
|
from .port_prototype import *
|
|
10
|
-
from .
|
|
10
|
+
from .m2.autosar_templates.sw_component_template.data_type.data_prototypes import *
|
|
11
11
|
from .m2.msr.asam_hdo.units import *
|
|
12
12
|
from .m2.msr.data_dictionary.data_def_properties import *
|
|
13
13
|
from .m2.msr.data_dictionary.auxillary_objects import *
|
|
@@ -19,4 +19,6 @@ from .communication import *
|
|
|
19
19
|
from .calibration import *
|
|
20
20
|
from .global_constraints import *
|
|
21
21
|
from .m2.msr.asam_hdo.units import *
|
|
22
|
-
from .m2.autosar_templates.sw_component_template import *
|
|
22
|
+
from .m2.autosar_templates.sw_component_template import *
|
|
23
|
+
from .m2.autosar_templates.sw_component_template.components import *
|
|
24
|
+
from .m2.autosar_templates.sw_component_template.composition import *
|
armodel/models/ar_object.py
CHANGED
armodel/models/ar_package.py
CHANGED
|
@@ -6,23 +6,26 @@ from .fibex.can_communication import CanFrame
|
|
|
6
6
|
from .fibex.fibex_4_multiplatform import Gateway
|
|
7
7
|
from .fibex.lin_communication import LinUnconditionalFrame
|
|
8
8
|
|
|
9
|
-
from .m2.msr.asam_hdo.units import PhysicalDimension
|
|
9
|
+
from .m2.msr.asam_hdo.units import PhysicalDimension, Unit
|
|
10
10
|
from .m2.msr.data_dictionary.auxillary_objects import SwAddrMethod
|
|
11
11
|
from .m2.autosar_templates.common_structure import ConstantSpecification
|
|
12
|
+
from .m2.autosar_templates.common_structure.implementation_data_types import ImplementationDataType
|
|
12
13
|
from .m2.autosar_templates.ecuc_description_template import EcucModuleConfigurationValues, EcucValueCollection
|
|
13
14
|
from .m2.autosar_templates.system_template import System
|
|
14
15
|
from .m2.autosar_templates.system_template.transport_protocols import CanTpConfig
|
|
15
16
|
from .m2.autosar_templates.system_template.network_management import NmConfig
|
|
17
|
+
from .m2.autosar_templates.sw_component_template.composition import CompositionSwComponentType
|
|
18
|
+
from .m2.autosar_templates.sw_component_template.port_interface import ClientServerInterface, ModeSwitchInterface, ParameterInterface, SenderReceiverInterface, TriggerInterface
|
|
19
|
+
from .m2.autosar_templates.sw_component_template.components import SwComponentType
|
|
16
20
|
|
|
17
21
|
from .timing import SwcTiming
|
|
18
22
|
from .record_layout import SwRecordLayout
|
|
19
23
|
from .end_to_end_protection import EndToEndProtectionSet
|
|
20
|
-
from .m2.msr.asam_hdo.units import Unit
|
|
21
24
|
from .general_structure import Identifiable, ARObject, Referrable, CollectableElement, SwcBswMapping
|
|
22
|
-
|
|
23
|
-
from .sw_component import
|
|
24
|
-
from .sw_component import ServiceSwComponentType,
|
|
25
|
-
from .datatype import ApplicationArrayDataType,
|
|
25
|
+
|
|
26
|
+
from .sw_component import EcuAbstractionSwComponentType, AtomicSwComponentType, ApplicationSwComponentType
|
|
27
|
+
from .sw_component import ServiceSwComponentType, SensorActuatorSwComponentType, ComplexDeviceDriverSwComponentType
|
|
28
|
+
from .datatype import ApplicationArrayDataType, ApplicationDataType, DataTypeMappingSet, DataTypeMap, SwBaseType, ApplicationPrimitiveDataType, ApplicationRecordDataType
|
|
26
29
|
from .m2_msr import CompuMethod
|
|
27
30
|
from .common_structure import ModeDeclarationGroup
|
|
28
31
|
from .implementation import BswImplementation, SwcImplementation, Implementation
|
|
@@ -56,318 +59,324 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
56
59
|
if (short_name in self._ar_packages):
|
|
57
60
|
return self._ar_packages[short_name]
|
|
58
61
|
return CollectableElement.getElement(self, short_name)
|
|
59
|
-
|
|
62
|
+
|
|
60
63
|
def createEcuAbstractionSwComponentType(self, short_name: str) -> EcuAbstractionSwComponentType:
|
|
61
64
|
if (short_name not in self.elements):
|
|
62
65
|
sw_component = EcuAbstractionSwComponentType(self, short_name)
|
|
63
|
-
self.
|
|
64
|
-
return self.
|
|
66
|
+
self.addElement(sw_component)
|
|
67
|
+
return self.getElement(short_name)
|
|
65
68
|
|
|
66
69
|
def createApplicationSwComponentType(self, short_name: str) -> ApplicationSwComponentType:
|
|
67
70
|
if short_name not in self.elements:
|
|
68
71
|
sw_component = ApplicationSwComponentType(self, short_name)
|
|
69
|
-
self.
|
|
70
|
-
return self.
|
|
72
|
+
self.addElement(sw_component)
|
|
73
|
+
return self.getElement(short_name)
|
|
71
74
|
|
|
72
75
|
def createComplexDeviceDriverSwComponentType(self, short_name: str) -> ComplexDeviceDriverSwComponentType:
|
|
73
76
|
if short_name not in self.elements:
|
|
74
77
|
sw_component = ComplexDeviceDriverSwComponentType(self, short_name)
|
|
75
|
-
self.
|
|
76
|
-
return self.
|
|
78
|
+
self.addElement(sw_component)
|
|
79
|
+
return self.getElement(short_name)
|
|
77
80
|
|
|
78
81
|
def createServiceSwComponentType(self, short_name: str) -> ServiceSwComponentType:
|
|
79
82
|
if (short_name not in self.elements):
|
|
80
83
|
sw_component = ServiceSwComponentType(self, short_name)
|
|
81
|
-
self.
|
|
82
|
-
return self.
|
|
84
|
+
self.addElement(sw_component)
|
|
85
|
+
return self.getElement(short_name)
|
|
83
86
|
|
|
84
87
|
def createSensorActuatorSwComponentType(self, short_name: str) -> SensorActuatorSwComponentType:
|
|
85
88
|
if (short_name not in self.elements):
|
|
86
89
|
sw_component = SensorActuatorSwComponentType(self, short_name)
|
|
87
|
-
self.
|
|
88
|
-
return self.
|
|
90
|
+
self.addElement(sw_component)
|
|
91
|
+
return self.getElement(short_name)
|
|
89
92
|
|
|
90
93
|
def createCompositionSwComponentType(self, short_name: str) -> CompositionSwComponentType:
|
|
91
94
|
if (short_name not in self.elements):
|
|
92
95
|
sw_component = CompositionSwComponentType(self, short_name)
|
|
93
|
-
self.
|
|
94
|
-
return self.
|
|
96
|
+
self.addElement(sw_component)
|
|
97
|
+
return self.getElement(short_name)
|
|
95
98
|
|
|
96
99
|
def createSenderReceiverInterface(self, short_name: str) -> SenderReceiverInterface:
|
|
97
100
|
if (short_name not in self.elements):
|
|
98
101
|
sr_interface = SenderReceiverInterface(self, short_name)
|
|
99
|
-
self.
|
|
100
|
-
return self.
|
|
102
|
+
self.addElement(sr_interface)
|
|
103
|
+
return self.getElement(short_name)
|
|
104
|
+
|
|
105
|
+
def createParameterInterface(self, short_name: str) -> ParameterInterface:
|
|
106
|
+
if (short_name not in self.elements):
|
|
107
|
+
sr_interface = ParameterInterface(self, short_name)
|
|
108
|
+
self.addElement(sr_interface)
|
|
109
|
+
return self.getElement(short_name)
|
|
101
110
|
|
|
102
111
|
def createClientServerInterface(self, short_name: str) -> ClientServerInterface:
|
|
103
112
|
if (short_name not in self.elements):
|
|
104
|
-
|
|
105
|
-
self.
|
|
106
|
-
return self.
|
|
113
|
+
cs_interface = ClientServerInterface(self, short_name)
|
|
114
|
+
self.addElement(cs_interface)
|
|
115
|
+
return self.getElement(short_name)
|
|
107
116
|
|
|
108
117
|
def createApplicationPrimitiveDataType(self, short_name: str) -> ApplicationPrimitiveDataType:
|
|
109
118
|
if (short_name not in self.elements):
|
|
110
119
|
data_type = ApplicationPrimitiveDataType(self, short_name)
|
|
111
|
-
self.
|
|
112
|
-
return self.
|
|
120
|
+
self.addElement(data_type)
|
|
121
|
+
return self.getElement(short_name)
|
|
113
122
|
|
|
114
123
|
def createApplicationRecordDataType(self, short_name: str) -> ApplicationPrimitiveDataType:
|
|
115
124
|
if (short_name not in self.elements):
|
|
116
125
|
data_type = ApplicationRecordDataType(self, short_name)
|
|
117
|
-
self.
|
|
118
|
-
return self.
|
|
126
|
+
self.addElement(data_type)
|
|
127
|
+
return self.getElement(short_name)
|
|
119
128
|
|
|
120
129
|
def createImplementationDataType(self, short_name: str) -> ImplementationDataType:
|
|
121
130
|
if (short_name not in self.elements):
|
|
122
131
|
data_type = ImplementationDataType(self, short_name)
|
|
123
|
-
self.
|
|
124
|
-
return self.
|
|
132
|
+
self.addElement(data_type)
|
|
133
|
+
return self.getElement(short_name)
|
|
125
134
|
|
|
126
135
|
def createSwBaseType(self, short_name: str) -> SwBaseType:
|
|
127
136
|
if (short_name not in self.elements):
|
|
128
137
|
base_type = SwBaseType(self, short_name)
|
|
129
|
-
self.
|
|
130
|
-
return self.
|
|
138
|
+
self.addElement(base_type)
|
|
139
|
+
return self.getElement(short_name)
|
|
131
140
|
|
|
132
141
|
def createDataTypeMappingSet(self, short_name: str) -> DataTypeMappingSet:
|
|
133
142
|
if (short_name not in self.elements):
|
|
134
143
|
mapping_set = DataTypeMappingSet(self, short_name)
|
|
135
|
-
self.
|
|
136
|
-
return self.
|
|
144
|
+
self.addElement(mapping_set)
|
|
145
|
+
return self.getElement(short_name)
|
|
137
146
|
|
|
138
147
|
def createCompuMethod(self, short_name: str) -> CompuMethod:
|
|
139
148
|
if (short_name not in self.elements):
|
|
140
149
|
compu_method = CompuMethod(self, short_name)
|
|
141
|
-
self.
|
|
142
|
-
return self.
|
|
150
|
+
self.addElement(compu_method)
|
|
151
|
+
return self.getElement(short_name)
|
|
143
152
|
|
|
144
153
|
def createBswModuleDescription(self, short_name: str) -> BswModuleDescription:
|
|
145
154
|
if (short_name not in self.elements):
|
|
146
|
-
|
|
147
|
-
self.
|
|
148
|
-
return self.
|
|
155
|
+
desc = BswModuleDescription(self, short_name)
|
|
156
|
+
self.addElement(desc)
|
|
157
|
+
return self.getElement(short_name)
|
|
149
158
|
|
|
150
159
|
def createBswModuleEntry(self, short_name: str) -> BswModuleEntry:
|
|
151
160
|
if (short_name not in self.elements):
|
|
152
161
|
entry = BswModuleEntry(self, short_name)
|
|
153
|
-
self.
|
|
154
|
-
return self.
|
|
162
|
+
self.addElement(entry)
|
|
163
|
+
return self.getElement(short_name)
|
|
155
164
|
|
|
156
165
|
def createBswImplementation(self, short_name: str) -> BswImplementation:
|
|
157
166
|
if (short_name not in self.elements):
|
|
158
|
-
|
|
159
|
-
self.
|
|
160
|
-
return self.
|
|
167
|
+
impl = BswImplementation(self, short_name)
|
|
168
|
+
self.addElement(impl)
|
|
169
|
+
return self.getElement(short_name)
|
|
161
170
|
|
|
162
171
|
def createSwcImplementation(self, short_name: str) -> SwcImplementation:
|
|
163
172
|
if (short_name not in self.elements):
|
|
164
|
-
|
|
165
|
-
self.
|
|
166
|
-
return self.
|
|
173
|
+
impl = SwcImplementation(self, short_name)
|
|
174
|
+
self.addElement(impl)
|
|
175
|
+
return self.getElement(short_name)
|
|
167
176
|
|
|
168
177
|
def createSwcBswMapping(self, short_name: str) -> SwcBswMapping:
|
|
169
178
|
if (short_name not in self.elements):
|
|
170
179
|
mapping = SwcBswMapping(self, short_name)
|
|
171
|
-
self.
|
|
172
|
-
return self.
|
|
180
|
+
self.addElement(mapping)
|
|
181
|
+
return self.getElement(short_name)
|
|
173
182
|
|
|
174
183
|
def createConstantSpecification(self, short_name: str) -> ConstantSpecification:
|
|
175
184
|
if (short_name not in self.elements):
|
|
176
185
|
spec = ConstantSpecification(self, short_name)
|
|
177
|
-
self.
|
|
178
|
-
return self.
|
|
186
|
+
self.addElement(spec)
|
|
187
|
+
return self.getElement(short_name)
|
|
179
188
|
|
|
180
189
|
def createDataConstr(self, short_name: str) -> DataConstr:
|
|
181
190
|
if (short_name not in self.elements):
|
|
182
191
|
constr = DataConstr(self, short_name)
|
|
183
|
-
self.
|
|
184
|
-
return self.
|
|
192
|
+
self.addElement(constr)
|
|
193
|
+
return self.getElement(short_name)
|
|
185
194
|
|
|
186
195
|
def createUnit(self, short_name: str) -> Unit:
|
|
187
196
|
if (short_name not in self.elements):
|
|
188
197
|
unit = Unit(self, short_name)
|
|
189
|
-
self.
|
|
190
|
-
return self.
|
|
198
|
+
self.addElement(unit)
|
|
199
|
+
return self.getElement(short_name)
|
|
191
200
|
|
|
192
201
|
def createEndToEndProtectionSet(self, short_name: str) -> EndToEndProtectionSet:
|
|
193
202
|
if (short_name not in self.elements):
|
|
194
|
-
|
|
195
|
-
self.
|
|
196
|
-
return self.
|
|
203
|
+
e2d_set = EndToEndProtectionSet(self, short_name)
|
|
204
|
+
self.addElement(e2d_set)
|
|
205
|
+
return self.getElement(short_name)
|
|
197
206
|
|
|
198
207
|
def createApplicationArrayDataType(self, short_name: str) -> ApplicationArrayDataType:
|
|
199
208
|
if (short_name not in self.elements):
|
|
200
209
|
data_type = ApplicationArrayDataType(self, short_name)
|
|
201
|
-
self.
|
|
202
|
-
return self.
|
|
210
|
+
self.addElement(data_type)
|
|
211
|
+
return self.getElement(short_name)
|
|
203
212
|
|
|
204
213
|
def createSwRecordLayout(self, short_name: str) -> SwRecordLayout:
|
|
205
214
|
if (short_name not in self.elements):
|
|
206
215
|
layout = SwRecordLayout(self, short_name)
|
|
207
|
-
self.
|
|
208
|
-
return self.
|
|
216
|
+
self.addElement(layout)
|
|
217
|
+
return self.getElement(short_name)
|
|
209
218
|
|
|
210
219
|
def createSwAddrMethod(self, short_name: str) -> SwAddrMethod:
|
|
211
220
|
if (short_name not in self.elements):
|
|
212
221
|
method = SwAddrMethod(self, short_name)
|
|
213
|
-
self.
|
|
214
|
-
return self.
|
|
222
|
+
self.addElement(method)
|
|
223
|
+
return self.getElement(short_name)
|
|
215
224
|
|
|
216
225
|
def createTriggerInterface(self, short_name: str) -> TriggerInterface:
|
|
217
226
|
if (short_name not in self.elements):
|
|
218
227
|
trigger_interface = TriggerInterface(self, short_name)
|
|
219
|
-
self.
|
|
220
|
-
return
|
|
228
|
+
self.addElement(trigger_interface)
|
|
229
|
+
return trigger_interface
|
|
221
230
|
|
|
222
231
|
def createModeDeclarationGroup(self, short_name: str) -> ModeDeclarationGroup:
|
|
223
232
|
if (short_name not in self.elements):
|
|
224
233
|
group = ModeDeclarationGroup(self, short_name)
|
|
225
|
-
self.
|
|
226
|
-
return self.
|
|
234
|
+
self.addElement(group)
|
|
235
|
+
return self.getElement(short_name)
|
|
227
236
|
|
|
228
237
|
def createModeSwitchInterface(self, short_name: str) -> ModeSwitchInterface:
|
|
229
238
|
if (short_name not in self.elements):
|
|
230
239
|
switch_interface = ModeSwitchInterface(self, short_name)
|
|
231
|
-
self.
|
|
232
|
-
return self.
|
|
240
|
+
self.addElement(switch_interface)
|
|
241
|
+
return self.getElement(short_name)
|
|
233
242
|
|
|
234
243
|
def createSwcTiming(self, short_name: str) -> SwcTiming:
|
|
235
244
|
if (short_name not in self.elements):
|
|
236
245
|
timing = SwcTiming(self, short_name)
|
|
237
|
-
self.
|
|
238
|
-
return self.
|
|
246
|
+
self.addElement(timing)
|
|
247
|
+
return self.getElement(short_name)
|
|
239
248
|
|
|
240
249
|
def createLinCluster(self, short_name: str) -> LinCluster:
|
|
241
250
|
if (short_name not in self.elements):
|
|
242
251
|
cluster = LinCluster(self, short_name)
|
|
243
|
-
self.
|
|
244
|
-
return self.
|
|
252
|
+
self.addElement(cluster)
|
|
253
|
+
return self.getElement(short_name)
|
|
245
254
|
|
|
246
255
|
def createCanCluster(self, short_name: str) -> CanCluster:
|
|
247
256
|
if (short_name not in self.elements):
|
|
248
257
|
cluster = CanCluster(self, short_name)
|
|
249
|
-
self.
|
|
250
|
-
return self.
|
|
258
|
+
self.addElement(cluster)
|
|
259
|
+
return self.getElement(short_name)
|
|
251
260
|
|
|
252
261
|
def createLinUnconditionalFrame(self, short_name: str) -> LinUnconditionalFrame:
|
|
253
262
|
if (short_name not in self.elements):
|
|
254
263
|
frame = LinUnconditionalFrame(self, short_name)
|
|
255
|
-
self.
|
|
256
|
-
return self.
|
|
264
|
+
self.addElement(frame)
|
|
265
|
+
return self.getElement(short_name)
|
|
257
266
|
|
|
258
267
|
def createNmPdu(self, short_name: str) -> NmPdu:
|
|
259
268
|
if (short_name not in self.elements):
|
|
260
|
-
|
|
261
|
-
self.
|
|
262
|
-
return self.
|
|
269
|
+
element = NmPdu(self, short_name)
|
|
270
|
+
self.addElement(element)
|
|
271
|
+
return self.getElement(short_name)
|
|
263
272
|
|
|
264
273
|
def createNPdu(self, short_name: str) -> NPdu:
|
|
265
274
|
if (short_name not in self.elements):
|
|
266
|
-
|
|
267
|
-
self.
|
|
268
|
-
return self.
|
|
275
|
+
element = NPdu(self, short_name)
|
|
276
|
+
self.addElement(element)
|
|
277
|
+
return self.getElement(short_name)
|
|
269
278
|
|
|
270
279
|
def createDcmIPdu(self, short_name: str) -> DcmIPdu:
|
|
271
280
|
if (short_name not in self.elements):
|
|
272
|
-
|
|
273
|
-
self.
|
|
274
|
-
return self.
|
|
281
|
+
element = DcmIPdu(self, short_name)
|
|
282
|
+
self.addElement(element)
|
|
283
|
+
return self.getElement(short_name)
|
|
275
284
|
|
|
276
285
|
def createSecuredIPdu(self, short_name: str) -> SecuredIPdu:
|
|
277
286
|
if (short_name not in self.elements):
|
|
278
|
-
|
|
279
|
-
self.
|
|
280
|
-
return self.
|
|
287
|
+
element = SecuredIPdu(self, short_name)
|
|
288
|
+
self.addElement(element)
|
|
289
|
+
return self.getElement(short_name)
|
|
281
290
|
|
|
282
291
|
def createNmConfig(self, short_name: str) -> NmConfig:
|
|
283
292
|
if (short_name not in self.elements):
|
|
284
|
-
|
|
285
|
-
self.
|
|
286
|
-
return self.
|
|
293
|
+
element = NmConfig(self, short_name)
|
|
294
|
+
self.addElement(element)
|
|
295
|
+
return self.getElement(short_name)
|
|
287
296
|
|
|
288
297
|
def createCanTpConfig(self, short_name: str) -> CanTpConfig:
|
|
289
298
|
if (short_name not in self.elements):
|
|
290
|
-
|
|
291
|
-
self.
|
|
292
|
-
return self.
|
|
299
|
+
element = CanTpConfig(self, short_name)
|
|
300
|
+
self.addElement(element)
|
|
301
|
+
return self.getElement(short_name)
|
|
293
302
|
|
|
294
303
|
def createCanFrame(self, short_name: str) -> CanFrame:
|
|
295
304
|
if (short_name not in self.elements):
|
|
296
|
-
|
|
297
|
-
self.
|
|
298
|
-
return self.
|
|
305
|
+
element = CanFrame(self, short_name)
|
|
306
|
+
self.addElement(element)
|
|
307
|
+
return self.getElement(short_name)
|
|
299
308
|
|
|
300
309
|
def createEcuInstance(self, short_name: str) -> EcuInstance:
|
|
301
310
|
if (short_name not in self.elements):
|
|
302
|
-
|
|
303
|
-
self.
|
|
304
|
-
return self.
|
|
311
|
+
element = EcuInstance(self, short_name)
|
|
312
|
+
self.addElement(element)
|
|
313
|
+
return self.getElement(short_name)
|
|
305
314
|
|
|
306
315
|
def createGateway(self, short_name: str) -> Gateway:
|
|
307
316
|
if (short_name not in self.elements):
|
|
308
|
-
|
|
309
|
-
self.
|
|
310
|
-
return self.
|
|
317
|
+
element = Gateway(self, short_name)
|
|
318
|
+
self.addElement(element)
|
|
319
|
+
return self.getElement(short_name)
|
|
311
320
|
|
|
312
321
|
def createISignal(self, short_name: str) -> ISignal:
|
|
313
322
|
if (short_name not in self.elements):
|
|
314
|
-
|
|
315
|
-
self.
|
|
316
|
-
return self.
|
|
323
|
+
element = ISignal(self, short_name)
|
|
324
|
+
self.addElement(element)
|
|
325
|
+
return self.getElement(short_name)
|
|
317
326
|
|
|
318
327
|
def createSystemSignal(self, short_name: str) -> SystemSignal:
|
|
319
328
|
if (short_name not in self.elements):
|
|
320
|
-
|
|
321
|
-
self.
|
|
322
|
-
return self.
|
|
329
|
+
element = SystemSignal(self, short_name)
|
|
330
|
+
self.addElement(element)
|
|
331
|
+
return self.getElement(short_name)
|
|
323
332
|
|
|
324
333
|
def createSystemSignalGroup(self, short_name: str) -> SystemSignalGroup:
|
|
325
334
|
if (short_name not in self.elements):
|
|
326
|
-
|
|
327
|
-
self.
|
|
328
|
-
return self.
|
|
335
|
+
element = SystemSignalGroup(self, short_name)
|
|
336
|
+
self.addElement(element)
|
|
337
|
+
return self.getElement(short_name)
|
|
329
338
|
|
|
330
339
|
def createISignalIPdu(self, short_name: str) -> ISignalIPdu:
|
|
331
340
|
if (short_name not in self.elements):
|
|
332
|
-
|
|
333
|
-
self.
|
|
334
|
-
return self.
|
|
341
|
+
element = ISignalIPdu(self, short_name)
|
|
342
|
+
self.addElement(element)
|
|
343
|
+
return self.getElement(short_name)
|
|
335
344
|
|
|
336
345
|
def createEcucValueCollection(self, short_name: str) -> EcucValueCollection:
|
|
337
346
|
if (short_name not in self.elements):
|
|
338
|
-
|
|
339
|
-
self.
|
|
340
|
-
return self.
|
|
347
|
+
element = EcucValueCollection(self, short_name)
|
|
348
|
+
self.addElement(element)
|
|
349
|
+
return self.getElement(short_name)
|
|
341
350
|
|
|
342
351
|
def createEcucModuleConfigurationValues(self, short_name: str) -> EcucModuleConfigurationValues:
|
|
343
352
|
if (short_name not in self.elements):
|
|
344
|
-
|
|
345
|
-
self.
|
|
346
|
-
return self.
|
|
353
|
+
element = EcucModuleConfigurationValues(self, short_name)
|
|
354
|
+
self.addElement(element)
|
|
355
|
+
return self.getElement(short_name)
|
|
347
356
|
|
|
348
357
|
def createPhysicalDimension(self, short_name: str) -> PhysicalDimension:
|
|
349
358
|
if (short_name not in self.elements):
|
|
350
|
-
|
|
351
|
-
self.
|
|
352
|
-
return self.
|
|
359
|
+
element = PhysicalDimension(self, short_name)
|
|
360
|
+
self.addElement(element)
|
|
361
|
+
return self.getElement(short_name)
|
|
353
362
|
|
|
354
363
|
def createISignalGroup(self, short_name: str) -> ISignalGroup:
|
|
355
364
|
if (short_name not in self.elements):
|
|
356
|
-
|
|
357
|
-
self.
|
|
358
|
-
return self.
|
|
365
|
+
element = ISignalGroup(self, short_name)
|
|
366
|
+
self.addElement(element)
|
|
367
|
+
return self.getElement(short_name)
|
|
359
368
|
|
|
360
369
|
def createISignalIPduGroup(self, short_name: str) -> ISignalIPduGroup:
|
|
361
370
|
if (short_name not in self.elements):
|
|
362
|
-
|
|
363
|
-
self.
|
|
364
|
-
return self.
|
|
371
|
+
element = ISignalIPduGroup(self, short_name)
|
|
372
|
+
self.addElement(element)
|
|
373
|
+
return self.getElement(short_name)
|
|
365
374
|
|
|
366
375
|
def createSystem(self, short_name: str) -> System:
|
|
367
376
|
if (short_name not in self.elements):
|
|
368
|
-
|
|
369
|
-
self.
|
|
370
|
-
return self.
|
|
377
|
+
element = System(self, short_name)
|
|
378
|
+
self.addElement(element)
|
|
379
|
+
return self.getElement(short_name)
|
|
371
380
|
|
|
372
381
|
def getApplicationPrimitiveDataTypes(self) -> List[ApplicationPrimitiveDataType]:
|
|
373
382
|
return list(sorted(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()), key= lambda o:o.short_name))
|
|
@@ -397,13 +406,16 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
397
406
|
return list(sorted(filter(lambda a : isinstance(a, ComplexDeviceDriverSwComponentType), self.elements.values()), key = lambda a: a.short_name))
|
|
398
407
|
|
|
399
408
|
def getSenderReceiverInterfaces(self) -> List[SenderReceiverInterface]:
|
|
400
|
-
return list(filter(lambda a : isinstance(a, SenderReceiverInterface), self.elements.values()))
|
|
409
|
+
return list(sorted(filter(lambda a : isinstance(a, SenderReceiverInterface), self.elements.values()), key = lambda a: a.short_name))
|
|
410
|
+
|
|
411
|
+
def getParameterInterfaces(self) -> List[ParameterInterface]:
|
|
412
|
+
return list(sorted(filter(lambda a : isinstance(a, ParameterInterface), self.elements.values()), key = lambda a: a.short_name))
|
|
401
413
|
|
|
402
414
|
def getClientServerInterfaces(self) -> List[ClientServerInterface]:
|
|
403
|
-
return list(filter(lambda a : isinstance(a, ClientServerInterface), self.elements.values()))
|
|
415
|
+
return list(sorted(filter(lambda a : isinstance(a, ClientServerInterface), self.elements.values()), key = lambda a: a.short_name))
|
|
404
416
|
|
|
405
417
|
def getDataTypeMappingSets(self) -> List[DataTypeMappingSet]:
|
|
406
|
-
return list(filter(lambda a: isinstance(a, DataTypeMappingSet), self.elements.values()))
|
|
418
|
+
return list(sorted(filter(lambda a : isinstance(a, DataTypeMappingSet), self.elements.values()), key = lambda a: a.short_name))
|
|
407
419
|
|
|
408
420
|
def getCompuMethods(self) -> List[CompuMethod]:
|
|
409
421
|
return list(filter(lambda a: isinstance(a, CompuMethod), self.elements.values()))
|
|
@@ -519,26 +531,22 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
519
531
|
def getSystems(self) -> List[System]:
|
|
520
532
|
return list(sorted(filter(lambda a : isinstance(a, System), self.elements.values()), key = lambda a: a.short_name))
|
|
521
533
|
|
|
522
|
-
class
|
|
523
|
-
__instance = None
|
|
524
|
-
|
|
525
|
-
@staticmethod
|
|
526
|
-
def getInstance():
|
|
527
|
-
if (AUTOSAR.__instance == None):
|
|
528
|
-
AUTOSAR()
|
|
529
|
-
return AUTOSAR.__instance
|
|
530
|
-
|
|
534
|
+
class AbstractAUTOSAR(CollectableElement):
|
|
531
535
|
def __init__(self):
|
|
532
|
-
|
|
533
|
-
|
|
536
|
+
super().__init__()
|
|
537
|
+
|
|
534
538
|
CollectableElement.__init__(self)
|
|
535
539
|
|
|
536
540
|
self.schema_location = ""
|
|
537
541
|
self._appl_impl_type_maps = {}
|
|
538
542
|
self._impl_appl_type_maps = {}
|
|
539
|
-
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
self._ar_packages = {} # type: Dict[str, ARPackage]
|
|
546
|
+
self.short_name_mappings = {} # type: Dict[str, str]
|
|
540
547
|
|
|
541
|
-
|
|
548
|
+
def reload(self):
|
|
549
|
+
pass
|
|
542
550
|
|
|
543
551
|
@property
|
|
544
552
|
def full_name(self):
|
|
@@ -574,6 +582,9 @@ class AUTOSAR (CollectableElement):
|
|
|
574
582
|
return element
|
|
575
583
|
# raise ValueError("The %s of reference <%s> does not exist." % (short_name, referred_name))
|
|
576
584
|
return element
|
|
585
|
+
|
|
586
|
+
def findByShortName(self, short_name: str) -> Referrable:
|
|
587
|
+
pass
|
|
577
588
|
|
|
578
589
|
def getDataType(self, data_type: ImplementationDataType) -> ImplementationDataType:
|
|
579
590
|
if (isinstance(data_type, ImplementationDataType) or isinstance(data_type, SwBaseType)):
|
|
@@ -605,3 +616,26 @@ class AUTOSAR (CollectableElement):
|
|
|
605
616
|
raise IndexError("Invalid Implementation data type <%s>" % impl_data_type)
|
|
606
617
|
|
|
607
618
|
return self.find(self._impl_appl_type_maps[impl_data_type])
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
class AUTOSAR (AbstractAUTOSAR):
|
|
622
|
+
__instance = None
|
|
623
|
+
|
|
624
|
+
@staticmethod
|
|
625
|
+
def getInstance():
|
|
626
|
+
if (AUTOSAR.__instance == None):
|
|
627
|
+
AUTOSAR()
|
|
628
|
+
return AUTOSAR.__instance
|
|
629
|
+
|
|
630
|
+
def __init__(self):
|
|
631
|
+
if (AUTOSAR.__instance != None):
|
|
632
|
+
raise Exception("The AUTOSAR is singleton!")
|
|
633
|
+
|
|
634
|
+
AUTOSAR.__instance = self
|
|
635
|
+
|
|
636
|
+
super().__init__()
|
|
637
|
+
|
|
638
|
+
class AUTOSARDoc(AbstractAUTOSAR):
|
|
639
|
+
def __init__(self):
|
|
640
|
+
super().__init__()
|
|
641
|
+
|