armodel 1.7.9__py3-none-any.whl → 1.8.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_format_cli.py +1 -0
- armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +50 -11
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +30 -28
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +5 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +5 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +19 -9
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +11 -10
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +8 -2
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/RteEventToOsTaskMapping.py +35 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SWmapping.py +25 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SecureCommunication.py +83 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +84 -32
- armodel/models/__init__.py +2 -0
- armodel/models/utils/__init__.py +0 -0
- armodel/models/utils/uuid_mgr.py +23 -0
- armodel/parser/abstract_arxml_parser.py +5 -0
- armodel/parser/arxml_parser.py +80 -69
- armodel/tests/test_armodel/models/test_datatype.py +136 -138
- armodel/writer/arxml_writer.py +38 -28
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/METADATA +15 -1
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/RECORD +25 -21
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/LICENSE +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/WHEEL +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/top_level.txt +0 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
from typing import List
|
|
2
2
|
|
|
3
|
+
from ....M2.AUTOSARTemplates.SystemTemplate.DataMapping import DataMapping
|
|
4
|
+
from ....M2.AUTOSARTemplates.SystemTemplate.SecureCommunication import CryptoServiceMapping
|
|
5
|
+
from ....M2.AUTOSARTemplates.SystemTemplate.RteEventToOsTaskMapping import AppOsTaskProxyToEcuTaskProxyMapping
|
|
3
6
|
from ....M2.AUTOSARTemplates.SystemTemplate.EcuResourceMapping import ECUMapping
|
|
4
7
|
from ....M2.AUTOSARTemplates.SystemTemplate.InstanceRefs import ComponentInSystemInstanceRef
|
|
5
|
-
from ....M2.AUTOSARTemplates.SystemTemplate.SWmapping import SwcToImplMapping
|
|
8
|
+
from ....M2.AUTOSARTemplates.SystemTemplate.SWmapping import ApplicationPartitionToEcuPartitionMapping, SwcToImplMapping
|
|
6
9
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
7
10
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Identifiable
|
|
8
|
-
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import PositiveInteger, RefType
|
|
11
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ByteOrderEnum, PositiveInteger, RefType
|
|
12
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RevisionLabelString, TRefType
|
|
9
13
|
|
|
10
14
|
|
|
11
15
|
class SwcToEcuMapping(Identifiable):
|
|
@@ -46,34 +50,67 @@ class SwcToEcuMapping(Identifiable):
|
|
|
46
50
|
return self
|
|
47
51
|
|
|
48
52
|
|
|
53
|
+
class ComManagementMapping(Identifiable):
|
|
54
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
55
|
+
super().__init__(parent, short_name)
|
|
56
|
+
|
|
57
|
+
self.comManagementGroupRefs = [] # type: List[RefType]
|
|
58
|
+
self.comManagementPortGroupRefs = [] # type: List[RefType]
|
|
59
|
+
self.physicalChannelRef = None # type: RefType
|
|
60
|
+
|
|
61
|
+
def getComManagementGroupRefs(self):
|
|
62
|
+
return self.comManagementGroupRefs
|
|
63
|
+
|
|
64
|
+
def addComManagementGroupRef(self, value):
|
|
65
|
+
if value is not None:
|
|
66
|
+
self.comManagementGroupRefs.append(value)
|
|
67
|
+
return self
|
|
68
|
+
|
|
69
|
+
def getComManagementPortGroupRefs(self):
|
|
70
|
+
return self.comManagementPortGroupRefs
|
|
71
|
+
|
|
72
|
+
def addComManagementPortGroupRef(self, value):
|
|
73
|
+
if value is not None:
|
|
74
|
+
self.comManagementPortGroupRefs.append(value)
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
def getPhysicalChannelRef(self):
|
|
78
|
+
return self.physicalChannelRef
|
|
79
|
+
|
|
80
|
+
def setPhysicalChannelRef(self, value):
|
|
81
|
+
if value is not None:
|
|
82
|
+
self.physicalChannelRef = value
|
|
83
|
+
return self
|
|
84
|
+
|
|
85
|
+
|
|
49
86
|
class SystemMapping(Identifiable):
|
|
50
87
|
def __init__(self, parent: ARObject, short_name: str):
|
|
51
88
|
super().__init__(parent, short_name)
|
|
52
89
|
|
|
53
|
-
self.applicationPartitionToEcuPartitionMappings = []
|
|
54
|
-
self.appOsTaskProxyToEcuTaskProxyMappings = []
|
|
55
|
-
self.comManagementMappings = []
|
|
56
|
-
self.cryptoServiceMappings = []
|
|
57
|
-
self.dataMappings = []
|
|
58
|
-
self.ddsISignalToTopicMappings = []
|
|
90
|
+
self.applicationPartitionToEcuPartitionMappings = [] # type: List[ApplicationPartitionToEcuPartitionMapping]
|
|
91
|
+
self.appOsTaskProxyToEcuTaskProxyMappings = [] # type: List[AppOsTaskProxyToEcuTaskProxyMapping]
|
|
92
|
+
self.comManagementMappings = [] # type: List[ComManagementMapping]
|
|
93
|
+
self.cryptoServiceMappings = [] # type: List[CryptoServiceMapping]
|
|
94
|
+
self.dataMappings = [] # type: List[DataMapping]
|
|
95
|
+
self.ddsISignalToTopicMappings = [] # type: List[DdsCpISignalToDdsTopicMapping]
|
|
59
96
|
self.ecuResourceMappings = [] # type: List[ECUMapping]
|
|
60
|
-
self.j1939ControllerApplicationToJ1939NmNodeMappings = []
|
|
61
|
-
self.mappingConstraints = []
|
|
62
|
-
self.pncMappings = []
|
|
63
|
-
self.portElementToComResourceMappings = []
|
|
64
|
-
self.resourceEstimations = []
|
|
65
|
-
self.resourceToApplicationPartitionMappings = []
|
|
66
|
-
self.rteEventSeparations = []
|
|
67
|
-
self.rteEventToOsTaskProxyMappings = []
|
|
68
|
-
self.signalPathConstraints = []
|
|
69
|
-
self.softwareClusterToApplicationPartitionMappings = []
|
|
70
|
-
self.softwareClusterToResourceMappings = []
|
|
71
|
-
self.swClusterMappings = []
|
|
72
|
-
self.swcToApplicationPartitionMappings = []
|
|
97
|
+
self.j1939ControllerApplicationToJ1939NmNodeMappings = [] # type: List[J1939ControllerApplicationToJ1939NmNodeMapping]
|
|
98
|
+
self.mappingConstraints = [] # type: List[MappingConstraint]
|
|
99
|
+
self.pncMappings = [] # type: List[PncMapping]
|
|
100
|
+
self.portElementToComResourceMappings = [] # type: List[PortElementToCommunicationResourceMapping]
|
|
101
|
+
self.resourceEstimations = [] # type: List[EcuResourceEstimation]
|
|
102
|
+
self.resourceToApplicationPartitionMappings = [] # type: List[CpSoftwareClusterResourceToApplicationPartitionMapping]
|
|
103
|
+
self.rteEventSeparations = [] # type: List[RteEventInSystemSeparation]
|
|
104
|
+
self.rteEventToOsTaskProxyMappings = [] # type: List[RteEventInSystemToOsTaskProxyMapping]
|
|
105
|
+
self.signalPathConstraints = [] # type: List[SignalPathConstraint]
|
|
106
|
+
self.softwareClusterToApplicationPartitionMappings = [] # type: List[CpSoftwareClusterToApplicationPartitionMapping]
|
|
107
|
+
self.softwareClusterToResourceMappings = [] # type: List[CpSoftwareClusterToResourceMapping]
|
|
108
|
+
self.swClusterMappings = [] # type: List[CpSoftwareClusterToEcuInstanceMapping]
|
|
109
|
+
self.swcToApplicationPartitionMappings = [] # type: List[SwcToApplicationPartitionMapping]
|
|
73
110
|
self.swImplMappings = [] # type: List[SwcToImplMapping]
|
|
74
111
|
self.swMappings = [] # type: List[SwcToEcuMapping]
|
|
75
|
-
self.systemSignalGroupToComResourceMappings = []
|
|
76
|
-
self.systemSignalToComResourceMappings = []
|
|
112
|
+
self.systemSignalGroupToComResourceMappings = [] # type: List[SystemSignalGroupToCommunicationResourceMapping]
|
|
113
|
+
self.systemSignalToComResourceMappings = [] # type: List[SystemSignalToCommunicationResourceMapping]
|
|
77
114
|
|
|
78
115
|
def getApplicationPartitionToEcuPartitionMappings(self):
|
|
79
116
|
return self.applicationPartitionToEcuPartitionMappings
|
|
@@ -286,22 +323,37 @@ class RootSwCompositionPrototype(Identifiable):
|
|
|
286
323
|
return self
|
|
287
324
|
|
|
288
325
|
|
|
326
|
+
class J1939SharedAddressCluster(Identifiable):
|
|
327
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
328
|
+
super().__init__(parent, short_name)
|
|
329
|
+
|
|
330
|
+
self.participatingJ1939ClusterRefs = [] # type: List[RefType]
|
|
331
|
+
|
|
332
|
+
def getParticipatingJ1939ClusterRefs(self):
|
|
333
|
+
return self.participatingJ1939ClusterRefs
|
|
334
|
+
|
|
335
|
+
def addParticipatingJ1939ClusterRef(self, value):
|
|
336
|
+
if value is not None:
|
|
337
|
+
self.participatingJ1939ClusterRefs.append(value)
|
|
338
|
+
return self
|
|
339
|
+
|
|
340
|
+
|
|
289
341
|
class System(ARElement):
|
|
290
342
|
def __init__(self, parent: ARObject, short_name: str):
|
|
291
343
|
super().__init__(parent, short_name)
|
|
292
344
|
|
|
293
345
|
self.clientIdDefinitionSetRefs = [] # type: List[RefType]
|
|
294
|
-
self.containerIPduHeaderByteOrder = None
|
|
295
|
-
self.ecuExtractVersion = None
|
|
346
|
+
self.containerIPduHeaderByteOrder = None # type: ByteOrderEnum
|
|
347
|
+
self.ecuExtractVersion = None # type: RevisionLabelString
|
|
296
348
|
self.fibexElements = [] # type: List[RefType]
|
|
297
349
|
self.interpolationRoutineMappingSetRefs = [] # type: List[RefType]
|
|
298
|
-
self.j1939SharedAddressClusters = []
|
|
350
|
+
self.j1939SharedAddressClusters = [] # type: List[J1939SharedAddressCluster]
|
|
299
351
|
self.mappings = [] # type: List[SystemMapping]
|
|
300
352
|
self.pncVectorLength = None # type: PositiveInteger
|
|
301
353
|
self.pncVectorOffset = None # type: PositiveInteger
|
|
302
354
|
self.rootSoftwareComposition = None # type: RootSwCompositionPrototype
|
|
303
|
-
self.
|
|
304
|
-
self.systemDocumentation = []
|
|
355
|
+
self.swClusterRefs = [] # type: List[RefType]
|
|
356
|
+
self.systemDocumentation = [] # type: Chapter
|
|
305
357
|
self.systemVersion = None # type: RevisionLabelString
|
|
306
358
|
|
|
307
359
|
def getClientIdDefinitionSetRefs(self):
|
|
@@ -384,11 +436,11 @@ class System(ARElement):
|
|
|
384
436
|
self.rootSoftwareComposition = prototype
|
|
385
437
|
return self.getElement(short_name)
|
|
386
438
|
|
|
387
|
-
def
|
|
388
|
-
return self.
|
|
439
|
+
def getSwClusterRefs(self):
|
|
440
|
+
return self.swClusterRefs
|
|
389
441
|
|
|
390
|
-
def
|
|
391
|
-
self.
|
|
442
|
+
def addSwClusterRef(self, value):
|
|
443
|
+
self.swClusterRefs.append(value)
|
|
392
444
|
return self
|
|
393
445
|
|
|
394
446
|
def getSystemDocumentation(self):
|
armodel/models/__init__.py
CHANGED
|
@@ -63,9 +63,11 @@ from .M2.AUTOSARTemplates.SystemTemplate.DataMapping import *
|
|
|
63
63
|
from .M2.AUTOSARTemplates.SystemTemplate.DiagnosticConnection import *
|
|
64
64
|
from .M2.AUTOSARTemplates.SystemTemplate.EcuResourceMapping import *
|
|
65
65
|
from .M2.AUTOSARTemplates.SystemTemplate.InstanceRefs import *
|
|
66
|
+
from .M2.AUTOSARTemplates.SystemTemplate.RteEventToOsTaskMapping import *
|
|
66
67
|
from .M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import *
|
|
67
68
|
from .M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import *
|
|
68
69
|
from .M2.AUTOSARTemplates.SystemTemplate.SWmapping import *
|
|
70
|
+
from .M2.AUTOSARTemplates.SystemTemplate.SecureCommunication import *
|
|
69
71
|
from .M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Multiplatform import *
|
|
70
72
|
from .M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication import *
|
|
71
73
|
from .M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import *
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from typing import Dict, List
|
|
2
|
+
|
|
3
|
+
from ..M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class UUIDMgr:
|
|
7
|
+
def __init__(self):
|
|
8
|
+
self.uuid_object_mappings = {} # type: Dict[str, List[ARObject]]
|
|
9
|
+
|
|
10
|
+
def addObject(self, obj: ARObject):
|
|
11
|
+
if obj.uuid is None:
|
|
12
|
+
return
|
|
13
|
+
if obj.uuid not in self.uuid_object_mappings:
|
|
14
|
+
self.uuid_object_mappings[obj.uuid] = []
|
|
15
|
+
|
|
16
|
+
uuid_obj_list = self.uuid_object_mappings[obj.uuid]
|
|
17
|
+
uuid_obj_list.append(obj)
|
|
18
|
+
|
|
19
|
+
def getObjects(self, uuid: str):
|
|
20
|
+
result = []
|
|
21
|
+
if uuid in self.uuid_object_mappings:
|
|
22
|
+
result = self.uuid_object_mappings[uuid]
|
|
23
|
+
return result
|
|
@@ -275,8 +275,12 @@ class AbstractARXMLParser:
|
|
|
275
275
|
ar_object.timestamp = self.readElementOptionalAttrib(element, "T") # read the timestamp
|
|
276
276
|
ar_object.uuid = self.readElementOptionalAttrib(element, "UUID") # read the uuid
|
|
277
277
|
|
|
278
|
+
AUTOSAR.getInstance().addARObject(ar_object)
|
|
279
|
+
|
|
278
280
|
# if ar_object.timestamp is not None:
|
|
279
281
|
# self.logger.debug("Timestamp: %s" % ar_object.timestamp)
|
|
282
|
+
|
|
283
|
+
'''
|
|
280
284
|
if ar_object.uuid is not None:
|
|
281
285
|
instance = AUTOSAR.getInstance()
|
|
282
286
|
old_ar_object = instance.getARObjectByUUID(ar_object.uuid)
|
|
@@ -285,6 +289,7 @@ class AbstractARXMLParser:
|
|
|
285
289
|
else:
|
|
286
290
|
instance.addARObject(ar_object)
|
|
287
291
|
# self.logger.debug("UUID: %s" % ar_object.uuid)
|
|
292
|
+
'''
|
|
288
293
|
|
|
289
294
|
def getAUTOSARInfo(self, element: ET.Element, document: AUTOSAR):
|
|
290
295
|
key = "{http://www.w3.org/2001/XMLSchema-instance}schemaLocation"
|