armodel 1.7.5__py3-none-any.whl → 1.7.7__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/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +41 -2
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +47 -6
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Filter.py +17 -7
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +2 -2
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +4 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +8 -2
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +9 -3
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +30 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +19 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +53 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +2 -2
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py +41 -16
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +10 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/RTEEvents.py +26 -8
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +19 -5
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DoIp.py +29 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/ECUResourceMapping.py +44 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanTopology.py +165 -4
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetTopology.py +409 -17
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/ServiceInstances.py +356 -8
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Lin/LinTopology.py +2 -4
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Multiplatform.py +76 -10
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +483 -54
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +45 -23
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +10 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/NetworkManagement.py +245 -130
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SWmapping.py +27 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/TransportProtocols.py +633 -5
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +22 -11
- armodel/models/M2/MSR/AsamHdo/AdminData.py +1 -2
- armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +3 -1
- armodel/models/M2/MSR/AsamHdo/SpecialData.py +35 -8
- armodel/models/M2/MSR/DataDictionary/RecordLayout.py +0 -3
- armodel/models/__init__.py +4 -0
- armodel/parser/abstract_arxml_parser.py +8 -5
- armodel/parser/arxml_parser.py +1229 -572
- armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -3
- armodel/tests/test_armodel/models/test_datatype.py +1 -1
- armodel/tests/test_armodel/parser/test_bsw_module_descriiption.py +218 -0
- armodel/tests/test_armodel/parser/test_sw_components.py +22 -1
- armodel/writer/abstract_arxml_writer.py +7 -6
- armodel/writer/arxml_writer.py +1037 -187
- {armodel-1.7.5.dist-info → armodel-1.7.7.dist-info}/METADATA +62 -3
- {armodel-1.7.5.dist-info → armodel-1.7.7.dist-info}/RECORD +48 -44
- {armodel-1.7.5.dist-info → armodel-1.7.7.dist-info}/LICENSE +0 -0
- {armodel-1.7.5.dist-info → armodel-1.7.7.dist-info}/WHEEL +0 -0
- {armodel-1.7.5.dist-info → armodel-1.7.7.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.5.dist-info → armodel-1.7.7.dist-info}/top_level.txt +0 -0
armodel/parser/arxml_parser.py
CHANGED
|
@@ -2,16 +2,22 @@ from typing import List
|
|
|
2
2
|
import xml.etree.ElementTree as ET
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
+
from armodel.models.M2.AUTOSARTemplates.SystemTemplate.SWmapping import SwcToImplMapping
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
from ..models.M2.MSR.AsamHdo.AdminData import AdminData
|
|
6
|
-
from ..models.M2.MSR.AsamHdo.BaseTypes import BaseTypeDirectDefinition
|
|
10
|
+
from ..models.M2.MSR.AsamHdo.BaseTypes import BaseTypeDirectDefinition, SwBaseType
|
|
7
11
|
from ..models.M2.MSR.AsamHdo.Constraints.GlobalConstraints import DataConstrRule, InternalConstrs, PhysConstrs, DataConstr
|
|
8
12
|
from ..models.M2.MSR.AsamHdo.ComputationMethod import CompuConstContent, CompuConstFormulaContent, CompuConstNumericContent, CompuMethod, Compu, CompuConst, CompuConstTextContent, CompuNominatorDenominator, CompuRationalCoeffs, CompuScale, CompuScaleConstantContents, CompuScaleRationalFormula, CompuScales
|
|
9
13
|
from ..models.M2.MSR.AsamHdo.SpecialData import Sdg, Sd
|
|
14
|
+
from ..models.M2.MSR.AsamHdo.Units import PhysicalDimension, Unit
|
|
10
15
|
from ..models.M2.MSR.CalibrationData.CalibrationValue import SwValueCont, SwValues
|
|
16
|
+
from ..models.M2.MSR.DataDictionary.AuxillaryObjects import SwAddrMethod
|
|
11
17
|
from ..models.M2.MSR.DataDictionary.DataDefProperties import SwDataDefProps, SwPointerTargetProps
|
|
12
18
|
from ..models.M2.MSR.DataDictionary.CalibrationParameter import SwCalprmAxis
|
|
13
19
|
from ..models.M2.MSR.DataDictionary.Axis import SwAxisGrouped, SwAxisIndividual
|
|
14
|
-
from ..models.M2.MSR.DataDictionary.RecordLayout import SwRecordLayoutGroupContent, SwRecordLayoutV
|
|
20
|
+
from ..models.M2.MSR.DataDictionary.RecordLayout import SwRecordLayout, SwRecordLayoutGroupContent, SwRecordLayoutV
|
|
15
21
|
from ..models.M2.MSR.DataDictionary.DataDefProperties import ValueList
|
|
16
22
|
from ..models.M2.MSR.DataDictionary.RecordLayout import SwRecordLayoutGroup
|
|
17
23
|
from ..models.M2.MSR.DataDictionary.CalibrationParameter import SwCalprmAxisSet
|
|
@@ -23,11 +29,11 @@ from ..models.M2.MSR.Documentation.TextModel.LanguageDataModel import LLongName,
|
|
|
23
29
|
from ..models.M2.MSR.Documentation.TextModel.MultilanguageData import MultiLanguageOverviewParagraph, MultiLanguageParagraph, MultiLanguagePlainText, MultilanguageLongName
|
|
24
30
|
|
|
25
31
|
from ..models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
26
|
-
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswCalledEntity, BswDataReceivedEvent, BswInternalBehavior, BswInternalTriggerOccurredEvent, BswInterruptEntity, BswModeSwitchEvent, BswModuleEntity, BswSchedulableEntity, BswScheduleEvent, BswModeSenderPolicy, BswTimingEvent
|
|
32
|
+
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswBackgroundEvent, BswCalledEntity, BswDataReceivedEvent, BswExternalTriggerOccurredEvent, BswInternalBehavior, BswInternalTriggerOccurredEvent, BswInterruptEntity, BswModeSwitchEvent, BswModuleEntity, BswSchedulableEntity, BswScheduleEvent, BswModeSenderPolicy, BswTimingEvent
|
|
27
33
|
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswInterfaces import BswModuleEntry
|
|
28
34
|
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswImplementation import BswImplementation
|
|
29
35
|
from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswOverview import BswModuleDescription
|
|
30
|
-
from ..models.M2.AUTOSARTemplates.CommonStructure import ApplicationValueSpecification, ArrayValueSpecification, ConstantReference, NumericalValueSpecification, RecordValueSpecification, TextValueSpecification, ValueSpecification
|
|
36
|
+
from ..models.M2.AUTOSARTemplates.CommonStructure import ApplicationValueSpecification, ArrayValueSpecification, ConstantReference, ConstantSpecification, NumericalValueSpecification, RecordValueSpecification, TextValueSpecification, ValueSpecification
|
|
31
37
|
from ..models.M2.AUTOSARTemplates.CommonStructure.Filter import DataFilter
|
|
32
38
|
from ..models.M2.AUTOSARTemplates.CommonStructure.FlatMap import FlatInstanceDescriptor, FlatMap
|
|
33
39
|
from ..models.M2.AUTOSARTemplates.CommonStructure.Implementation import ImplementationProps, Code
|
|
@@ -41,23 +47,25 @@ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServ
|
|
|
41
47
|
from ..models.M2.AUTOSARTemplates.CommonStructure.Implementation import Implementation
|
|
42
48
|
from ..models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
|
|
43
49
|
from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.ExecutionOrderConstraint import ExecutionOrderConstraint
|
|
44
|
-
from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import TimingExtension
|
|
50
|
+
from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import SwcTiming, TimingExtension
|
|
51
|
+
from ..models.M2.AUTOSARTemplates.DiagnosticExtract.DiagnosticContribution import DiagnosticServiceTable
|
|
45
52
|
from ..models.M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucAbstractReferenceValue, EcucContainerValue, EcucInstanceReferenceValue, EcucModuleConfigurationValues, EcucNumericalParamValue, EcucParameterValue, EcucReferenceValue, EcucTextualParamValue, EcucValueCollection
|
|
46
53
|
from ..models.M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AnyInstanceRef
|
|
47
|
-
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable, MultilanguageReferrable
|
|
54
|
+
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable, MultilanguageReferrable, Referrable
|
|
48
55
|
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.EngineeringObject import AutosarEngineeringObject, EngineeringObject
|
|
49
56
|
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage, ReferenceBase
|
|
50
57
|
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Ip6AddressString, RefType, ARLiteral
|
|
58
|
+
from ..models.M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
|
|
51
59
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.PortAPIOptions import PortAPIOption, PortDefinedArgumentValue
|
|
52
|
-
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import DataReceivedEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent
|
|
53
|
-
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationRecordDataType, ApplicationArrayDataType, ApplicationCompositeDataType, ApplicationDataType, AutosarDataType, DataTypeMap, DataTypeMappingSet
|
|
60
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import AsynchronousServerCallReturnsEvent, BackgroundEvent, DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent, ModeSwitchedAckEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent, TimingEvent
|
|
61
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationPrimitiveDataType, ApplicationRecordDataType, ApplicationArrayDataType, ApplicationCompositeDataType, ApplicationDataType, AutosarDataType, DataTypeMap, DataTypeMappingSet
|
|
54
62
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndProtectionSet, EndToEndDescription, EndToEndProtection, EndToEndProtectionVariablePrototype
|
|
55
63
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition.InstanceRefs import POperationInAtomicSwcInstanceRef, PPortInCompositionInstanceRef, ROperationInAtomicSwcInstanceRef, RPortInCompositionInstanceRef
|
|
56
64
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface.InstanceRefs import ApplicationCompositeElementInPortInterfaceInstanceRef
|
|
57
65
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef, VariableInAtomicSWCTypeInstanceRef
|
|
58
|
-
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import CompositeNetworkRepresentation, TransmissionAcknowledgementRequest
|
|
66
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import CompositeNetworkRepresentation, ModeSwitchedAckRequest, TransmissionAcknowledgementRequest
|
|
59
67
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.IncludedDataTypes import IncludedDataTypeSet
|
|
60
|
-
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import AbstractProvidedPortPrototype, AbstractRequiredPortPrototype, CompositionSwComponentType, PortGroup, SwComponentType, SymbolProps, PPortPrototype, RPortPrototype
|
|
68
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import AbstractProvidedPortPrototype, AbstractRequiredPortPrototype, ApplicationSwComponentType, ComplexDeviceDriverSwComponentType, CompositionSwComponentType, EcuAbstractionSwComponentType, PortGroup, SensorActuatorSwComponentType, ServiceSwComponentType, SwComponentType, SymbolProps, PPortPrototype, RPortPrototype
|
|
61
69
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import InnerPortGroupInCompositionInstanceRef, PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef, RModeInAtomicSwcInstanceRef, RVariableInAtomicSwcInstanceRef
|
|
62
70
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import RunnableEntity, RunnableEntityArgument, SwcInternalBehavior
|
|
63
71
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AutosarVariableRef import AutosarVariableRef
|
|
@@ -66,28 +74,32 @@ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition import Assembl
|
|
|
66
74
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import IncludedModeDeclarationGroupSet, ModeAccessPoint
|
|
67
75
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServerCall import ServerCallPoint
|
|
68
76
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import ClientComSpec, ModeSwitchReceiverComSpec, ModeSwitchSenderComSpec, NonqueuedReceiverComSpec, NonqueuedSenderComSpec, ParameterRequireComSpec, QueuedReceiverComSpec, QueuedSenderComSpec, ReceiverComSpec, SenderComSpec, ServerComSpec
|
|
69
|
-
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ArgumentDataPrototype, ClientServerInterface, ClientServerOperation, DataPrototypeMapping, InvalidationPolicy, ModeSwitchInterface, ParameterInterface, PortInterface, PortInterfaceMappingSet, SenderReceiverInterface, VariableAndParameterInterfaceMapping
|
|
77
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ArgumentDataPrototype, ClientServerInterface, ClientServerOperation, DataPrototypeMapping, InvalidationPolicy, ModeSwitchInterface, ParameterInterface, PortInterface, PortInterfaceMappingSet, SenderReceiverInterface, TriggerInterface, VariableAndParameterInterfaceMapping
|
|
70
78
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import AtomicSwComponentType
|
|
79
|
+
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcImplementation import SwcImplementation
|
|
71
80
|
from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ApplicationCompositeElementDataPrototype, AutosarDataPrototype, DataPrototype, ParameterDataPrototype, VariableDataPrototype
|
|
72
81
|
|
|
73
82
|
from ..models.M2.AUTOSARTemplates.SystemTemplate import SwcToEcuMapping , System, SystemMapping
|
|
74
83
|
from ..models.M2.AUTOSARTemplates.SystemTemplate.DataMapping import SenderReceiverToSignalGroupMapping, SenderReceiverToSignalMapping
|
|
75
84
|
from ..models.M2.AUTOSARTemplates.SystemTemplate.DiagnosticConnection import DiagnosticConnection
|
|
76
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.
|
|
85
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.ECUResourceMapping import ECUMapping
|
|
86
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import CanNmCluster, CanNmClusterCoupling, CanNmNode, NmCluster, NmConfig, NmEcu, NmNode, UdpNmCluster, UdpNmClusterCoupling, UdpNmEcu, UdpNmNode
|
|
77
87
|
from ..models.M2.AUTOSARTemplates.SystemTemplate.InstanceRefs import ComponentInSystemInstanceRef, VariableDataPrototypeInSystemInstanceRef
|
|
78
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import ApplicationEntry, LinFrameTriggering, LinScheduleTable, ScheduleTableEntry
|
|
79
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinTopology import LinCommunicationConnector, LinMaster
|
|
80
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import AbstractCanCluster, CanClusterBusOffRecovery, CanPhysicalChannel, CommConnectorPort, CommunicationCluster, CommunicationConnector, EthernetPhysicalChannel, FramePort, IPduPort, ISignalPort, LinPhysicalChannel, PhysicalChannel
|
|
81
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import Frame, FrameTriggering, IPdu, IPduTiming, ISignalIPdu, ISignalTriggering, PduTriggering
|
|
88
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import ApplicationEntry, LinFrameTriggering, LinScheduleTable, LinUnconditionalFrame, ScheduleTableEntry
|
|
89
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinTopology import LinCommunicationConnector, LinCommunicationController, LinMaster
|
|
90
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import AbstractCanCluster, CanCluster, CanClusterBusOffRecovery, CanPhysicalChannel, CommConnectorPort, CommunicationCluster, CommunicationConnector, CommunicationController, EthernetPhysicalChannel, FramePort, IPduPort, ISignalPort, LinCluster, LinPhysicalChannel, PhysicalChannel
|
|
91
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import DcmIPdu, DynamicPart, DynamicPartAlternative, Frame, FrameTriggering, GeneralPurposeIPdu, GeneralPurposePdu, IPdu, IPduTiming, ISignal, ISignalGroup, ISignalIPdu, ISignalIPduGroup, ISignalToIPduMapping, ISignalTriggering, MultiplexedIPdu, MultiplexedPart, NPdu, NmPdu, Pdu, PduTriggering, SecureCommunicationAuthenticationProps, SecureCommunicationFreshnessProps, SecureCommunicationProps, SecureCommunicationPropsSet, SecuredIPdu, SegmentPosition, StaticPart, SystemSignal, SystemSignalGroup, UserDefinedIPdu, UserDefinedPdu
|
|
82
92
|
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.Timing import CyclicTiming, EventControlledTiming, TimeRangeType, TransmissionModeCondition, TransmissionModeDeclaration, TransmissionModeTiming
|
|
83
93
|
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.EcuInstance import EcuInstance
|
|
84
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication import CanFrameTriggering, RxIdentifierRange
|
|
85
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import CanCommunicationConnector, CanCommunicationController
|
|
86
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.
|
|
87
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.
|
|
94
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication import CanFrame, CanFrameTriggering, RxIdentifierRange
|
|
95
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import AbstractCanCommunicationController, AbstractCanCommunicationControllerAttributes, CanCommunicationConnector, CanCommunicationController, CanControllerConfigurationRequirements, CanControllerFdConfiguration, CanControllerFdConfigurationRequirements
|
|
96
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetCommunication import SoAdRoutingGroup, SocketConnection, SocketConnectionBundle, SocketConnectionIpduIdentifier
|
|
97
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetFrame import GenericEthernetFrame
|
|
88
98
|
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.NetworkEndpoint import DoIpEntity, InfrastructureServices, Ipv6Configuration, NetworkEndpoint
|
|
89
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import ApplicationEndpoint, ConsumedEventGroup, ConsumedServiceInstance, GenericTp, SoAdConfig, SocketAddress, TcpTp, TpPort, TransportProtocolConfiguration, UdpTp
|
|
90
|
-
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.
|
|
99
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import ApplicationEndpoint, ConsumedEventGroup, ConsumedServiceInstance, EventHandler, GenericTp, ProvidedServiceInstance, SdServerConfig, SoAdConfig, SocketAddress, TcpTp, TpPort, TransportProtocolConfiguration, UdpTp
|
|
100
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import CouplingPort, CouplingPortDetails, CouplingPortFifo, CouplingPortScheduler, CouplingPortStructuralElement, EthernetCluster, EthernetCommunicationConnector, EthernetCommunicationController, EthernetPriorityRegeneration, InitialSdDelayConfig, MacMulticastGroup, RequestResponseDelay, SdClientConfig, VlanMembership
|
|
101
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Multiplatform import Gateway, IPduMapping, ISignalMapping, TargetIPduRef
|
|
102
|
+
from ..models.M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpAddress, CanTpChannel, CanTpConfig, CanTpConnection, CanTpEcu, CanTpNode, DoIpLogicAddress, DoIpTpConfig, DoIpTpConnection, LinTpConfig, LinTpConnection, LinTpNode, TpAddress, TpConfig, TpConnection
|
|
91
103
|
|
|
92
104
|
from .abstract_arxml_parser import AbstractARXMLParser
|
|
93
105
|
|
|
@@ -112,13 +124,24 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
112
124
|
sd.setValue(child_element.text)
|
|
113
125
|
sdg.addSd(sd)
|
|
114
126
|
|
|
127
|
+
def readSdgCaption(self, element: ET.Element, sdg:Sdg):
|
|
128
|
+
child_element = self.find(element, "SDG-CAPTION")
|
|
129
|
+
if child_element is not None:
|
|
130
|
+
sdg.createSdgCaption(self.getShortName(child_element))
|
|
131
|
+
|
|
132
|
+
def readSdgSdxRefs(self, element: ET.SubElement, sdg:Sdg):
|
|
133
|
+
for ref in self.getChildElementRefTypeList(element, "SDX-REF"):
|
|
134
|
+
sdg.addSdxRef(ref)
|
|
135
|
+
|
|
115
136
|
def getSdg(self, element: ET.Element) -> Sdg:
|
|
116
137
|
sdg = Sdg()
|
|
117
138
|
if 'GID' in element.attrib:
|
|
118
139
|
sdg.setGID(element.attrib["GID"])
|
|
140
|
+
self.readSdgCaption(element, sdg)
|
|
119
141
|
self.readSd(element, sdg)
|
|
120
142
|
for child_element in self.findall(element, "SDG"):
|
|
121
143
|
sdg.addSdgContentsType(self.getSdg(child_element))
|
|
144
|
+
self.readSdgSdxRefs(element, sdg)
|
|
122
145
|
return sdg
|
|
123
146
|
|
|
124
147
|
def readSdgs(self, element: ET.Element, admin_data: AdminData):
|
|
@@ -136,9 +159,12 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
136
159
|
|
|
137
160
|
self.readSdgs(child_element, admin_data)
|
|
138
161
|
return admin_data
|
|
162
|
+
|
|
163
|
+
def readReferrable(self, element: ET.Element, referrable: Referrable):
|
|
164
|
+
self.readARObjectAttributes(element, referrable)
|
|
139
165
|
|
|
140
166
|
def readMultilanguageReferrable(self, element: ET.Element, referrable: MultilanguageReferrable):
|
|
141
|
-
self.
|
|
167
|
+
self.readReferrable(element, referrable)
|
|
142
168
|
referrable.setLongName(self.getMultilanguageLongName(element, "LONG-NAME"))
|
|
143
169
|
|
|
144
170
|
def readIdentifiable(self, element: ET.Element, identifiable: Identifiable):
|
|
@@ -308,12 +334,12 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
308
334
|
self.readBswEvent(element, event)
|
|
309
335
|
|
|
310
336
|
def readBswModeSwitchEvent(self, element: ET.Element, event: BswModeSwitchEvent):
|
|
311
|
-
self.logger.debug("
|
|
337
|
+
self.logger.debug("Read BswModeSwitchEvent <%s>" % event.getShortName())
|
|
312
338
|
# Read the Inherit BswScheduleEvent
|
|
313
339
|
self.readBswScheduleEvent(element, event)
|
|
314
340
|
|
|
315
341
|
def readBswTimingEvent(self, element: ET.Element, event: BswTimingEvent):
|
|
316
|
-
self.logger.debug("
|
|
342
|
+
self.logger.debug("Read BswTimingEvent <%s>" % event.getShortName())
|
|
317
343
|
# Read the Inherit BswScheduleEvent
|
|
318
344
|
self.readBswScheduleEvent(element, event)
|
|
319
345
|
event.setPeriod(self.getChildElementOptionalTimeValue(element, "PERIOD"))
|
|
@@ -323,13 +349,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
323
349
|
self.logger.debug(" Period: <%f, %s>" % (event.getPeriod().getValue(), event.getPeriod().getText()))
|
|
324
350
|
|
|
325
351
|
def readBswDataReceivedEvent(self, element: ET.Element, event: BswDataReceivedEvent):
|
|
326
|
-
self.logger.debug("
|
|
352
|
+
self.logger.debug("Read BswDataReceivedEvent <%s>" % event.getShortName())
|
|
327
353
|
# Read the Inherit BswScheduleEvent
|
|
328
354
|
self.readBswScheduleEvent(element, event)
|
|
329
355
|
event.setDataRef(self.getChildElementOptionalRefType(element, "DATA-REF"))
|
|
330
356
|
|
|
331
357
|
def readBswInternalTriggerOccurredEvent(self, element: ET.Element, event: BswInternalTriggerOccurredEvent):
|
|
332
|
-
self.logger.debug("
|
|
358
|
+
self.logger.debug("Read BswInternalTriggerOccurredEvent <%s>" % event.getShortName())
|
|
333
359
|
# Read the Inherit BswScheduleEvent
|
|
334
360
|
self.readBswScheduleEvent(element, event)
|
|
335
361
|
event.setEventSourceRef(self.getChildElementOptionalRefType(element, "EVENT-SOURCE-REF"))
|
|
@@ -346,7 +372,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
346
372
|
if tag_name == "BSW-MODE-SENDER-POLICY":
|
|
347
373
|
parent.addModeSenderPolicy(self.getBswModeSenderPolicy(child_element))
|
|
348
374
|
else:
|
|
349
|
-
self.
|
|
375
|
+
self.raiseError("Unsupported ModeSenderPolicy type <%s>." % tag_name)
|
|
350
376
|
|
|
351
377
|
def readDataTypeMappingRefs(self, element: ET.Element, behavior: InternalBehavior):
|
|
352
378
|
child_element = self.find(element, "DATA-TYPE-MAPPING-REFS")
|
|
@@ -391,27 +417,27 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
391
417
|
def readServiceDependency(self, element: ET.Element, dependency: ServiceDependency):
|
|
392
418
|
self.readIdentifiable(element, dependency)
|
|
393
419
|
for child_element in self.findall(element, "ASSIGNED-DATA-TYPES/*"):
|
|
394
|
-
tag_name = self.getTagName(child_element
|
|
420
|
+
tag_name = self.getTagName(child_element)
|
|
395
421
|
if (tag_name == "ROLE-BASED-DATA-TYPE-ASSIGNMENT"):
|
|
396
422
|
dependency.addAssignedDataType(self.getRoleBasedDataTypeAssignment(child_element))
|
|
397
423
|
else:
|
|
398
|
-
self.
|
|
424
|
+
self.notImplemented("Unsupported assigned data type <%s>" % tag_name)
|
|
399
425
|
|
|
400
426
|
def readSwcServiceDependencyAssignedData(self, element: ET.Element, dependency: SwcServiceDependency):
|
|
401
427
|
for child_element in self.findall(element, "ASSIGNED-DATAS/*"):
|
|
402
|
-
tag_name = self.getTagName(child_element
|
|
428
|
+
tag_name = self.getTagName(child_element)
|
|
403
429
|
if (tag_name == "ROLE-BASED-DATA-ASSIGNMENT"):
|
|
404
430
|
dependency.AddAssignedData(self.getRoleBasedDataAssignment(child_element))
|
|
405
431
|
else:
|
|
406
|
-
self.
|
|
432
|
+
self.raiseError("Unsupported assigned data <%s>" % tag_name)
|
|
407
433
|
|
|
408
434
|
def readSwcServiceDependencyAssignedPorts(self, element: ET.Element, dependency: SwcServiceDependency):
|
|
409
435
|
for child_element in self.findall(element, "ASSIGNED-PORTS/*"):
|
|
410
|
-
tag_name = self.getTagName(child_element
|
|
436
|
+
tag_name = self.getTagName(child_element)
|
|
411
437
|
if (tag_name == "ROLE-BASED-PORT-ASSIGNMENT"):
|
|
412
438
|
dependency.AddAssignedPort(self.getRoleBasedPortAssignment(child_element))
|
|
413
439
|
else:
|
|
414
|
-
self.
|
|
440
|
+
self.raiseError("Unsupported assigned ports <%s>" % tag_name)
|
|
415
441
|
|
|
416
442
|
def readNvBlockNeeds(self, element: ET.Element, parent: SwcServiceDependency):
|
|
417
443
|
short_name = self.getShortName(element)
|
|
@@ -507,7 +533,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
507
533
|
|
|
508
534
|
def readSwcServiceDependencyServiceNeeds(self, element: ET.Element, parent: SwcServiceDependency):
|
|
509
535
|
for child_element in self.findall(element, "SERVICE-NEEDS/*"):
|
|
510
|
-
tag_name = self.getTagName(child_element
|
|
536
|
+
tag_name = self.getTagName(child_element)
|
|
511
537
|
if tag_name == "NV-BLOCK-NEEDS":
|
|
512
538
|
self.readNvBlockNeeds(child_element, parent)
|
|
513
539
|
elif tag_name == "DIAGNOSTIC-COMMUNICATION-MANAGER-NEEDS":
|
|
@@ -538,7 +564,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
538
564
|
|
|
539
565
|
def readSwcInternalBehaviorServiceDependencies(self, element: ET.Element, parent: SwcInternalBehavior):
|
|
540
566
|
for child_element in self.findall(element, "SERVICE-DEPENDENCYS/*"):
|
|
541
|
-
tag_name = self.getTagName(child_element
|
|
567
|
+
tag_name = self.getTagName(child_element)
|
|
542
568
|
if (tag_name == "SWC-SERVICE-DEPENDENCY"):
|
|
543
569
|
self.readSwcServiceDependency(child_element, parent)
|
|
544
570
|
else:
|
|
@@ -632,6 +658,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
632
658
|
else:
|
|
633
659
|
self.notImplemented("Unsupported BswModuleEntity <%s>" % tag_name)
|
|
634
660
|
|
|
661
|
+
def readBswBackgroundEvent(self, element: ET.Element, event: BswBackgroundEvent):
|
|
662
|
+
self.readBswScheduleEvent(element, event)
|
|
663
|
+
|
|
664
|
+
def readBswExternalTriggerOccurredEvent(self, element: ET.Element, event: BswExternalTriggerOccurredEvent):
|
|
665
|
+
self.readBswScheduleEvent(element, event)
|
|
666
|
+
event.setTriggerRef(self.getChildElementOptionalRefType(element, "TRIGGER-REF"))
|
|
667
|
+
|
|
635
668
|
def readBswInternalBehaviorEvents(self, element: ET.Element, behavior: BswInternalBehavior):
|
|
636
669
|
for child_element in self.findall(element, "EVENTS/*"):
|
|
637
670
|
tag_name = self.getTagName(child_element)
|
|
@@ -647,6 +680,12 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
647
680
|
elif tag_name == "BSW-INTERNAL-TRIGGER-OCCURRED-EVENT":
|
|
648
681
|
event = behavior.createBswInternalTriggerOccurredEvent(self.getShortName(child_element))
|
|
649
682
|
self.readBswInternalTriggerOccurredEvent(child_element, event)
|
|
683
|
+
elif tag_name == "BSW-BACKGROUND-EVENT":
|
|
684
|
+
event = behavior.createBswBackgroundEvent(self.getShortName(child_element))
|
|
685
|
+
self.readBswBackgroundEvent(child_element, event)
|
|
686
|
+
elif tag_name == "BSW-EXTERNAL-TRIGGER-OCCURRED-EVENT":
|
|
687
|
+
event = behavior.createBswExternalTriggerOccurredEvent(self.getShortName(child_element))
|
|
688
|
+
self.readBswExternalTriggerOccurredEvent(child_element, event)
|
|
650
689
|
else:
|
|
651
690
|
self.notImplemented("Unsupported BswModuleEntity <%s>" % tag_name)
|
|
652
691
|
|
|
@@ -664,17 +703,15 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
664
703
|
for group_set in self.getIncludedModeDeclarationGroupSets(child_element):
|
|
665
704
|
behavior.addIncludedModeDeclarationGroupSet(group_set)
|
|
666
705
|
|
|
667
|
-
def readBswModuleDescription(self, element: ET.Element,
|
|
668
|
-
|
|
669
|
-
bsw_module_description = parent.createBswModuleDescription(short_name)
|
|
670
|
-
bsw_module_description.moduleId = self.getChildElementOptionalNumericalValue(element, "MODULE-ID")
|
|
706
|
+
def readBswModuleDescription(self, element: ET.Element, desc: BswModuleDescription):
|
|
707
|
+
self.logger.debug("Read BswModuleDescription <%s>" % desc.getShortName())
|
|
671
708
|
|
|
672
|
-
self.
|
|
673
|
-
|
|
674
|
-
self.readBswModuleDescriptionImplementedEntry(element,
|
|
675
|
-
self.readProvidedModeGroup(element,
|
|
676
|
-
self.readRequiredModeGroup(element,
|
|
677
|
-
self.readBswInternalBehavior(element,
|
|
709
|
+
self.readIdentifiable(element, desc)
|
|
710
|
+
desc.setModuleId(self.getChildElementOptionalNumericalValue(element, "MODULE-ID"))
|
|
711
|
+
self.readBswModuleDescriptionImplementedEntry(element, desc)
|
|
712
|
+
self.readProvidedModeGroup(element, desc)
|
|
713
|
+
self.readRequiredModeGroup(element, desc)
|
|
714
|
+
self.readBswInternalBehavior(element, desc)
|
|
678
715
|
|
|
679
716
|
def readSwServiceArg(self, element: ET.Element, arg: SwServiceArg):
|
|
680
717
|
self.logger.debug("Read SwServiceArg <%s>" % arg.getShortName())
|
|
@@ -690,9 +727,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
690
727
|
else:
|
|
691
728
|
self.notImplemented("Unsupported Argument <%s>" % tag_name)
|
|
692
729
|
|
|
693
|
-
def readBswModuleEntry(self, element: ET.Element,
|
|
694
|
-
|
|
695
|
-
entry = parent.createBswModuleEntry(short_name)
|
|
730
|
+
def readBswModuleEntry(self, element: ET.Element, entry: BswModuleEntry):
|
|
731
|
+
self.logger.debug("Read BswModuleEntry <%s>" % entry.getShortName())
|
|
696
732
|
self.readIdentifiable(element, entry)
|
|
697
733
|
self.readBswModuleEntryArguments(element, entry)
|
|
698
734
|
entry.setIsReentrant(self.getChildElementOptionalBooleanValue(element, "IS-REENTRANT")) \
|
|
@@ -717,11 +753,11 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
717
753
|
|
|
718
754
|
def readArtifactDescriptor(self, element: ET.Element, code_desc: Code):
|
|
719
755
|
for child_element in self.findall(element, "ARTIFACT-DESCRIPTORS/*"):
|
|
720
|
-
tag_name = self.getTagName(child_element
|
|
756
|
+
tag_name = self.getTagName(child_element)
|
|
721
757
|
if tag_name == "AUTOSAR-ENGINEERING-OBJECT":
|
|
722
758
|
code_desc.addArtifactDescriptor(self.getAutosarEngineeringObject(child_element))
|
|
723
759
|
else:
|
|
724
|
-
self.
|
|
760
|
+
self.raiseError("Unsupported Artifact Descriptor <%s>" % tag_name)
|
|
725
761
|
|
|
726
762
|
def readCodeDescriptor(self, element: ET.Element, impl: Implementation):
|
|
727
763
|
for child_element in self.findall(element, "CODE-DESCRIPTORS/CODE"):
|
|
@@ -790,21 +826,19 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
790
826
|
for ref in self.getChildElementRefTypeList(child_element, "VENDOR-SPECIFIC-MODULE-DEF-REF"):
|
|
791
827
|
impl.addVendorSpecificModuleDefRef(ref)
|
|
792
828
|
|
|
793
|
-
def readBswImplementation(self, element: ET.Element,
|
|
794
|
-
|
|
795
|
-
impl = parent.createBswImplementation(short_name)
|
|
796
|
-
self.logger.debug("readBswImplementation %s" % impl.getShortName())
|
|
829
|
+
def readBswImplementation(self, element: ET.Element, impl: BswImplementation):
|
|
830
|
+
self.logger.debug("Read BswImplementation <%s>" % impl.getShortName())
|
|
797
831
|
self.readImplementation(element, impl)
|
|
798
832
|
impl.setArReleaseVersion(self.getChildElementOptionalLiteral(element, "AR-RELEASE-VERSION")) \
|
|
799
833
|
.setBehaviorRef(self.getChildElementOptionalRefType(element, "BEHAVIOR-REF"))
|
|
800
834
|
self.readBswImplementationVendorSpecificModuleDefRefs(element, impl)
|
|
835
|
+
AUTOSAR.getInstance().addImplementationBehaviorMap(impl.getFullName(), impl.getBehaviorRef().getValue())
|
|
801
836
|
|
|
802
|
-
def readSwcImplementation(self, element: ET.Element,
|
|
803
|
-
|
|
804
|
-
impl = parent.createSwcImplementation(short_name)
|
|
805
|
-
self.logger.debug("readSwcImplementation %s" % impl.getShortName())
|
|
837
|
+
def readSwcImplementation(self, element: ET.Element, impl: SwcImplementation):
|
|
838
|
+
self.logger.debug("Read SwcImplementation <%s>" % impl.getShortName())
|
|
806
839
|
self.readImplementation(element, impl)
|
|
807
|
-
impl.
|
|
840
|
+
impl.setBehaviorRef(self.getChildElementOptionalRefType(element, "BEHAVIOR-REF"))
|
|
841
|
+
AUTOSAR.getInstance().addImplementationBehaviorMap(impl.getFullName(), impl.getBehaviorRef().getValue())
|
|
808
842
|
|
|
809
843
|
def readDataReceivePointByArguments(self, element, parent: RunnableEntity):
|
|
810
844
|
self._readVariableAccesses(element, parent, "DATA-RECEIVE-POINT-BY-ARGUMENTS")
|
|
@@ -890,13 +924,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
890
924
|
|
|
891
925
|
def readInternalBehaviorServerCallPoint(self, element: ET.Element, parent: RunnableEntity):
|
|
892
926
|
for child_element in self.findall(element, "SERVER-CALL-POINTS/*"):
|
|
893
|
-
tag_name = self.getTagName(child_element
|
|
927
|
+
tag_name = self.getTagName(child_element)
|
|
894
928
|
if tag_name == "SYNCHRONOUS-SERVER-CALL-POINT":
|
|
895
929
|
self.readSynchronousServerCallPoint(child_element, parent)
|
|
896
930
|
elif tag_name == "ASYNCHRONOUS-SERVER-CALL-POINT":
|
|
897
931
|
self.readAsynchronousServerCallPoint(child_element, parent)
|
|
898
932
|
else:
|
|
899
|
-
self.
|
|
933
|
+
self.raiseError("Unsupported server call point type <%s>" % tag_name)
|
|
900
934
|
|
|
901
935
|
def readInternalTriggeringPoints(self, element: ET.Element, parent: RunnableEntity):
|
|
902
936
|
for child_element in self.findall(element, "INTERNAL-TRIGGERING-POINTS/INTERNAL-TRIGGERING-POINT"):
|
|
@@ -1008,9 +1042,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1008
1042
|
.setTargetProvidedOperationRef(self.getChildElementRefType(parent.getShortName(), child_element, "TARGET-PROVIDED-OPERATION-REF"))
|
|
1009
1043
|
parent.setOperationIRef(operation_iref)
|
|
1010
1044
|
|
|
1011
|
-
def readOperationInvokedEvent(self, element: ET.Element,
|
|
1012
|
-
|
|
1013
|
-
event = parent.createOperationInvokedEvent(short_name)
|
|
1045
|
+
def readOperationInvokedEvent(self, element: ET.Element, event: OperationInvokedEvent):
|
|
1046
|
+
self.logger.debug("Read OperationInvokedEvent <%s>" % event.getShortName())
|
|
1014
1047
|
self.readPOperationIRef(element, "OPERATION-IREF", event)
|
|
1015
1048
|
self.readRTEEvent(element, event)
|
|
1016
1049
|
|
|
@@ -1068,60 +1101,76 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1068
1101
|
option.addPortArgValue(self.readPortDefinedArgumentValue(argument_value_tag))
|
|
1069
1102
|
behavior.addPortAPIOption(option)
|
|
1070
1103
|
|
|
1071
|
-
def readTimingEvent(self, element: ET.Element,
|
|
1072
|
-
|
|
1073
|
-
event = parent.createTimingEvent(short_name)
|
|
1104
|
+
def readTimingEvent(self, element: ET.Element, event: TimingEvent):
|
|
1105
|
+
self.logger.debug("Read TimingEvent <%s>" % event.getShortName())
|
|
1074
1106
|
self.readRTEEvent(element, event)
|
|
1075
1107
|
event.setOffset(self.getChildElementOptionalTimeValue(element, "OFFSET")) \
|
|
1076
1108
|
.setPeriod(self.getChildElementOptionalTimeValue(element, "PERIOD"))
|
|
1077
1109
|
|
|
1078
|
-
def readDataReceivedEvent(self, element: ET.Element,
|
|
1079
|
-
|
|
1080
|
-
event = parent.createDataReceivedEvent(short_name)
|
|
1110
|
+
def readDataReceivedEvent(self, element: ET.Element, event: DataReceivedEvent):
|
|
1111
|
+
self.logger.debug("Read DataReceivedEvent <%s>" % event.getShortName())
|
|
1081
1112
|
self.readRTEEvent(element, event)
|
|
1082
1113
|
self.readRVariableInAtomicSwcInstanceRef(element, event)
|
|
1083
1114
|
|
|
1084
|
-
def readSwcModeSwitchEvent(self, element: ET.Element,
|
|
1085
|
-
|
|
1086
|
-
event = parent.createSwcModeSwitchEvent(short_name)
|
|
1115
|
+
def readSwcModeSwitchEvent(self, element: ET.Element, event: SwcModeSwitchEvent):
|
|
1116
|
+
self.logger.debug("Read SwcModeSwitchEvent <%s>" % event.getShortName())
|
|
1087
1117
|
self.readRTEEvent(element, event)
|
|
1088
1118
|
event.setActivation(self.getChildElementOptionalLiteral(element, "ACTIVATION"))
|
|
1089
1119
|
self.readRModeInAtomicSwcInstanceRef(element, event)
|
|
1090
1120
|
|
|
1091
|
-
def readInternalTriggerOccurredEvent(self, element: ET.Element,
|
|
1092
|
-
|
|
1093
|
-
event = parent.createInternalTriggerOccurredEvent(short_name)
|
|
1121
|
+
def readInternalTriggerOccurredEvent(self, element: ET.Element, event: InternalTriggerOccurredEvent):
|
|
1122
|
+
self.logger.debug("Read InternalTriggerOccurredEvent <%s>" % event.getShortName())
|
|
1094
1123
|
self.readRTEEvent(element, event)
|
|
1095
1124
|
event.setEventSourceRef(self.getChildElementOptionalRefType(element, "EVENT-SOURCE-REF"))
|
|
1096
1125
|
|
|
1097
|
-
def readInitEvent(self, element,
|
|
1098
|
-
|
|
1099
|
-
event = parent.createInitEvent(short_name)
|
|
1126
|
+
def readInitEvent(self, element, event: InitEvent):
|
|
1127
|
+
self.logger.debug("Read InitEvent <%s>" % event.getShortName())
|
|
1100
1128
|
self.readRTEEvent(element, event)
|
|
1101
1129
|
|
|
1102
|
-
def readAsynchronousServerCallReturnsEvent(self, element,
|
|
1103
|
-
|
|
1104
|
-
event = parent.createAsynchronousServerCallReturnsEvent(short_name)
|
|
1130
|
+
def readAsynchronousServerCallReturnsEvent(self, element, event: AsynchronousServerCallReturnsEvent):
|
|
1131
|
+
self.logger.debug("Read AsynchronousServerCallReturnsEvent <%s>" % event.getShortName())
|
|
1105
1132
|
self.readRTEEvent(element, event)
|
|
1106
1133
|
event.setActivationReasonRepresentationRef(self.getChildElementOptionalRefType(element, "EVENT-SOURCE-REF"))
|
|
1107
1134
|
|
|
1135
|
+
def readModeSwitchedAckEvent(self, element, event: ModeSwitchedAckEvent):
|
|
1136
|
+
self.logger.debug("Read ModeSwitchedAckEvent <%s>" % event.getShortName())
|
|
1137
|
+
self.readRTEEvent(element, event)
|
|
1138
|
+
event.setEventSourceRef(self.getChildElementOptionalRefType(element, "EVENT-SOURCE-REF"))
|
|
1139
|
+
|
|
1140
|
+
def readBackgroundEvent(self, element, event: BackgroundEvent):
|
|
1141
|
+
self.logger.debug("Read BackgroundEvent <%s>" % event.getShortName())
|
|
1142
|
+
self.readRTEEvent(element, event)
|
|
1143
|
+
|
|
1108
1144
|
def readSwcInternalBehaviorEvents(self, element: ET.Element, parent: SwcInternalBehavior):
|
|
1109
1145
|
for child_element in self.findall(element, "EVENTS/*"):
|
|
1110
|
-
tag_name = self.getTagName(child_element
|
|
1146
|
+
tag_name = self.getTagName(child_element)
|
|
1111
1147
|
if tag_name == "TIMING-EVENT":
|
|
1112
|
-
self.
|
|
1148
|
+
event = parent.createTimingEvent(self.getShortName(child_element))
|
|
1149
|
+
self.readTimingEvent(child_element, event)
|
|
1113
1150
|
elif tag_name == "SWC-MODE-SWITCH-EVENT":
|
|
1114
|
-
self.
|
|
1151
|
+
event = parent.createSwcModeSwitchEvent(self.getShortName(child_element))
|
|
1152
|
+
self.readSwcModeSwitchEvent(child_element, event)
|
|
1115
1153
|
elif tag_name == "OPERATION-INVOKED-EVENT":
|
|
1116
|
-
self.
|
|
1154
|
+
event = parent.createOperationInvokedEvent(self.getShortName(child_element))
|
|
1155
|
+
self.readOperationInvokedEvent(child_element, event)
|
|
1117
1156
|
elif tag_name == "DATA-RECEIVED-EVENT":
|
|
1118
|
-
self.
|
|
1157
|
+
event = parent.createDataReceivedEvent(self.getShortName(child_element))
|
|
1158
|
+
self.readDataReceivedEvent(child_element, event)
|
|
1119
1159
|
elif tag_name == "INTERNAL-TRIGGER-OCCURRED-EVENT":
|
|
1120
|
-
self.
|
|
1160
|
+
event = parent.createInternalTriggerOccurredEvent(self.getShortName(child_element))
|
|
1161
|
+
self.readInternalTriggerOccurredEvent(child_element, event)
|
|
1121
1162
|
elif tag_name == "INIT-EVENT":
|
|
1122
|
-
self.
|
|
1163
|
+
event = parent.createInitEvent(self.getShortName(child_element))
|
|
1164
|
+
self.readInitEvent(child_element, event)
|
|
1123
1165
|
elif tag_name == "ASYNCHRONOUS-SERVER-CALL-RETURNS-EVENT":
|
|
1124
|
-
self.
|
|
1166
|
+
event = parent.createAsynchronousServerCallReturnsEvent(self.getShortName(child_element))
|
|
1167
|
+
self.readAsynchronousServerCallReturnsEvent(child_element, event)
|
|
1168
|
+
elif tag_name == "MODE-SWITCHED-ACK-EVENT":
|
|
1169
|
+
event = parent.createModeSwitchedAckEvent(self.getShortName(child_element))
|
|
1170
|
+
self.readModeSwitchedAckEvent(child_element, event)
|
|
1171
|
+
elif tag_name == "BACKGROUND-EVENT":
|
|
1172
|
+
event = parent.createBackgroundEvent(self.getShortName(child_element))
|
|
1173
|
+
self.readBackgroundEvent(child_element, event)
|
|
1125
1174
|
else:
|
|
1126
1175
|
self.notImplemented("Unsupported SwcInternalBehavior Event <%s>" % tag_name)
|
|
1127
1176
|
|
|
@@ -1265,7 +1314,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1265
1314
|
def getSwCalprmAxisSet(self, element: ET.Element, key: str) -> SwCalprmAxisSet:
|
|
1266
1315
|
set = SwCalprmAxisSet()
|
|
1267
1316
|
for child_element in self.findall(element, "%s/*" % key):
|
|
1268
|
-
tag_name = self.getTagName(child_element
|
|
1317
|
+
tag_name = self.getTagName(child_element)
|
|
1269
1318
|
if tag_name == "SW-CALPRM-AXIS":
|
|
1270
1319
|
set.addSwCalprmAxis(self.getSwCalprmAxis(child_element))
|
|
1271
1320
|
return set
|
|
@@ -1310,10 +1359,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1310
1359
|
self.readIdentifiable(element, data_type)
|
|
1311
1360
|
data_type.setSwDataDefProps(self.getSwDataDefProps(element, "SW-DATA-DEF-PROPS"))
|
|
1312
1361
|
|
|
1313
|
-
def readApplicationPrimitiveDataType(self, element: ET.Element,
|
|
1314
|
-
|
|
1315
|
-
data_type = parent.createApplicationPrimitiveDataType(short_name)
|
|
1316
|
-
self.logger.debug("readApplicationPrimitiveDataTypes %s" % short_name)
|
|
1362
|
+
def readApplicationPrimitiveDataType(self, element: ET.Element, data_type: ApplicationPrimitiveDataType):
|
|
1363
|
+
self.logger.debug("Read ApplicationPrimitiveDataType <%s>" % data_type.getShortName())
|
|
1317
1364
|
self.readAutosarDataType(element, data_type)
|
|
1318
1365
|
|
|
1319
1366
|
def readApplicationCompositeElementDataPrototype(self, element: ET.Element, prototype: ApplicationCompositeElementDataPrototype):
|
|
@@ -1327,10 +1374,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1327
1374
|
self.readIdentifiable(child_element, record_element)
|
|
1328
1375
|
self.readApplicationCompositeElementDataPrototype(child_element, record_element)
|
|
1329
1376
|
|
|
1330
|
-
def
|
|
1331
|
-
|
|
1332
|
-
data_type = parent.createApplicationRecordDataType(short_name)
|
|
1333
|
-
self.logger.debug("readApplicationRecordDataTypes %s" % short_name)
|
|
1377
|
+
def readApplicationRecordDataType(self, element: ET.Element, data_type: ApplicationRecordDataType):
|
|
1378
|
+
self.logger.debug("Read ApplicationRecordDataType <%s>" % data_type.getShortName())
|
|
1334
1379
|
self.readIdentifiable(element, data_type)
|
|
1335
1380
|
data_type.setSwDataDefProps(self.getSwDataDefProps(element, "SW-DATA-DEF-PROPS"))
|
|
1336
1381
|
self.readApplicationRecordElements(element, data_type)
|
|
@@ -1345,41 +1390,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1345
1390
|
self.readImplementationDataTypeElements(child_element, type_element)
|
|
1346
1391
|
type_element.setSwDataDefProps(self.getSwDataDefProps(child_element, "SW-DATA-DEF-PROPS"))
|
|
1347
1392
|
|
|
1348
|
-
def readImplementationDataType(self, element: ET.Element,
|
|
1349
|
-
|
|
1350
|
-
data_type = parent.createImplementationDataType(short_name)
|
|
1393
|
+
def readImplementationDataType(self, element: ET.Element, data_type: ImplementationDataType):
|
|
1394
|
+
self.logger.debug("Read ImplementationDataType <%s>" % data_type.getShortName())
|
|
1351
1395
|
self.readAutosarDataType(element, data_type)
|
|
1352
1396
|
data_type.setDynamicArraySizeProfile(self.getChildElementOptionalLiteral(element, "DYNAMIC-ARRAY-SIZE-PROFILE"))
|
|
1353
1397
|
self.readImplementationDataTypeElements(element, data_type)
|
|
1398
|
+
self.readImplementationDataTypeSymbolProps(element, data_type)
|
|
1354
1399
|
data_type.setTypeEmitter(self.getChildElementOptionalLiteral(element, "TYPE-EMITTER"))
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
'''
|
|
1358
|
-
if (data_type.getCategory().getValue() == ImplementationDataType.CATEGORY_ARRAY):
|
|
1359
|
-
if (len(data_type.getImplementationDataTypeElements()) < 1):
|
|
1360
|
-
self._raiseError("Array Sub-Element of <%s> do not defined." % data_type.getShortName())
|
|
1361
|
-
|
|
1362
|
-
array_sub_element = data_type.getImplementationDataTypeElements()[0]
|
|
1363
|
-
if (array_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_REFERENCE):
|
|
1364
|
-
data_type.setArrayElementType(array_sub_element.swDataDefProps.implementationDataTypeRef.value)
|
|
1365
|
-
elif (array_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_VALUE): # TODO: fix
|
|
1366
|
-
return
|
|
1367
|
-
else:
|
|
1368
|
-
self._raiseError("The category <%s> of array sub-element <%s> does not support." % (
|
|
1369
|
-
array_sub_element.getCategory().getValue(), data_type.getShortName()))
|
|
1370
|
-
elif (data_type.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_STRUCTURE):
|
|
1371
|
-
if len(data_type.getImplementationDataTypeElements()) < 1:
|
|
1372
|
-
self._raiseError("Structure Sub-Element of <%s> do not defined." % data_type.getShortName())
|
|
1373
|
-
self.readImplementationDataTypeSymbolProps(element, data_type)
|
|
1374
|
-
struct_sub_element = data_type.getImplementationDataTypeElements()[0]
|
|
1375
|
-
if struct_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_REFERENCE:
|
|
1376
|
-
data_type.setStructElementType(struct_sub_element.getSwDataDefProps().getImplementationDataTypeRef().getValue())
|
|
1377
|
-
#elif struct_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_VALUE:
|
|
1378
|
-
# return
|
|
1379
|
-
else:
|
|
1380
|
-
self._raiseError("The category <%s> of structure sub-element <%s> does not support." % (
|
|
1381
|
-
struct_sub_element.getCategory().getValue(), data_type.getShortName()))
|
|
1382
|
-
'''
|
|
1383
1400
|
|
|
1384
1401
|
def readBaseTypeDirectDefinition(self, element: ET.Element, definition: BaseTypeDirectDefinition):
|
|
1385
1402
|
definition.setBaseTypeSize(self.getChildElementOptionalNumericalValue(element, "BASE-TYPE-SIZE")) \
|
|
@@ -1388,9 +1405,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1388
1405
|
.setMemAlignment(self.getChildElementOptionalNumericalValue(element, "MEM-ALIGNMENT")) \
|
|
1389
1406
|
.setNativeDeclaration(self.getChildElementOptionalLiteral(element, "NATIVE-DECLARATION"))
|
|
1390
1407
|
|
|
1391
|
-
def readSwBaseType(self, element: ET.Element,
|
|
1392
|
-
|
|
1393
|
-
data_type = parent.createSwBaseType(short_name)
|
|
1408
|
+
def readSwBaseType(self, element: ET.Element, data_type: SwBaseType):
|
|
1409
|
+
self.logger.debug("Read SwBaseType <%s>" % data_type.getShortName())
|
|
1394
1410
|
self.readIdentifiable(element, data_type)
|
|
1395
1411
|
self.readBaseTypeDirectDefinition(element, data_type.getBaseTypeDefinition())
|
|
1396
1412
|
|
|
@@ -1510,7 +1526,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1510
1526
|
|
|
1511
1527
|
def readRequiredComSpec(self, element: ET.Element, parent: RPortPrototype):
|
|
1512
1528
|
for child_element in self.findall(element, "REQUIRED-COM-SPECS/*"):
|
|
1513
|
-
tag_name = self.getTagName(child_element
|
|
1529
|
+
tag_name = self.getTagName(child_element)
|
|
1514
1530
|
if tag_name == "NONQUEUED-RECEIVER-COM-SPEC":
|
|
1515
1531
|
parent.addRequiredComSpec(self.getNonqueuedReceiverComSpec(child_element))
|
|
1516
1532
|
elif tag_name == "CLIENT-COM-SPEC":
|
|
@@ -1522,7 +1538,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1522
1538
|
elif tag_name == "PARAMETER-REQUIRE-COM-SPEC":
|
|
1523
1539
|
parent.addRequiredComSpec(self.getParameterRequireComSpec(child_element))
|
|
1524
1540
|
else:
|
|
1525
|
-
self.
|
|
1541
|
+
self.raiseError("Unsupported RequiredComSpec <%s>" % tag_name)
|
|
1526
1542
|
|
|
1527
1543
|
def readAbstractRequiredPortPrototype(self, element: ET.Element, prototype: AbstractRequiredPortPrototype):
|
|
1528
1544
|
self.readProvidedComSpec(element, prototype)
|
|
@@ -1565,7 +1581,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1565
1581
|
elif tag_name == "PR-PORT-PROTOTYPE":
|
|
1566
1582
|
self.readPRPortPrototype(child_element, sw_component)
|
|
1567
1583
|
else:
|
|
1568
|
-
self.
|
|
1584
|
+
self.raiseError("Unsupported Port Prototype <%s>" % tag_name)
|
|
1569
1585
|
|
|
1570
1586
|
def readTransmissionAcknowledgementRequest(self, element: ET.Element) -> TransmissionAcknowledgementRequest:
|
|
1571
1587
|
child_element = self.find(element, "TRANSMISSION-ACKNOWLEDGE")
|
|
@@ -1586,33 +1602,42 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1586
1602
|
.setTransmissionAcknowledge(self.readTransmissionAcknowledgementRequest(element)) \
|
|
1587
1603
|
.setUsesEndToEndProtection(self.getChildElementOptionalBooleanValue(element, "USES-END-TO-END-PROTECTION"))
|
|
1588
1604
|
|
|
1589
|
-
def getNonqueuedSenderComSpec(self, element) -> NonqueuedSenderComSpec:
|
|
1605
|
+
def getNonqueuedSenderComSpec(self, element:ET.Element) -> NonqueuedSenderComSpec:
|
|
1590
1606
|
com_spec = NonqueuedSenderComSpec()
|
|
1591
1607
|
self.readSenderComSpec(element, com_spec)
|
|
1592
1608
|
com_spec.setInitValue(self.getInitValue(element))
|
|
1593
1609
|
return com_spec
|
|
1594
1610
|
|
|
1595
|
-
def getServerComSpec(self, element) -> ServerComSpec:
|
|
1611
|
+
def getServerComSpec(self, element:ET.Element) -> ServerComSpec:
|
|
1596
1612
|
com_spec = ServerComSpec()
|
|
1597
1613
|
self.readARObjectAttributes(element, com_spec)
|
|
1598
1614
|
com_spec.setOperationRef(self.getChildElementOptionalRefType(element, "OPERATION-REF")) \
|
|
1599
1615
|
.setQueueLength(self.getChildElementOptionalNumericalValue(element, "QUEUE-LENGTH"))
|
|
1600
1616
|
return com_spec
|
|
1601
1617
|
|
|
1602
|
-
def getQueuedSenderComSpec(self, element) -> QueuedSenderComSpec:
|
|
1618
|
+
def getQueuedSenderComSpec(self, element:ET.Element) -> QueuedSenderComSpec:
|
|
1603
1619
|
com_spec = QueuedSenderComSpec()
|
|
1604
1620
|
self.readSenderComSpec(element, com_spec)
|
|
1605
1621
|
return com_spec
|
|
1606
1622
|
|
|
1623
|
+
def getModeSwitchedAckRequest(self, element: ET.Element, key: str) -> ModeSwitchedAckRequest:
|
|
1624
|
+
request = None
|
|
1625
|
+
child_element = self.find(element, key)
|
|
1626
|
+
if child_element is not None:
|
|
1627
|
+
request = ModeSwitchedAckRequest()
|
|
1628
|
+
request.setTimeout(self.getChildElementOptionalTimeValue(child_element, "TIMEOUT"))
|
|
1629
|
+
return request
|
|
1630
|
+
|
|
1607
1631
|
def getModeSwitchSenderComSpec(self, element) -> ModeSwitchSenderComSpec:
|
|
1608
1632
|
com_spec = ModeSwitchSenderComSpec()
|
|
1609
1633
|
com_spec.setModeGroupRef(self.getChildElementOptionalRefType(element, "MODE-GROUP-REF")) \
|
|
1634
|
+
.setModeSwitchedAck(self.getModeSwitchedAckRequest(element, "MODE-SWITCHED-ACK")) \
|
|
1610
1635
|
.setQueueLength(self.getChildElementOptionalNumericalValue(element, "QUEUE-LENGTH"))
|
|
1611
1636
|
return com_spec
|
|
1612
1637
|
|
|
1613
1638
|
def readProvidedComSpec(self, element: ET.Element, parent: PPortPrototype):
|
|
1614
1639
|
for child_element in self.findall(element, "PROVIDED-COM-SPECS/*"):
|
|
1615
|
-
tag_name = self.getTagName(child_element
|
|
1640
|
+
tag_name = self.getTagName(child_element)
|
|
1616
1641
|
if tag_name == "NONQUEUED-SENDER-COM-SPEC":
|
|
1617
1642
|
parent.addProvidedComSpec(self.getNonqueuedSenderComSpec(child_element))
|
|
1618
1643
|
elif tag_name == "SERVER-COM-SPEC":
|
|
@@ -1622,7 +1647,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1622
1647
|
elif tag_name == "MODE-SWITCH-SENDER-COM-SPEC":
|
|
1623
1648
|
parent.addProvidedComSpec(self.getModeSwitchSenderComSpec(child_element))
|
|
1624
1649
|
else:
|
|
1625
|
-
self.
|
|
1650
|
+
self.raiseError("Unsupported RequiredComSpec <%s>" % tag_name)
|
|
1626
1651
|
|
|
1627
1652
|
def readPortGroupInnerGroupIRefs(self, element: ET.Element, parent: PortGroup):
|
|
1628
1653
|
for child_element in self.findall(element, "INNER-GROUP-IREFS/INNER-GROUP-IREF"):
|
|
@@ -1645,11 +1670,11 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1645
1670
|
|
|
1646
1671
|
def readSwComponentTypePortGroups(self, element: ET.Element, parent: SwComponentType):
|
|
1647
1672
|
for child_element in self.findall(element, "PORT-GROUPS/*"):
|
|
1648
|
-
tag_name = self.getTagName(child_element
|
|
1673
|
+
tag_name = self.getTagName(child_element)
|
|
1649
1674
|
if tag_name == "PORT-GROUP":
|
|
1650
1675
|
self.readPortGroup(child_element, parent)
|
|
1651
1676
|
else:
|
|
1652
|
-
self.
|
|
1677
|
+
self.raiseError("Unsupported Port Group type: %s" % tag_name)
|
|
1653
1678
|
|
|
1654
1679
|
def readSwComponentType(self, element: ET.Element, parent: SwComponentType):
|
|
1655
1680
|
self.readIdentifiable(element, parent)
|
|
@@ -1660,32 +1685,24 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1660
1685
|
self.readSwComponentType(element, parent)
|
|
1661
1686
|
self.readSwcInternalBehavior(element, parent)
|
|
1662
1687
|
|
|
1663
|
-
def
|
|
1664
|
-
|
|
1665
|
-
sw_component = parent.createEcuAbstractionSwComponentType(short_name)
|
|
1688
|
+
def readEcuAbstractionSwComponentType(self, element, sw_component: EcuAbstractionSwComponentType):
|
|
1689
|
+
self.logger.debug("Read EcuAbstractionSwComponentType <%s>" % sw_component.getShortName())
|
|
1666
1690
|
self.readAtomicSwComponentType(element, sw_component)
|
|
1667
1691
|
|
|
1668
|
-
def
|
|
1669
|
-
|
|
1670
|
-
sw_component = parent.createApplicationSwComponentType(short_name)
|
|
1692
|
+
def readApplicationSwComponentType(self, element: ET.Element, sw_component: ApplicationSwComponentType):
|
|
1693
|
+
self.logger.debug("Read ApplicationSwComponentType <%s>" % sw_component.getShortName())
|
|
1671
1694
|
self.readAtomicSwComponentType(element, sw_component)
|
|
1672
1695
|
|
|
1673
|
-
def readComplexDeviceDriverSwComponentType(self, element: ET.Element,
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
self.logger.debug("readComplexDeviceDriverSwComponentType <%s>" % short_name)
|
|
1677
|
-
self.readAtomicSwComponentType(element, sw_component)
|
|
1696
|
+
def readComplexDeviceDriverSwComponentType(self, element: ET.Element, type: ComplexDeviceDriverSwComponentType):
|
|
1697
|
+
self.logger.debug("Read ComplexDeviceDriverSwComponentType <%s>" % type.getShortName())
|
|
1698
|
+
self.readAtomicSwComponentType(element, type)
|
|
1678
1699
|
|
|
1679
|
-
def readSensorActuatorSwComponentType(self, element: ET.Element,
|
|
1680
|
-
|
|
1681
|
-
sw_component = parent.createSensorActuatorSwComponentType(short_name)
|
|
1682
|
-
self.logger.debug("readSensorActuatorSwComponentType <%s>" % short_name)
|
|
1700
|
+
def readSensorActuatorSwComponentType(self, element: ET.Element, sw_component: SensorActuatorSwComponentType):
|
|
1701
|
+
self.logger.debug("Read SensorActuatorSwComponentType <%s>" % sw_component.getShortName())
|
|
1683
1702
|
self.readAtomicSwComponentType(element, sw_component)
|
|
1684
1703
|
|
|
1685
|
-
def readServiceSwComponentType(self, element: ET.Element,
|
|
1686
|
-
|
|
1687
|
-
sw_component = parent.createServiceSwComponentType(short_name)
|
|
1688
|
-
self.logger.debug("readServiceSwComponentType <%s>" % short_name)
|
|
1704
|
+
def readServiceSwComponentType(self, element: ET.Element, sw_component: ServiceSwComponentType):
|
|
1705
|
+
self.logger.debug("Read ServiceSwComponentType <%s>" % sw_component.getShortName())
|
|
1689
1706
|
self.readAtomicSwComponentType(element, sw_component)
|
|
1690
1707
|
|
|
1691
1708
|
def readPPortInCompositionInstanceRef(self, element: ET.Element, p_port_in_composition_instance_ref: PPortInCompositionInstanceRef):
|
|
@@ -1752,7 +1769,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1752
1769
|
parent.setInnerPortIRref(p_port_in_composition_instance_ref)
|
|
1753
1770
|
return
|
|
1754
1771
|
|
|
1755
|
-
self.
|
|
1772
|
+
self.raiseError("Unsupported child element of INNER-PORT-IREF")
|
|
1756
1773
|
|
|
1757
1774
|
def readDelegationSwConnectors(self, element, parent: CompositionSwComponentType):
|
|
1758
1775
|
for child_element in self.findall(element, "CONNECTORS/DELEGATION-SW-CONNECTOR"):
|
|
@@ -1764,7 +1781,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1764
1781
|
self.readDelegationSwConnectorInnerPortIRef(child_element, connector)
|
|
1765
1782
|
|
|
1766
1783
|
if connector.getInnerPortIRref() == None and connector.getOuterPortRef() == None:
|
|
1767
|
-
self.
|
|
1784
|
+
self.raiseError("Invalid PortPrototype of DELEGATION-SW-CONNECTOR")
|
|
1768
1785
|
|
|
1769
1786
|
connector.setOuterPortRef(self.getChildElementOptionalRefType(child_element, "OUTER-PORT-REF"))
|
|
1770
1787
|
self.logger.debug("OUTER-PORT-REF DEST: %s, %s"
|
|
@@ -1785,19 +1802,14 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1785
1802
|
for ref in self.getChildElementRefTypeList(child_element, "./DATA-TYPE-MAPPING-REF"):
|
|
1786
1803
|
parent.addDataTypeMapping(ref)
|
|
1787
1804
|
|
|
1788
|
-
def readCompositionSwComponentType(self, element: ET.Element,
|
|
1789
|
-
|
|
1790
|
-
self.
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
self.
|
|
1794
|
-
self.
|
|
1795
|
-
self.
|
|
1796
|
-
self.readAssemblySwConnectors(element, sw_component)
|
|
1797
|
-
self.readDelegationSwConnectors(element, sw_component)
|
|
1798
|
-
self.readCompositionSwComponentTypeDataTypeMappingSet(element, sw_component)
|
|
1799
|
-
|
|
1800
|
-
self.logger.debug("ReadCompositionSwComponentTypes: <%s> (Done)" % short_name)
|
|
1805
|
+
def readCompositionSwComponentType(self, element: ET.Element, type: CompositionSwComponentType):
|
|
1806
|
+
self.logger.debug("Read CompositionSwComponentType: <%s>" % type.getShortName())
|
|
1807
|
+
self.readIdentifiable(element, type)
|
|
1808
|
+
self.readSwComponentType(element, type)
|
|
1809
|
+
self.readSwComponentPrototypes(element, type)
|
|
1810
|
+
self.readAssemblySwConnectors(element, type)
|
|
1811
|
+
self.readDelegationSwConnectors(element, type)
|
|
1812
|
+
self.readCompositionSwComponentTypeDataTypeMappingSet(element, type)
|
|
1801
1813
|
|
|
1802
1814
|
def readDataTypeMaps(self, element: ET.Element, parent: DataTypeMappingSet):
|
|
1803
1815
|
for child_element in element.findall("./xmlns:DATA-TYPE-MAPS/xmlns:DATA-TYPE-MAP", self.nsmap):
|
|
@@ -1817,9 +1829,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1817
1829
|
map.modeGroupRef = self.getChildElementOptionalRefType(child_element, "MODE-GROUP-REF")
|
|
1818
1830
|
parent.addModeRequestTypeMap(map)
|
|
1819
1831
|
|
|
1820
|
-
def readDataTypeMappingSet(self, element: ET.Element,
|
|
1821
|
-
|
|
1822
|
-
mapping_set = parent.createDataTypeMappingSet(short_name)
|
|
1832
|
+
def readDataTypeMappingSet(self, element: ET.Element, mapping_set: DataTypeMappingSet):
|
|
1833
|
+
self.logger.debug("Read DataTypeMappingSet: <%s>" % mapping_set.getShortName())
|
|
1823
1834
|
self.readIdentifiable(element, mapping_set)
|
|
1824
1835
|
self.readDataTypeMaps(element, mapping_set)
|
|
1825
1836
|
self.readModeRequestTypeMaps(element, mapping_set)
|
|
@@ -1848,11 +1859,10 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1848
1859
|
policy.data_element_ref = self.getChildElementOptionalRefType(child_element, "DATA-ELEMENT-REF")
|
|
1849
1860
|
policy.handle_invalid = self.getChildElementOptionalLiteral(child_element, "HANDLE-INVALID")
|
|
1850
1861
|
|
|
1851
|
-
def
|
|
1852
|
-
|
|
1853
|
-
sr_interface = parent.createSenderReceiverInterface(short_name)
|
|
1862
|
+
def readSenderReceiverInterface(self, element, sr_interface: SenderReceiverInterface):
|
|
1863
|
+
self.logger.debug("Read SenderReceiverInterface <%s>" % sr_interface.getShortName())
|
|
1854
1864
|
self.readIdentifiable(element, sr_interface)
|
|
1855
|
-
sr_interface.
|
|
1865
|
+
sr_interface.setIsService(self.getChildElementOptionalBooleanValue(element, "IS-SERVICE"))
|
|
1856
1866
|
self.readSenderReceiverInterfaceDataElements(element, sr_interface)
|
|
1857
1867
|
self.readSenderReceiverInterfaceInvalidationPolicies(element, sr_interface)
|
|
1858
1868
|
|
|
@@ -1899,16 +1909,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1899
1909
|
prototype = param_interface.createParameter(short_name)
|
|
1900
1910
|
self.readParameterDataPrototype(child_element, prototype)
|
|
1901
1911
|
|
|
1902
|
-
def readParameterInterface(self, element: ET.Element,
|
|
1903
|
-
|
|
1904
|
-
self.logger.debug("Read ParameterInterface %s" % short_name)
|
|
1905
|
-
param_interface = parent.createParameterInterface(short_name)
|
|
1912
|
+
def readParameterInterface(self, element: ET.Element, param_interface: ParameterInterface):
|
|
1913
|
+
self.logger.debug("Read ParameterInterface <%s>" % param_interface.getShortName())
|
|
1906
1914
|
self.readPortInterface(element, param_interface)
|
|
1907
1915
|
self.readParameterInterfaceParameters(element, param_interface)
|
|
1908
1916
|
|
|
1909
|
-
def readClientServerInterface(self, element: ET.Element,
|
|
1910
|
-
|
|
1911
|
-
cs_interface = parent.createClientServerInterface(short_name)
|
|
1917
|
+
def readClientServerInterface(self, element: ET.Element, cs_interface: ClientServerInterface):
|
|
1918
|
+
self.logger.debug("Read readClientServerInterface <%s>" % cs_interface.getShortName())
|
|
1912
1919
|
self.readPortInterface(element, cs_interface)
|
|
1913
1920
|
self.readOperations(element, cs_interface)
|
|
1914
1921
|
self.readPossibleErrors(element, cs_interface)
|
|
@@ -1982,6 +1989,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1982
1989
|
self.readARObjectAttributes(child_element, compu_scale)
|
|
1983
1990
|
compu_scale.setLowerLimit(self.getChildLimitElement(child_element, "LOWER-LIMIT")) \
|
|
1984
1991
|
.setShortLabel(self.getChildElementOptionalLiteral(child_element, "SHORT-LABEL")) \
|
|
1992
|
+
.setDesc(self.getMultiLanguageOverviewParagraph(child_element, "DESC")) \
|
|
1985
1993
|
.setSymbol(self.getChildElementOptionalLiteral(child_element, "SYMBOL")) \
|
|
1986
1994
|
.setUpperLimit(self.getChildLimitElement(child_element, "UPPER-LIMIT"))
|
|
1987
1995
|
self.readCompuScaleContents(child_element, compu_scale)
|
|
@@ -1998,29 +2006,26 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1998
2006
|
compu.setCompuDefaultValue(self.getCompuConst(child_element, "COMPU-DEFAULT-VALUE"))
|
|
1999
2007
|
return compu
|
|
2000
2008
|
|
|
2001
|
-
def readCompuMethod(self, element: ET.Element,
|
|
2002
|
-
|
|
2003
|
-
self.logger.debug("readCompuMethods %s" % short_name)
|
|
2004
|
-
compu_method = parent.createCompuMethod(short_name)
|
|
2009
|
+
def readCompuMethod(self, element: ET.Element, compu_method: CompuMethod):
|
|
2010
|
+
self.logger.debug("Read CompuMethods <%s>" % compu_method.getShortName())
|
|
2005
2011
|
self.readIdentifiable(element, compu_method)
|
|
2006
2012
|
compu_method.setUnitRef(self.getChildElementOptionalRefType(element, "UNIT-REF")) \
|
|
2007
2013
|
.setCompuInternalToPhys(self.getCompu(element, "COMPU-INTERNAL-TO-PHYS")) \
|
|
2008
2014
|
.setCompuPhysToInternal(self.getCompu(element, "COMPU-PHYS-TO-INTERNAL"))
|
|
2009
2015
|
|
|
2010
|
-
def
|
|
2016
|
+
def readSwcBswMappingSwcBswRunnableMappings(self, element: ET.Element, parent: SwcBswMapping):
|
|
2011
2017
|
for child_element in self.findall(element, "RUNNABLE-MAPPINGS/SWC-BSW-RUNNABLE-MAPPING"):
|
|
2012
2018
|
mapping = SwcBswRunnableMapping()
|
|
2013
2019
|
mapping.setBswEntityRef(self.getChildElementOptionalRefType(child_element, "BSW-ENTITY-REF")) \
|
|
2014
2020
|
.setSwcRunnableRef(self.getChildElementOptionalRefType(child_element, "SWC-RUNNABLE-REF"))
|
|
2015
2021
|
parent.addRunnableMapping(mapping)
|
|
2016
2022
|
|
|
2017
|
-
def
|
|
2018
|
-
|
|
2019
|
-
self.
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
self.
|
|
2023
|
-
swc_bsw_mapping.setSwcBehaviorRef(self.getChildElementOptionalRefType(element, "SWC-BEHAVIOR-REF"))
|
|
2023
|
+
def readSwcBswMapping(self, element: ET.Element, mapping: SwcBswMapping):
|
|
2024
|
+
self.logger.debug("read SwcBswMappings %s" % mapping.getShortName())
|
|
2025
|
+
self.readIdentifiable(element, mapping)
|
|
2026
|
+
mapping.setBswBehaviorRef(self.getChildElementOptionalRefType(element, "BSW-BEHAVIOR-REF"))
|
|
2027
|
+
self.readSwcBswMappingSwcBswRunnableMappings(element, mapping)
|
|
2028
|
+
mapping.setSwcBehaviorRef(self.getChildElementOptionalRefType(element, "SWC-BEHAVIOR-REF"))
|
|
2024
2029
|
|
|
2025
2030
|
def readValueSpecification(self, element: ET.Element, value_spec: ValueSpecification):
|
|
2026
2031
|
self.readARObjectAttributes(element, value_spec)
|
|
@@ -2095,10 +2100,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2095
2100
|
self.readRecordValueSpecificationFields(element, value_spec)
|
|
2096
2101
|
return value_spec
|
|
2097
2102
|
|
|
2098
|
-
def readConstantSpecification(self, element: ET.Element,
|
|
2099
|
-
|
|
2100
|
-
self.logger.debug("readConstantSpecification %s" % short_name)
|
|
2101
|
-
spec = parent.createConstantSpecification(short_name)
|
|
2103
|
+
def readConstantSpecification(self, element: ET.Element, spec: ConstantSpecification):
|
|
2104
|
+
self.logger.debug("readConstantSpecification %s" % spec.getShortName())
|
|
2102
2105
|
self.readIdentifiable(element, spec)
|
|
2103
2106
|
for child_element in self.findall(element, "VALUE-SPEC/*"):
|
|
2104
2107
|
spec.setValueSpec(self.getValueSpecification(child_element, self.getTagName(child_element)))
|
|
@@ -2132,24 +2135,19 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2132
2135
|
self.readPhysConstrs(child_element, rule)
|
|
2133
2136
|
parent.addDataConstrRule(rule)
|
|
2134
2137
|
|
|
2135
|
-
def readDataConstr(self, element: ET.Element,
|
|
2136
|
-
|
|
2137
|
-
self.logger.debug("readDataConstr %s" % short_name)
|
|
2138
|
-
constr = parent.createDataConstr(short_name)
|
|
2138
|
+
def readDataConstr(self, element: ET.Element, constr: DataConstr):
|
|
2139
|
+
self.logger.debug("Read DataConstr <%s>" % constr.getShortName())
|
|
2139
2140
|
self.readIdentifiable(element, constr)
|
|
2140
2141
|
self.readDataConstrRule(element, constr)
|
|
2141
2142
|
|
|
2142
|
-
def readUnit(self, element: ET.Element,
|
|
2143
|
-
|
|
2144
|
-
self.logger.debug("readUnit %s" % short_name)
|
|
2145
|
-
unit = parent.createUnit(short_name)
|
|
2143
|
+
def readUnit(self, element: ET.Element, unit: Unit):
|
|
2144
|
+
self.logger.debug("Read Unit <%s>" % unit.getShortName())
|
|
2146
2145
|
self.readIdentifiable(element, unit)
|
|
2147
2146
|
unit.setDisplayName(self.getChildElementOptionalLiteral(element, "DISPLAY-NAME")) \
|
|
2148
2147
|
.setFactorSiToUnit(self.getChildElementOptionalFloatValue(element, "FACTOR-SI-TO-UNIT")) \
|
|
2149
2148
|
.setOffsetSiToUnit(self.getChildElementOptionalFloatValue(element, "OFFSET-SI-TO-UNIT")) \
|
|
2150
2149
|
.setPhysicalDimensionRef(self.getChildElementOptionalRefType(element, "PHYSICAL-DIMENSION-REF"))
|
|
2151
2150
|
|
|
2152
|
-
|
|
2153
2151
|
def readEndToEndDescriptionDataId(self, element: ET.Element, parent: EndToEndDescription):
|
|
2154
2152
|
child_element = element.find("./xmlns:DATA-IDS", self.nsmap)
|
|
2155
2153
|
if child_element is not None:
|
|
@@ -2190,11 +2188,11 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2190
2188
|
|
|
2191
2189
|
def readEndToEndProtectionVariablePrototypes(self, element: ET.Element, parent: EndToEndProtection):
|
|
2192
2190
|
for child_element in element.findall("./xmlns:END-TO-END-PROTECTION-VARIABLE-PROTOTYPES/*", self.nsmap):
|
|
2193
|
-
tag_name = self.getTagName(child_element
|
|
2191
|
+
tag_name = self.getTagName(child_element)
|
|
2194
2192
|
if tag_name == "END-TO-END-PROTECTION-VARIABLE-PROTOTYPE":
|
|
2195
2193
|
parent.addEndToEndProtectionVariablePrototype(self.getEndToEndProtectionVariablePrototype(child_element))
|
|
2196
2194
|
else:
|
|
2197
|
-
self.
|
|
2195
|
+
self.raiseError("Unsupported End To End Protection Variable Prototype <%s>" % tag_name)
|
|
2198
2196
|
|
|
2199
2197
|
def readEndToEndProtection(self, element: ET.Element, parent: EndToEndProtectionSet):
|
|
2200
2198
|
short_name = self.getShortName(element)
|
|
@@ -2205,15 +2203,16 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2205
2203
|
self.readEndToEndProtectionVariablePrototypes(element, protection)
|
|
2206
2204
|
|
|
2207
2205
|
def readEndToEndProtections(self, element: ET.Element, parent: EndToEndProtectionSet):
|
|
2208
|
-
for child_element in
|
|
2209
|
-
tag_name = self.getTagName(child_element
|
|
2206
|
+
for child_element in self.findall(element, "END-TO-END-PROTECTIONS/*"):
|
|
2207
|
+
tag_name = self.getTagName(child_element)
|
|
2210
2208
|
if tag_name == "END-TO-END-PROTECTION":
|
|
2211
2209
|
self.readEndToEndProtection(child_element, parent)
|
|
2210
|
+
else:
|
|
2211
|
+
self.notImplemented("Unsupported EndToEndProtectionSet <%s>" % tag_name)
|
|
2212
2212
|
|
|
2213
|
-
def readEndToEndProtectionSet(self, element: ET.Element,
|
|
2214
|
-
|
|
2215
|
-
self.
|
|
2216
|
-
protection_set = parent.createEndToEndProtectionSet(short_name)
|
|
2213
|
+
def readEndToEndProtectionSet(self, element: ET.Element, protection_set: EndToEndProtectionSet):
|
|
2214
|
+
self.logger.debug("Read EndToEndProtectionSet <%s>" % protection_set.getShortName())
|
|
2215
|
+
self.readIdentifiable(element, protection_set)
|
|
2217
2216
|
self.readEndToEndProtections(element, protection_set)
|
|
2218
2217
|
|
|
2219
2218
|
def readAutosarDataType(self, element: ET.Element, data_type: AutosarDataType):
|
|
@@ -2227,11 +2226,9 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2227
2226
|
self.readImplementationProps(element, props)
|
|
2228
2227
|
|
|
2229
2228
|
def readImplementationDataTypeSymbolProps(self, element: ET.Element, data_type: ImplementationDataType):
|
|
2230
|
-
child_element =
|
|
2229
|
+
child_element = self.find(element, "SYMBOL-PROPS")
|
|
2231
2230
|
if child_element is not None:
|
|
2232
|
-
|
|
2233
|
-
self.logger.debug("readSymbolProps %s" % short_name)
|
|
2234
|
-
props = data_type.createSymbolProps(short_name)
|
|
2231
|
+
props = data_type.createSymbolProps(self.getShortName(child_element))
|
|
2235
2232
|
self.readSymbolProps(child_element, props)
|
|
2236
2233
|
|
|
2237
2234
|
def readApplicationDataType(self, element: ET.Element, data_type: ApplicationDataType):
|
|
@@ -2255,14 +2252,14 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2255
2252
|
self.logger.debug("readApplicationArrayElement %s" % short_name)
|
|
2256
2253
|
array_element = parent.createApplicationArrayElement(short_name)
|
|
2257
2254
|
self.readApplicationCompositeElementDataPrototype(child_element, array_element)
|
|
2255
|
+
array_element.setArraySizeHandling(self.getChildElementOptionalLiteral(child_element, "ARRAY-SIZE-HANDLING"))
|
|
2258
2256
|
array_element.setArraySizeSemantics(self.getChildElementOptionalLiteral(child_element, "ARRAY-SIZE-SEMANTICS"))
|
|
2259
2257
|
array_element.setMaxNumberOfElements(self.getChildElementOptionalNumericalValue(child_element, "MAX-NUMBER-OF-ELEMENTS"))
|
|
2260
2258
|
|
|
2261
|
-
def readApplicationArrayDataType(self, element: ET.Element,
|
|
2262
|
-
|
|
2263
|
-
self.logger.debug("readApplicationArrayDataType %s" % short_name)
|
|
2264
|
-
data_type = parent.createApplicationArrayDataType(short_name)
|
|
2259
|
+
def readApplicationArrayDataType(self, element: ET.Element, data_type: ApplicationArrayDataType):
|
|
2260
|
+
self.logger.debug("Read ApplicationArrayDataType <%s>" % data_type)
|
|
2265
2261
|
self.readApplicationCompositeDataType(element, data_type)
|
|
2262
|
+
data_type.setDynamicArraySizeProfile(self.getChildElementOptionalLiteral(element, "DYNAMIC-ARRAY-SIZE-PROFILE"))
|
|
2266
2263
|
self.readApplicationArrayElement(element, data_type)
|
|
2267
2264
|
|
|
2268
2265
|
def getSwRecordLayoutV(self, element: ET.Element, key: str) -> SwRecordLayoutV:
|
|
@@ -2275,7 +2272,14 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2275
2272
|
.setSwRecordLayoutVAxis(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-AXIS")) \
|
|
2276
2273
|
.setSwRecordLayoutVProp(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-PROP")) \
|
|
2277
2274
|
.setSwRecordLayoutVIndex(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-INDEX"))
|
|
2275
|
+
#print(layout_v.getShortLabel())
|
|
2278
2276
|
return layout_v
|
|
2277
|
+
|
|
2278
|
+
def readSwRecordLayoutGroupSwRecordLayoutGroupContentType(self, element: ET.Element, group: SwRecordLayoutGroup):
|
|
2279
|
+
content = SwRecordLayoutGroupContent()
|
|
2280
|
+
content.setSwRecordLayoutGroup(self.getSwRecordLayoutGroup(element, "SW-RECORD-LAYOUT-GROUP")) \
|
|
2281
|
+
.setSwRecordLayoutV(self.getSwRecordLayoutV(element, "SW-RECORD-LAYOUT-V"))
|
|
2282
|
+
group.setSwRecordLayoutGroupContentType(content)
|
|
2279
2283
|
|
|
2280
2284
|
def getSwRecordLayoutGroup(self, element: ET.Element, key: str) -> SwRecordLayoutGroup:
|
|
2281
2285
|
child_element = element.find("./xmlns:%s" % key, self.nsmap)
|
|
@@ -2283,35 +2287,23 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2283
2287
|
if child_element is not None:
|
|
2284
2288
|
group = SwRecordLayoutGroup()
|
|
2285
2289
|
group.setShortLabel(self.getChildElementOptionalLiteral(child_element, "SHORT-LABEL")) \
|
|
2286
|
-
.setCategory(self.getChildElementOptionalLiteral(child_element, "CATEGORY"))
|
|
2287
|
-
|
|
2290
|
+
.setCategory(self.getChildElementOptionalLiteral(child_element, "CATEGORY"))
|
|
2291
|
+
self.readSwRecordLayoutGroupSwRecordLayoutGroupContentType(child_element, group)
|
|
2292
|
+
group.setSwRecordLayoutGroupAxis(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-AXIS")) \
|
|
2288
2293
|
.setSwRecordLayoutGroupIndex(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-INDEX")) \
|
|
2289
2294
|
.setSwRecordLayoutGroupFrom(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-FROM")) \
|
|
2290
2295
|
.setSwRecordLayoutGroupStep(self.getChildElementOptionalIntegerValue(child_element, "SW-RECORD-LAYOUT-GROUP-STEP")) \
|
|
2291
|
-
.setSwRecordLayoutGroupTo(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-TO"))
|
|
2292
|
-
|
|
2293
|
-
group_content = SwRecordLayoutGroupContent()
|
|
2294
|
-
group_content.swRecordLayoutGroup = self.getSwRecordLayoutGroup(child_element, "SW-RECORD-LAYOUT-GROUP")
|
|
2295
|
-
group_content.swRecordLayoutV = self.getSwRecordLayoutV(child_element, "SW-RECORD-LAYOUT-V")
|
|
2296
|
-
|
|
2297
|
-
if group_content.swRecordLayoutGroup is not None:
|
|
2298
|
-
group.setSwRecordLayoutGroupContentType(group_content)
|
|
2299
|
-
elif group_content.swRecordLayoutV is not None:
|
|
2300
|
-
group.setSwRecordLayoutGroupContentType(group_content)
|
|
2301
|
-
|
|
2296
|
+
.setSwRecordLayoutGroupTo(self.getChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-TO"))
|
|
2297
|
+
#print(group.getShortLabel())
|
|
2302
2298
|
return group
|
|
2303
2299
|
|
|
2304
|
-
def readSwRecordLayout(self, element: ET.Element,
|
|
2305
|
-
|
|
2306
|
-
self.logger.debug("readSwRecordLayout %s" % short_name)
|
|
2307
|
-
layout = parent.createSwRecordLayout(short_name)
|
|
2300
|
+
def readSwRecordLayout(self, element: ET.Element, layout: SwRecordLayout):
|
|
2301
|
+
self.logger.debug("Read SwRecordLayout <%s>" % layout.getShortName())
|
|
2308
2302
|
self.readIdentifiable(element, layout)
|
|
2309
2303
|
layout.setSwRecordLayoutGroup(self.getSwRecordLayoutGroup(element, "SW-RECORD-LAYOUT-GROUP"))
|
|
2310
2304
|
|
|
2311
|
-
def readSwAddrMethod(self, element: ET.Element,
|
|
2312
|
-
|
|
2313
|
-
self.logger.debug("read SwAddrMethod %s" % short_name)
|
|
2314
|
-
method = parent.createSwAddrMethod(short_name)
|
|
2305
|
+
def readSwAddrMethod(self, element: ET.Element, method: SwAddrMethod):
|
|
2306
|
+
self.logger.debug("Read SwAddrMethod <%s>" % method.getShortName())
|
|
2315
2307
|
self.readIdentifiable(element, method)
|
|
2316
2308
|
method.setMemoryAllocationKeywordPolicy(self.getChildElementOptionalLiteral(element, "MEMORY-ALLOCATION-KEYWORD-POLICY"))
|
|
2317
2309
|
for option in self.getChildElementLiteralValueList(element, "OPTIONS/OPTION"):
|
|
@@ -2319,10 +2311,9 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2319
2311
|
method.setSectionInitializationPolicy(self.getChildElementOptionalLiteral(element, "SECTION-INITIALIZATION-POLICY")) \
|
|
2320
2312
|
.setSectionType(self.getChildElementOptionalLiteral(element, "SECTION-TYPE"))
|
|
2321
2313
|
|
|
2322
|
-
def readTriggerInterface(self, element: ET.Element,
|
|
2323
|
-
|
|
2324
|
-
self.
|
|
2325
|
-
trigger_if = parent.createTriggerInterface(short_name)
|
|
2314
|
+
def readTriggerInterface(self, element: ET.Element, trigger_if: TriggerInterface):
|
|
2315
|
+
self.logger.debug("Read TriggerInterface <%s>" % trigger_if.getShortName())
|
|
2316
|
+
self.readIdentifiable(element, trigger_if)
|
|
2326
2317
|
|
|
2327
2318
|
def readModeDeclarationGroupModeDeclaration(self, element: ET.Element, parent: ModeDeclarationGroup):
|
|
2328
2319
|
for child_element in self.findall(element, "MODE-DECLARATIONS/MODE-DECLARATION"):
|
|
@@ -2331,10 +2322,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2331
2322
|
self.readARObjectAttributes(child_element, declaration)
|
|
2332
2323
|
declaration.setValue(self.getChildElementOptionalNumericalValue(child_element, "VALUE"))
|
|
2333
2324
|
|
|
2334
|
-
def readModeDeclarationGroup(self, element: ET.Element,
|
|
2335
|
-
|
|
2336
|
-
self.logger.debug("readModeDeclarationGroup %s" % short_name)
|
|
2337
|
-
group = parent.createModeDeclarationGroup(short_name)
|
|
2325
|
+
def readModeDeclarationGroup(self, element: ET.Element, group: ModeDeclarationGroup):
|
|
2326
|
+
self.logger.debug("Read ModeDeclarationGroup <%s>" % group.getShortName())
|
|
2338
2327
|
self.readIdentifiable(element, group)
|
|
2339
2328
|
self.readModeDeclarationGroupModeDeclaration(element, group)
|
|
2340
2329
|
group.setInitialModeRef(self.getChildElementOptionalRefType(element, "INITIAL-MODE-REF"))
|
|
@@ -2348,10 +2337,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2348
2337
|
self.readIdentifiable(child_element, mode_group)
|
|
2349
2338
|
mode_group.type_tref = self.getChildElementOptionalRefType(child_element, "TYPE-TREF")
|
|
2350
2339
|
|
|
2351
|
-
def readModeSwitchInterface(self, element: ET.Element,
|
|
2352
|
-
|
|
2353
|
-
self.logger.debug("readModeSwitchInterface %s" % short_name)
|
|
2354
|
-
mode_interface = parent.createModeSwitchInterface(short_name)
|
|
2340
|
+
def readModeSwitchInterface(self, element: ET.Element, mode_interface: ModeSwitchInterface):
|
|
2341
|
+
self.logger.debug("Read ModeSwitchInterface <%s>" % mode_interface.getShortName())
|
|
2355
2342
|
self.readPortInterface(element, mode_interface)
|
|
2356
2343
|
self.readModeSwitchInterfaceModeGroup(element, mode_interface)
|
|
2357
2344
|
|
|
@@ -2369,7 +2356,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2369
2356
|
if tag_name == "EOC-EXECUTABLE-ENTITY-REF":
|
|
2370
2357
|
self.readEOCExecutableEntityRef(child_element, constrain)
|
|
2371
2358
|
else:
|
|
2372
|
-
self.
|
|
2359
|
+
self.raiseError("Unsupported order element <%s>." % tag_name)
|
|
2373
2360
|
|
|
2374
2361
|
def readExecutionOrderConstraint(self, element: ET.Element, extension: TimingExtension):
|
|
2375
2362
|
short_name = self.getShortName(element)
|
|
@@ -2384,12 +2371,10 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2384
2371
|
if tag_name == "EXECUTION-ORDER-CONSTRAINT":
|
|
2385
2372
|
self.readExecutionOrderConstraint(child_element, extension)
|
|
2386
2373
|
else:
|
|
2387
|
-
self.
|
|
2374
|
+
self.raiseError("Unsupported timing requirement <%s>" % tag_name)
|
|
2388
2375
|
|
|
2389
|
-
def readSwcTiming(self, element: ET.Element,
|
|
2390
|
-
|
|
2391
|
-
self.logger.debug("readSwcTiming %s" % short_name)
|
|
2392
|
-
timing = parent.createSwcTiming(short_name)
|
|
2376
|
+
def readSwcTiming(self, element: ET.Element, timing: SwcTiming):
|
|
2377
|
+
self.logger.debug("Read SwcTiming <%s>" % timing.getShortName())
|
|
2393
2378
|
self.readIdentifiable(element, timing)
|
|
2394
2379
|
self.readTimingExtension(element, timing)
|
|
2395
2380
|
|
|
@@ -2727,19 +2712,80 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2727
2712
|
else:
|
|
2728
2713
|
self.notImplemented("Unsupported ConsumedServiceInstances <%s>" % tag_name)
|
|
2729
2714
|
|
|
2715
|
+
def getInitialSdDelayConfig(self, element: ET.Element, key: str) -> InitialSdDelayConfig:
|
|
2716
|
+
config = None
|
|
2717
|
+
child_element = self.find(element, key)
|
|
2718
|
+
if child_element is not None:
|
|
2719
|
+
config = InitialSdDelayConfig()
|
|
2720
|
+
config.setInitialDelayMaxValue(self.getChildElementOptionalTimeValue(child_element, "INITIAL-DELAY-MAX-VALUE")) \
|
|
2721
|
+
.setInitialDelayMinValue(self.getChildElementOptionalTimeValue(child_element, "INITIAL-DELAY-MIN-VALUE")) \
|
|
2722
|
+
.setInitialRepetitionsBaseDelay(self.getChildElementOptionalTimeValue(child_element, "INITIAL-REPETITIONS-BASE-DELAY")) \
|
|
2723
|
+
.setInitialRepetitionsMax(self.getChildElementOptionalPositiveInteger(child_element, "INITIAL-REPETITIONS-MAX"))
|
|
2724
|
+
return config
|
|
2725
|
+
|
|
2726
|
+
def getSdServerConfig(self, element: ET.Element, key: str) -> SdServerConfig:
|
|
2727
|
+
config = None
|
|
2728
|
+
child_element = self.find(element, key)
|
|
2729
|
+
if child_element is not None:
|
|
2730
|
+
config = SdServerConfig()
|
|
2731
|
+
config.setInitialOfferBehavior(self.getInitialSdDelayConfig(child_element, "INITIAL-OFFER-BEHAVIOR")) \
|
|
2732
|
+
.setOfferCyclicDelay(self.getChildElementOptionalTimeValue(child_element, "OFFER-CYCLIC-DELAY")) \
|
|
2733
|
+
.setRequestResponseDelay(self.getRequestResponseDelay(child_element, "REQUEST-RESPONSE-DELAY")) \
|
|
2734
|
+
.setServerServiceMajorVersion(self.getChildElementOptionalPositiveInteger(child_element, "SERVER-SERVICE-MAJOR-VERSION")) \
|
|
2735
|
+
.setServerServiceMinorVersion(self.getChildElementOptionalPositiveInteger(child_element, "SERVER-SERVICE-MINOR-VERSION")) \
|
|
2736
|
+
.setTtl(self.getChildElementOptionalPositiveInteger(child_element, "TTL"))
|
|
2737
|
+
return config
|
|
2738
|
+
|
|
2739
|
+
def readEventHandler(self, element: ET.Element, handler: EventHandler):
|
|
2740
|
+
self.readIdentifiable(element, handler)
|
|
2741
|
+
handler.setApplicationEndpointRef(self.getChildElementOptionalRefType(element, "APPLICATION-ENDPOINT-REF"))
|
|
2742
|
+
for ref in self.getChildElementRefTypeList(element, "CONSUMED-EVENT-GROUP-REFS/CONSUMED-EVENT-GROUP-REF"):
|
|
2743
|
+
handler.addConsumedEventGroupRef(ref)
|
|
2744
|
+
handler.setMulticastThreshold(self.getChildElementOptionalPositiveInteger(element, "MULTICAST-THRESHOLD"))
|
|
2745
|
+
for ref in self.getChildElementRefTypeList(element, "ROUTING-GROUP-REFS/ROUTING-GROUP-REF"):
|
|
2746
|
+
handler.addRoutingGroupRef(ref)
|
|
2747
|
+
handler.setSdServerConfig(self.getSdServerConfig(element, "SD-SERVER-CONFIG")) \
|
|
2748
|
+
|
|
2749
|
+
def readProvidedServiceInstanceEventHandlers(self, element: ET.Element, instance: ProvidedServiceInstance):
|
|
2750
|
+
for child_element in self.findall(element, "EVENT-HANDLERS/*"):
|
|
2751
|
+
tag_name = self.getTagName(child_element)
|
|
2752
|
+
if tag_name == "EVENT-HANDLER":
|
|
2753
|
+
handler = instance.createEventHandler(self.getShortName(child_element))
|
|
2754
|
+
self.readEventHandler(child_element, handler)
|
|
2755
|
+
else:
|
|
2756
|
+
self.notImplemented("Unsupported Event Handler <%s>" % tag_name)
|
|
2757
|
+
|
|
2758
|
+
def readProvidedServiceInstance(self, element: ET.Element, instance: ProvidedServiceInstance):
|
|
2759
|
+
self.readIdentifiable(element, instance)
|
|
2760
|
+
self.readProvidedServiceInstanceEventHandlers(element, instance)
|
|
2761
|
+
instance.setInstanceIdentifier(self.getChildElementOptionalPositiveInteger(element, "INSTANCE-IDENTIFIER")) \
|
|
2762
|
+
.setSdServerConfig(self.getSdServerConfig(element, "SD-SERVER-CONFIG")) \
|
|
2763
|
+
.setServiceIdentifier(self.getChildElementOptionalPositiveInteger(element, "SERVICE-IDENTIFIER"))
|
|
2764
|
+
|
|
2765
|
+
def readSocketAddressApplicationEndpointProvidedServiceInstance(self, element: ET.Element, end_point: ApplicationEndpoint):
|
|
2766
|
+
for child_element in self.findall(element, "PROVIDED-SERVICE-INSTANCES/*"):
|
|
2767
|
+
tag_name = self.getTagName(child_element)
|
|
2768
|
+
if tag_name == "PROVIDED-SERVICE-INSTANCE":
|
|
2769
|
+
instance = end_point.createProvidedServiceInstance(self.getShortName(child_element))
|
|
2770
|
+
self.readProvidedServiceInstance(child_element, instance)
|
|
2771
|
+
else:
|
|
2772
|
+
self.notImplemented("Unsupported ConsumedServiceInstances <%s>" % tag_name)
|
|
2773
|
+
|
|
2730
2774
|
def readSocketAddressApplicationEndpoint(self, element: ET.Element, address: SocketAddress):
|
|
2731
2775
|
child_element = self.find(element, "APPLICATION-ENDPOINT")
|
|
2732
2776
|
if child_element is not None:
|
|
2733
2777
|
end_point = address.createApplicationEndpoint(self.getShortName(child_element))
|
|
2734
2778
|
self.readSocketAddressApplicationEndpointConsumedServiceInstances(child_element, end_point)
|
|
2735
2779
|
end_point.setNetworkEndpointRef(self.getChildElementOptionalRefType(child_element, "NETWORK-ENDPOINT-REF")) \
|
|
2736
|
-
.setPriority(self.getChildElementOptionalPositiveInteger(child_element, "PRIORITY"))
|
|
2737
|
-
|
|
2780
|
+
.setPriority(self.getChildElementOptionalPositiveInteger(child_element, "PRIORITY"))
|
|
2781
|
+
self.readSocketAddressApplicationEndpointProvidedServiceInstance(child_element, end_point)
|
|
2782
|
+
end_point.setTpConfiguration(self.getTransportProtocolConfiguration(child_element, "TP-CONFIGURATION"))
|
|
2738
2783
|
|
|
2739
2784
|
def readSocketAddressMulticastConnectorRefs(self, element: ET.Element, address: SocketAddress):
|
|
2740
2785
|
for ref in self.getChildElementRefTypeList(element, "MULTICAST-CONNECTOR-REFS/MULTICAST-CONNECTOR-REF"):
|
|
2741
2786
|
address.addMulticastConnectorRef(ref)
|
|
2742
2787
|
|
|
2788
|
+
|
|
2743
2789
|
def readSocketAddress(self, element: ET.Element, address: SocketAddress):
|
|
2744
2790
|
self.readIdentifiable(element, address)
|
|
2745
2791
|
self.readSocketAddressApplicationEndpoint(element, address)
|
|
@@ -2747,7 +2793,6 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2747
2793
|
address.setConnectorRef(self.getChildElementOptionalRefType(element, "CONNECTOR-REF")) \
|
|
2748
2794
|
.setPortAddress(self.getChildElementOptionalPositiveInteger(element, "PORT-ADDRESS"))
|
|
2749
2795
|
|
|
2750
|
-
|
|
2751
2796
|
def readSoAdConfigSocketAddresses(self, element: ET.Element, config: SoAdConfig):
|
|
2752
2797
|
for child_element in self.findall(element, "SOCKET-ADDRESSS/*"):
|
|
2753
2798
|
tag_name = self.getTagName(child_element)
|
|
@@ -2816,98 +2861,226 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2816
2861
|
.setCanFdBaudrate(self.getChildElementOptionalNumericalValue(element, "CAN-FD-BAUDRATE")) \
|
|
2817
2862
|
.setSpeed(self.getChildElementOptionalNumericalValue(element, "SPEED"))
|
|
2818
2863
|
|
|
2819
|
-
def readLinCluster(self, element: ET.Element,
|
|
2820
|
-
|
|
2821
|
-
self.logger.debug("readLinCluster %s" % short_name)
|
|
2822
|
-
cluster = parent.createLinCluster(short_name)
|
|
2864
|
+
def readLinCluster(self, element: ET.Element, cluster: LinCluster):
|
|
2865
|
+
self.logger.debug("Read LinCluster <%s>" % cluster.getShortName())
|
|
2823
2866
|
self.readIdentifiable(element, cluster)
|
|
2824
2867
|
child_element = self.find(element, "LIN-CLUSTER-VARIANTS/LIN-CLUSTER-CONDITIONAL")
|
|
2825
2868
|
if child_element is not None:
|
|
2826
2869
|
self.readCommunicationCluster(child_element, cluster)
|
|
2827
2870
|
|
|
2828
|
-
def readCanCluster(self, element: ET.Element,
|
|
2829
|
-
|
|
2830
|
-
self.logger.debug("readCanCluster %s" % short_name)
|
|
2831
|
-
cluster = parent.createCanCluster(short_name)
|
|
2871
|
+
def readCanCluster(self, element: ET.Element, cluster: CanCluster):
|
|
2872
|
+
self.logger.debug("Read CanCluster <%s>" % cluster.getShortName())
|
|
2832
2873
|
self.readIdentifiable(element, cluster)
|
|
2833
2874
|
child_element = self.find(element, "CAN-CLUSTER-VARIANTS/CAN-CLUSTER-CONDITIONAL")
|
|
2834
2875
|
if child_element is not None:
|
|
2835
2876
|
self.readCommunicationCluster(child_element, cluster)
|
|
2836
2877
|
self.readAbstractCanCluster(child_element, cluster)
|
|
2837
2878
|
|
|
2838
|
-
def
|
|
2839
|
-
|
|
2840
|
-
self.
|
|
2841
|
-
|
|
2879
|
+
def readMacMulticastGroup(self, element: ET.Element, group: MacMulticastGroup):
|
|
2880
|
+
self.readIdentifiable(element, group)
|
|
2881
|
+
group.setMacMulticastAddress(self.getChildElementOptionalLiteral(element, "MAC-MULTICAST-ADDRESS",))
|
|
2882
|
+
|
|
2883
|
+
def readEthernetClusterMacMulticastGroups(self, element: ET.Element, cluster: EthernetCluster):
|
|
2884
|
+
for child_element in self.findall(element, "MAC-MULTICAST-GROUPS/*"):
|
|
2885
|
+
tag_name = self.getTagName(child_element)
|
|
2886
|
+
if (tag_name == "MAC-MULTICAST-GROUP"):
|
|
2887
|
+
group = cluster.createMacMulticastGroup(self.getShortName(child_element))
|
|
2888
|
+
self.readMacMulticastGroup(child_element, group)
|
|
2889
|
+
else:
|
|
2890
|
+
self.notImplemented("Unsupported assigned data type <%s>" % tag_name)
|
|
2891
|
+
|
|
2892
|
+
def readEthernetCluster(self, element: ET.Element, cluster: EthernetCluster):
|
|
2893
|
+
self.logger.debug("Read EthernetCluster <%s>" % cluster.getShortName())
|
|
2842
2894
|
self.readIdentifiable(element, cluster)
|
|
2843
2895
|
child_element = self.find(element, "ETHERNET-CLUSTER-VARIANTS/ETHERNET-CLUSTER-CONDITIONAL")
|
|
2844
2896
|
if child_element is not None:
|
|
2845
2897
|
self.readCommunicationCluster(child_element, cluster)
|
|
2898
|
+
self.readEthernetClusterMacMulticastGroups(child_element, cluster)
|
|
2846
2899
|
|
|
2847
2900
|
def readDiagnosticConnectionFunctionalRequestRefs(self, element: ET.Element, connection: DiagnosticConnection):
|
|
2848
2901
|
for ref in self.getChildElementRefTypeList(element, "FUNCTIONAL-REQUEST-REFS/FUNCTIONAL-REQUEST-REF"):
|
|
2849
2902
|
connection.addFunctionalRequestRef(ref)
|
|
2850
2903
|
|
|
2851
2904
|
def readDiagnosticConnection(self, element: ET.Element, connection: DiagnosticConnection):
|
|
2852
|
-
self.logger.debug("Read DiagnosticConnection
|
|
2905
|
+
self.logger.debug("Read DiagnosticConnection <%s>" % connection.getShortName())
|
|
2853
2906
|
self.readIdentifiable(element, connection)
|
|
2854
2907
|
self.readDiagnosticConnectionFunctionalRequestRefs(element, connection)
|
|
2855
2908
|
connection.setPhysicalRequestRef(self.getChildElementOptionalRefType(element, "PHYSICAL-REQUEST-REF")) \
|
|
2856
2909
|
.setResponseOnEventRef(self.getChildElementOptionalRefType(element, "RESPONSE-REF"))
|
|
2857
|
-
|
|
2858
|
-
def
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2910
|
+
|
|
2911
|
+
def readDiagnosticServiceTableDiagnosticConnectionRefs(self, element: ET.Element, table: DiagnosticServiceTable):
|
|
2912
|
+
for ref in self.getChildElementRefTypeList(element, "DIAGNOSTIC-CONNECTIONS/DIAGNOSTIC-CONNECTION-REF-CONDITIONAL/DIAGNOSTIC-CONNECTION-REF"):
|
|
2913
|
+
table.addDiagnosticConnectionRef(ref)
|
|
2914
|
+
|
|
2915
|
+
def readDiagnosticServiceTable(self, element: ET.Element, table: DiagnosticServiceTable):
|
|
2916
|
+
self.logger.debug("Read DiagnosticServiceTable <%s>" % table.getShortName())
|
|
2862
2917
|
self.readIdentifiable(element, table)
|
|
2918
|
+
self.readDiagnosticServiceTableDiagnosticConnectionRefs(element, table)
|
|
2919
|
+
table.setEcuInstanceRef(self.getChildElementOptionalRefType(element, "ECU-INSTANCE-REF"))
|
|
2863
2920
|
|
|
2864
|
-
def
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
self.readIdentifiable(element, i_pdu)
|
|
2921
|
+
def readSegmentPosition(self, element: ET.Element, position: SegmentPosition):
|
|
2922
|
+
position.setSegmentByteOrder(self.getChildElementOptionalLiteral(element, "SEGMENT-BYTE-ORDER")) \
|
|
2923
|
+
.setSegmentLength(self.getChildElementOptionalIntegerValue(element, "SEGMENT-LENGTH")) \
|
|
2924
|
+
.setSegmentPosition(self.getChildElementOptionalIntegerValue(element, "SEGMENT-POSITION"))
|
|
2869
2925
|
|
|
2870
|
-
def
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2926
|
+
def readMultiplexedPartSegmentPositions(self, element: ET.Element, part: MultiplexedPart):
|
|
2927
|
+
for child_element in self.findall(element, "SEGMENT-POSITIONS/*"):
|
|
2928
|
+
tag_name = self.getTagName(child_element)
|
|
2929
|
+
if tag_name == "SEGMENT-POSITION":
|
|
2930
|
+
position = SegmentPosition()
|
|
2931
|
+
self.readSegmentPosition(child_element, position)
|
|
2932
|
+
part.addSegmentPosition(position)
|
|
2933
|
+
else:
|
|
2934
|
+
self.notImplemented("Unsupported DynamicPart <%s>" % tag_name)
|
|
2875
2935
|
|
|
2876
|
-
def
|
|
2877
|
-
|
|
2878
|
-
self.logger.debug("Read UserDefinedPdu %s" % short_name)
|
|
2879
|
-
pdu = parent.createUserDefinedPdu(short_name)
|
|
2880
|
-
self.readIdentifiable(element, pdu)
|
|
2936
|
+
def readMultiplexedPart(self, element: ET.Element, part: MultiplexedPart):
|
|
2937
|
+
self.readMultiplexedPartSegmentPositions(element, part)
|
|
2881
2938
|
|
|
2882
|
-
def
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
self.readIdentifiable(element, pdu)
|
|
2939
|
+
def readDynamicPartAlternative(self, element: ET.Element, alternative: DynamicPartAlternative):
|
|
2940
|
+
alternative.setIPduRef(self.getChildElementOptionalRefType(element, "I-PDU-REF")) \
|
|
2941
|
+
.setInitialDynamicPart(self.getChildElementOptionalBooleanValue(element, "INITIAL-DYNAMIC-PART")) \
|
|
2942
|
+
.setSelectorFieldCode(self.getChildElementOptionalIntegerValue(element, "SELECTOR-FIELD-CODE"))
|
|
2887
2943
|
|
|
2888
|
-
def
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2944
|
+
def readDynamicPartDynamicPartAlternatives(self, element: ET.Element, part: DynamicPart):
|
|
2945
|
+
for child_element in self.findall(element, "DYNAMIC-PART-ALTERNATIVES/*"):
|
|
2946
|
+
tag_name = self.getTagName(child_element)
|
|
2947
|
+
if tag_name == "DYNAMIC-PART-ALTERNATIVE":
|
|
2948
|
+
alternative = DynamicPartAlternative()
|
|
2949
|
+
self.readDynamicPartAlternative(child_element, alternative)
|
|
2950
|
+
part.addDynamicPartAlternative(alternative)
|
|
2951
|
+
else:
|
|
2952
|
+
self.notImplemented("Unsupported DynamicPartAlternative <%s>" % tag_name)
|
|
2893
2953
|
|
|
2894
|
-
def
|
|
2895
|
-
|
|
2896
|
-
self.
|
|
2897
|
-
prop_set = parent.createSecureCommunicationPropsSet(short_name)
|
|
2898
|
-
self.readIdentifiable(element, prop_set)
|
|
2954
|
+
def readDynamicPart(self, element: ET.Element, part: DynamicPart):
|
|
2955
|
+
self.readMultiplexedPart(element, part)
|
|
2956
|
+
self.readDynamicPartDynamicPartAlternatives(element, part)
|
|
2899
2957
|
|
|
2900
|
-
def
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2958
|
+
def readMultiplexedIPduDynamicParts(self, element: ET.Element, ipdu: MultiplexedIPdu):
|
|
2959
|
+
for child_element in self.findall(element, "DYNAMIC-PARTS/*"):
|
|
2960
|
+
tag_name = self.getTagName(child_element)
|
|
2961
|
+
if tag_name == "DYNAMIC-PART":
|
|
2962
|
+
part = DynamicPart()
|
|
2963
|
+
self.readDynamicPart(child_element, part)
|
|
2964
|
+
ipdu.setDynamicPart(part)
|
|
2965
|
+
else:
|
|
2966
|
+
self.notImplemented("Unsupported DynamicPart <%s>" % tag_name)
|
|
2905
2967
|
|
|
2906
|
-
def
|
|
2907
|
-
|
|
2908
|
-
self.
|
|
2909
|
-
|
|
2968
|
+
def readStaticPart(self, element: ET.Element, part: StaticPart):
|
|
2969
|
+
self.readMultiplexedPart(element, part)
|
|
2970
|
+
part.setIPduRef(self.getChildElementOptionalRefType(element, "I-PDU-REF"))
|
|
2971
|
+
|
|
2972
|
+
def readMultiplexedIPduStaticParts(self, element: ET.Element, ipdu: MultiplexedIPdu):
|
|
2973
|
+
for child_element in self.findall(element, "STATIC-PARTS/*"):
|
|
2974
|
+
tag_name = self.getTagName(child_element)
|
|
2975
|
+
if tag_name == "STATIC-PART":
|
|
2976
|
+
part = StaticPart()
|
|
2977
|
+
self.readStaticPart(child_element, part)
|
|
2978
|
+
ipdu.setStaticPart(part)
|
|
2979
|
+
else:
|
|
2980
|
+
self.notImplemented("Unsupported StaticPart <%s>" % tag_name)
|
|
2981
|
+
|
|
2982
|
+
def readMultiplexedIPdu(self, element: ET.Element, ipdu: MultiplexedIPdu):
|
|
2983
|
+
self.logger.debug("Read MultiplexedIPdu <%s>" % ipdu.getShortName())
|
|
2984
|
+
self.readIPdu(element, ipdu)
|
|
2985
|
+
self.readMultiplexedIPduDynamicParts(element, ipdu)
|
|
2986
|
+
ipdu.setSelectorFieldByteOrder(self.getChildElementOptionalLiteral(element, "SELECTOR-FIELD-BYTE-ORDER")) \
|
|
2987
|
+
.setSelectorFieldLength(self.getChildElementOptionalIntegerValue(element, "SELECTOR-FIELD-LENGTH")) \
|
|
2988
|
+
.setSelectorFieldStartPosition(self.getChildElementOptionalIntegerValue(element, "SELECTOR-FIELD-START-POSITION"))
|
|
2989
|
+
self.readMultiplexedIPduStaticParts(element, ipdu)
|
|
2990
|
+
ipdu.setTriggerMode(self.getChildElementOptionalLiteral(element, "TRIGGER-MODE")) \
|
|
2991
|
+
.setUnusedBitPattern(self.getChildElementOptionalIntegerValue(element, "UNUSED-BIT-PATTERN"))
|
|
2992
|
+
|
|
2993
|
+
def readUserDefinedIPdu(self, element: ET.Element, ipdu: UserDefinedIPdu):
|
|
2994
|
+
self.logger.debug("Read UserDefinedIPdu <%s>" % ipdu.getShortName())
|
|
2995
|
+
self.readIPdu(element, ipdu)
|
|
2996
|
+
ipdu.setCddType(self.getChildElementOptionalLiteral(element, "CDD-TYPE"))
|
|
2997
|
+
|
|
2998
|
+
def readUserDefinedPdu(self, element: ET.Element, pdu: UserDefinedPdu):
|
|
2999
|
+
self.logger.debug("Read UserDefinedPdu <%s>" % pdu.getShortName())
|
|
3000
|
+
self.readPdu(element, pdu)
|
|
3001
|
+
pdu.setCddType(self.getChildElementOptionalLiteral(element, "CDD-TYPE"))
|
|
3002
|
+
|
|
3003
|
+
def readGeneralPurposePdu(self, element: ET.Element, pdu: GeneralPurposePdu):
|
|
3004
|
+
self.logger.debug("Read GeneralPurposePdu <%s>" % pdu.getShortName())
|
|
3005
|
+
self.readPdu(element, pdu)
|
|
3006
|
+
|
|
3007
|
+
def readGeneralPurposeIPdu(self, element: ET.Element, i_pdu: GeneralPurposeIPdu):
|
|
3008
|
+
self.logger.debug("Read GeneralPurposeIPdu <%s>" % i_pdu.getShortName())
|
|
3009
|
+
self.readIPdu(element, i_pdu)
|
|
3010
|
+
|
|
3011
|
+
def readSecureCommunicationAuthenticationProps(self, element: ET.Element, props: SecureCommunicationAuthenticationProps):
|
|
3012
|
+
self.readIdentifiable(element, props)
|
|
3013
|
+
props.setAuthAlgorithm(self.getChildElementOptionalLiteral(element, "AUTH-ALGORITHM")) \
|
|
3014
|
+
.setAuthInfoTxLength(self.getChildElementOptionalPositiveInteger(element, "AUTH-INFO-TX-LENGTH"))
|
|
3015
|
+
|
|
3016
|
+
def readSecureCommunicationPropsSetAuthenticationProps(self, element: ET.Element, props_set: SecureCommunicationPropsSet):
|
|
3017
|
+
for child_element in self.findall(element, "AUTHENTICATION-PROPSS/*"):
|
|
3018
|
+
tag_name = self.getTagName(child_element)
|
|
3019
|
+
if tag_name == "SECURE-COMMUNICATION-AUTHENTICATION-PROPS":
|
|
3020
|
+
props = props_set.createSecureCommunicationAuthenticationProps(self.getShortName(child_element))
|
|
3021
|
+
self.readSecureCommunicationAuthenticationProps(child_element, props)
|
|
3022
|
+
else:
|
|
3023
|
+
self.notImplemented("Unsupported AuthenticationProps <%s>" % tag_name)
|
|
3024
|
+
|
|
3025
|
+
def readSecureCommunicationFreshnessProps(self, element: ET.Element, props: SecureCommunicationFreshnessProps):
|
|
3026
|
+
self.readIdentifiable(element, props)
|
|
3027
|
+
props.setFreshnessValueLength(self.getChildElementOptionalLiteral(element, "FRESHNESS-VALUE-LENGTH")) \
|
|
3028
|
+
.setFreshnessValueTxLength(self.getChildElementOptionalPositiveInteger(element, "FRESHNESS-VALUE-TX-LENGTH"))
|
|
3029
|
+
|
|
3030
|
+
def readSecureCommunicationPropsSetFreshnessProps(self, element: ET.Element, props_set: SecureCommunicationPropsSet):
|
|
3031
|
+
for child_element in self.findall(element, "FRESHNESS-PROPSS/*"):
|
|
3032
|
+
tag_name = self.getTagName(child_element)
|
|
3033
|
+
if tag_name == "SECURE-COMMUNICATION-FRESHNESS-PROPS":
|
|
3034
|
+
props = props_set.createSecureCommunicationFreshnessProps(self.getShortName(child_element))
|
|
3035
|
+
self.readSecureCommunicationFreshnessProps(child_element, props)
|
|
3036
|
+
else:
|
|
3037
|
+
self.notImplemented("Unsupported FreshnessProps <%s>" % tag_name)
|
|
3038
|
+
|
|
3039
|
+
def readSecureCommunicationPropsSet(self, element: ET.Element, props_set: SecureCommunicationPropsSet):
|
|
3040
|
+
self.logger.debug("Read SecureCommunicationPropsSet <%s>" % props_set.getShortName())
|
|
3041
|
+
self.readIdentifiable(element, props_set)
|
|
3042
|
+
self.readSecureCommunicationPropsSetAuthenticationProps(element, props_set)
|
|
3043
|
+
self.readSecureCommunicationPropsSetFreshnessProps(element, props_set)
|
|
3044
|
+
|
|
3045
|
+
def readSoAdRoutingGroup(self, element: ET.Element, group: SoAdRoutingGroup):
|
|
3046
|
+
self.logger.debug("Read SoAdRoutingGroup <%s>" % group.getShortName())
|
|
2910
3047
|
self.readIdentifiable(element, group)
|
|
3048
|
+
group.setEventGroupControlType(self.getChildElementOptionalLiteral(element, "EVENT-GROUP-CONTROL-TYPE"))
|
|
3049
|
+
|
|
3050
|
+
def readDoIpLogicAddress(self, element: ET.Element, address: DoIpLogicAddress):
|
|
3051
|
+
self.readIdentifiable(element, address)
|
|
3052
|
+
address.setAddress(self.getChildElementOptionalIntegerValue(element, "ADDRESS"))
|
|
3053
|
+
|
|
3054
|
+
def readDoIpTpConfigDoIpLogicAddresses(self, element: ET.Element, config: DoIpTpConfig):
|
|
3055
|
+
for child_element in self.findall(element, "DO-IP-LOGIC-ADDRESSS/*"):
|
|
3056
|
+
tag_name = self.getTagName(child_element)
|
|
3057
|
+
if tag_name == "DO-IP-LOGIC-ADDRESS":
|
|
3058
|
+
address = config.createDoIpLogicAddress(self.getShortName(child_element))
|
|
3059
|
+
self.readDoIpLogicAddress(child_element, address)
|
|
3060
|
+
else:
|
|
3061
|
+
self.notImplemented("Unsupported DoIpLogicAddress <%s>" % tag_name)
|
|
3062
|
+
|
|
3063
|
+
def readDoIpTpConnection(self, element: ET.Element, connection: DoIpTpConnection):
|
|
3064
|
+
self.readTpConnection(element, connection)
|
|
3065
|
+
connection.setDoIpSourceAddressRef(self.getChildElementOptionalRefType(element, "DO-IP-SOURCE-ADDRESS-REF")) \
|
|
3066
|
+
.setDoIpTargetAddressRef(self.getChildElementOptionalRefType(element, "DO-IP-TARGET-ADDRESS-REF")) \
|
|
3067
|
+
.setTpSduRef(self.getChildElementOptionalRefType(element, "TP-SDU-REF"))
|
|
3068
|
+
|
|
3069
|
+
def readDoIpTpConfigTpConnections(self, element: ET.Element, config: DoIpTpConfig):
|
|
3070
|
+
for child_element in self.findall(element, "TP-CONNECTIONS/*"):
|
|
3071
|
+
tag_name = self.getTagName(child_element)
|
|
3072
|
+
if tag_name == "DO-IP-TP-CONNECTION":
|
|
3073
|
+
connection = DoIpTpConnection()
|
|
3074
|
+
self.readDoIpTpConnection(child_element, connection)
|
|
3075
|
+
config.addTpConnection(connection)
|
|
3076
|
+
else:
|
|
3077
|
+
self.notImplemented("Unsupported TpConnection <%s>" % tag_name)
|
|
3078
|
+
|
|
3079
|
+
def readDoIpTpConfig(self, element: ET.Element, config: DoIpTpConfig):
|
|
3080
|
+
self.logger.debug("Read DoIpTpConfig <%s>" % config.getShortName())
|
|
3081
|
+
self.readTpConfig(element, config)
|
|
3082
|
+
self.readDoIpTpConfigDoIpLogicAddresses(element, config)
|
|
3083
|
+
self.readDoIpTpConfigTpConnections(element, config)
|
|
2911
3084
|
|
|
2912
3085
|
def readPduToFrameMappings(self, element: ET.Element, parent: Frame):
|
|
2913
3086
|
for child_element in self.findall(element, "PDU-TO-FRAME-MAPPINGS/PDU-TO-FRAME-MAPPING"):
|
|
@@ -2924,99 +3097,129 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2924
3097
|
frame.frameLength = self.getChildElementOptionalNumericalValue(element, "FRAME-LENGTH")
|
|
2925
3098
|
self.readPduToFrameMappings(element, frame)
|
|
2926
3099
|
|
|
2927
|
-
def readLinUnconditionalFrame(self, element: ET.Element,
|
|
2928
|
-
|
|
2929
|
-
self.logger.debug("LinUnconditionalFrame %s" % short_name)
|
|
2930
|
-
frame = parent.createLinUnconditionalFrame(short_name)
|
|
3100
|
+
def readLinUnconditionalFrame(self, element: ET.Element, frame: LinUnconditionalFrame):
|
|
3101
|
+
self.logger.debug("Read LinUnconditionalFrame <%s>" % frame.getShortName())
|
|
2931
3102
|
self.readFrame(element, frame)
|
|
2932
3103
|
|
|
2933
|
-
def
|
|
2934
|
-
short_name = self.getShortName(element)
|
|
2935
|
-
self.logger.debug("readNmPdu %s" % short_name)
|
|
2936
|
-
pdu = parent.createNmPdu(short_name)
|
|
3104
|
+
def readPdu(self, element: ET.Element, pdu: Pdu):
|
|
2937
3105
|
self.readIdentifiable(element, pdu)
|
|
2938
|
-
self.
|
|
3106
|
+
pdu.setHasDynamicLength(self.getChildElementOptionalBooleanValue(element, "HAS-DYNAMIC-LENGTH")) \
|
|
3107
|
+
.setLength(self.getChildElementOptionalNumericalValue(element, "LENGTH"))
|
|
3108
|
+
|
|
3109
|
+
def readISignalToIPduMapping(self, element: ET.Element, mapping: ISignalToIPduMapping):
|
|
3110
|
+
self.readIdentifiable(element, mapping)
|
|
3111
|
+
mapping.setISignalRef(self.getChildElementOptionalRefType(element, "I-SIGNAL-REF")) \
|
|
3112
|
+
.setPackingByteOrder(self.getChildElementOptionalLiteral(element, "PACKING-BYTE-ORDER")) \
|
|
3113
|
+
.setStartPosition(self.getChildElementOptionalIntegerValue(element, "START-POSITION")) \
|
|
3114
|
+
.setTransferProperty(self.getChildElementOptionalLiteral(element, "TRANSFER-PROPERTY"))
|
|
3115
|
+
|
|
3116
|
+
def readNmPduISignalToIPduMappings(self, element: ET.Element, pdu: NmPdu):
|
|
3117
|
+
for child_element in self.findall(element, "I-SIGNAL-TO-I-PDU-MAPPINGS/*"):
|
|
3118
|
+
tag_name = self.getTagName(child_element)
|
|
3119
|
+
if tag_name == "I-SIGNAL-TO-I-PDU-MAPPING":
|
|
3120
|
+
mapping = pdu.createISignalToIPduMapping(self.getShortName(child_element))
|
|
3121
|
+
self.readISignalToIPduMapping(child_element, mapping)
|
|
3122
|
+
else:
|
|
3123
|
+
self.notImplemented("Unsupported ISignalToIPduMapping <%s>" % tag_name)
|
|
2939
3124
|
|
|
2940
|
-
def
|
|
2941
|
-
|
|
2942
|
-
self.
|
|
2943
|
-
|
|
2944
|
-
self.
|
|
2945
|
-
self.readIPdu(element, pdu)
|
|
3125
|
+
def readNmPdu(self, element: ET.Element, pdu: NmPdu):
|
|
3126
|
+
self.logger.debug("Read NmPdu <%s>" % pdu.getShortName())
|
|
3127
|
+
self.readPdu(element, pdu)
|
|
3128
|
+
self.readNmPduISignalToIPduMappings(element, pdu)
|
|
3129
|
+
pdu.setUnusedBitPattern(self.getChildElementOptionalIntegerValue(element, "UNUSED-BIT-PATTERN"))
|
|
2946
3130
|
|
|
2947
3131
|
def readIPdu(self, element: ET.Element, pdu: IPdu):
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
def readDcmIPdu(self, element: ET.Element, parent: ARPackage):
|
|
2951
|
-
short_name = self.getShortName(element)
|
|
2952
|
-
self.logger.debug("readDcmIPdu %s" % short_name)
|
|
2953
|
-
pdu = parent.createDcmIPdu(short_name)
|
|
2954
|
-
self.readIdentifiable(element, pdu)
|
|
2955
|
-
self.readIPdu(element, pdu)
|
|
2956
|
-
pdu.setDiagPduType(self.getChildElementOptionalLiteral(element, "DIAG-PDU-TYPE"))
|
|
3132
|
+
self.readPdu(element, pdu)
|
|
2957
3133
|
|
|
2958
|
-
def
|
|
2959
|
-
|
|
2960
|
-
self.logger.debug("readSecuredIPdu %s" % short_name)
|
|
2961
|
-
pdu = parent.createSecuredIPdu(short_name)
|
|
2962
|
-
self.readIdentifiable(element, pdu)
|
|
3134
|
+
def readNPdu(self, element: ET.Element, pdu: NPdu):
|
|
3135
|
+
self.logger.debug("Read NPdu <%s>" % pdu.getShortName())
|
|
2963
3136
|
self.readIPdu(element, pdu)
|
|
2964
3137
|
|
|
3138
|
+
def readDcmIPdu(self, element: ET.Element, i_pdu: DcmIPdu):
|
|
3139
|
+
self.logger.debug("Read DcmIPdu <%s>" % i_pdu.getShortName())
|
|
3140
|
+
self.readIPdu(element, i_pdu)
|
|
3141
|
+
i_pdu.setDiagPduType(self.getChildElementOptionalLiteral(element, "DIAG-PDU-TYPE"))
|
|
3142
|
+
|
|
3143
|
+
def getSecureCommunicationProps(self, element: ET.Element, key: str) -> SecureCommunicationProps:
|
|
3144
|
+
props = None
|
|
3145
|
+
child_element = self.find(element, key)
|
|
3146
|
+
if child_element is not None:
|
|
3147
|
+
props = SecureCommunicationProps()
|
|
3148
|
+
props.setAuthDataFreshnessLength(self.getChildElementOptionalPositiveInteger(child_element, "AUTH-DATA-FRESHNESS-LENGTH")) \
|
|
3149
|
+
.setAuthDataFreshnessStartPosition(self.getChildElementOptionalPositiveInteger(child_element, "AUTH-DATA-FRESHNESS-START-POSITION")) \
|
|
3150
|
+
.setAuthInfoTxLength(self.getChildElementOptionalPositiveInteger(child_element, "AUTH-INFO-TX-LENGTH")) \
|
|
3151
|
+
.setAuthenticationBuildAttempts(self.getChildElementOptionalPositiveInteger(child_element, "AUTHENTICATION-BUILD-ATTEMPTS")) \
|
|
3152
|
+
.setAuthenticationRetries(self.getChildElementOptionalPositiveInteger(child_element, "AUTHENTICATION-RETRIES")) \
|
|
3153
|
+
.setDataId(self.getChildElementOptionalPositiveInteger(child_element, "DATA-ID")) \
|
|
3154
|
+
.setFreshnessValueId(self.getChildElementOptionalPositiveInteger(child_element, "FRESHNESS-VALUE-ID")) \
|
|
3155
|
+
.setFreshnessValueLength(self.getChildElementOptionalPositiveInteger(child_element, "FRESHNESS-VALUE-LENGTH")) \
|
|
3156
|
+
.setFreshnessValueTxLength(self.getChildElementOptionalPositiveInteger(child_element, "FRESHNESS-VALUE-TX-LENGTH"))
|
|
3157
|
+
return props
|
|
3158
|
+
|
|
3159
|
+
def readSecuredIPdu(self, element: ET.Element, i_pdu: SecuredIPdu):
|
|
3160
|
+
self.logger.debug("Read SecuredIPdu <%s>" % i_pdu.getShortName())
|
|
3161
|
+
self.readIPdu(element, i_pdu)
|
|
3162
|
+
i_pdu.setAuthenticationPropsRef(self.getChildElementOptionalRefType(element, "AUTHENTICATION-PROPS-REF")) \
|
|
3163
|
+
.setFreshnessPropsRef(self.getChildElementOptionalRefType(element, "FRESHNESS-PROPS-REF")) \
|
|
3164
|
+
.setPayloadRef(self.getChildElementOptionalRefType(element, "PAYLOAD-REF")) \
|
|
3165
|
+
.setSecureCommunicationProps(self.getSecureCommunicationProps(element, "SECURE-COMMUNICATION-PROPS")) \
|
|
3166
|
+
.setUseAsCryptographicIPdu(self.getChildElementOptionalBooleanValue(element, "USE-AS-CRYPTOGRAPHIC-I-PDU"))
|
|
3167
|
+
|
|
2965
3168
|
def readNmNode(self, element: ET.Element, nm_node: NmNode):
|
|
2966
3169
|
self.readIdentifiable(element, nm_node)
|
|
2967
3170
|
|
|
2968
3171
|
nm_node.setControllerRef(self.getChildElementOptionalRefType(element, "CONTROLLER-REF")) \
|
|
2969
|
-
|
|
2970
|
-
|
|
3172
|
+
.setNmIfEcuRef(self.getChildElementOptionalRefType(element, "NM-IF-ECU-REF")) \
|
|
3173
|
+
.setNmPassiveModeEnabled(self.getChildElementOptionalBooleanValue(element, "NM-PASSIVE-MODE-ENABLED")) \
|
|
3174
|
+
.setNmNodeId(self.getChildElementOptionalNumericalValue(element, "NM-NODE-ID"))
|
|
2971
3175
|
for ref in self.getChildElementRefTypeList(element, "RX-NM-PDU-REFS/RX-NM-PDU-REF"):
|
|
2972
3176
|
nm_node.addRxNmPduRef(ref)
|
|
2973
3177
|
for ref in self.getChildElementRefTypeList(element, "TX-NM-PDU-REFS/TX-NM-PDU-REF"):
|
|
2974
3178
|
nm_node.addTxNmPduRefs(ref)
|
|
3179
|
+
|
|
2975
3180
|
|
|
2976
3181
|
def readCanNmNode(self, element: ET.Element, nm_node: CanNmNode):
|
|
2977
|
-
self.logger.debug("Read CanNmNode
|
|
2978
|
-
|
|
3182
|
+
self.logger.debug("Read CanNmNode <%s>" % nm_node.getShortName())
|
|
2979
3183
|
self.readNmNode(element, nm_node)
|
|
2980
|
-
|
|
2981
|
-
|
|
3184
|
+
nm_node.setNmCarWakeUpRxEnabled(self.getChildElementOptionalBooleanValue(element, "NM-CAR-WAKE-UP-RX-ENABLED")) \
|
|
3185
|
+
.setNmMsgCycleOffset(self.getChildElementOptionalFloatValue(element, "NM-MSG-CYCLE-OFFSET")) \
|
|
2982
3186
|
.setNmMsgReducedTime(self.getChildElementOptionalFloatValue(element, "NM-MSG-REDUCED-TIME")) \
|
|
2983
3187
|
.setNmRangeConfig(self.getChildElementRxIdentifierRange(element, "NM-RANGE-CONFIG"))
|
|
2984
3188
|
|
|
2985
3189
|
def readUdpNmNode(self, element: ET.Element, nm_node: UdpNmNode):
|
|
2986
|
-
self.logger.debug("Read UdpNmNode
|
|
2987
|
-
|
|
3190
|
+
self.logger.debug("Read UdpNmNode <%s>" % nm_node.getShortName())
|
|
2988
3191
|
self.readNmNode(element, nm_node)
|
|
3192
|
+
nm_node.setNmMsgCycleOffset(self.getChildElementOptionalTimeValue(element, "NM-MSG-CYCLE-OFFSET"))
|
|
2989
3193
|
|
|
2990
|
-
def readNmClusterNmNodes(self, element: ET.Element,
|
|
2991
|
-
self.logger.debug("readNmConfigNmNodes %s" %
|
|
3194
|
+
def readNmClusterNmNodes(self, element: ET.Element, cluster: NmCluster):
|
|
3195
|
+
self.logger.debug("readNmConfigNmNodes %s" % cluster.getShortName())
|
|
2992
3196
|
for child_element in self.findall(element, "NM-NODES/*"):
|
|
2993
3197
|
tag_name = self.getTagName(child_element)
|
|
2994
3198
|
if tag_name == "CAN-NM-NODE":
|
|
2995
|
-
nm_node =
|
|
3199
|
+
nm_node = cluster.createCanNmNode(self.getShortName(child_element))
|
|
2996
3200
|
self.readCanNmNode(child_element, nm_node)
|
|
2997
3201
|
elif tag_name == "UDP-NM-NODE":
|
|
2998
|
-
nm_node =
|
|
3202
|
+
nm_node = cluster.readUdpNmNode(self.getShortName(child_element))
|
|
2999
3203
|
self.readUdpNmNode(child_element, nm_node)
|
|
3000
3204
|
else:
|
|
3001
|
-
self.
|
|
3205
|
+
self.notImplemented("Unsupported Nm Node <%s>" % tag_name)
|
|
3002
3206
|
|
|
3003
3207
|
def getCanNmClusterCoupling(self, element: ET.Element) -> CanNmClusterCoupling:
|
|
3004
3208
|
coupling = CanNmClusterCoupling()
|
|
3005
|
-
|
|
3006
3209
|
for ref in self.getChildElementRefTypeList(element, "COUPLED-CLUSTER-REFS/COUPLED-CLUSTER-REF"):
|
|
3007
3210
|
coupling.addCoupledClusterRef(ref)
|
|
3008
|
-
|
|
3009
3211
|
coupling.setNmBusloadReductionEnabled(self.getChildElementOptionalBooleanValue(element, "NM-BUSLOAD-REDUCTION-ENABLED")) \
|
|
3010
3212
|
.setNmImmediateRestartEnabled(self.getChildElementOptionalBooleanValue(element, "NM-IMMEDIATE-RESTART-ENABLED"))
|
|
3011
|
-
|
|
3012
3213
|
return coupling
|
|
3013
3214
|
|
|
3014
3215
|
def getUdpNmClusterCoupling(self, element: ET.Element) -> UdpNmClusterCoupling:
|
|
3015
3216
|
coupling = UdpNmClusterCoupling()
|
|
3217
|
+
for ref in self.getChildElementRefTypeList(element, "COUPLED-CLUSTER-REFS/COUPLED-CLUSTER-REF"):
|
|
3218
|
+
coupling.addCoupledClusterRef(ref)
|
|
3219
|
+
coupling.setNmImmediateRestartEnabled(self.getChildElementOptionalBooleanValue(element, "NM-IMMEDIATE-RESTART-ENABLED"))
|
|
3016
3220
|
return coupling
|
|
3017
3221
|
|
|
3018
3222
|
def readNmConfigNmClusterCouplings(self, element: ET.Element, nm_config: NmConfig):
|
|
3019
|
-
self.logger.debug("readNmClusterNmClusterCouplings %s" % nm_config.getShortName())
|
|
3020
3223
|
for child_element in self.findall(element, "NM-CLUSTER-COUPLINGS/*"):
|
|
3021
3224
|
tag_name = self.getTagName(child_element)
|
|
3022
3225
|
if tag_name == "CAN-NM-CLUSTER-COUPLING":
|
|
@@ -3027,6 +3230,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3027
3230
|
self.notImplemented("Unsupported Nm Node <%s>" % tag_name)
|
|
3028
3231
|
|
|
3029
3232
|
def readNmCluster(self, element: ET.Element, cluster: NmCluster):
|
|
3233
|
+
self.logger.debug("read NmCluster %s" % cluster.getShortName())
|
|
3030
3234
|
self.readIdentifiable(element, cluster)
|
|
3031
3235
|
cluster.setCommunicationClusterRef(self.getChildElementOptionalRefType(element, "COMMUNICATION-CLUSTER-REF")) \
|
|
3032
3236
|
.setNmChannelId(self.getChildElementOptionalNumericalValue(element, "NM-CHANNEL-ID")) \
|
|
@@ -3034,12 +3238,9 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3034
3238
|
self.readNmClusterNmNodes(element, cluster)
|
|
3035
3239
|
cluster.setNmSynchronizingNetwork(self.getChildElementOptionalBooleanValue(element, "NM-SYNCHRONIZING-NETWORK"))
|
|
3036
3240
|
|
|
3037
|
-
def readCanNmCluster(self, element: ET.Element,
|
|
3038
|
-
|
|
3039
|
-
self.logger.debug("readCanNmCluster %s" % short_name)
|
|
3040
|
-
cluster = parent.createCanNmCluster(short_name) # type: CanNmCluster
|
|
3241
|
+
def readCanNmCluster(self, element: ET.Element, cluster: CanNmCluster):
|
|
3242
|
+
self.logger.debug("Read CanNmCluster <%s>" % cluster.getShortName())
|
|
3041
3243
|
self.readNmCluster(element, cluster)
|
|
3042
|
-
|
|
3043
3244
|
cluster.setNmBusloadReductionActive(self.getChildElementOptionalBooleanValue(element, "NM-BUSLOAD-REDUCTION-ACTIVE")) \
|
|
3044
3245
|
.setNmCarWakeUpRxEnabled(self.getChildElementOptionalBooleanValue(element, "NM-CAR-WAKE-UP-RX-ENABLED")) \
|
|
3045
3246
|
.setNmCbvPosition(self.getChildElementOptionalNumericalValue(element, "NM-CBV-POSITION")) \
|
|
@@ -3055,53 +3256,408 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3055
3256
|
.setNmUserDataLength(self. getChildElementOptionalNumericalValue(element, "NM-USER-DATA-LENGTH")) \
|
|
3056
3257
|
.setNmWaitBusSleepTime(self.getChildElementOptionalFloatValue(element, "NM-WAIT-BUS-SLEEP-TIME"))
|
|
3057
3258
|
|
|
3058
|
-
def readUdpNmCluster(self, element: ET.Element,
|
|
3059
|
-
|
|
3060
|
-
self.logger.debug("readCanNmCluster %s" % short_name)
|
|
3061
|
-
cluster = parent.createUdpNmCluster(short_name) # type: CanNmCluster
|
|
3259
|
+
def readUdpNmCluster(self, element: ET.Element, cluster: UdpNmCluster):
|
|
3260
|
+
self.logger.debug("Read UdpNmCluster %s" % cluster.getShortName())
|
|
3062
3261
|
self.readNmCluster(element, cluster)
|
|
3262
|
+
cluster.setNmCbvPosition(self.getChildElementOptionalIntegerValue(element, "NM-CBV-POSITION")) \
|
|
3263
|
+
.setNmChannelActive(self.getChildElementOptionalBooleanValue(element, "NM-CHANNEL-ACTIVE")) \
|
|
3264
|
+
.setNmImmediateNmCycleTime(self.getChildElementOptionalTimeValue(element, "NM-IMMEDIATE-NM-CYCLE-TIME")) \
|
|
3265
|
+
.setNmImmediateNmTransmissions(self.getChildElementOptionalPositiveInteger(element, "NM-IMMEDIATE-NM-TRANSMISSIONS")) \
|
|
3266
|
+
.setNmMessageTimeoutTime(self.getChildElementOptionalTimeValue(element, "NM-MESSAGE-TIMEOUT-TIME")) \
|
|
3267
|
+
.setNmMsgCycleTime(self.getChildElementOptionalTimeValue(element, "NM-MSG-CYCLE-TIME")) \
|
|
3268
|
+
.setNmNetworkTimeout(self.getChildElementOptionalTimeValue(element, "NM-NETWORK-TIMEOUT")) \
|
|
3269
|
+
.setNmNidPosition(self.getChildElementOptionalIntegerValue(element, "NM-NID-POSITION")) \
|
|
3270
|
+
.setNmRemoteSleepIndicationTime(self.getChildElementOptionalTimeValue(element, "NM-REMOTE-SLEEP-INDICATION-TIME")) \
|
|
3271
|
+
.setNmRepeatMessageTime(self.getChildElementOptionalTimeValue(element, "NM-REPEAT-MESSAGE-TIME")) \
|
|
3272
|
+
.setNmWaitBusSleepTime(self.getChildElementOptionalTimeValue(element, "NM-WAIT-BUS-SLEEP-TIME")) \
|
|
3273
|
+
.setVlanRef(self.getChildElementOptionalRefType(element, "VLAN-REF"))
|
|
3063
3274
|
|
|
3064
|
-
def readNmConfigNmClusters(self, element: ET.Element,
|
|
3275
|
+
def readNmConfigNmClusters(self, element: ET.Element, nm_config: NmConfig):
|
|
3065
3276
|
for child_element in self.findall(element, "NM-CLUSTERS/*"):
|
|
3066
3277
|
tag_name = self.getTagName(child_element)
|
|
3067
3278
|
if tag_name == "CAN-NM-CLUSTER":
|
|
3068
|
-
self.
|
|
3279
|
+
cluster = nm_config.createCanNmCluster(self.getShortName(child_element))
|
|
3280
|
+
self.readCanNmCluster(child_element, cluster)
|
|
3069
3281
|
elif tag_name == "UDP-NM-CLUSTER":
|
|
3070
|
-
self.
|
|
3282
|
+
cluster = nm_config.createUdpNmCluster(self.getShortName(child_element))
|
|
3283
|
+
self.readUdpNmCluster(child_element, cluster)
|
|
3284
|
+
else:
|
|
3285
|
+
self.raiseError("Unsupported Nm Cluster <%s>" % tag_name)
|
|
3286
|
+
|
|
3287
|
+
def readUdpNmEcu(self, element: ET.Element, ecu: UdpNmEcu):
|
|
3288
|
+
ecu.setNmSynchronizationPointEnabled(self.getChildElementOptionalBooleanValue(element, "NM-SYNCHRONIZATION-POINT-ENABLED"))
|
|
3289
|
+
|
|
3290
|
+
def readBusDependentNmEcus(self, element: ET.Element, nm_ecu: NmEcu):
|
|
3291
|
+
for child_element in self.findall(element, "BUS-DEPENDENT-NM-ECUS/*"):
|
|
3292
|
+
tag_name = self.getTagName(child_element)
|
|
3293
|
+
if tag_name == "UDP-NM-ECU":
|
|
3294
|
+
udp_nm_ecu = UdpNmEcu()
|
|
3295
|
+
self.readUdpNmEcu(child_element, udp_nm_ecu)
|
|
3296
|
+
nm_ecu.addBusDependentNmEcu(udp_nm_ecu)
|
|
3071
3297
|
else:
|
|
3072
|
-
self.
|
|
3298
|
+
self.notImplemented("Unsupported BusDependentNmEcu <%s>" % tag_name)
|
|
3299
|
+
|
|
3300
|
+
def readNmEcu(self, element: ET.Element, nm_ecu: NmEcu):
|
|
3301
|
+
self.readIdentifiable(element, nm_ecu)
|
|
3302
|
+
self.readBusDependentNmEcus(element, nm_ecu)
|
|
3303
|
+
nm_ecu.setEcuInstanceRef(self.getChildElementOptionalRefType(element, "ECU-INSTANCE-REF")) \
|
|
3304
|
+
.setNmBusSynchronizationEnabled(self.getChildElementOptionalBooleanValue(element, "NM-BUS-SYNCHRONIZATION-ENABLED")) \
|
|
3305
|
+
.setNmComControlEnabled(self.getChildElementOptionalBooleanValue(element, "NM-COM-CONTROL-ENABLED")) \
|
|
3306
|
+
.setNmNodeDetectionEnabled(self.getChildElementOptionalBooleanValue(element, "NM-NODE-DETECTION-ENABLED")) \
|
|
3307
|
+
.setNmNodeIdEnabled(self.getChildElementOptionalBooleanValue(element, "NM-NODE-ID-ENABLED")) \
|
|
3308
|
+
.setNmPduRxIndicationEnabled(self.getChildElementOptionalBooleanValue(element, "NM-PDU-RX-INDICATION-ENABLED")) \
|
|
3309
|
+
.setNmRemoteSleepIndEnabled(self.getChildElementOptionalBooleanValue(element, "NM-REMOTE-SLEEP-IND-ENABLED")) \
|
|
3310
|
+
.setNmRepeatMsgIndEnabled(self.getChildElementOptionalBooleanValue(element, "NM-REPEAT-MSG-IND-ENABLED")) \
|
|
3311
|
+
.setNmStateChangeIndEnabled(self.getChildElementOptionalBooleanValue(element, "NM-STATE-CHANGE-IND-ENABLED")) \
|
|
3312
|
+
.setNmUserDataEnabled(self.getChildElementOptionalBooleanValue(element, "NM-USER-DATA-ENABLED"))
|
|
3313
|
+
|
|
3314
|
+
def readNmConfigNmIfEcus(self, element: ET.Element, nm_config: NmConfig):
|
|
3315
|
+
for child_element in self.findall(element, "NM-IF-ECUS/*"):
|
|
3316
|
+
tag_name = self.getTagName(child_element)
|
|
3317
|
+
if tag_name == "NM-ECU":
|
|
3318
|
+
ecu = nm_config.createNmEcu(self.getShortName(child_element))
|
|
3319
|
+
self.readNmEcu(child_element, ecu)
|
|
3320
|
+
else:
|
|
3321
|
+
self.notImplemented("Unsupported NmIfEcus <%s>" % tag_name)
|
|
3073
3322
|
|
|
3074
|
-
def readNmConfig(self, element: ET.Element,
|
|
3075
|
-
|
|
3076
|
-
self.logger.debug("NmConfig %s" % short_name)
|
|
3077
|
-
config = parent.createNmConfig(short_name) # type: NmConfig
|
|
3323
|
+
def readNmConfig(self, element: ET.Element, config: NmConfig):
|
|
3324
|
+
self.logger.debug("Read NmConfig <%s>" % config.getShortName())
|
|
3078
3325
|
self.readIdentifiable(element, config)
|
|
3079
3326
|
self.readNmConfigNmClusters(element, config)
|
|
3080
3327
|
self.readNmConfigNmClusterCouplings(element, config)
|
|
3328
|
+
self.readNmConfigNmIfEcus(element, config)
|
|
3081
3329
|
|
|
3082
|
-
def
|
|
3083
|
-
|
|
3084
|
-
self.
|
|
3085
|
-
pdu = parent.createCanTpConfig(short_name)
|
|
3086
|
-
self.readIdentifiable(element, pdu)
|
|
3330
|
+
def readTpConfig(self, element: ET.Element, config: TpConfig):
|
|
3331
|
+
self.readIdentifiable(element, config)
|
|
3332
|
+
config.setCommunicationClusterRef(self.getChildElementOptionalRefType(element, "COMMUNICATION-CLUSTER-REF"))
|
|
3087
3333
|
|
|
3088
|
-
def
|
|
3089
|
-
|
|
3090
|
-
self.
|
|
3091
|
-
|
|
3334
|
+
def readCanTpAddress(self, element: ET.Element, address: CanTpAddress):
|
|
3335
|
+
self.readIdentifiable(element, address)
|
|
3336
|
+
address.setTpAddress(self.getChildElementOptionalIntegerValue(element, "TP-ADDRESS")) \
|
|
3337
|
+
.setTpAddressExtensionValue(self.getChildElementOptionalIntegerValue(element, "TP-ADDRESS-EXTENSION-VALUE"))
|
|
3338
|
+
|
|
3339
|
+
def readCanTpConfigTpAddresses(self, element: ET.Element, config: CanTpConfig):
|
|
3340
|
+
for child_element in self.findall(element, "TP-ADDRESSS/*"):
|
|
3341
|
+
tag_name = self.getTagName(child_element)
|
|
3342
|
+
if tag_name == "CAN-TP-ADDRESS":
|
|
3343
|
+
address = config.createCanTpAddress(self.getShortName(child_element))
|
|
3344
|
+
self.readCanTpAddress(child_element, address)
|
|
3345
|
+
else:
|
|
3346
|
+
self.notImplemented("Unsupported TpAddress <%s>" % tag_name)
|
|
3347
|
+
|
|
3348
|
+
def readCanTpChannel(self, element: ET.Element, channel: CanTpChannel):
|
|
3349
|
+
self.readIdentifiable(element, channel)
|
|
3350
|
+
channel.setChannelId(self.getChildElementOptionalPositiveInteger(element, "CHANNEL-ID")) \
|
|
3351
|
+
.setChannelMode(self.getChildElementOptionalLiteral(element, "CHANNEL-MODE"))
|
|
3352
|
+
|
|
3353
|
+
def readCanTpConfigTpChannels(self, element: ET.Element, config: CanTpConfig):
|
|
3354
|
+
for child_element in self.findall(element, "TP-CHANNELS/*"):
|
|
3355
|
+
tag_name = self.getTagName(child_element)
|
|
3356
|
+
if tag_name == "CAN-TP-CHANNEL":
|
|
3357
|
+
channel = config.createCanTpChannel(self.getShortName(child_element))
|
|
3358
|
+
self.readCanTpChannel(child_element, channel)
|
|
3359
|
+
else:
|
|
3360
|
+
self.notImplemented("Unsupported TpChannel <%s>" % tag_name)
|
|
3361
|
+
|
|
3362
|
+
def readTpConnection(self, element: ET.Element, connection: TpConnection):
|
|
3363
|
+
self.readARObjectAttributes(element, connection)
|
|
3364
|
+
child_element = self.find(element, "IDENT")
|
|
3365
|
+
if child_element is not None:
|
|
3366
|
+
ident = connection.createTpConnectionIdent(self.getShortName(child_element))
|
|
3367
|
+
self.readReferrable(child_element, ident)
|
|
3368
|
+
|
|
3369
|
+
def readTpConnectionReceiverRefs(self, element: ET.Element, connection: CanTpConnection):
|
|
3370
|
+
for ref in self.getChildElementRefTypeList(element, "RECEIVER-REFS/RECEIVER-REF"):
|
|
3371
|
+
connection.addReceiverRef(ref)
|
|
3372
|
+
|
|
3373
|
+
def readCanTpConnection(self, element: ET.Element, connection: CanTpConnection):
|
|
3374
|
+
self.readTpConnection(element, connection)
|
|
3375
|
+
connection.setAddressingFormat(self.getChildElementOptionalLiteral(element, "ADDRESSING-FORMAT")) \
|
|
3376
|
+
.setCanTpChannelRef(self.getChildElementOptionalRefType(element, "CAN-TP-CHANNEL-REF")) \
|
|
3377
|
+
.setCancellation(self.getChildElementOptionalBooleanValue(element, "CANCELLATION")) \
|
|
3378
|
+
.setDataPduRef(self.getChildElementOptionalRefType(element, "DATA-PDU-REF")) \
|
|
3379
|
+
.setFlowControlPduRef(self.getChildElementOptionalRefType(element, "FLOW-CONTROL-PDU-REF")) \
|
|
3380
|
+
.setMaxBlockSize(self.getChildElementOptionalIntegerValue(element, "MAX-BLOCK-SIZE")) \
|
|
3381
|
+
.setMulticastRef(self.getChildElementOptionalRefType(element, "MULTICAST-REF")) \
|
|
3382
|
+
.setPaddingActivation(self.getChildElementOptionalBooleanValue(element, "PADDING-ACTIVATION"))
|
|
3383
|
+
self.readTpConnectionReceiverRefs(element, connection)
|
|
3384
|
+
connection.setTaType(self.getChildElementOptionalLiteral(element, "TA-TYPE")) \
|
|
3385
|
+
.setTimeoutBr(self.getChildElementOptionalTimeValue(element, "TIMEOUT-BR")) \
|
|
3386
|
+
.setTimeoutBs(self.getChildElementOptionalTimeValue(element, "TIMEOUT-BS")) \
|
|
3387
|
+
.setTimeoutCr(self.getChildElementOptionalTimeValue(element, "TIMEOUT-CR")) \
|
|
3388
|
+
.setTimeoutCs(self.getChildElementOptionalTimeValue(element, "TIMEOUT-CS")) \
|
|
3389
|
+
.setTpSduRef(self.getChildElementOptionalRefType(element, "TP-SDU-REF")) \
|
|
3390
|
+
.setTransmitterRef(self.getChildElementOptionalRefType(element, "TRANSMITTER-REF"))
|
|
3391
|
+
|
|
3392
|
+
def readCanTpConfigTpConnections(self, element: ET.Element, config: CanTpConfig):
|
|
3393
|
+
for child_element in self.findall(element, "TP-CONNECTIONS/*"):
|
|
3394
|
+
tag_name = self.getTagName(child_element)
|
|
3395
|
+
if tag_name == "CAN-TP-CONNECTION":
|
|
3396
|
+
connection = CanTpConnection()
|
|
3397
|
+
self.readCanTpConnection(child_element, connection)
|
|
3398
|
+
config.addTpConnection(connection)
|
|
3399
|
+
else:
|
|
3400
|
+
self.notImplemented("Unsupported TpConnection <%s>" % tag_name)
|
|
3401
|
+
|
|
3402
|
+
def readCanTpEcu(self, element: ET.Element, tp_ecu: CanTpEcu):
|
|
3403
|
+
tp_ecu.setCycleTimeMainFunction(self.getChildElementOptionalTimeValue(element, "CYCLE-TIME-MAIN-FUNCTION")) \
|
|
3404
|
+
.setEcuInstanceRef(self.getChildElementOptionalRefType(element, "ECU-INSTANCE-REF"))
|
|
3405
|
+
|
|
3406
|
+
def readCanTpConfigTpEcus(self, element: ET.Element, config: CanTpConfig):
|
|
3407
|
+
for child_element in self.findall(element, "TP-ECUS/*"):
|
|
3408
|
+
tag_name = self.getTagName(child_element)
|
|
3409
|
+
if tag_name == "CAN-TP-ECU":
|
|
3410
|
+
tp_ecu = CanTpEcu()
|
|
3411
|
+
self.readCanTpEcu(child_element, tp_ecu)
|
|
3412
|
+
config.addTpEcu(tp_ecu)
|
|
3413
|
+
else:
|
|
3414
|
+
self.notImplemented("Unsupported TpEcu <%s>" % tag_name)
|
|
3415
|
+
|
|
3416
|
+
def readCanTpNode(self, element: ET.Element, tp_node: CanTpNode):
|
|
3417
|
+
self.readIdentifiable(element, tp_node)
|
|
3418
|
+
tp_node.setConnectorRef(self.getChildElementOptionalRefType(element, "CONNECTOR-REF")) \
|
|
3419
|
+
.setMaxFcWait(self.getChildElementOptionalIntegerValue(element, "MAX-FC-WAIT")) \
|
|
3420
|
+
.setStMin(self.getChildElementOptionalTimeValue(element, "ST-MIN")) \
|
|
3421
|
+
.setTimeoutAr(self.getChildElementOptionalTimeValue(element, "TIMEOUT-AR")) \
|
|
3422
|
+
.setTimeoutAs(self.getChildElementOptionalTimeValue(element, "TIMEOUT-AS")) \
|
|
3423
|
+
.setTpAddressRef(self.getChildElementOptionalRefType(element, "TP-ADDRESS-REF"))
|
|
3424
|
+
|
|
3425
|
+
def readCanTpConfigTpNodes(self, element: ET.Element, config: CanTpConfig):
|
|
3426
|
+
for child_element in self.findall(element, "TP-NODES/*"):
|
|
3427
|
+
tag_name = self.getTagName(child_element)
|
|
3428
|
+
if tag_name == "CAN-TP-NODE":
|
|
3429
|
+
tp_node = config.createCanTpNode(self.getShortName(child_element))
|
|
3430
|
+
self.readCanTpNode(child_element, tp_node)
|
|
3431
|
+
else:
|
|
3432
|
+
self.notImplemented("Unsupported TpNode <%s>" % tag_name)
|
|
3433
|
+
|
|
3434
|
+
def readCanTpConfig(self, element: ET.Element, config: CanTpConfig):
|
|
3435
|
+
self.logger.debug("Read CanTpConfig <%s>" % config.getShortName())
|
|
3436
|
+
self.readTpConfig(element, config)
|
|
3437
|
+
self.readCanTpConfigTpAddresses(element, config)
|
|
3438
|
+
self.readCanTpConfigTpChannels(element, config)
|
|
3439
|
+
self.readCanTpConfigTpConnections(element, config)
|
|
3440
|
+
self.readCanTpConfigTpEcus(element, config)
|
|
3441
|
+
self.readCanTpConfigTpNodes(element, config)
|
|
3442
|
+
|
|
3443
|
+
def readTpAddress(self, element: ET.Element, address: TpAddress):
|
|
3444
|
+
self.readIdentifiable(element, address)
|
|
3445
|
+
address.setTpAddress(self.getChildElementOptionalIntegerValue(element, "TP-ADDRESS"))
|
|
3446
|
+
|
|
3447
|
+
def readLinTpConfigTpAddresses(self, element: ET.Element, config: LinTpConfig):
|
|
3448
|
+
for child_element in self.findall(element, "TP-ADDRESSS/*"):
|
|
3449
|
+
tag_name = self.getTagName(child_element)
|
|
3450
|
+
if tag_name == "TP-ADDRESS":
|
|
3451
|
+
address = config.createTpAddress(self.getShortName(child_element))
|
|
3452
|
+
self.readTpAddress(child_element, address)
|
|
3453
|
+
else:
|
|
3454
|
+
self.notImplemented("Unsupported TpAddress <%s>" % tag_name)
|
|
3455
|
+
|
|
3456
|
+
def readLinTpConnection(self, element: ET.Element, connection: LinTpConnection):
|
|
3457
|
+
self.readTpConnection(element, connection)
|
|
3458
|
+
connection.setDataPduRef(self.getChildElementOptionalRefType(element, "DATA-PDU-REF")) \
|
|
3459
|
+
.setFlowControlRef(self.getChildElementOptionalRefType(element, "FLOW-CONTROL-REF")) \
|
|
3460
|
+
.setLinTpNSduRef(self.getChildElementOptionalRefType(element, "LIN-TP-N-SDU-REF"))
|
|
3461
|
+
self.readTpConnectionReceiverRefs(element, connection)
|
|
3462
|
+
connection.setTimeoutAs(self.getChildElementOptionalTimeValue(element, "TIMEOUT-AS")) \
|
|
3463
|
+
.setTimeoutCr(self.getChildElementOptionalTimeValue(element, "TIMEOUT-CR")) \
|
|
3464
|
+
.setTimeoutCs(self.getChildElementOptionalTimeValue(element, "TIMEOUT-CS")) \
|
|
3465
|
+
.setTransmitterRef(self.getChildElementOptionalRefType(element, "TRANSMITTER-REF"))
|
|
3466
|
+
|
|
3467
|
+
def readLinTpConfigTpConnections(self, element: ET.Element, config: LinTpConfig):
|
|
3468
|
+
for child_element in self.findall(element, "TP-CONNECTIONS/*"):
|
|
3469
|
+
tag_name = self.getTagName(child_element)
|
|
3470
|
+
if tag_name == "LIN-TP-CONNECTION":
|
|
3471
|
+
connection = LinTpConnection()
|
|
3472
|
+
self.readLinTpConnection(child_element, connection)
|
|
3473
|
+
config.addTpConnection(connection)
|
|
3474
|
+
else:
|
|
3475
|
+
self.notImplemented("Unsupported TpConnection <%s>" % tag_name)
|
|
3476
|
+
|
|
3477
|
+
def readLinTpNode(self, element: ET.Element, tp_node: LinTpNode):
|
|
3478
|
+
self.readIdentifiable(element, tp_node)
|
|
3479
|
+
tp_node.setConnectorRef(self.getChildElementOptionalRefType(element, "CONNECTOR-REF")) \
|
|
3480
|
+
.setDropNotRequestedNad(self.getChildElementOptionalBooleanValue(element, "DROP-NOT-REQUESTED-NAD")) \
|
|
3481
|
+
.setP2Max(self.getChildElementOptionalTimeValue(element, "P-2-MAX")) \
|
|
3482
|
+
.setP2Timing(self.getChildElementOptionalTimeValue(element, "P-2-TIMING")) \
|
|
3483
|
+
.setTpAddressRef(self.getChildElementOptionalRefType(element, "TP-ADDRESS-REF"))
|
|
3484
|
+
|
|
3485
|
+
def readLinTpConfigTpNodes(self, element: ET.Element, config: LinTpConfig):
|
|
3486
|
+
for child_element in self.findall(element, "TP-NODES/*"):
|
|
3487
|
+
tag_name = self.getTagName(child_element)
|
|
3488
|
+
if tag_name == "LIN-TP-NODE":
|
|
3489
|
+
tp_node = config.createLinTpNode(self.getShortName(child_element))
|
|
3490
|
+
self.readLinTpNode(child_element, tp_node)
|
|
3491
|
+
else:
|
|
3492
|
+
self.notImplemented("Unsupported TpNode <%s>" % tag_name)
|
|
3493
|
+
|
|
3494
|
+
def readLinTpConfig(self, element: ET.Element, config: LinTpConfig):
|
|
3495
|
+
self.logger.debug("Read LinTpConfig <%s>" % config.getShortName())
|
|
3496
|
+
self.readTpConfig(element, config)
|
|
3497
|
+
self.readLinTpConfigTpAddresses(element, config)
|
|
3498
|
+
self.readLinTpConfigTpConnections(element, config)
|
|
3499
|
+
self.readLinTpConfigTpNodes(element, config)
|
|
3500
|
+
|
|
3501
|
+
def readCanFrame(self, element: ET.Element, frame: CanFrame):
|
|
3502
|
+
self.logger.debug("Read CanFrame <%s>" % frame.getShortName())
|
|
3092
3503
|
self.readFrame(element, frame)
|
|
3093
3504
|
|
|
3505
|
+
def readCommunicationController(self, element: ET.Element, controller: CommunicationController):
|
|
3506
|
+
controller.setWakeUpByControllerSupported(self.getChildElementOptionalBooleanValue(element, "WAKE-UP-BY-CONTROLLER-SUPPORTED"))
|
|
3507
|
+
|
|
3508
|
+
def getCanControllerFdConfiguration(self, element: ET.Element, key: str) -> CanControllerFdConfiguration:
|
|
3509
|
+
configuration = None
|
|
3510
|
+
child_element = self.find(element, key)
|
|
3511
|
+
if child_element is not None:
|
|
3512
|
+
configuration = CanControllerFdConfiguration()
|
|
3513
|
+
#TODO: need to implemented
|
|
3514
|
+
return configuration
|
|
3515
|
+
|
|
3516
|
+
def getCanControllerFdConfigurationRequirements(self, element: ET.Element, key: str) -> CanControllerFdConfigurationRequirements:
|
|
3517
|
+
requirements = None
|
|
3518
|
+
child_element = self.find(element, key)
|
|
3519
|
+
if child_element is not None:
|
|
3520
|
+
requirements = CanControllerFdConfigurationRequirements()
|
|
3521
|
+
requirements.setMaxNumberOfTimeQuantaPerBit(self.getChildElementOptionalIntegerValue(child_element, "MAX-NUMBER-OF-TIME-QUANTA-PER-BIT")) \
|
|
3522
|
+
.setMaxSamplePoint(self.getChildElementOptionalFloatValue(child_element, "MAX-SAMPLE-POINT")) \
|
|
3523
|
+
.setMaxSyncJumpWidth(self.getChildElementOptionalFloatValue(child_element, "MAX-SYNC-JUMP-WIDTH")) \
|
|
3524
|
+
.setMaxTrcvDelayCompensationOffset(self.getChildElementOptionalTimeValue(child_element, "MAX-TRCV-DELAY-COMPENSATION-OFFSET")) \
|
|
3525
|
+
.setMinNumberOfTimeQuantaPerBit(self.getChildElementOptionalIntegerValue(child_element, "MIN-NUMBER-OF-TIME-QUANTA-PER-BIT")) \
|
|
3526
|
+
.setMinSamplePoint(self.getChildElementOptionalFloatValue(child_element, "MIN-SAMPLE-POINT")) \
|
|
3527
|
+
.setMinSyncJumpWidth(self.getChildElementOptionalFloatValue(child_element, "MIN-SYNC-JUMP-WIDTH")) \
|
|
3528
|
+
.setMinTrcvDelayCompensationOffset(self.getChildElementOptionalTimeValue(child_element, "MIN-TRCV-DELAY-COMPENSATION-OFFSET")) \
|
|
3529
|
+
.setTxBitRateSwitch(self.getChildElementOptionalBooleanValue(child_element, "TX-BIT-RATE-SWITCH"))
|
|
3530
|
+
return requirements
|
|
3531
|
+
|
|
3532
|
+
def readAbstractCanCommunicationControllerAttributes(self, element: ET.Element, attributes: AbstractCanCommunicationControllerAttributes):
|
|
3533
|
+
attributes.setCanControllerFdAttributes(self.getCanControllerFdConfiguration(element, "CAN-CONTROLLER-FD-CONFIGURATION")) \
|
|
3534
|
+
.setCanControllerFdRequirements(self.getCanControllerFdConfigurationRequirements(element, "CAN-CONTROLLER-FD-REQUIREMENTS"))
|
|
3535
|
+
|
|
3536
|
+
def readCanControllerConfigurationRequirements(self, element: ET.Element, requirements: CanControllerConfigurationRequirements):
|
|
3537
|
+
self.readAbstractCanCommunicationControllerAttributes(element, requirements)
|
|
3538
|
+
requirements.setMaxNumberOfTimeQuantaPerBit(self.getChildElementOptionalIntegerValue(element, "MAX-NUMBER-OF-TIME-QUANTA-PER-BIT")) \
|
|
3539
|
+
.setMaxSamplePoint(self.getChildElementOptionalFloatValue(element, "MAX-SAMPLE-POINT")) \
|
|
3540
|
+
.setMaxSyncJumpWidth(self.getChildElementOptionalFloatValue(element, "MAX-SYNC-JUMP-WIDTH")) \
|
|
3541
|
+
.setMinNumberOfTimeQuantaPerBit(self.getChildElementOptionalIntegerValue(element, "MIN-NUMBER-OF-TIME-QUANTA-PER-BIT")) \
|
|
3542
|
+
.setMinSamplePoint(self.getChildElementOptionalFloatValue(element, "MIN-SAMPLE-POINT")) \
|
|
3543
|
+
.setMinSyncJumpWidth(self.getChildElementOptionalFloatValue(element, "MIN-SYNC-JUMP-WIDTH"))
|
|
3544
|
+
|
|
3545
|
+
def readAbstractCanCommunicationControllerCanControllerAttributes(self, element: ET.SubElement, controller: AbstractCanCommunicationController):
|
|
3546
|
+
for child_element in self.findall(element, "CAN-CONTROLLER-ATTRIBUTES/*"):
|
|
3547
|
+
tag_name = self.getTagName(child_element)
|
|
3548
|
+
if tag_name == "CAN-CONTROLLER-CONFIGURATION-REQUIREMENTS":
|
|
3549
|
+
requirements = CanControllerConfigurationRequirements()
|
|
3550
|
+
self.readCanControllerConfigurationRequirements(child_element, requirements)
|
|
3551
|
+
controller.setCanControllerAttributes(requirements)
|
|
3552
|
+
else:
|
|
3553
|
+
self.notImplemented("Unsupported CanControllerAttributes <%s>" % tag_name)
|
|
3554
|
+
|
|
3555
|
+
def readAbstractCanCommunicationController(self, element: ET.Element, controller: AbstractCanCommunicationController):
|
|
3556
|
+
self.readCommunicationController(element, controller)
|
|
3557
|
+
self.readAbstractCanCommunicationControllerCanControllerAttributes(element, controller)
|
|
3558
|
+
|
|
3094
3559
|
def readCanCommunicationController(self, element: ET.Element, controller: CanCommunicationController):
|
|
3095
3560
|
self.logger.debug("Read CanCommunicationController %s" % controller.getShortName())
|
|
3096
3561
|
self.readIdentifiable(element, controller)
|
|
3562
|
+
child_element = self.find(element, "CAN-COMMUNICATION-CONTROLLER-VARIANTS/CAN-COMMUNICATION-CONTROLLER-CONDITIONAL")
|
|
3563
|
+
if child_element is not None:
|
|
3564
|
+
self.readAbstractCanCommunicationController(child_element, controller)
|
|
3565
|
+
|
|
3566
|
+
def readCouplingPortSchedulerCouplingPortStructuralElement(self, element: ET.Element, item: CouplingPortStructuralElement):
|
|
3567
|
+
self.readIdentifiable(element, item)
|
|
3568
|
+
|
|
3569
|
+
def readCouplingPortFifo(self, element: ET.Element, fifo: CouplingPortFifo):
|
|
3570
|
+
self.readCouplingPortSchedulerCouplingPortStructuralElement(element, fifo)
|
|
3571
|
+
|
|
3572
|
+
def readCouplingPortScheduler(self, element: ET.Element, scheduler: CouplingPortScheduler):
|
|
3573
|
+
self.readCouplingPortSchedulerCouplingPortStructuralElement(element, scheduler)
|
|
3574
|
+
scheduler.setPortScheduler(self.getChildElementOptionalLiteral(element, "PORT-SCHEDULER"))
|
|
3575
|
+
|
|
3576
|
+
def readCouplingPortDetailsCouplingPortStructuralElements(self, item: ET.Element, details: CouplingPortDetails):
|
|
3577
|
+
for child_element in self.findall(item, "COUPLING-PORT-STRUCTURAL-ELEMENTS/*"):
|
|
3578
|
+
tag_name = self.getTagName(child_element)
|
|
3579
|
+
if tag_name == "COUPLING-PORT-FIFO":
|
|
3580
|
+
item = details.createCouplingPortFifo(self.getShortName(child_element))
|
|
3581
|
+
self.readCouplingPortFifo(child_element, item)
|
|
3582
|
+
elif tag_name == "COUPLING-PORT-SCHEDULER":
|
|
3583
|
+
item = details.createCouplingPortScheduler(self.getShortName(child_element))
|
|
3584
|
+
self.readCouplingPortScheduler(child_element, item)
|
|
3585
|
+
else:
|
|
3586
|
+
self.notImplemented("Unsupported CouplingPortStructuralElement <%s>" % tag_name)
|
|
3587
|
+
|
|
3588
|
+
def readEthernetPriorityRegeneration(self, element: ET.Element, regeneration: EthernetPriorityRegeneration):
|
|
3589
|
+
regeneration.setIngressPriority(self.getChildElementOptionalPositiveInteger(element, "INGRESS-PRIORITY")) \
|
|
3590
|
+
.setRegeneratedPriority(self.getChildElementOptionalPositiveInteger(element, "REGENERATED-PRIORITY"))
|
|
3591
|
+
|
|
3592
|
+
def readCouplingPortDetailsEthernetPriorityRegenerations(self, element: ET.Element, details: CouplingPortDetails):
|
|
3593
|
+
for child_element in self.findall(element, "ETHERNET-PRIORITY-REGENERATIONS/*"):
|
|
3594
|
+
tag_name = self.getTagName(child_element)
|
|
3595
|
+
if tag_name == "ETHERNET-PRIORITY-REGENERATION":
|
|
3596
|
+
item = details.createEthernetPriorityRegeneration(self.getShortName(child_element))
|
|
3597
|
+
self.readEthernetPriorityRegeneration(child_element, item)
|
|
3598
|
+
else:
|
|
3599
|
+
self.notImplemented("Unsupported EthernetPriorityRegeneration <%s>" % tag_name)
|
|
3600
|
+
|
|
3601
|
+
def getCouplingPortDetails(self, element: ET.Element, key: str) -> CouplingPortDetails:
|
|
3602
|
+
details = None
|
|
3603
|
+
child_element = self.find(element, key)
|
|
3604
|
+
if child_element is not None:
|
|
3605
|
+
details = CouplingPortDetails()
|
|
3606
|
+
self.readCouplingPortDetailsCouplingPortStructuralElements(child_element, details)
|
|
3607
|
+
self.readCouplingPortDetailsEthernetPriorityRegenerations(child_element, details)
|
|
3608
|
+
details.setLastEgressSchedulerRef(self.getChildElementOptionalRefType(child_element, "LAST-EGRESS-SCHEDULER-REF"))
|
|
3609
|
+
return details
|
|
3610
|
+
|
|
3611
|
+
def readVlanMembership(self, element: ET.Element, membership: VlanMembership):
|
|
3612
|
+
membership.setSendActivity(self.getChildElementOptionalLiteral(element, "SEND-ACTIVITY")) \
|
|
3613
|
+
.setVlanRef(self.getChildElementOptionalRefType(element, "VLAN-REF"))
|
|
3614
|
+
|
|
3615
|
+
def readCouplingPortVlanMemberships(self, element: ET.Element, port: CouplingPort):
|
|
3616
|
+
for child_element in self.findall(element, "VLAN-MEMBERSHIPS/*"):
|
|
3617
|
+
tag_name = self.getTagName(child_element)
|
|
3618
|
+
if tag_name == "VLAN-MEMBERSHIP":
|
|
3619
|
+
membership = VlanMembership()
|
|
3620
|
+
self.readVlanMembership(child_element, membership)
|
|
3621
|
+
port.addVlanMembership(membership)
|
|
3622
|
+
else:
|
|
3623
|
+
self.notImplemented("Unsupported VlanMembership <%s>" % tag_name)
|
|
3624
|
+
|
|
3625
|
+
def readCouplingPort(self, element: ET.Element, port: CouplingPort):
|
|
3626
|
+
self.readIdentifiable(element, port)
|
|
3627
|
+
port.setCouplingPortDetails(self.getCouplingPortDetails(element, "COUPLING-PORT-DETAILS")) \
|
|
3628
|
+
.setMacAddressVlanAssignments(self.getChildElementOptionalLiteral(element, "MAC-LAYER-TYPE"))
|
|
3629
|
+
self.readCouplingPortVlanMemberships(element, port)
|
|
3630
|
+
|
|
3631
|
+
def readEthernetCommunicationControllerCouplingPorts(self, element: ET.Element, controller: EthernetCommunicationController):
|
|
3632
|
+
for child_element in self.findall(element, "COUPLING-PORTS/*"):
|
|
3633
|
+
tag_name = self.getTagName(child_element)
|
|
3634
|
+
if (tag_name == "COUPLING-PORT"):
|
|
3635
|
+
port = controller.createCouplingPort(self.getShortName(child_element))
|
|
3636
|
+
self.readCouplingPort(child_element, port)
|
|
3637
|
+
else:
|
|
3638
|
+
self.notImplemented("Unsupported Coupling Port <%s>" % tag_name)
|
|
3097
3639
|
|
|
3098
3640
|
def readEthernetCommunicationController(self, element: ET.Element, controller: EthernetCommunicationController):
|
|
3099
3641
|
self.logger.debug("Read EthernetCommunicationController %s" % controller.getShortName())
|
|
3100
3642
|
self.readIdentifiable(element, controller)
|
|
3643
|
+
child_element = self.find(element, "ETHERNET-COMMUNICATION-CONTROLLER-VARIANTS/ETHERNET-COMMUNICATION-CONTROLLER-CONDITIONAL")
|
|
3644
|
+
if child_element is not None:
|
|
3645
|
+
self.readCommunicationController(child_element, controller)
|
|
3646
|
+
self.readEthernetCommunicationControllerCouplingPorts(child_element, controller)
|
|
3647
|
+
|
|
3648
|
+
def readLinCommunicationController(self, element: ET.Element, controller: LinCommunicationController):
|
|
3649
|
+
self.readCommunicationController(element, controller)
|
|
3650
|
+
controller.setProtocolVersion(self.getChildElementOptionalLiteral(element, "PROTOCOL-VERSION"))
|
|
3101
3651
|
|
|
3102
3652
|
def readLinMaster(self, element: ET.Element, controller: LinMaster):
|
|
3103
3653
|
self.logger.debug("Read LinMaster %s" % controller.getShortName())
|
|
3104
3654
|
self.readIdentifiable(element, controller)
|
|
3655
|
+
child_element = self.find(element, "LIN-MASTER-VARIANTS/LIN-MASTER-CONDITIONAL")
|
|
3656
|
+
if child_element is not None:
|
|
3657
|
+
self.readLinCommunicationController(child_element, controller)
|
|
3658
|
+
controller.setTimeBase(self.getChildElementOptionalTimeValue(child_element, "TIME-BASE")) \
|
|
3659
|
+
.setTimeBaseJitter(self.getChildElementOptionalTimeValue(child_element, "TIME-BASE-JITTER"))
|
|
3660
|
+
|
|
3105
3661
|
|
|
3106
3662
|
def readEcuInstanceCommControllers(self, element: ET.Element, instance: EcuInstance):
|
|
3107
3663
|
self.logger.debug("readEcuInstanceCommControllers %s" % instance.getShortName())
|
|
@@ -3117,7 +3673,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3117
3673
|
controller = instance.createLinMaster(self.getShortName(child_element))
|
|
3118
3674
|
self.readLinMaster(child_element, controller)
|
|
3119
3675
|
else:
|
|
3120
|
-
self.
|
|
3676
|
+
self.raiseError("Unsupported Communication Controller <%s>" % tag_name)
|
|
3121
3677
|
|
|
3122
3678
|
def readCommConnectorPort(self, element: ET.Element, port: CommConnectorPort):
|
|
3123
3679
|
self.readIdentifiable(element, port)
|
|
@@ -3128,9 +3684,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3128
3684
|
|
|
3129
3685
|
def readIPduPort(self, element: ET.Element, port: IPduPort):
|
|
3130
3686
|
self.readCommConnectorPort(element, port)
|
|
3687
|
+
port.setKeyId(self.getChildElementOptionalPositiveInteger(element, "KEY-ID")) \
|
|
3688
|
+
.setRxSecurityVerification(self.getChildElementOptionalBooleanValue(element, "RX-SECURITY-VERIFICATION")) \
|
|
3689
|
+
.setUseAuthDataFreshness(self.getChildElementOptionalBooleanValue(element, "USE-AUTH-DATA-FRESHNESS")) \
|
|
3131
3690
|
|
|
3132
3691
|
def readISignalPort(self, element: ET.Element, port: ISignalPort):
|
|
3133
3692
|
self.readCommConnectorPort(element, port)
|
|
3693
|
+
port.setTimeout(self.getChildElementOptionalTimeValue(element, "TIMEOUT"))
|
|
3134
3694
|
|
|
3135
3695
|
def readCommunicationConnectorEcuCommPortInstances(self, element: ET.Element, connector: CommunicationConnector):
|
|
3136
3696
|
self.logger.debug("read EcuCommPortInstances of CommunicationConnector %s" % connector.getShortName())
|
|
@@ -3146,18 +3706,25 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3146
3706
|
port = connector.createISignalPort(self.getShortName(child_element))
|
|
3147
3707
|
self.readISignalPort(child_element, port)
|
|
3148
3708
|
else:
|
|
3149
|
-
self.
|
|
3709
|
+
self.raiseError("Unsupported EcuCommPortInstances <%s>" % tag_name)
|
|
3150
3710
|
|
|
3151
3711
|
def readCommunicationConnector(self, element: ET.Element, connector: CommunicationConnector):
|
|
3152
3712
|
self.readIdentifiable(element, connector)
|
|
3153
3713
|
connector.setCommControllerRef(self.getChildElementOptionalRefType(element, "COMM-CONTROLLER-REF"))
|
|
3154
3714
|
self.readCommunicationConnectorEcuCommPortInstances(element, connector)
|
|
3715
|
+
connector.setPncGatewayType(self.getChildElementOptionalLiteral(element, "PNC-GATEWAY-TYPE"))
|
|
3155
3716
|
|
|
3156
3717
|
def readCanCommunicationConnector(self, element: ET.Element, connector: CanCommunicationConnector):
|
|
3157
3718
|
self.readCommunicationConnector(element, connector)
|
|
3158
3719
|
|
|
3720
|
+
def readEthernetCommunicationConnectorNetworkEndpointRefs(self, element: ET.Element, connector: EthernetCommunicationConnector):
|
|
3721
|
+
for ref in self.getChildElementRefTypeList(element, "NETWORK-ENDPOINT-REFS/NETWORK-ENDPOINT-REF"):
|
|
3722
|
+
connector.addNetworkEndpointRef(ref)
|
|
3723
|
+
|
|
3159
3724
|
def readEthernetCommunicationConnector(self, element: ET.Element, connector: EthernetCommunicationConnector):
|
|
3160
3725
|
self.readCommunicationConnector(element, connector)
|
|
3726
|
+
connector.setMaximumTransmissionUnit(self.getChildElementOptionalPositiveInteger(element, "MAXIMUM-TRANSMISSION-UNIT"))
|
|
3727
|
+
self.readEthernetCommunicationConnectorNetworkEndpointRefs(element, connector)
|
|
3161
3728
|
|
|
3162
3729
|
def readLinCommunicationConnector(self, element: ET.Element, connector: LinCommunicationConnector):
|
|
3163
3730
|
self.readCommunicationConnector(element, connector)
|
|
@@ -3176,20 +3743,24 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3176
3743
|
connector = instance.createLinCommunicationConnector(self.getShortName(child_element))
|
|
3177
3744
|
self.readLinCommunicationConnector(child_element, connector)
|
|
3178
3745
|
else:
|
|
3179
|
-
self.
|
|
3746
|
+
self.notImplemented("Unsupported Communication Connector <%s>" % tag_name)
|
|
3180
3747
|
|
|
3181
|
-
def
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3748
|
+
def readEcuInstanceAssociatedComIPduGroupRefs(self, element: ET.Element, instance: EcuInstance):
|
|
3749
|
+
for ref in self.getChildElementRefTypeList(element, "ASSOCIATED-COM-I-PDU-GROUP-REFS/ASSOCIATED-COM-I-PDU-GROUP-REF"):
|
|
3750
|
+
instance.addAssociatedComIPduGroupRef(ref)
|
|
3751
|
+
|
|
3752
|
+
def readEcuInstance(self, element: ET.Element, instance: EcuInstance):
|
|
3753
|
+
self.logger.debug("Read EcuInstance <%s>" % instance.getShortName())
|
|
3185
3754
|
self.readIdentifiable(element, instance)
|
|
3755
|
+
self.readEcuInstanceAssociatedComIPduGroupRefs(element, instance)
|
|
3186
3756
|
instance.setComConfigurationGwTimeBase(self.getChildElementOptionalTimeValue(element, "COM-CONFIGURATION-GW-TIME-BASE")) \
|
|
3187
3757
|
.setComConfigurationRxTimeBase(self.getChildElementOptionalTimeValue(element, "COM-CONFIGURATION-RX-TIME-BASE")) \
|
|
3188
3758
|
.setComConfigurationTxTimeBase(self.getChildElementOptionalTimeValue(element, "COM-CONFIGURATION-TX-TIME-BASE")) \
|
|
3189
3759
|
.setComEnableMDTForCyclicTransmission(self.getChildElementOptionalBooleanValue(element, "COM-ENABLE-MDT-FOR-CYCLIC-TRANSMISSION"))
|
|
3190
3760
|
self.readEcuInstanceCommControllers(element, instance)
|
|
3191
3761
|
self.readEcuInstanceConnectors(element, instance)
|
|
3192
|
-
instance.
|
|
3762
|
+
instance.setDiagnosticAddress(self.getChildElementOptionalIntegerValue(element, "DIAGNOSTIC-ADDRESS")) \
|
|
3763
|
+
.setSleepModeSupported(self.getChildElementOptionalBooleanValue(element, "SLEEP-MODE-SUPPORTED")) \
|
|
3193
3764
|
.setWakeUpOverBusSupported(self.getChildElementOptionalBooleanValue(element, "WAKE-UP-OVER-BUS-SUPPORTED"))
|
|
3194
3765
|
|
|
3195
3766
|
'''
|
|
@@ -3212,30 +3783,34 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3212
3783
|
mappings.append(mapping)
|
|
3213
3784
|
return mappings
|
|
3214
3785
|
|
|
3215
|
-
|
|
3786
|
+
def getTargetIPduRef(self, element, key: str) -> TargetIPduRef:
|
|
3787
|
+
i_pdu_ref = None
|
|
3788
|
+
child_element = self.find(element, key)
|
|
3789
|
+
if child_element is not None:
|
|
3790
|
+
i_pdu_ref = TargetIPduRef()
|
|
3791
|
+
i_pdu_ref.setTargetIPdu(self.getChildElementOptionalRefType(child_element, "TARGET-I-PDU-REF"))
|
|
3792
|
+
return i_pdu_ref
|
|
3793
|
+
|
|
3216
3794
|
def getIPduMappings(self, element: ET.Element) -> List[IPduMapping]:
|
|
3217
3795
|
mappings = []
|
|
3218
|
-
for child_element in self.findall(element,
|
|
3796
|
+
for child_element in self.findall(element, "I-PDU-MAPPINGS/I-PDU-MAPPING"):
|
|
3219
3797
|
mapping = IPduMapping()
|
|
3220
|
-
mapping.
|
|
3221
|
-
|
|
3798
|
+
mapping.setSourceIpduRef(self.getChildElementOptionalRefType(child_element, "SOURCE-I-PDU-REF")) \
|
|
3799
|
+
.setTargetIPdu(self.getTargetIPduRef(child_element, "TARGET-I-PDU"))
|
|
3222
3800
|
mappings.append(mapping)
|
|
3223
3801
|
return mappings
|
|
3224
|
-
'''
|
|
3225
3802
|
|
|
3226
|
-
def readGateway(self, element: ET.Element,
|
|
3227
|
-
|
|
3228
|
-
self.logger.debug("Gateway %s" % short_name)
|
|
3229
|
-
gateway = parent.createGateway(short_name)
|
|
3803
|
+
def readGateway(self, element: ET.Element, gateway: Gateway):
|
|
3804
|
+
self.logger.debug("Read Gateway <%s>" % gateway.getShortName())
|
|
3230
3805
|
self.readIdentifiable(element, gateway)
|
|
3231
|
-
gateway.
|
|
3806
|
+
gateway.setEcuRef(self.getChildElementOptionalRefType(element, "ECU-REF"))
|
|
3807
|
+
for mapping in self.getIPduMappings(element):
|
|
3808
|
+
gateway.addIPduMapping(mapping)
|
|
3232
3809
|
for mapping in self.getISignalMappings(element):
|
|
3233
3810
|
gateway.addSignalMapping(mapping)
|
|
3234
3811
|
|
|
3235
|
-
def readISignal(self, element: ET.Element,
|
|
3236
|
-
|
|
3237
|
-
self.logger.debug("ISignal %s" % short_name)
|
|
3238
|
-
signal = parent.createISignal(short_name)
|
|
3812
|
+
def readISignal(self, element: ET.Element, signal: ISignal):
|
|
3813
|
+
self.logger.debug("Read ISignal <%s>" % signal.getShortName())
|
|
3239
3814
|
self.readIdentifiable(element, signal)
|
|
3240
3815
|
signal.setDataTypePolicy(self.getChildElementOptionalLiteral(element, "DATA-TYPE-POLICY")) \
|
|
3241
3816
|
.setISignalType(self.getChildElementOptionalLiteral(element, "I-SIGNAL-TYPE")) \
|
|
@@ -3251,10 +3826,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3251
3826
|
parent.addEcucValueRef(ref)
|
|
3252
3827
|
self.logger.debug("EcucValue <%s> of EcucValueCollection <%s> has been added", ref.value, parent.getShortName())
|
|
3253
3828
|
|
|
3254
|
-
def readEcucValueCollection(self, element: ET.Element,
|
|
3255
|
-
|
|
3256
|
-
self.logger.debug("EcucValueCollection %s" % short_name)
|
|
3257
|
-
collection = parent.createEcucValueCollection(short_name)
|
|
3829
|
+
def readEcucValueCollection(self, element: ET.Element, collection: EcucValueCollection):
|
|
3830
|
+
self.logger.debug("Read EcucValueCollection <%s>" % collection.getShortName())
|
|
3258
3831
|
self.readIdentifiable(element, collection)
|
|
3259
3832
|
collection.setEcuExtractRef(self.getChildElementOptionalRefType(element, "ECU-EXTRACT-REF"))
|
|
3260
3833
|
self.readEcucValueCollectionEcucValues(element, collection)
|
|
@@ -3359,24 +3932,23 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3359
3932
|
else:
|
|
3360
3933
|
self.notImplemented("Unsupported Container %s" % tag_name)
|
|
3361
3934
|
|
|
3362
|
-
def readEcucModuleConfigurationValues(self, element: ET.Element,
|
|
3363
|
-
|
|
3364
|
-
self.logger.debug("EcucModuleConfigurationValues %s" % short_name)
|
|
3365
|
-
values = parent.createEcucModuleConfigurationValues(short_name)
|
|
3935
|
+
def readEcucModuleConfigurationValues(self, element: ET.Element, values: EcucModuleConfigurationValues):
|
|
3936
|
+
self.logger.debug("Read EcucModuleConfigurationValues %s" % values.getShortName())
|
|
3366
3937
|
self.readIdentifiable(element, values)
|
|
3367
3938
|
values.setDefinitionRef(self.getChildElementOptionalRefType(element, "DEFINITION-REF"))
|
|
3368
3939
|
values.setImplementationConfigVariant(self.getChildElementOptionalLiteral(element, "IMPLEMENTATION-CONFIG-VARIANT"))
|
|
3369
3940
|
values.setModuleDescriptionRef(self.getChildElementOptionalRefType(element, "MODULE-DESCRIPTION-REF"))
|
|
3370
3941
|
self.readEcucModuleConfigurationValuesContainers(element, values)
|
|
3371
3942
|
|
|
3372
|
-
def
|
|
3373
|
-
|
|
3374
|
-
self.logger.debug("read PhysicalDimensions %s" % short_name)
|
|
3375
|
-
dimension = parent.createPhysicalDimension(short_name)
|
|
3943
|
+
def readPhysicalDimension(self, element: ET.Element, dimension: PhysicalDimension):
|
|
3944
|
+
self.logger.debug("Read PhysicalDimension <%s>" % dimension.getShortName())
|
|
3376
3945
|
self.readIdentifiable(element, dimension)
|
|
3377
|
-
dimension.
|
|
3378
|
-
.
|
|
3379
|
-
.
|
|
3946
|
+
dimension.setLengthExp(self.getChildElementOptionalNumericalValue(element, "LENGTH-EXP")) \
|
|
3947
|
+
.setLuminousIntensityExp(self.getChildElementOptionalNumericalValue(element, "LUMINOUS-INTENSITY-EXP")) \
|
|
3948
|
+
.setMassExp(self.getChildElementOptionalNumericalValue(element, "MASS-EXP")) \
|
|
3949
|
+
.setTemperatureExp(self.getChildElementOptionalNumericalValue(element, "TEMPERATURE-EXP")) \
|
|
3950
|
+
.setTimeExp(self.getChildElementOptionalNumericalValue(element, "TIME-EXP")) \
|
|
3951
|
+
.setCurrentExp(self.getChildElementOptionalNumericalValue(element, "CURRENT-EXP")) \
|
|
3380
3952
|
|
|
3381
3953
|
'''
|
|
3382
3954
|
def getIPduMappings(self, element: ET.Element) -> List[IPduMapping]:
|
|
@@ -3389,27 +3961,21 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3389
3961
|
return mappings
|
|
3390
3962
|
'''
|
|
3391
3963
|
|
|
3392
|
-
def readISignalGroup(self, element: ET.Element,
|
|
3393
|
-
|
|
3394
|
-
self.logger.debug("ISignalGroup %s" % short_name)
|
|
3395
|
-
group = parent.createISignalGroup(short_name)
|
|
3964
|
+
def readISignalGroup(self, element: ET.Element, group: ISignalGroup):
|
|
3965
|
+
self.logger.debug("Read ISignalGroup <%s>" % group.getShortName())
|
|
3396
3966
|
self.readIdentifiable(element, group)
|
|
3397
3967
|
for ref_type in self.getChildElementRefTypeList(element, "I-SIGNAL-REFS/I-SIGNAL-REF"):
|
|
3398
3968
|
group.addISignalRef(ref_type)
|
|
3399
3969
|
group.systemSignalGroupRef = self.getChildElementOptionalRefType(element, "SYSTEM-SIGNAL-GROUP-REF")
|
|
3400
3970
|
|
|
3401
|
-
def readSystemSignal(self, element: ET.Element,
|
|
3402
|
-
|
|
3403
|
-
self.logger.debug("SystemSignal %s" % short_name)
|
|
3404
|
-
signal = parent.createSystemSignal(short_name)
|
|
3971
|
+
def readSystemSignal(self, element: ET.Element, signal: SystemSignal):
|
|
3972
|
+
self.logger.debug("Read SystemSignal <%s>" % signal.getShortName())
|
|
3405
3973
|
self.readIdentifiable(element, signal)
|
|
3406
3974
|
signal.setDynamicLength(self.getChildElementOptionalBooleanValue(element, "DYNAMIC-LENGTH")) \
|
|
3407
3975
|
.setPhysicalProps(self.getSwDataDefProps(element, "PHYSICAL-PROPS"))
|
|
3408
3976
|
|
|
3409
|
-
def readSystemSignalGroup(self, element: ET.Element,
|
|
3410
|
-
|
|
3411
|
-
self.logger.debug("SystemSignalGroup %s" % short_name)
|
|
3412
|
-
group = parent.createSystemSignalGroup(short_name)
|
|
3977
|
+
def readSystemSignalGroup(self, element: ET.Element, group: SystemSignalGroup):
|
|
3978
|
+
self.logger.debug("Read SystemSignalGroup <%s>" % group.getShortName())
|
|
3413
3979
|
self.readIdentifiable(element, group)
|
|
3414
3980
|
for ref_type in self.getChildElementRefTypeList(element, "SYSTEM-SIGNAL-REFS/SYSTEM-SIGNAL-REF"):
|
|
3415
3981
|
group.addSystemSignalRefs(ref_type)
|
|
@@ -3431,7 +3997,10 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3431
3997
|
child_element = self.find(element, key)
|
|
3432
3998
|
if child_element is not None:
|
|
3433
3999
|
filter = DataFilter()
|
|
3434
|
-
filter.setDataFilterType(self.getChildElementOptionalLiteral(child_element, "DATA-FILTER-TYPE"))
|
|
4000
|
+
filter.setDataFilterType(self.getChildElementOptionalLiteral(child_element, "DATA-FILTER-TYPE")) \
|
|
4001
|
+
.setMask(self.getChildElementOptionalIntegerValue(child_element, "MASK")) \
|
|
4002
|
+
.setX(self.getChildElementOptionalIntegerValue(child_element, "X"))
|
|
4003
|
+
|
|
3435
4004
|
return filter
|
|
3436
4005
|
|
|
3437
4006
|
def getTransmissionModeConditions(self, element: ET.Element, key: str) -> List[TransmissionModeCondition]:
|
|
@@ -3487,7 +4056,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3487
4056
|
decl = TransmissionModeDeclaration()
|
|
3488
4057
|
for condition in self.getTransmissionModeConditions(child_element, "TRANSMISSION-MODE-CONDITIONS/TRANSMISSION-MODE-CONDITION"):
|
|
3489
4058
|
decl.addTransmissionModeCondition(condition)
|
|
3490
|
-
decl.
|
|
4059
|
+
decl.setTransmissionModeFalseTiming(self.getTransmissionModeTiming(child_element, "TRANSMISSION-MODE-FALSE-TIMING")) \
|
|
4060
|
+
.setTransmissionModeTrueTiming(self.getTransmissionModeTiming(child_element, "TRANSMISSION-MODE-TRUE-TIMING"))
|
|
3491
4061
|
return decl
|
|
3492
4062
|
|
|
3493
4063
|
def getISignalIPduIPduTimingSpecification(self, element: ET.Element) -> IPduTiming:
|
|
@@ -3499,15 +4069,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3499
4069
|
.setTransmissionModeDeclaration(self.getTransmissionModeDeclaration(child_element, "TRANSMISSION-MODE-DECLARATION"))
|
|
3500
4070
|
return timing
|
|
3501
4071
|
|
|
3502
|
-
def readISignalIPdu(self, element: ET.Element,
|
|
3503
|
-
|
|
3504
|
-
self.
|
|
3505
|
-
|
|
3506
|
-
self.readIdentifiable(element, i_pdu)
|
|
3507
|
-
i_pdu.setLength(self.getChildElementOptionalNumericalValue(element, "LENGTH")) \
|
|
4072
|
+
def readISignalIPdu(self, element: ET.Element, ipdu: ISignalIPdu):
|
|
4073
|
+
self.logger.debug("Read ISignalIPdu <%s>" % ipdu.getShortName())
|
|
4074
|
+
self.readIdentifiable(element, ipdu)
|
|
4075
|
+
ipdu.setLength(self.getChildElementOptionalNumericalValue(element, "LENGTH")) \
|
|
3508
4076
|
.setIPduTimingSpecification(self.getISignalIPduIPduTimingSpecification(element))
|
|
3509
|
-
self.readISignalToPduMappings(element,
|
|
3510
|
-
|
|
4077
|
+
self.readISignalToPduMappings(element, ipdu)
|
|
4078
|
+
ipdu.setUnusedBitPattern(self.getChildElementOptionalIntegerValue(element, "UNUSED-BIT-PATTERN"))
|
|
3511
4079
|
|
|
3512
4080
|
def getISignalIPduRefs(self, element: ET.Element) -> List[RefType]:
|
|
3513
4081
|
ref_types = []
|
|
@@ -3515,13 +4083,11 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3515
4083
|
ref_types.append(self.getChildElementOptionalRefType(child_element, "I-SIGNAL-I-PDU-REF"))
|
|
3516
4084
|
return ref_types
|
|
3517
4085
|
|
|
3518
|
-
def readISignalIPduGroup(self, element: ET.Element,
|
|
3519
|
-
|
|
3520
|
-
self.logger.debug("ISignalIPduGroup %s" % short_name)
|
|
3521
|
-
group = parent.createISignalIPduGroup(short_name)
|
|
4086
|
+
def readISignalIPduGroup(self, element: ET.Element, group: ISignalIPduGroup):
|
|
4087
|
+
self.logger.debug("Read ISignalIPduGroup <%s>" % group.getShortName())
|
|
3522
4088
|
self.readIdentifiable(element, group)
|
|
3523
|
-
group.
|
|
3524
|
-
|
|
4089
|
+
group.setCommunicationDirection(self.getChildElementOptionalLiteral(element, "COMMUNICATION-DIRECTION")) \
|
|
4090
|
+
.setCommunicationMode(self.getChildElementOptionalLiteral(element, "COMMUNICATION-MODE"))
|
|
3525
4091
|
for ref_type in self.getChildElementRefTypeList(element, "CONTAINED-I-SIGNAL-I-PDU-GROUP-REFS/CONTAINED-I-SIGNAL-I-PDU-GROUP-REF"):
|
|
3526
4092
|
group.addContainedISignalIPduGroupRef(ref_type)
|
|
3527
4093
|
for ref_type in self.getISignalIPduRefs(element):
|
|
@@ -3561,23 +4127,54 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3561
4127
|
for child_element in self.findall(element, "SW-MAPPINGS/*"):
|
|
3562
4128
|
tag_name = self.getTagName(child_element)
|
|
3563
4129
|
if tag_name == "SWC-TO-ECU-MAPPING":
|
|
3564
|
-
|
|
4130
|
+
swc_to_ecu_mapping = mapping.createSwcToEcuMapping(self.getShortName(child_element))
|
|
4131
|
+
self.readSwcToEcuMapping(child_element, swc_to_ecu_mapping)
|
|
3565
4132
|
else:
|
|
3566
4133
|
self.notImplemented("Unsupported Sw Mapping %s" % tag_name)
|
|
3567
4134
|
|
|
3568
|
-
def
|
|
3569
|
-
|
|
3570
|
-
self.
|
|
3571
|
-
|
|
4135
|
+
def readEcuMapping(self, element: ET.Element, mapping: ECUMapping):
|
|
4136
|
+
self.readIdentifiable(element, mapping)
|
|
4137
|
+
mapping.setEcuInstanceRef(self.getChildElementOptionalRefType(element, "ECU-INSTANCE-REF")) \
|
|
4138
|
+
.setEcuRef(self.getChildElementOptionalRefType(element, "ECU-REF"))
|
|
4139
|
+
|
|
4140
|
+
def readSystemMappingEcuResourceMappings(self, element: ET.Element, mapping: SystemMapping):
|
|
4141
|
+
for child_element in self.findall(element, "ECU-RESOURCE-MAPPINGS/*"):
|
|
4142
|
+
tag_name = self.getTagName(child_element)
|
|
4143
|
+
if tag_name == "ECU-MAPPING":
|
|
4144
|
+
ecu_mapping = mapping.createECUMapping(self.getShortName(child_element))
|
|
4145
|
+
self.readEcuMapping(child_element, ecu_mapping)
|
|
4146
|
+
else:
|
|
4147
|
+
self.notImplemented("Unsupported EcuResourceMapping <%s>" % tag_name)
|
|
4148
|
+
|
|
4149
|
+
def readSwcToImplMapping(self, element: ET.Element, mapping: SwcToImplMapping):
|
|
4150
|
+
self.readIdentifiable(element, mapping)
|
|
4151
|
+
mapping.setComponentImplementationRef(self.getChildElementOptionalRefType(element, "COMPONENT-IMPLEMENTATION-REF"))
|
|
4152
|
+
for child_element in self.findall(element, "COMPONENT-IREFS/COMPONENT-IREF"):
|
|
4153
|
+
mapping.addComponentIRef(self.getComponentInSystemInstanceRef(child_element))
|
|
4154
|
+
|
|
4155
|
+
def readSystemMappingSwImplMappings(self, element: ET.Element, mapping: SystemMapping):
|
|
4156
|
+
for child_element in self.findall(element, "SW-IMPL-MAPPINGS/*"):
|
|
4157
|
+
tag_name = self.getTagName(child_element)
|
|
4158
|
+
if tag_name == "SWC-TO-IMPL-MAPPING":
|
|
4159
|
+
sw_impl_mapping = mapping.createSwcToImplMapping(self.getShortName(child_element))
|
|
4160
|
+
self.readSwcToImplMapping(child_element, sw_impl_mapping)
|
|
4161
|
+
else:
|
|
4162
|
+
self.notImplemented("Unsupported SwImplMapping <%s>" % tag_name)
|
|
4163
|
+
|
|
4164
|
+
def readSystemMapping(self, element: ET.Element, mapping: SystemMapping):
|
|
4165
|
+
self.logger.debug("SystemMapping %s" % mapping.getShortName())
|
|
3572
4166
|
self.readIdentifiable(element, mapping)
|
|
3573
4167
|
self.readSystemMappingDataMappings(element, mapping)
|
|
4168
|
+
self.readSystemMappingEcuResourceMappings(element, mapping)
|
|
4169
|
+
self.readSystemMappingSwImplMappings(element, mapping)
|
|
3574
4170
|
self.readSystemMappingSwMappings(element, mapping)
|
|
3575
4171
|
|
|
3576
4172
|
def readSystemMappings(self, element: ET.Element, system: System):
|
|
3577
4173
|
for child_element in self.findall(element, "MAPPINGS/*"):
|
|
3578
4174
|
tag_name = self.getTagName(child_element)
|
|
3579
4175
|
if tag_name == "SYSTEM-MAPPING":
|
|
3580
|
-
self.
|
|
4176
|
+
mapping = system.createSystemMapping(self.getShortName(child_element))
|
|
4177
|
+
self.readSystemMapping(child_element, mapping)
|
|
3581
4178
|
else:
|
|
3582
4179
|
self.notImplemented("Unsupported Mapping %s" % tag_name)
|
|
3583
4180
|
|
|
@@ -3590,32 +4187,29 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3590
4187
|
self.readIdentifiable(child_element, prototype)
|
|
3591
4188
|
prototype.setFlatMapRef(self.getChildElementOptionalRefType(child_element, "FLAT-MAP-REF")) \
|
|
3592
4189
|
.setSoftwareCompositionTRef(self.getChildElementOptionalRefType(child_element, "SOFTWARE-COMPOSITION-TREF"))
|
|
3593
|
-
|
|
4190
|
+
AUTOSAR.getInstance().setRootSwCompositionPrototype(prototype)
|
|
4191
|
+
|
|
4192
|
+
def readSystemFibexElementRefs(self, element: ET.Element, system: System):
|
|
4193
|
+
for ref in self.getChildElementRefTypeList(element, "FIBEX-ELEMENTS/FIBEX-ELEMENT-REF-CONDITIONAL/FIBEX-ELEMENT-REF"):
|
|
4194
|
+
system.addFibexElementRef(ref)
|
|
3594
4195
|
|
|
3595
|
-
def readSystem(self, element: ET.Element,
|
|
3596
|
-
|
|
3597
|
-
self.logger.debug("Read System %s" % short_name)
|
|
3598
|
-
system = parent.createSystem(short_name)
|
|
4196
|
+
def readSystem(self, element: ET.Element, system: System):
|
|
4197
|
+
self.logger.debug("Read System <%s>" % system.getShortName())
|
|
3599
4198
|
self.readIdentifiable(element, system)
|
|
3600
|
-
|
|
3601
4199
|
system.setEcuExtractVersion(self.getChildElementOptionalLiteral(element, "ECU-EXTRACT-VERSION"))
|
|
3602
|
-
|
|
3603
|
-
system.addFibexElementRef(self.getChildElementOptionalRefType(child_element, "FIBEX-ELEMENT-REF"))
|
|
4200
|
+
self.readSystemFibexElementRefs(element, system)
|
|
3604
4201
|
self.readSystemMappings(element, system)
|
|
3605
4202
|
self.readRootSwCompositionPrototype(element, system)
|
|
3606
4203
|
system.setSystemVersion(self.getChildElementOptionalRevisionLabelString(element, "SYSTEM-VERSION"))
|
|
4204
|
+
AUTOSAR.getInstance().addSystem(system)
|
|
3607
4205
|
|
|
3608
|
-
def readGenericEthernetFrame(self, element: ET.Element,
|
|
3609
|
-
|
|
3610
|
-
self.logger.debug("Read EthernetFrame %s" % short_name)
|
|
3611
|
-
frame = parent.createGenericEthernetFrame(short_name)
|
|
4206
|
+
def readGenericEthernetFrame(self, element: ET.Element, frame: GenericEthernetFrame):
|
|
4207
|
+
self.logger.debug("Read GenericEthernetFrame <%s>" % frame.getShortName())
|
|
3612
4208
|
self.readFrame(element, frame)
|
|
3613
4209
|
|
|
3614
|
-
def readLifeCycleInfoSet(self, element: ET.Element,
|
|
3615
|
-
|
|
3616
|
-
self.
|
|
3617
|
-
frame = parent.createLifeCycleInfoSet(short_name)
|
|
3618
|
-
self.readIdentifiable(element, frame)
|
|
4210
|
+
def readLifeCycleInfoSet(self, element: ET.Element, info_set: LifeCycleInfoSet):
|
|
4211
|
+
self.logger.debug("Read LifeCycleInfoSet <%s>" % info_set.getShortName())
|
|
4212
|
+
self.readIdentifiable(element, info_set)
|
|
3619
4213
|
|
|
3620
4214
|
def readFlatInstanceDescriptor(self, element: ET.Element, desc: FlatInstanceDescriptor):
|
|
3621
4215
|
self.logger.debug("Read LifeCycleInfoSet %s" % desc.getShortName())
|
|
@@ -3632,10 +4226,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3632
4226
|
else:
|
|
3633
4227
|
self.notImplemented("Unsupported Flat Map Instances <%s>" % tag_name)
|
|
3634
4228
|
|
|
3635
|
-
def readFlatMap(self, element: ET.Element,
|
|
3636
|
-
|
|
3637
|
-
self.logger.debug("Read FlatMap %s" % short_name)
|
|
3638
|
-
map = parent.createFlatMap(short_name)
|
|
4229
|
+
def readFlatMap(self, element: ET.Element, map: FlatMap):
|
|
4230
|
+
self.logger.debug("Read FlatMap <%s>" % map.getShortName())
|
|
3639
4231
|
self.readIdentifiable(element, map)
|
|
3640
4232
|
self.readFlatMapInstances(element, map)
|
|
3641
4233
|
|
|
@@ -3663,156 +4255,221 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3663
4255
|
else:
|
|
3664
4256
|
self.notImplemented("Unsupported PortInterfaceMapping <%s>" % tag_name)
|
|
3665
4257
|
|
|
3666
|
-
def readPortInterfaceMappingSet(self, element: ET.Element,
|
|
3667
|
-
|
|
3668
|
-
self.logger.debug("Read PortInterfaceMappingSet %s" % short_name)
|
|
3669
|
-
mapping_set = parent.createPortInterfaceMappingSet(short_name)
|
|
4258
|
+
def readPortInterfaceMappingSet(self, element: ET.Element, mapping_set: PortInterfaceMappingSet):
|
|
4259
|
+
self.logger.debug("Read PortInterfaceMappingSet %s" % mapping_set.getShortName())
|
|
3670
4260
|
self.readIdentifiable(element, mapping_set)
|
|
3671
4261
|
self.readPortInterfaceMappings(element, mapping_set)
|
|
3672
4262
|
|
|
3673
4263
|
def readARPackageElements(self, element: ET.Element, parent: ARPackage):
|
|
3674
4264
|
for child_element in self.findall(element, "ELEMENTS/*"):
|
|
3675
|
-
tag_name = self.getTagName(child_element
|
|
4265
|
+
tag_name = self.getTagName(child_element)
|
|
3676
4266
|
if tag_name == "COMPOSITION-SW-COMPONENT-TYPE":
|
|
3677
|
-
self.
|
|
4267
|
+
type = parent.createCompositionSwComponentType(self.getShortName(child_element))
|
|
4268
|
+
self.readCompositionSwComponentType(child_element, type)
|
|
3678
4269
|
elif tag_name == "COMPLEX-DEVICE-DRIVER-SW-COMPONENT-TYPE":
|
|
3679
|
-
self.
|
|
4270
|
+
type = parent.createComplexDeviceDriverSwComponentType(self.getShortName(child_element))
|
|
4271
|
+
self.readComplexDeviceDriverSwComponentType(child_element, type)
|
|
3680
4272
|
elif tag_name == "SWC-IMPLEMENTATION":
|
|
3681
|
-
self.
|
|
4273
|
+
impl = parent.createSwcImplementation(self.getShortName(child_element))
|
|
4274
|
+
self.readSwcImplementation(child_element, impl)
|
|
3682
4275
|
elif tag_name == "APPLICATION-PRIMITIVE-DATA-TYPE":
|
|
3683
|
-
self.
|
|
4276
|
+
data_type = parent.createApplicationPrimitiveDataType(self.getShortName(child_element))
|
|
4277
|
+
self.readApplicationPrimitiveDataType(child_element, data_type)
|
|
3684
4278
|
elif tag_name == "APPLICATION-RECORD-DATA-TYPE":
|
|
3685
|
-
self.
|
|
4279
|
+
data_type = parent.createApplicationRecordDataType(self.getShortName(child_element))
|
|
4280
|
+
self.readApplicationRecordDataType(child_element, data_type)
|
|
3686
4281
|
elif tag_name == "SW-BASE-TYPE":
|
|
3687
|
-
self.
|
|
4282
|
+
data_type = parent.createSwBaseType(self.getShortName(child_element))
|
|
4283
|
+
self.readSwBaseType(child_element, data_type)
|
|
3688
4284
|
elif tag_name == "COMPU-METHOD":
|
|
3689
|
-
self.
|
|
4285
|
+
compu_method = parent.createCompuMethod(self.getShortName(child_element))
|
|
4286
|
+
self.readCompuMethod(child_element, compu_method)
|
|
3690
4287
|
elif tag_name == "CONSTANT-SPECIFICATION":
|
|
3691
|
-
self.
|
|
4288
|
+
spec = parent.createConstantSpecification(self.getShortName(child_element))
|
|
4289
|
+
self.readConstantSpecification(child_element, spec)
|
|
3692
4290
|
elif tag_name == "DATA-CONSTR":
|
|
3693
|
-
self.
|
|
4291
|
+
constr = parent.createDataConstr(self.getShortName(child_element))
|
|
4292
|
+
self.readDataConstr(child_element, constr)
|
|
3694
4293
|
elif tag_name == "END-TO-END-PROTECTION-SET":
|
|
3695
|
-
self.
|
|
4294
|
+
protection_set = parent.createEndToEndProtectionSet(self.getShortName(child_element))
|
|
4295
|
+
self.readEndToEndProtectionSet(child_element, protection_set)
|
|
3696
4296
|
elif tag_name == "SENDER-RECEIVER-INTERFACE":
|
|
3697
|
-
self.
|
|
4297
|
+
sr_interface = parent.createSenderReceiverInterface(self.getShortName(child_element))
|
|
4298
|
+
self.readSenderReceiverInterface(child_element, sr_interface)
|
|
3698
4299
|
elif tag_name == "UNIT":
|
|
3699
|
-
self.
|
|
4300
|
+
unit = parent.createUnit(self.getShortName(child_element))
|
|
4301
|
+
self.readUnit(child_element, unit)
|
|
3700
4302
|
elif tag_name == "BSW-MODULE-DESCRIPTION":
|
|
3701
|
-
self.
|
|
4303
|
+
desc = parent.createBswModuleDescription(self.getShortName(child_element))
|
|
4304
|
+
self.readBswModuleDescription(child_element, desc)
|
|
3702
4305
|
elif tag_name == "BSW-MODULE-ENTRY":
|
|
3703
|
-
self.
|
|
4306
|
+
entry = parent.createBswModuleEntry(self.getShortName(child_element))
|
|
4307
|
+
self.readBswModuleEntry(child_element, entry)
|
|
3704
4308
|
elif tag_name == "SWC-BSW-MAPPING":
|
|
3705
|
-
self.
|
|
4309
|
+
mapping = parent.createSwcBswMapping(self.getShortName(child_element))
|
|
4310
|
+
self.readSwcBswMapping(child_element, mapping)
|
|
3706
4311
|
elif tag_name == "BSW-IMPLEMENTATION":
|
|
3707
|
-
self.
|
|
4312
|
+
impl = parent.createBswImplementation(self.getShortName(child_element))
|
|
4313
|
+
self.readBswImplementation(child_element, impl)
|
|
3708
4314
|
elif tag_name == "IMPLEMENTATION-DATA-TYPE":
|
|
3709
|
-
self.
|
|
4315
|
+
data_type = parent.createImplementationDataType(self.getShortName(child_element))
|
|
4316
|
+
self.readImplementationDataType(child_element, data_type)
|
|
3710
4317
|
elif tag_name == "CLIENT-SERVER-INTERFACE":
|
|
3711
|
-
self.
|
|
4318
|
+
cs_interface = parent.createClientServerInterface(self.getShortName(child_element))
|
|
4319
|
+
self.readClientServerInterface(child_element, cs_interface)
|
|
3712
4320
|
elif tag_name == "APPLICATION-SW-COMPONENT-TYPE":
|
|
3713
|
-
self.
|
|
4321
|
+
sw_component = parent.createApplicationSwComponentType(self.getShortName(child_element))
|
|
4322
|
+
self.readApplicationSwComponentType(child_element, sw_component)
|
|
3714
4323
|
elif tag_name == "ECU-ABSTRACTION-SW-COMPONENT-TYPE":
|
|
3715
|
-
self.
|
|
4324
|
+
sw_component = parent.createEcuAbstractionSwComponentType(self.getShortName(child_element))
|
|
4325
|
+
self.readEcuAbstractionSwComponentType(child_element, sw_component)
|
|
3716
4326
|
elif tag_name == "APPLICATION-ARRAY-DATA-TYPE":
|
|
3717
|
-
self.
|
|
4327
|
+
data_type = parent.createApplicationArrayDataType(self.getShortName(child_element))
|
|
4328
|
+
self.readApplicationArrayDataType(child_element, data_type)
|
|
3718
4329
|
elif tag_name == "SW-RECORD-LAYOUT":
|
|
3719
|
-
|
|
3720
|
-
self.readSwRecordLayout(child_element,
|
|
4330
|
+
layout = parent.createSwRecordLayout(self.getShortName(child_element))
|
|
4331
|
+
self.readSwRecordLayout(child_element, layout)
|
|
3721
4332
|
elif tag_name == "SW-ADDR-METHOD":
|
|
3722
|
-
self.
|
|
4333
|
+
method = parent.createSwAddrMethod(self.getShortName(child_element))
|
|
4334
|
+
self.readSwAddrMethod(child_element, method)
|
|
3723
4335
|
elif tag_name == "TRIGGER-INTERFACE":
|
|
3724
|
-
self.
|
|
4336
|
+
trigger_if = parent.createTriggerInterface(self.getShortName(child_element))
|
|
4337
|
+
self.readTriggerInterface(child_element, trigger_if)
|
|
3725
4338
|
elif tag_name == "SERVICE-SW-COMPONENT-TYPE":
|
|
3726
|
-
self.
|
|
4339
|
+
sw_component = parent.createServiceSwComponentType(self.getShortName(child_element))
|
|
4340
|
+
self.readServiceSwComponentType(child_element, sw_component)
|
|
3727
4341
|
elif tag_name == "SENSOR-ACTUATOR-SW-COMPONENT-TYPE":
|
|
3728
|
-
self.
|
|
4342
|
+
sw_component = parent.createSensorActuatorSwComponentType(self.getShortName(child_element))
|
|
4343
|
+
self.readSensorActuatorSwComponentType(child_element, sw_component)
|
|
3729
4344
|
elif tag_name == "DATA-TYPE-MAPPING-SET":
|
|
3730
|
-
self.
|
|
4345
|
+
mapping_set = parent.createDataTypeMappingSet(self.getShortName(child_element))
|
|
4346
|
+
self.readDataTypeMappingSet(child_element, mapping_set)
|
|
3731
4347
|
elif tag_name == "MODE-DECLARATION-GROUP":
|
|
3732
|
-
self.
|
|
4348
|
+
group = parent.createModeDeclarationGroup(self.getShortName(child_element))
|
|
4349
|
+
self.readModeDeclarationGroup(child_element, group)
|
|
3733
4350
|
elif tag_name == "MODE-SWITCH-INTERFACE":
|
|
3734
|
-
self.
|
|
4351
|
+
mode_interface = parent.createModeSwitchInterface(self.getShortName(child_element))
|
|
4352
|
+
self.readModeSwitchInterface(child_element, mode_interface)
|
|
3735
4353
|
elif tag_name == "SWC-TIMING":
|
|
3736
|
-
self.
|
|
4354
|
+
timing = parent.createSwcTiming(self.getShortName(child_element))
|
|
4355
|
+
self.readSwcTiming(child_element, timing)
|
|
3737
4356
|
elif tag_name == "LIN-CLUSTER":
|
|
3738
|
-
self.
|
|
4357
|
+
cluster = parent.createLinCluster(self.getShortName(child_element))
|
|
4358
|
+
self.readLinCluster(child_element, cluster)
|
|
3739
4359
|
elif tag_name == "LIN-UNCONDITIONAL-FRAME":
|
|
3740
|
-
self.
|
|
4360
|
+
frame = parent.createLinUnconditionalFrame(self.getShortName(child_element))
|
|
4361
|
+
self.readLinUnconditionalFrame(child_element, frame)
|
|
3741
4362
|
elif tag_name == "NM-PDU":
|
|
3742
|
-
self.
|
|
4363
|
+
pdu = parent.createNmPdu(self.getShortName(child_element))
|
|
4364
|
+
self.readNmPdu(child_element, pdu)
|
|
3743
4365
|
elif tag_name == "N-PDU":
|
|
3744
|
-
self.
|
|
4366
|
+
pdu = parent.createNPdu(self.getShortName(child_element))
|
|
4367
|
+
self.readNPdu(child_element, pdu)
|
|
3745
4368
|
elif tag_name == "DCM-I-PDU":
|
|
3746
|
-
self.
|
|
4369
|
+
i_pdu = parent.createDcmIPdu(self.getShortName(child_element))
|
|
4370
|
+
self.readDcmIPdu(child_element, i_pdu)
|
|
3747
4371
|
elif tag_name == "SECURED-I-PDU":
|
|
3748
|
-
self.
|
|
4372
|
+
i_pdu = parent.createSecuredIPdu(self.getShortName(child_element))
|
|
4373
|
+
self.readSecuredIPdu(child_element, i_pdu)
|
|
3749
4374
|
elif tag_name == "NM-CONFIG":
|
|
3750
|
-
self.
|
|
4375
|
+
config = parent.createNmConfig(self.getShortName(child_element))
|
|
4376
|
+
self.readNmConfig(child_element, config)
|
|
3751
4377
|
elif tag_name == "CAN-TP-CONFIG":
|
|
3752
|
-
self.
|
|
4378
|
+
config = parent.createCanTpConfig(self.getShortName(child_element))
|
|
4379
|
+
self.readCanTpConfig(child_element, config)
|
|
3753
4380
|
elif tag_name == "LIN-TP-CONFIG":
|
|
3754
|
-
|
|
4381
|
+
config = parent.createLinTpConfig(self.getShortName(child_element))
|
|
4382
|
+
self.readLinTpConfig(child_element, config)
|
|
3755
4383
|
elif tag_name == "SYSTEM":
|
|
3756
|
-
self.
|
|
4384
|
+
system = parent.createSystem(self.getShortName(child_element))
|
|
4385
|
+
self.readSystem(child_element, system)
|
|
3757
4386
|
elif tag_name == "ECU-INSTANCE":
|
|
3758
|
-
self.
|
|
4387
|
+
instance = parent.createEcuInstance(self.getShortName(child_element))
|
|
4388
|
+
self.readEcuInstance(child_element, instance)
|
|
3759
4389
|
elif tag_name == "GATEWAY":
|
|
3760
|
-
self.
|
|
4390
|
+
gateway = parent.createGateway(self.getShortName(child_element))
|
|
4391
|
+
self.readGateway(child_element, gateway)
|
|
3761
4392
|
elif tag_name == "I-SIGNAL-I-PDU-GROUP":
|
|
3762
|
-
self.
|
|
4393
|
+
group = parent.createISignalIPduGroup(self.getShortName(child_element))
|
|
4394
|
+
self.readISignalIPduGroup(child_element, group)
|
|
3763
4395
|
elif tag_name == "CAN-CLUSTER":
|
|
3764
|
-
self.
|
|
4396
|
+
cluster = parent.createCanCluster(self.getShortName(child_element))
|
|
4397
|
+
self.readCanCluster(child_element, cluster)
|
|
3765
4398
|
elif tag_name == "CAN-FRAME":
|
|
3766
|
-
self.
|
|
4399
|
+
frame = parent.createCanFrame(self.getShortName(child_element))
|
|
4400
|
+
self.readCanFrame(child_element, frame)
|
|
3767
4401
|
elif tag_name == "I-SIGNAL":
|
|
3768
|
-
self.
|
|
4402
|
+
signal = parent.createISignal(self.getShortName(child_element))
|
|
4403
|
+
self.readISignal(child_element, signal)
|
|
3769
4404
|
elif tag_name == "I-SIGNAL-GROUP":
|
|
3770
|
-
self.
|
|
4405
|
+
group = parent.createISignalGroup(self.getShortName(child_element))
|
|
4406
|
+
self.readISignalGroup(child_element, group)
|
|
3771
4407
|
elif tag_name == "I-SIGNAL-I-PDU":
|
|
3772
|
-
self.
|
|
4408
|
+
i_pdu = parent.createISignalIPdu(self.getShortName(child_element))
|
|
4409
|
+
self.readISignalIPdu(child_element, i_pdu)
|
|
3773
4410
|
elif tag_name == "SYSTEM-SIGNAL":
|
|
3774
|
-
self.
|
|
4411
|
+
signal = parent.createSystemSignal(self.getShortName(child_element))
|
|
4412
|
+
self.readSystemSignal(child_element, signal)
|
|
3775
4413
|
elif tag_name == "SYSTEM-SIGNAL-GROUP":
|
|
3776
|
-
self.
|
|
4414
|
+
group = parent.createSystemSignalGroup(self.getShortName(child_element))
|
|
4415
|
+
self.readSystemSignalGroup(child_element, group)
|
|
3777
4416
|
elif tag_name == "ECUC-VALUE-COLLECTION":
|
|
3778
|
-
self.
|
|
4417
|
+
collection = parent.createEcucValueCollection(self.getShortName(child_element))
|
|
4418
|
+
self.readEcucValueCollection(child_element, collection)
|
|
3779
4419
|
elif tag_name == "ECUC-MODULE-CONFIGURATION-VALUES":
|
|
3780
|
-
self.
|
|
4420
|
+
values = parent.createEcucModuleConfigurationValues(self.getShortName(child_element))
|
|
4421
|
+
self.readEcucModuleConfigurationValues(child_element, values)
|
|
3781
4422
|
elif tag_name == "PHYSICAL-DIMENSION":
|
|
3782
|
-
self.
|
|
4423
|
+
dimension = parent.createPhysicalDimension(self.getShortName(child_element))
|
|
4424
|
+
self.readPhysicalDimension(child_element, dimension)
|
|
3783
4425
|
elif tag_name == "PARAMETER-INTERFACE":
|
|
3784
|
-
self.
|
|
4426
|
+
param_interface = parent.createParameterInterface(self.getShortName(child_element))
|
|
4427
|
+
self.readParameterInterface(child_element, param_interface)
|
|
3785
4428
|
elif tag_name == "ETHERNET-FRAME":
|
|
3786
|
-
self.
|
|
4429
|
+
frame = parent.createGenericEthernetFrame(self.getShortName(child_element))
|
|
4430
|
+
self.readGenericEthernetFrame(child_element, frame)
|
|
3787
4431
|
elif tag_name == "LIFE-CYCLE-INFO-SET":
|
|
3788
|
-
self.
|
|
4432
|
+
info_set = parent.createLifeCycleInfoSet(self.getShortName(child_element))
|
|
4433
|
+
self.readLifeCycleInfoSet(child_element, info_set)
|
|
3789
4434
|
elif tag_name == "FLAT-MAP":
|
|
3790
|
-
self.
|
|
4435
|
+
map = parent.createFlatMap(self.getShortName(child_element))
|
|
4436
|
+
self.readFlatMap(child_element, map)
|
|
3791
4437
|
elif tag_name == "PORT-INTERFACE-MAPPING-SET":
|
|
3792
|
-
self.
|
|
4438
|
+
mapping_set = parent.createPortInterfaceMappingSet(self.getShortName(child_element))
|
|
4439
|
+
self.readPortInterfaceMappingSet(child_element, mapping_set)
|
|
3793
4440
|
elif tag_name == "ETHERNET-CLUSTER":
|
|
3794
|
-
self.
|
|
4441
|
+
cluster = parent.createEthernetCluster(self.getShortName(child_element))
|
|
4442
|
+
self.readEthernetCluster(child_element, cluster)
|
|
3795
4443
|
elif tag_name == "DIAGNOSTIC-CONNECTION":
|
|
3796
4444
|
connection = parent.createDiagnosticConnection(self.getShortName(child_element))
|
|
3797
4445
|
self.readDiagnosticConnection(child_element, connection)
|
|
3798
4446
|
elif tag_name == "DIAGNOSTIC-SERVICE-TABLE":
|
|
3799
|
-
self.
|
|
4447
|
+
table = parent.createDiagnosticServiceTable(self.getShortName(child_element))
|
|
4448
|
+
self.readDiagnosticServiceTable(child_element, table)
|
|
3800
4449
|
elif tag_name == "MULTIPLEXED-I-PDU":
|
|
3801
|
-
self.
|
|
4450
|
+
i_pdu = parent.createMultiplexedIPdu(self.getShortName(child_element))
|
|
4451
|
+
self.readMultiplexedIPdu(child_element, i_pdu)
|
|
3802
4452
|
elif tag_name == "USER-DEFINED-I-PDU":
|
|
3803
|
-
self.
|
|
4453
|
+
i_pdu = parent.createUserDefinedIPdu(self.getShortName(child_element))
|
|
4454
|
+
self.readUserDefinedIPdu(child_element, i_pdu)
|
|
3804
4455
|
elif tag_name == "USER-DEFINED-PDU":
|
|
3805
|
-
self.
|
|
4456
|
+
pdu = parent.createUserDefinedPdu(self.getShortName(child_element))
|
|
4457
|
+
self.readUserDefinedPdu(child_element, pdu)
|
|
3806
4458
|
elif tag_name == "GENERAL-PURPOSE-PDU":
|
|
3807
|
-
self.
|
|
4459
|
+
pdu = parent.createGeneralPurposePdu(self.getShortName(child_element))
|
|
4460
|
+
self.readGeneralPurposePdu(child_element, pdu)
|
|
3808
4461
|
elif tag_name == "GENERAL-PURPOSE-I-PDU":
|
|
3809
|
-
self.
|
|
4462
|
+
i_pdu = parent.createGeneralPurposeIPdu(self.getShortName(child_element))
|
|
4463
|
+
self.readGeneralPurposeIPdu(child_element, i_pdu)
|
|
3810
4464
|
elif tag_name == "SECURE-COMMUNICATION-PROPS-SET":
|
|
3811
|
-
self.
|
|
4465
|
+
prop_set = parent.createSecureCommunicationPropsSet(self.getShortName(child_element))
|
|
4466
|
+
self.readSecureCommunicationPropsSet(child_element, prop_set)
|
|
3812
4467
|
elif tag_name == "SO-AD-ROUTING-GROUP":
|
|
3813
|
-
self.
|
|
4468
|
+
group = parent.createSoAdRoutingGroup(self.getShortName(child_element))
|
|
4469
|
+
self.readSoAdRoutingGroup(child_element, group)
|
|
3814
4470
|
elif tag_name == "DO-IP-TP-CONFIG":
|
|
3815
|
-
self.
|
|
4471
|
+
config = parent.createDoIpTpConfig(self.getShortName(child_element))
|
|
4472
|
+
self.readDoIpTpConfig(child_element, config)
|
|
3816
4473
|
else:
|
|
3817
4474
|
self.notImplemented("Unsupported element type of ARPackage <%s>" % tag_name)
|
|
3818
4475
|
|
|
@@ -3840,12 +4497,12 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
3840
4497
|
self.readReferenceBases(child_element, ar_package)
|
|
3841
4498
|
|
|
3842
4499
|
def load(self, filename, document: AUTOSAR):
|
|
3843
|
-
self.logger.info("
|
|
4500
|
+
self.logger.info("Loading %s ..." % os.path.realpath(filename))
|
|
3844
4501
|
|
|
3845
4502
|
tree = ET.parse(filename)
|
|
3846
4503
|
root = tree.getroot()
|
|
3847
4504
|
if (self.getPureTagName(root.tag) != "AUTOSAR"):
|
|
3848
|
-
self.
|
|
4505
|
+
self.raiseError("Invalid ARXML file <%s>" % filename)
|
|
3849
4506
|
|
|
3850
4507
|
self.getAUTOSARInfo(root, document)
|
|
3851
4508
|
document.setAdminData(self.getAdminData(root, "ADMIN-DATA"))
|