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
armodel/models/ar_package.py
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
from typing import Dict, List
|
|
2
2
|
|
|
3
|
-
from .
|
|
3
|
+
from .fibex.fibex_core.core_topology import EcuInstance, CanCluster, LinCluster
|
|
4
|
+
from .fibex.fibex_core.core_communication import ISignalGroup, ISignalIPdu, ISignalIPduGroup, SecuredIPdu, SystemSignal, DcmIPdu, ISignal, NPdu, NmPdu, SystemSignalGroup
|
|
5
|
+
from .fibex.can_communication import CanFrame
|
|
6
|
+
from .fibex.fibex_4_multiplatform import Gateway
|
|
7
|
+
from .fibex.lin_communication import LinUnconditionalFrame
|
|
8
|
+
|
|
9
|
+
from .m2.msr.asam_hdo.units import PhysicalDimension
|
|
10
|
+
from .m2.msr.data_dictionary.auxillary_objects import SwAddrMethod
|
|
11
|
+
from .m2.autosar_templates.common_structure import ConstantSpecification
|
|
12
|
+
from .m2.autosar_templates.ecuc_description_template import EcucModuleConfigurationValues, EcucValueCollection
|
|
13
|
+
from .m2.autosar_templates.system_template import System
|
|
14
|
+
from .m2.autosar_templates.system_template.transport_protocols import CanTpConfig
|
|
15
|
+
from .m2.autosar_templates.system_template.network_management import NmConfig
|
|
16
|
+
|
|
17
|
+
from .timing import SwcTiming
|
|
4
18
|
from .record_layout import SwRecordLayout
|
|
5
19
|
from .end_to_end_protection import EndToEndProtectionSet
|
|
6
|
-
from .
|
|
20
|
+
from .m2.msr.asam_hdo.units import Unit
|
|
7
21
|
from .general_structure import Identifiable, ARObject, Referrable, CollectableElement, SwcBswMapping
|
|
8
|
-
from .port_interface import ModeSwitchInterface, SenderReceiverInterface, ClientServerInterface, TriggerInterface
|
|
22
|
+
from .m2.autosar_templates.sw_component_template.port_interface import ModeSwitchInterface, SenderReceiverInterface, ClientServerInterface, TriggerInterface
|
|
9
23
|
from .sw_component import SwComponentType, EcuAbstractionSwComponentType, AtomicSwComponentType, ApplicationSwComponentType
|
|
10
24
|
from .sw_component import ServiceSwComponentType, CompositionSwComponentType, SensorActuatorSwComponentType, ComplexDeviceDriverSwComponentType
|
|
11
25
|
from .datatype import ApplicationArrayDataType, ImplementationDataType, ApplicationDataType, DataTypeMappingSet, DataTypeMap, SwBaseType, ApplicationPrimitiveDataType, ApplicationRecordDataType
|
|
12
26
|
from .m2_msr import CompuMethod
|
|
13
|
-
from .common_structure import
|
|
27
|
+
from .common_structure import ModeDeclarationGroup
|
|
14
28
|
from .implementation import BswImplementation, SwcImplementation, Implementation
|
|
15
29
|
from .bsw_module_template import BswModuleDescription, BswModuleEntry
|
|
16
30
|
from .global_constraints import DataConstr
|
|
@@ -153,8 +167,8 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
153
167
|
|
|
154
168
|
def createSwcBswMapping(self, short_name: str) -> SwcBswMapping:
|
|
155
169
|
if (short_name not in self.elements):
|
|
156
|
-
|
|
157
|
-
self.elements[short_name] =
|
|
170
|
+
mapping = SwcBswMapping(self, short_name)
|
|
171
|
+
self.elements[short_name] = mapping
|
|
158
172
|
return self.elements[short_name]
|
|
159
173
|
|
|
160
174
|
def createConstantSpecification(self, short_name: str) -> ConstantSpecification:
|
|
@@ -165,14 +179,14 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
165
179
|
|
|
166
180
|
def createDataConstr(self, short_name: str) -> DataConstr:
|
|
167
181
|
if (short_name not in self.elements):
|
|
168
|
-
|
|
169
|
-
self.elements[short_name] =
|
|
182
|
+
constr = DataConstr(self, short_name)
|
|
183
|
+
self.elements[short_name] = constr
|
|
170
184
|
return self.elements[short_name]
|
|
171
185
|
|
|
172
186
|
def createUnit(self, short_name: str) -> Unit:
|
|
173
187
|
if (short_name not in self.elements):
|
|
174
|
-
|
|
175
|
-
self.elements[short_name] =
|
|
188
|
+
unit = Unit(self, short_name)
|
|
189
|
+
self.elements[short_name] = unit
|
|
176
190
|
return self.elements[short_name]
|
|
177
191
|
|
|
178
192
|
def createEndToEndProtectionSet(self, short_name: str) -> EndToEndProtectionSet:
|
|
@@ -183,48 +197,186 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
183
197
|
|
|
184
198
|
def createApplicationArrayDataType(self, short_name: str) -> ApplicationArrayDataType:
|
|
185
199
|
if (short_name not in self.elements):
|
|
186
|
-
|
|
187
|
-
self.elements[short_name] =
|
|
200
|
+
data_type = ApplicationArrayDataType(self, short_name)
|
|
201
|
+
self.elements[short_name] = data_type
|
|
188
202
|
return self.elements[short_name]
|
|
189
203
|
|
|
190
204
|
def createSwRecordLayout(self, short_name: str) -> SwRecordLayout:
|
|
191
205
|
if (short_name not in self.elements):
|
|
192
|
-
|
|
193
|
-
self.elements[short_name] =
|
|
206
|
+
layout = SwRecordLayout(self, short_name)
|
|
207
|
+
self.elements[short_name] = layout
|
|
194
208
|
return self.elements[short_name]
|
|
195
209
|
|
|
196
210
|
def createSwAddrMethod(self, short_name: str) -> SwAddrMethod:
|
|
197
211
|
if (short_name not in self.elements):
|
|
198
|
-
|
|
199
|
-
self.elements[short_name] =
|
|
212
|
+
method = SwAddrMethod(self, short_name)
|
|
213
|
+
self.elements[short_name] = method
|
|
200
214
|
return self.elements[short_name]
|
|
201
215
|
|
|
202
216
|
def createTriggerInterface(self, short_name: str) -> TriggerInterface:
|
|
203
217
|
if (short_name not in self.elements):
|
|
204
|
-
|
|
205
|
-
self.elements[short_name] =
|
|
218
|
+
trigger_interface = TriggerInterface(self, short_name)
|
|
219
|
+
self.elements[short_name] = trigger_interface
|
|
206
220
|
return self.elements[short_name]
|
|
207
221
|
|
|
208
222
|
def createModeDeclarationGroup(self, short_name: str) -> ModeDeclarationGroup:
|
|
209
223
|
if (short_name not in self.elements):
|
|
210
|
-
|
|
211
|
-
self.elements[short_name] =
|
|
224
|
+
group = ModeDeclarationGroup(self, short_name)
|
|
225
|
+
self.elements[short_name] = group
|
|
212
226
|
return self.elements[short_name]
|
|
213
227
|
|
|
214
228
|
def createModeSwitchInterface(self, short_name: str) -> ModeSwitchInterface:
|
|
215
229
|
if (short_name not in self.elements):
|
|
216
|
-
|
|
217
|
-
self.elements[short_name] =
|
|
230
|
+
switch_interface = ModeSwitchInterface(self, short_name)
|
|
231
|
+
self.elements[short_name] = switch_interface
|
|
218
232
|
return self.elements[short_name]
|
|
219
|
-
|
|
233
|
+
|
|
234
|
+
def createSwcTiming(self, short_name: str) -> SwcTiming:
|
|
235
|
+
if (short_name not in self.elements):
|
|
236
|
+
timing = SwcTiming(self, short_name)
|
|
237
|
+
self.elements[short_name] = timing
|
|
238
|
+
return self.elements[short_name]
|
|
239
|
+
|
|
240
|
+
def createLinCluster(self, short_name: str) -> LinCluster:
|
|
241
|
+
if (short_name not in self.elements):
|
|
242
|
+
cluster = LinCluster(self, short_name)
|
|
243
|
+
self.elements[short_name] = cluster
|
|
244
|
+
return self.elements[short_name]
|
|
245
|
+
|
|
246
|
+
def createCanCluster(self, short_name: str) -> CanCluster:
|
|
247
|
+
if (short_name not in self.elements):
|
|
248
|
+
cluster = CanCluster(self, short_name)
|
|
249
|
+
self.elements[short_name] = cluster
|
|
250
|
+
return self.elements[short_name]
|
|
251
|
+
|
|
252
|
+
def createLinUnconditionalFrame(self, short_name: str) -> LinUnconditionalFrame:
|
|
253
|
+
if (short_name not in self.elements):
|
|
254
|
+
frame = LinUnconditionalFrame(self, short_name)
|
|
255
|
+
self.elements[short_name] = frame
|
|
256
|
+
return self.elements[short_name]
|
|
257
|
+
|
|
258
|
+
def createNmPdu(self, short_name: str) -> NmPdu:
|
|
259
|
+
if (short_name not in self.elements):
|
|
260
|
+
pdu = NmPdu(self, short_name)
|
|
261
|
+
self.elements[short_name] = pdu
|
|
262
|
+
return self.elements[short_name]
|
|
263
|
+
|
|
264
|
+
def createNPdu(self, short_name: str) -> NPdu:
|
|
265
|
+
if (short_name not in self.elements):
|
|
266
|
+
pdu = NPdu(self, short_name)
|
|
267
|
+
self.elements[short_name] = pdu
|
|
268
|
+
return self.elements[short_name]
|
|
269
|
+
|
|
270
|
+
def createDcmIPdu(self, short_name: str) -> DcmIPdu:
|
|
271
|
+
if (short_name not in self.elements):
|
|
272
|
+
pdu = DcmIPdu(self, short_name)
|
|
273
|
+
self.elements[short_name] = pdu
|
|
274
|
+
return self.elements[short_name]
|
|
275
|
+
|
|
276
|
+
def createSecuredIPdu(self, short_name: str) -> SecuredIPdu:
|
|
277
|
+
if (short_name not in self.elements):
|
|
278
|
+
pdu = SecuredIPdu(self, short_name)
|
|
279
|
+
self.elements[short_name] = pdu
|
|
280
|
+
return self.elements[short_name]
|
|
281
|
+
|
|
282
|
+
def createNmConfig(self, short_name: str) -> NmConfig:
|
|
283
|
+
if (short_name not in self.elements):
|
|
284
|
+
config = NmConfig(self, short_name)
|
|
285
|
+
self.elements[short_name] = config
|
|
286
|
+
return self.elements[short_name]
|
|
287
|
+
|
|
288
|
+
def createCanTpConfig(self, short_name: str) -> CanTpConfig:
|
|
289
|
+
if (short_name not in self.elements):
|
|
290
|
+
config = CanTpConfig(self, short_name)
|
|
291
|
+
self.elements[short_name] = config
|
|
292
|
+
return self.elements[short_name]
|
|
293
|
+
|
|
294
|
+
def createCanFrame(self, short_name: str) -> CanFrame:
|
|
295
|
+
if (short_name not in self.elements):
|
|
296
|
+
frame = CanFrame(self, short_name)
|
|
297
|
+
self.elements[short_name] = frame
|
|
298
|
+
return self.elements[short_name]
|
|
299
|
+
|
|
300
|
+
def createEcuInstance(self, short_name: str) -> EcuInstance:
|
|
301
|
+
if (short_name not in self.elements):
|
|
302
|
+
frame = EcuInstance(self, short_name)
|
|
303
|
+
self.elements[short_name] = frame
|
|
304
|
+
return self.elements[short_name]
|
|
305
|
+
|
|
306
|
+
def createGateway(self, short_name: str) -> Gateway:
|
|
307
|
+
if (short_name not in self.elements):
|
|
308
|
+
gateway = Gateway(self, short_name)
|
|
309
|
+
self.elements[short_name] = gateway
|
|
310
|
+
return self.elements[short_name]
|
|
311
|
+
|
|
312
|
+
def createISignal(self, short_name: str) -> ISignal:
|
|
313
|
+
if (short_name not in self.elements):
|
|
314
|
+
signal = ISignal(self, short_name)
|
|
315
|
+
self.elements[short_name] = signal
|
|
316
|
+
return self.elements[short_name]
|
|
317
|
+
|
|
318
|
+
def createSystemSignal(self, short_name: str) -> SystemSignal:
|
|
319
|
+
if (short_name not in self.elements):
|
|
320
|
+
signal = SystemSignal(self, short_name)
|
|
321
|
+
self.elements[short_name] = signal
|
|
322
|
+
return self.elements[short_name]
|
|
323
|
+
|
|
324
|
+
def createSystemSignalGroup(self, short_name: str) -> SystemSignalGroup:
|
|
325
|
+
if (short_name not in self.elements):
|
|
326
|
+
signal = SystemSignalGroup(self, short_name)
|
|
327
|
+
self.elements[short_name] = signal
|
|
328
|
+
return self.elements[short_name]
|
|
329
|
+
|
|
330
|
+
def createISignalIPdu(self, short_name: str) -> ISignalIPdu:
|
|
331
|
+
if (short_name not in self.elements):
|
|
332
|
+
signal = ISignalIPdu(self, short_name)
|
|
333
|
+
self.elements[short_name] = signal
|
|
334
|
+
return self.elements[short_name]
|
|
335
|
+
|
|
336
|
+
def createEcucValueCollection(self, short_name: str) -> EcucValueCollection:
|
|
337
|
+
if (short_name not in self.elements):
|
|
338
|
+
signal = EcucValueCollection(self, short_name)
|
|
339
|
+
self.elements[short_name] = signal
|
|
340
|
+
return self.elements[short_name]
|
|
341
|
+
|
|
342
|
+
def createEcucModuleConfigurationValues(self, short_name: str) -> EcucModuleConfigurationValues:
|
|
343
|
+
if (short_name not in self.elements):
|
|
344
|
+
signal = EcucModuleConfigurationValues(self, short_name)
|
|
345
|
+
self.elements[short_name] = signal
|
|
346
|
+
return self.elements[short_name]
|
|
347
|
+
|
|
348
|
+
def createPhysicalDimension(self, short_name: str) -> PhysicalDimension:
|
|
349
|
+
if (short_name not in self.elements):
|
|
350
|
+
signal = PhysicalDimension(self, short_name)
|
|
351
|
+
self.elements[short_name] = signal
|
|
352
|
+
return self.elements[short_name]
|
|
353
|
+
|
|
354
|
+
def createISignalGroup(self, short_name: str) -> ISignalGroup:
|
|
355
|
+
if (short_name not in self.elements):
|
|
356
|
+
signal = ISignalGroup(self, short_name)
|
|
357
|
+
self.elements[short_name] = signal
|
|
358
|
+
return self.elements[short_name]
|
|
359
|
+
|
|
360
|
+
def createISignalIPduGroup(self, short_name: str) -> ISignalIPduGroup:
|
|
361
|
+
if (short_name not in self.elements):
|
|
362
|
+
signal = ISignalIPduGroup(self, short_name)
|
|
363
|
+
self.elements[short_name] = signal
|
|
364
|
+
return self.elements[short_name]
|
|
365
|
+
|
|
366
|
+
def createSystem(self, short_name: str) -> System:
|
|
367
|
+
if (short_name not in self.elements):
|
|
368
|
+
signal = System(self, short_name)
|
|
369
|
+
self.elements[short_name] = signal
|
|
370
|
+
return self.elements[short_name]
|
|
371
|
+
|
|
220
372
|
def getApplicationPrimitiveDataTypes(self) -> List[ApplicationPrimitiveDataType]:
|
|
221
|
-
return list(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()))
|
|
373
|
+
return list(sorted(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()), key= lambda o:o.short_name))
|
|
222
374
|
|
|
223
375
|
def getApplicationDataType(self) -> List[ApplicationDataType]:
|
|
224
376
|
return list(sorted(filter(lambda a: isinstance(a, ApplicationDataType), self.elements.values()), key= lambda o:o.short_name))
|
|
225
377
|
|
|
226
378
|
def getImplementationDataTypes(self) -> List[ImplementationDataType]:
|
|
227
|
-
return list(filter(lambda a: isinstance(a, ImplementationDataType), self.elements.values()))
|
|
379
|
+
return list(sorted(filter(lambda a: isinstance(a, ImplementationDataType), self.elements.values()), key= lambda o:o.short_name))
|
|
228
380
|
|
|
229
381
|
def getSwBaseTypes(self) -> List[SwBaseType]:
|
|
230
382
|
return list(filter(lambda a: isinstance(a, SwBaseType), self.elements.values()))
|
|
@@ -300,8 +452,74 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
300
452
|
|
|
301
453
|
def getModeSwitchInterfaces(self) -> List[ModeSwitchInterface]:
|
|
302
454
|
return list(sorted(filter(lambda a : isinstance(a, ModeSwitchInterface), self.elements.values()), key = lambda a: a.short_name))
|
|
303
|
-
|
|
304
|
-
|
|
455
|
+
|
|
456
|
+
def getSwcTimings(self) -> List[SwcTiming]:
|
|
457
|
+
return list(sorted(filter(lambda a : isinstance(a, SwcTiming), self.elements.values()), key = lambda a: a.short_name))
|
|
458
|
+
|
|
459
|
+
def getLinClusters(self) -> List[LinCluster]:
|
|
460
|
+
return list(sorted(filter(lambda a : isinstance(a, LinCluster), self.elements.values()), key = lambda a: a.short_name))
|
|
461
|
+
|
|
462
|
+
def getCanClusters(self) -> List[CanCluster]:
|
|
463
|
+
return list(sorted(filter(lambda a : isinstance(a, CanCluster), self.elements.values()), key = lambda a: a.short_name))
|
|
464
|
+
|
|
465
|
+
def getLinUnconditionalFrames(self) -> List[LinUnconditionalFrame]:
|
|
466
|
+
return list(sorted(filter(lambda a : isinstance(a, LinUnconditionalFrame), self.elements.values()), key = lambda a: a.short_name))
|
|
467
|
+
|
|
468
|
+
def getNmPdus(self) -> List[NmPdu]:
|
|
469
|
+
return list(sorted(filter(lambda a : isinstance(a, NmPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
470
|
+
|
|
471
|
+
def getNPdus(self) -> List[NPdu]:
|
|
472
|
+
return list(sorted(filter(lambda a : isinstance(a, NPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
473
|
+
|
|
474
|
+
def getDcmIPdus(self) -> List[DcmIPdu]:
|
|
475
|
+
return list(sorted(filter(lambda a : isinstance(a, DcmIPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
476
|
+
|
|
477
|
+
def getSecuredIPdus(self) -> List[SecuredIPdu]:
|
|
478
|
+
return list(sorted(filter(lambda a : isinstance(a, SecuredIPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
479
|
+
|
|
480
|
+
def getNmConfigs(self) -> List[NmConfig]:
|
|
481
|
+
return list(sorted(filter(lambda a : isinstance(a, NmConfig), self.elements.values()), key = lambda a: a.short_name))
|
|
482
|
+
|
|
483
|
+
def getCanTpConfigs(self) -> List[CanTpConfig]:
|
|
484
|
+
return list(sorted(filter(lambda a : isinstance(a, CanTpConfig), self.elements.values()), key = lambda a: a.short_name))
|
|
485
|
+
|
|
486
|
+
def getCanFrames(self) -> List[CanFrame]:
|
|
487
|
+
return list(sorted(filter(lambda a : isinstance(a, CanFrame), self.elements.values()), key = lambda a: a.short_name))
|
|
488
|
+
|
|
489
|
+
def getEcuInstances(self) -> List[EcuInstance]:
|
|
490
|
+
return list(sorted(filter(lambda a : isinstance(a, EcuInstance), self.elements.values()), key = lambda a: a.short_name))
|
|
491
|
+
|
|
492
|
+
def getGateways(self) -> List[Gateway]:
|
|
493
|
+
return list(sorted(filter(lambda a : isinstance(a, Gateway), self.elements.values()), key = lambda a: a.short_name))
|
|
494
|
+
|
|
495
|
+
def getISignals(self) -> List[ISignal]:
|
|
496
|
+
return list(sorted(filter(lambda a : isinstance(a, ISignal), self.elements.values()), key = lambda a: a.short_name))
|
|
497
|
+
|
|
498
|
+
def getEcucValueCollections(self) -> List[EcucValueCollection]:
|
|
499
|
+
return list(sorted(filter(lambda a : isinstance(a, EcucValueCollection), self.elements.values()), key = lambda a: a.short_name))
|
|
500
|
+
|
|
501
|
+
def getEcucModuleConfigurationValues(self) -> List[EcucModuleConfigurationValues]:
|
|
502
|
+
return list(sorted(filter(lambda a : isinstance(a, EcucModuleConfigurationValues), self.elements.values()), key = lambda a: a.short_name))
|
|
503
|
+
|
|
504
|
+
def getEcucModuleConfigurationValues(self) -> List[PhysicalDimension]:
|
|
505
|
+
return list(sorted(filter(lambda a : isinstance(a, PhysicalDimension), self.elements.values()), key = lambda a: a.short_name))
|
|
506
|
+
|
|
507
|
+
def getISignalGroups(self) -> List[ISignalGroup]:
|
|
508
|
+
return list(sorted(filter(lambda a : isinstance(a, ISignalGroup), self.elements.values()), key = lambda a: a.short_name))
|
|
509
|
+
|
|
510
|
+
def getSystemSignals(self) -> List[SystemSignal]:
|
|
511
|
+
return list(sorted(filter(lambda a : isinstance(a, SystemSignal), self.elements.values()), key = lambda a: a.short_name))
|
|
512
|
+
|
|
513
|
+
def getSystemSignalGroups(self) -> List[SystemSignalGroup]:
|
|
514
|
+
return list(sorted(filter(lambda a : isinstance(a, SystemSignalGroup), self.elements.values()), key = lambda a: a.short_name))
|
|
515
|
+
|
|
516
|
+
def getISignalIPdus(self) -> List[ISignalIPdu]:
|
|
517
|
+
return list(sorted(filter(lambda a : isinstance(a, ISignalIPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
518
|
+
|
|
519
|
+
def getSystems(self) -> List[System]:
|
|
520
|
+
return list(sorted(filter(lambda a : isinstance(a, System), self.elements.values()), key = lambda a: a.short_name))
|
|
521
|
+
|
|
522
|
+
class AUTOSAR (CollectableElement):
|
|
305
523
|
__instance = None
|
|
306
524
|
|
|
307
525
|
@staticmethod
|
|
@@ -360,11 +578,11 @@ class AUTOSAR (CollectableElement):
|
|
|
360
578
|
def getDataType(self, data_type: ImplementationDataType) -> ImplementationDataType:
|
|
361
579
|
if (isinstance(data_type, ImplementationDataType) or isinstance(data_type, SwBaseType)):
|
|
362
580
|
if (data_type.category == ImplementationDataType.CATEGORY_TYPE_REFERENCE):
|
|
363
|
-
referred_type = self.find(data_type.
|
|
581
|
+
referred_type = self.find(data_type.swDataDefProps.implementationDataTypeRef.value)
|
|
364
582
|
return self.getDataType(referred_type)
|
|
365
583
|
if (data_type.category == ImplementationDataType.CATEGORY_DATA_REFERENCE):
|
|
366
|
-
if (data_type.
|
|
367
|
-
referred_type = self.find(data_type.
|
|
584
|
+
if (data_type.swDataDefProps.swPointerTargetProps.target_category == "VALUE"):
|
|
585
|
+
referred_type = self.find(data_type.swDataDefProps.swPointerTargetProps.sw_data_def_props.baseTypeRef.value)
|
|
368
586
|
return self.getDataType(referred_type)
|
|
369
587
|
return data_type
|
|
370
588
|
else:
|
armodel/models/ar_ref.py
CHANGED
|
@@ -7,17 +7,81 @@ class RefType(ARObject):
|
|
|
7
7
|
self.dest = ""
|
|
8
8
|
self.value = ""
|
|
9
9
|
|
|
10
|
+
def getDest(self):
|
|
11
|
+
return self.dest
|
|
12
|
+
|
|
13
|
+
def setDest(self, value):
|
|
14
|
+
self.dest = value
|
|
15
|
+
return self
|
|
16
|
+
|
|
17
|
+
def getValue(self):
|
|
18
|
+
return self.value
|
|
19
|
+
|
|
20
|
+
def setValue(self, value):
|
|
21
|
+
self.value = value
|
|
22
|
+
return self
|
|
23
|
+
|
|
10
24
|
class TRefType(RefType):
|
|
11
25
|
def __init__(self):
|
|
12
26
|
super().__init__()
|
|
13
|
-
|
|
27
|
+
|
|
28
|
+
class AnyInstanceRef(ARObject):
|
|
29
|
+
def __init__(self):
|
|
30
|
+
super().__init__()
|
|
31
|
+
|
|
32
|
+
self.baseRef = None # type: RefType
|
|
33
|
+
self.contextElementRef = None # type: RefType
|
|
34
|
+
self.targetRef = None # type: RefType
|
|
35
|
+
|
|
36
|
+
def getBaseRef(self) -> RefType:
|
|
37
|
+
return self.baseRef
|
|
38
|
+
|
|
39
|
+
def setBaseRef(self, value: RefType):
|
|
40
|
+
self.baseRef = value
|
|
41
|
+
return self
|
|
42
|
+
|
|
43
|
+
def getContextElementRef(self) -> RefType:
|
|
44
|
+
return self.contextElementRef
|
|
45
|
+
|
|
46
|
+
def setContextElementRef(self, value: RefType):
|
|
47
|
+
self.contextElementRef = value
|
|
48
|
+
return self
|
|
49
|
+
|
|
50
|
+
def getTargetRef(self) -> RefType:
|
|
51
|
+
return self.targetRef
|
|
52
|
+
|
|
53
|
+
def setTargetRef(self, value:RefType):
|
|
54
|
+
self.targetRef = value
|
|
55
|
+
return self
|
|
14
56
|
|
|
15
57
|
class AutosarVariableRef(ARObject):
|
|
16
58
|
def __init__(self):
|
|
17
59
|
super().__init__()
|
|
18
|
-
|
|
19
|
-
self.
|
|
20
|
-
self.
|
|
60
|
+
|
|
61
|
+
self.autosarVariableIRef = None # type: VariableInAtomicSWCTypeInstanceRef
|
|
62
|
+
self.autosarVariableInImplDatatype = None # type: ArVariableInImplementationDataInstanceRef
|
|
63
|
+
self.localVariableRef = None
|
|
64
|
+
|
|
65
|
+
def getAutosarVariableIRef(self):
|
|
66
|
+
return self.autosarVariableIRef
|
|
67
|
+
|
|
68
|
+
def setAutosarVariableIRef(self, value):
|
|
69
|
+
self.autosarVariableIRef = value
|
|
70
|
+
return self
|
|
71
|
+
|
|
72
|
+
def getAutosarVariableInImplDatatype(self):
|
|
73
|
+
return self.autosarVariableInImplDatatype
|
|
74
|
+
|
|
75
|
+
def setAutosarVariableInImplDatatype(self, value):
|
|
76
|
+
self.autosarVariableInImplDatatype = value
|
|
77
|
+
return self
|
|
78
|
+
|
|
79
|
+
def getLocalVariableRef(self):
|
|
80
|
+
return self.localVariableRef
|
|
81
|
+
|
|
82
|
+
def setLocalVariableRef(self, value):
|
|
83
|
+
self.localVariableRef = value
|
|
84
|
+
return self
|
|
21
85
|
|
|
22
86
|
class AutosarParameterRef(ARObject):
|
|
23
87
|
def __init__(self):
|
|
@@ -32,16 +96,51 @@ class AtpInstanceRef(ARObject, metaclass=ABCMeta):
|
|
|
32
96
|
raise NotImplementedError("AtpInstanceRef is an abstract class.")
|
|
33
97
|
|
|
34
98
|
super().__init__()
|
|
35
|
-
|
|
36
99
|
class VariableInAtomicSWCTypeInstanceRef(AtpInstanceRef):
|
|
37
100
|
def __init__(self):
|
|
38
101
|
super().__init__()
|
|
39
102
|
|
|
40
|
-
self.
|
|
41
|
-
self.
|
|
42
|
-
self.
|
|
43
|
-
self.
|
|
44
|
-
self.
|
|
103
|
+
self.baseRef = None # type: RefType
|
|
104
|
+
self.contextDataPrototypeRefs = [] # type: List[RefType]
|
|
105
|
+
self.portPrototypeRef = None # type: RefType
|
|
106
|
+
self.rootVariableDataPrototypeRef = None # type: RefType
|
|
107
|
+
self.targetDataPrototypeRef = None # type: RefType
|
|
108
|
+
|
|
109
|
+
def getBaseRef(self):
|
|
110
|
+
return self.baseRef
|
|
111
|
+
|
|
112
|
+
def setBaseRef(self, value):
|
|
113
|
+
self.baseRef = value
|
|
114
|
+
return self
|
|
115
|
+
|
|
116
|
+
def getContextDataPrototypeRefs(self):
|
|
117
|
+
return self.contextDataPrototypeRefs
|
|
118
|
+
|
|
119
|
+
def addContextDataPrototypeRef(self, value):
|
|
120
|
+
self.contextDataPrototypeRefs.append(value)
|
|
121
|
+
return self
|
|
122
|
+
|
|
123
|
+
def getPortPrototypeRef(self):
|
|
124
|
+
return self.portPrototypeRef
|
|
125
|
+
|
|
126
|
+
def setPortPrototypeRef(self, value):
|
|
127
|
+
self.portPrototypeRef = value
|
|
128
|
+
return self
|
|
129
|
+
|
|
130
|
+
def getRootVariableDataPrototypeRef(self):
|
|
131
|
+
return self.rootVariableDataPrototypeRef
|
|
132
|
+
|
|
133
|
+
def setRootVariableDataPrototypeRef(self, value):
|
|
134
|
+
self.rootVariableDataPrototypeRef = value
|
|
135
|
+
return self
|
|
136
|
+
|
|
137
|
+
def getTargetDataPrototypeRef(self):
|
|
138
|
+
return self.targetDataPrototypeRef
|
|
139
|
+
|
|
140
|
+
def setTargetDataPrototypeRef(self, value):
|
|
141
|
+
self.targetDataPrototypeRef = value
|
|
142
|
+
return self
|
|
143
|
+
|
|
45
144
|
|
|
46
145
|
class PortInCompositionTypeInstanceRef(AtpInstanceRef, metaclass=ABCMeta):
|
|
47
146
|
def __init__(self):
|
|
@@ -89,36 +188,6 @@ class ROperationInAtomicSwcInstanceRef(OperationInAtomicSwcInstanceRef):
|
|
|
89
188
|
self.context_r_port_ref = None # type: RefType
|
|
90
189
|
self.target_required_operation_ref = None # type: RefType
|
|
91
190
|
|
|
92
|
-
class VariableInAtomicSwcInstanceRef(AtpInstanceRef, metaclass=ABCMeta):
|
|
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
191
|
class ParameterInAtomicSWCTypeInstanceRef(AtpInstanceRef):
|
|
123
192
|
def __init__(self):
|
|
124
193
|
super().__init__()
|
|
@@ -150,8 +219,9 @@ class VariableDataPrototypeInSystemInstanceRef(AtpInstanceRef):
|
|
|
150
219
|
def __init__(self):
|
|
151
220
|
super().__init__()
|
|
152
221
|
|
|
153
|
-
self.
|
|
154
|
-
self.
|
|
155
|
-
self.
|
|
156
|
-
self.
|
|
157
|
-
self.
|
|
222
|
+
self.base_ref = None # type: RefType
|
|
223
|
+
self.context_component_refs = [] # type: List[RefType]
|
|
224
|
+
self.context_composition_ref = None # type: RefType
|
|
225
|
+
self.context_port_ref = None # type: RefType
|
|
226
|
+
self.target_data_prototype_ref = None # type: RefType
|
|
227
|
+
|