armodel 1.7.3__py3-none-any.whl → 1.7.4__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.
Files changed (31) hide show
  1. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +2 -1
  2. armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +1 -1
  3. armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +6 -7
  4. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +7 -1
  5. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +28 -1
  6. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +17 -1
  7. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AutosarVariableRef.py +31 -0
  8. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py +4 -3
  9. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py +17 -32
  10. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/RTEEvents.py +4 -0
  11. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +7 -1
  12. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +47 -15
  13. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetCommunication.py +229 -0
  14. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetTopology.py +167 -0
  15. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/NetworkEndpoint.py +225 -0
  16. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/ServiceInstances.py +96 -7
  17. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +47 -4
  18. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +18 -5
  19. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/Timing.py +7 -12
  20. armodel/models/M2/MSR/AsamHdo/BaseTypes.py +0 -1
  21. armodel/models/__init__.py +3 -0
  22. armodel/parser/arxml_parser.py +222 -46
  23. armodel/tests/test_armodel/models/test_ar_ref.py +2 -2
  24. armodel/writer/abstract_arxml_writer.py +1 -3
  25. armodel/writer/arxml_writer.py +256 -103
  26. {armodel-1.7.3.dist-info → armodel-1.7.4.dist-info}/METADATA +17 -2
  27. {armodel-1.7.3.dist-info → armodel-1.7.4.dist-info}/RECORD +31 -27
  28. {armodel-1.7.3.dist-info → armodel-1.7.4.dist-info}/LICENSE +0 -0
  29. {armodel-1.7.3.dist-info → armodel-1.7.4.dist-info}/WHEEL +0 -0
  30. {armodel-1.7.3.dist-info → armodel-1.7.4.dist-info}/entry_points.txt +0 -0
  31. {armodel-1.7.3.dist-info → armodel-1.7.4.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,6 @@
1
1
  import xml.etree.cElementTree as ET
2
-
3
2
  from typing import List
4
3
 
5
-
6
-
7
4
  from ..models.M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
8
5
  from ..models.M2.MSR.AsamHdo.AdminData import AdminData
9
6
  from ..models.M2.MSR.AsamHdo.BaseTypes import BaseTypeDirectDefinition, SwBaseType
@@ -36,7 +33,7 @@ from ..models.M2.AUTOSARTemplates.CommonStructure.SwcBswMapping import SwcBswMap
36
33
  from ..models.M2.AUTOSARTemplates.CommonStructure.Implementation import Code, Implementation
37
34
  from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import SwcTiming, TimingExtension
38
35
  from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.ExecutionOrderConstraint import EOCExecutableEntityRef, ExecutionOrderConstraint
39
- from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagEventDebounceMonitorInternal, DiagnosticCommunicationManagerNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment, RoleBasedDataTypeAssignment, ServiceDependency
36
+ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagEventDebounceMonitorInternal, DiagnosticCommunicationManagerNeeds, DiagnosticEventInfoNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment, RoleBasedDataTypeAssignment, ServiceDependency
40
37
  from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import ExecutableEntity
41
38
  from ..models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
42
39
  from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import InternalBehavior
@@ -60,12 +57,13 @@ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import Compo
60
57
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import AbstractProvidedPortPrototype, AbstractRequiredPortPrototype, ApplicationSwComponentType, AtomicSwComponentType, ComplexDeviceDriverSwComponentType, CompositionSwComponentType, EcuAbstractionSwComponentType, PRPortPrototype, PortGroup, SwComponentType, PPortPrototype, PortPrototype, RPortPrototype
61
58
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import InnerPortGroupInCompositionInstanceRef, PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef, RModeInAtomicSwcInstanceRef, RVariableInAtomicSwcInstanceRef
62
59
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import AsynchronousServerCallPoint, RunnableEntity, RunnableEntityArgument, SwcInternalBehavior, SynchronousServerCallPoint
60
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AutosarVariableRef import AutosarVariableRef
63
61
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServerCall import ServerCallPoint
64
62
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.DataElements import ParameterAccess, VariableAccess
65
63
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition import AssemblySwConnector, DelegationSwConnector, SwComponentPrototype, SwConnector
66
64
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition.InstanceRefs import POperationInAtomicSwcInstanceRef, PPortInCompositionInstanceRef, ROperationInAtomicSwcInstanceRef, RPortInCompositionInstanceRef
67
65
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface.InstanceRefs import ApplicationCompositeElementInPortInterfaceInstanceRef
68
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef, AutosarVariableRef, VariableInAtomicSWCTypeInstanceRef
66
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef, VariableInAtomicSWCTypeInstanceRef
69
67
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import ClientComSpec, ModeSwitchReceiverComSpec, ModeSwitchSenderComSpec, NonqueuedReceiverComSpec, NonqueuedSenderComSpec, PPortComSpec, ParameterRequireComSpec, QueuedReceiverComSpec, QueuedSenderComSpec, RPortComSpec, ReceiverComSpec, SenderComSpec, ServerComSpec
70
68
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef
71
69
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServiceMapping import RoleBasedPortAssignment, SwcServiceDependency
@@ -80,13 +78,17 @@ from ..models.M2.AUTOSARTemplates.SystemTemplate import SwcToEcuMapping, System,
80
78
  from ..models.M2.AUTOSARTemplates.SystemTemplate.DataMapping import SenderReceiverToSignalGroupMapping, SenderReceiverToSignalMapping
81
79
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import FrameTriggering, IPdu, IPduTiming, ISignalGroup, ISignalIPdu, ISignalIPduGroup, ISignalTriggering, PduTriggering, SecuredIPdu, SystemSignal, DcmIPdu, Frame, ISignal, NPdu, NmPdu, SystemSignalGroup
82
80
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.EcuInstance import EcuInstance
83
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.Timing import EventControlledTiming, TimeRangeType, TransmissionModeCondition, TransmissionModeDeclaration, TransmissionModeTiming
81
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.Timing import CyclicTiming, EventControlledTiming, TimeRangeType, TransmissionModeCondition, TransmissionModeDeclaration, TransmissionModeTiming
82
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetCommunication import SocketConnection, SocketConnectionBundle, SocketConnectionIpduIdentifier
84
83
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetFrame import GenericEthernetFrame
84
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import EthernetCluster, EthernetCommunicationConnector, EthernetCommunicationController
85
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.NetworkEndpoint import Ipv6Configuration, NetworkEndpoint, NetworkEndpointAddress
86
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import SoAdConfig
85
87
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Multiplatform import Gateway, ISignalMapping
86
88
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication import CanFrame, CanFrameTriggering, RxIdentifierRange
87
89
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import CanCommunicationConnector, CanCommunicationController
88
90
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import LinFrameTriggering, LinUnconditionalFrame
89
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import AbstractCanCluster, CanCluster, CanPhysicalChannel, CommConnectorPort, CommunicationCluster, CommunicationConnector, FramePort, IPduPort, ISignalPort, LinCluster, LinPhysicalChannel, PhysicalChannel
91
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import AbstractCanCluster, CanCluster, CanPhysicalChannel, CommConnectorPort, CommunicationCluster, CommunicationConnector, EthernetPhysicalChannel, FramePort, IPduPort, ISignalPort, LinCluster, LinPhysicalChannel, PhysicalChannel
90
92
  from ..models.M2.AUTOSARTemplates.SystemTemplate.InstanceRefs import ComponentInSystemInstanceRef, VariableDataPrototypeInSystemInstanceRef
91
93
  from ..models.M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import CanNmCluster, CanNmClusterCoupling, CanNmNode, NmCluster, NmConfig, NmNode
92
94
  from ..models.M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpConfig
@@ -402,11 +404,13 @@ class ARXMLWriter(AbstractARXMLWriter):
402
404
  self.setChildElementOptionalRefType(child_element, "PARAMETER-REF", com_spec.getParameterRef())
403
405
  self.setValueSpecification(child_element, "INIT-VALUE", com_spec.getInitValue())
404
406
 
405
- def writeModeSwitchReceiverComSpec(self, element: ET.Element, com_spec: ModeSwitchReceiverComSpec):
407
+ def setModeSwitchReceiverComSpec(self, element: ET.Element, com_spec: ModeSwitchReceiverComSpec):
406
408
  self.logger.debug("writeModeSwitchReceiverComSpec")
407
409
  child_element = ET.SubElement(element, "MODE-SWITCH-RECEIVER-COM-SPEC")
408
410
  self.setARObjectAttributes(child_element, com_spec)
409
- self.setChildElementOptionalRefType(child_element, "MODE-GROUP-REF", com_spec.modeGroupRef)
411
+ self.setChildElementOptionalBooleanValue(child_element, "ENHANCED-MODE-API", com_spec.getEnhancedModeApi())
412
+ self.setChildElementOptionalRefType(child_element, "MODE-GROUP-REF", com_spec.getModeGroupRef())
413
+ self.setChildElementOptionalBooleanValue(child_element, "SUPPORTS-ASYNCHRONOUS-MODE-SWITCH", com_spec.getSupportsAsynchronousModeSwitch())
410
414
 
411
415
  def writeRPortComSpec(self, element: ET.Element, com_spec: RPortComSpec):
412
416
  if isinstance(com_spec, NonqueuedReceiverComSpec):
@@ -416,7 +420,7 @@ class ARXMLWriter(AbstractARXMLWriter):
416
420
  elif isinstance(com_spec, ClientComSpec):
417
421
  self.writeClientComSpec(element, com_spec)
418
422
  elif isinstance(com_spec, ModeSwitchReceiverComSpec):
419
- self.writeModeSwitchReceiverComSpec(element, com_spec)
423
+ self.setModeSwitchReceiverComSpec(element, com_spec)
420
424
  elif isinstance(com_spec, ParameterRequireComSpec):
421
425
  self.writeParameterRequireComSpec(element, com_spec)
422
426
  else:
@@ -652,11 +656,11 @@ class ARXMLWriter(AbstractARXMLWriter):
652
656
  def setSwAxisIndividual(self, element: ET.Element, props: SwAxisIndividual):
653
657
  child_element = ET.SubElement(element, "SW-AXIS-INDIVIDUAL")
654
658
  self.setARObjectAttributes(child_element, props)
655
- self.setChildElementOptionalRefType(child_element, "INPUT-VARIABLE-TYPE-REF", props.inputVariableTypeRef)
656
- self.setChildElementOptionalRefType(child_element, "COMPU-METHOD-REF", props.compuMethodRef)
657
- self.setChildElementOptionalNumericalValue(child_element, "SW-MAX-AXIS-POINTS", props.swMaxAxisPoints)
658
- self.setChildElementOptionalNumericalValue(child_element, "SW-MIN-AXIS-POINTS", props.swMinAxisPoints)
659
- self.setChildElementOptionalRefType(child_element, "DATA-CONSTR-REF", props.dataConstrRef)
659
+ self.setChildElementOptionalRefType(child_element, "INPUT-VARIABLE-TYPE-REF", props.getInputVariableTypeRef())
660
+ self.setChildElementOptionalRefType(child_element, "COMPU-METHOD-REF", props.getCompuMethodRef())
661
+ self.setChildElementOptionalNumericalValue(child_element, "SW-MAX-AXIS-POINTS", props.getSwMaxAxisPoints())
662
+ self.setChildElementOptionalNumericalValue(child_element, "SW-MIN-AXIS-POINTS", props.getSwMinAxisPoints())
663
+ self.setChildElementOptionalRefType(child_element, "DATA-CONSTR-REF", props.getDataConstrRef())
660
664
 
661
665
  def setSwAxisGrouped(self, element: ET.Element, props: SwAxisGrouped):
662
666
  child_element = ET.SubElement(element, "SW-AXIS-GROUPED")
@@ -699,12 +703,13 @@ class ARXMLWriter(AbstractARXMLWriter):
699
703
  self.setAnnotations(conditional_tag, props.getAnnotations())
700
704
  self.setChildElementOptionalRefType(conditional_tag, "BASE-TYPE-REF", props.getBaseTypeRef())
701
705
  self.setChildElementOptionalRefType(conditional_tag, "COMPU-METHOD-REF", props.getCompuMethodRef())
702
- self.setChildElementOptionalRefType(conditional_tag, "DATA-CONSTR-REF", props.getDataConstrRef())
706
+
703
707
  self.setValueSpecification(conditional_tag, "INVALID-VALUE", props.getInvalidValue())
704
708
  self.setChildElementOptionalRefType(conditional_tag, "IMPLEMENTATION-DATA-TYPE-REF", props.getImplementationDataTypeRef())
705
709
  self.setChildElementOptionalFloatValue(conditional_tag, "STEP-SIZE", props.getStepSize())
706
710
  self.setChildElementOptionalRefType(conditional_tag, "SW-ADDR-METHOD-REF", props.getSwAddrMethodRef())
707
711
  self.setChildElementOptionalLiteral(conditional_tag, "SW-CALIBRATION-ACCESS", props.getSwCalibrationAccess())
712
+ self.setChildElementOptionalRefType(conditional_tag, "DATA-CONSTR-REF", props.getDataConstrRef())
708
713
  self.setSwCalprmAxisSet(conditional_tag, "SW-CALPRM-AXIS-SET", props.getSwCalprmAxisSet())
709
714
  self.setChildElementOptionalLiteral(conditional_tag, "SW-IMPL-POLICY", props.getSwImplPolicy())
710
715
  self.setChildElementOptionalNumericalValue(conditional_tag, "SW-INTENDED-RESOLUTION", props.getSwIntendedResolution())
@@ -723,7 +728,7 @@ class ARXMLWriter(AbstractARXMLWriter):
723
728
  self.setARElement(element, data_type)
724
729
  self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", data_type.getSwDataDefProps())
725
730
 
726
- def setApplicationPrimitiveDataType(self, element: ET.Element, data_type: ApplicationPrimitiveDataType):
731
+ def writeApplicationPrimitiveDataType(self, element: ET.Element, data_type: ApplicationPrimitiveDataType):
727
732
  self.logger.debug("writeApplicationPrimitiveDataType %s" % data_type.getShortName())
728
733
  data_type_tag = ET.SubElement(element, "APPLICATION-PRIMITIVE-DATA-TYPE")
729
734
  self.setApplicationDataType(data_type_tag, data_type)
@@ -732,6 +737,7 @@ class ARXMLWriter(AbstractARXMLWriter):
732
737
  self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", prototype.getSwDataDefProps())
733
738
 
734
739
  def setApplicationCompositeElementDataPrototype(self, element: ET.Element, prototype: ApplicationCompositeElementDataPrototype):
740
+ self.setIdentifiable(element, prototype)
735
741
  self.setDataPrototype(element, prototype)
736
742
  self.setChildElementOptionalRefType(element, "TYPE-TREF", prototype.typeTRef)
737
743
 
@@ -746,7 +752,7 @@ class ARXMLWriter(AbstractARXMLWriter):
746
752
  child_element = ET.SubElement(elements_tag, "APPLICATION-RECORD-ELEMENT")
747
753
  self.setApplicationRecordElement(child_element, record)
748
754
 
749
- def setApplicationRecordDataType(self, element: ET.Element, data_type: ApplicationRecordDataType):
755
+ def writeApplicationRecordDataType(self, element: ET.Element, data_type: ApplicationRecordDataType):
750
756
  data_type_tag = ET.SubElement(element, "APPLICATION-RECORD-DATA-TYPE")
751
757
  self.setApplicationDataType(data_type_tag, data_type)
752
758
  self.writeApplicationRecordElements(data_type_tag, data_type)
@@ -754,22 +760,23 @@ class ARXMLWriter(AbstractARXMLWriter):
754
760
  def writeApplicationDataTypes(self, parent: ET.Element, ar_package: ARPackage):
755
761
  for data_type in ar_package.getApplicationDataType():
756
762
  if isinstance(data_type, ApplicationPrimitiveDataType):
757
- self.setApplicationPrimitiveDataType(parent, data_type)
763
+ self.writeApplicationPrimitiveDataType(parent, data_type)
758
764
  elif isinstance(data_type, ApplicationRecordDataType):
759
- self.setApplicationRecordDataType(parent, data_type)
765
+ self.writeApplicationRecordDataType(parent, data_type)
760
766
  else:
761
767
  self.notImplemented("Unsupported ApplicationDataType <%s>" % type(data_type))
762
768
 
763
- def writeBaseTypeDirectDefinition(self, element: ET.Element, base_type_definition: BaseTypeDirectDefinition):
764
- self.setChildElementOptionalNumericalValue(element, "BASE-TYPE-SIZE", base_type_definition.baseTypeSize)
765
- self.setChildElementOptionalLiteral(element, "BASE-TYPE-ENCODING", base_type_definition.baseTypeEncoding)
766
- self.setChildElementOptionalNumericalValue(element, "MEM-ALIGNMENT", base_type_definition.memAlignment)
767
- self.setChildElementOptionalLiteral(element, "NATIVE-DECLARATION", base_type_definition.nativeDeclaration)
769
+ def setBaseTypeDirectDefinition(self, element: ET.Element, base_type_definition: BaseTypeDirectDefinition):
770
+ self.setChildElementOptionalNumericalValue(element, "BASE-TYPE-SIZE", base_type_definition.getBaseTypeSize())
771
+ self.setChildElementOptionalLiteral(element, "BASE-TYPE-ENCODING", base_type_definition.getBaseTypeEncoding())
772
+ self.setChildElementOptionalLiteral(element, "BYTE-ORDER", base_type_definition.getByteOrder())
773
+ self.setChildElementOptionalNumericalValue(element, "MEM-ALIGNMENT", base_type_definition.getMemAlignment())
774
+ self.setChildElementOptionalLiteral(element, "NATIVE-DECLARATION", base_type_definition.getNativeDeclaration())
768
775
 
769
- def setSwBaseType(self, element: ET.Element, base_type: SwBaseType):
776
+ def writeSwBaseType(self, element: ET.Element, base_type: SwBaseType):
770
777
  data_type_tag = ET.SubElement(element, "SW-BASE-TYPE")
771
778
  self.setIdentifiable(data_type_tag, base_type)
772
- self.writeBaseTypeDirectDefinition(data_type_tag, base_type.baseTypeDefinition)
779
+ self.setBaseTypeDirectDefinition(data_type_tag, base_type.getBaseTypeDefinition())
773
780
 
774
781
  def writeCompuScaleConstantContents(self, element: ET.Element, contents: CompuScaleConstantContents):
775
782
  compu_const_tag = ET.SubElement(element, "COMPU-CONST")
@@ -834,7 +841,7 @@ class ARXMLWriter(AbstractARXMLWriter):
834
841
  self.setCompuScales(child_element, compu.getCompuContent())
835
842
  self.setCompuConst(child_element, "COMPU-DEFAULT-VALUE", compu.getCompuDefaultValue())
836
843
 
837
- def setCompuMethod(self, element: ET.Element, compu_method: CompuMethod):
844
+ def writeCompuMethod(self, element: ET.Element, compu_method: CompuMethod):
838
845
  child_element = ET.SubElement(element, "COMPU-METHOD")
839
846
  self.logger.debug("write CompuMethods %s" % compu_method.getShortName())
840
847
  self.setIdentifiable(child_element, compu_method)
@@ -1032,22 +1039,15 @@ class ARXMLWriter(AbstractARXMLWriter):
1032
1039
  for ref in refs:
1033
1040
  self.setChildElementOptionalRefType(refs_tag, "DATA-TYPE-MAPPING-REF", ref)
1034
1041
 
1035
- def writeInternalBehaviorConstantMemories(self, element: ET.Element, behavior: InternalBehavior):
1036
- memories = behavior.getConstantMemorys()
1037
- if len(memories) > 0:
1038
- child_element = ET.SubElement(element, "CONSTANT-MEMORYS")
1039
- for memory in memories:
1040
- self.writeParameterDataPrototype(child_element, memory)
1041
-
1042
1042
  def writeInternalBehavior(self, element: ET.Element, behavior: InternalBehavior):
1043
1043
  self.setIdentifiable(element, behavior)
1044
- self.writeInternalBehaviorConstantMemories(element, behavior)
1044
+ self.setParameterDataPrototypes(element, "CONSTANT-MEMORYS", behavior.getConstantMemories())
1045
1045
  self.writeDataTypeMappingRefs(element, behavior)
1046
1046
  self.writeExclusiveAreas(element, behavior)
1047
1047
 
1048
- def setAutosarVariableRef(self, element: ET.Element, ref: AutosarVariableRef):
1048
+ def setAutosarVariableRef(self, element: ET.Element, key: str, ref: AutosarVariableRef):
1049
1049
  if ref is not None:
1050
- child_element = ET.SubElement(element, "ACCESSED-VARIABLE")
1050
+ child_element = ET.SubElement(element, key)
1051
1051
  self.setARObjectAttributes(child_element, ref)
1052
1052
  if ref.getAutosarVariableIRef() is not None:
1053
1053
  child_element = ET.SubElement(child_element, "AUTOSAR-VARIABLE-IREF")
@@ -1067,19 +1067,17 @@ class ARXMLWriter(AbstractARXMLWriter):
1067
1067
  def setVariableAccess(self, element: ET.Element, access: VariableAccess):
1068
1068
  child_element = ET.SubElement(element, "VARIABLE-ACCESS")
1069
1069
  self.setIdentifiable(child_element, access)
1070
- self.setAutosarVariableRef(child_element, access.getAccessedVariableRef())
1071
-
1072
-
1070
+ self.setAutosarVariableRef(child_element, "ACCESSED-VARIABLE", access.getAccessedVariableRef())
1073
1071
 
1074
1072
  def setAutosarParameterRef(self, element: ET.Element, key: str, parameter_ref: AutosarParameterRef):
1075
1073
  if parameter_ref is not None:
1076
1074
  child_element = ET.SubElement(element, key)
1077
- self.setChildElementOptionalRefType(child_element, "LOCAL-PARAMETER-REF", parameter_ref.local_parameter_ref)
1075
+ self.setChildElementOptionalRefType(child_element, "LOCAL-PARAMETER-REF", parameter_ref.getLocalParameterRef())
1078
1076
 
1079
1077
  def writeParameterAccess(self, element: ET.Element, parameter_access: ParameterAccess):
1080
1078
  child_element = ET.SubElement(element, "PARAMETER-ACCESS")
1081
1079
  self.setIdentifiable(child_element, parameter_access)
1082
- self.setAutosarParameterRef(child_element, "ACCESSED-PARAMETER", parameter_access.accessed_parameter)
1080
+ self.setAutosarParameterRef(child_element, "ACCESSED-PARAMETER", parameter_access.getAccessedParameter())
1083
1081
 
1084
1082
  def writeParameterAccesses(self, element: ET.Element, entity: RunnableEntity):
1085
1083
  parameter_accesses = entity.getParameterAccesses()
@@ -1223,13 +1221,13 @@ class ARXMLWriter(AbstractARXMLWriter):
1223
1221
  self.writeRunnableEntityArguments(child_element, entity)
1224
1222
  self.writeAsynchronousServerCallResultPoint(child_element, entity)
1225
1223
  self.setChildElementOptionalBooleanValue(child_element, "CAN-BE-INVOKED-CONCURRENTLY", entity.getCanBeInvokedConcurrently())
1226
- self.writeParameterAccesses(child_element, entity)
1227
1224
  self.writeDataReadAccesses(child_element, entity)
1228
1225
  self.writeDataReceivePointByArguments(child_element, entity)
1229
1226
  self.writeDataSendPoints(child_element, entity)
1230
1227
  self.writeDataWriteAccesses(child_element, entity)
1231
1228
  self.writeModeAccessPoints(child_element, entity)
1232
1229
  self.writeModeSwitchPoints(child_element, entity)
1230
+ self.writeParameterAccesses(child_element, entity)
1233
1231
  self.writeReadLocalVariables(child_element, entity)
1234
1232
  self.writeServerCallPoints(child_element, entity)
1235
1233
  self.setChildElementOptionalLiteral(child_element, "SYMBOL", entity.symbol)
@@ -1244,6 +1242,16 @@ class ARXMLWriter(AbstractARXMLWriter):
1244
1242
  self.writeRunnableEntity(runnables_tag, entity)
1245
1243
  else:
1246
1244
  self.notImplemented("Unsupported RunnableEntity <%s>" % type(entity))
1245
+
1246
+ def writeSwcInternalBehaviorArTypedPerInstanceMemories(self, element: ET.Element, behavior: SwcInternalBehavior):
1247
+ prototypes = behavior.getArTypedPerInstanceMemories()
1248
+ if len(prototypes) > 0:
1249
+ child_element = ET.SubElement(element, "AR-TYPED-PER-INSTANCE-MEMORYS")
1250
+ for prototype in prototypes:
1251
+ if isinstance(prototype, VariableDataPrototype):
1252
+ self.writeVariableDataPrototype(child_element, prototype)
1253
+ else:
1254
+ self._raiseError("Unsupported ArTypedPerInstanceMemories <%s>" % type(prototype))
1247
1255
 
1248
1256
  def writeExplicitInterRunnableVariables(self, element: ET.Element, behavior: SwcInternalBehavior):
1249
1257
  prototypes = behavior.getExplicitInterRunnableVariables()
@@ -1267,18 +1275,17 @@ class ARXMLWriter(AbstractARXMLWriter):
1267
1275
  self.setChildElementOptionalLiteral(child_element, "TYPE", memory.getType())
1268
1276
  self.setChildElementOptionalLiteral (child_element, "TYPE-DEFINITION", memory.getTypeDefinition())
1269
1277
 
1270
- def writeParameterDataPrototype(self, element: ET.Element, prototype: ParameterDataPrototype):
1278
+ def setParameterDataPrototype(self, element: ET.Element, prototype: ParameterDataPrototype):
1271
1279
  child_element = ET.SubElement(element, "PARAMETER-DATA-PROTOTYPE")
1272
1280
  self.setIdentifiable(child_element, prototype)
1273
1281
  self.setAutosarDataPrototype(child_element, prototype)
1274
1282
  self.setValueSpecification(child_element, "INIT-VALUE", prototype.getInitValue())
1275
1283
 
1276
- def writePerInstanceParameters(self, element: ET.Element, behavior: SwcInternalBehavior):
1277
- prototypes = behavior.getPerInstanceParameters()
1278
- if len(prototypes) > 0:
1279
- child_element = ET.SubElement(element, "PER-INSTANCE-PARAMETERS")
1280
- for prototype in prototypes:
1281
- self.writeParameterDataPrototype(child_element, prototype)
1284
+ def setParameterDataPrototypes(self, element: ET.Element, key: str, parameters: List[ParameterDataPrototype]):
1285
+ if len(parameters) > 0:
1286
+ child_element = ET.SubElement(element, key)
1287
+ for parameter in parameters:
1288
+ self.setParameterDataPrototype(child_element, parameter)
1282
1289
 
1283
1290
  def writePortDefinedArgumentValues(self, element: ET.Element, argument_values: List[PortDefinedArgumentValue]) :
1284
1291
  if len(argument_values) > 0:
@@ -1323,6 +1330,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1323
1330
  def writeRoleBasedDataAssignment(self, element: ET.Element, assignment: RoleBasedDataAssignment):
1324
1331
  child_element = ET.SubElement(element, "ROLE-BASED-DATA-ASSIGNMENT")
1325
1332
  self.setChildElementOptionalLiteral(child_element, "ROLE", assignment.role)
1333
+ self.setAutosarVariableRef(child_element, "USED-DATA-ELEMENT", assignment.getUsedDataElement())
1326
1334
  self.setAutosarParameterRef(child_element, "USED-PARAMETER-ELEMENT", assignment.getUsedParameterElement())
1327
1335
  self.setChildElementOptionalRefType(child_element, "USED-PIM-REF", assignment.getUsedPimRef())
1328
1336
 
@@ -1351,7 +1359,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1351
1359
  else:
1352
1360
  self._raiseError("Unsupported Assigned Data <%s>" % type(data))
1353
1361
 
1354
- def writeNvBlockNeeds(self, element: ET.Element, needs: NvBlockNeeds):
1362
+ def setNvBlockNeeds(self, element: ET.Element, needs: NvBlockNeeds):
1355
1363
  child_element = ET.SubElement(element, "NV-BLOCK-NEEDS")
1356
1364
  self.logger.debug("write NvBlockNeeds %s" % needs.getShortName())
1357
1365
  self.setIdentifiable(child_element, needs)
@@ -1372,22 +1380,23 @@ class ARXMLWriter(AbstractARXMLWriter):
1372
1380
  self.setChildElementOptionalBooleanValue(child_element, "USE-CRC-COMP-MECHANISM", needs.getUseCRCCompMechanism())
1373
1381
  self.setChildElementOptionalBooleanValue(child_element, "WRITE-ONLY-ONCE", needs.getWriteOnlyOnce())
1374
1382
  self.setChildElementOptionalBooleanValue(child_element, "WRITE-VERIFICATION", needs.getWriteVerification())
1383
+ self.setChildElementOptionalPositiveInteger(child_element, "WRITING-FREQUENCY", needs.getWritingFrequency())
1375
1384
  self.setChildElementOptionalLiteral(child_element, "WRITING-PRIORITY", needs.getWritingPriority())
1376
1385
 
1377
- def writeDiagnosticCommunicationManagerNeeds(self, element: ET.Element, needs: DiagnosticCommunicationManagerNeeds):
1386
+ def setDiagnosticCommunicationManagerNeeds(self, element: ET.Element, needs: DiagnosticCommunicationManagerNeeds):
1378
1387
  child_element = ET.SubElement(element, "DIAGNOSTIC-COMMUNICATION-MANAGER-NEEDS")
1379
1388
  self.logger.debug("write DiagnosticCommunicationManagerNeeds %s" % needs.getShortName())
1380
1389
  self.setIdentifiable(child_element, needs)
1381
1390
  self.setChildElementOptionalLiteral(child_element, "SERVICE-REQUEST-CALLBACK-TYPE", needs.getServiceRequestCallbackType())
1382
1391
 
1383
- def writeDiagnosticRoutineNeeds(self, element: ET.Element, needs: DiagnosticRoutineNeeds):
1392
+ def setDiagnosticRoutineNeeds(self, element: ET.Element, needs: DiagnosticRoutineNeeds):
1384
1393
  child_element = ET.SubElement(element, "DIAGNOSTIC-ROUTINE-NEEDS")
1385
1394
  self.logger.debug("write DiagnosticRoutineNeeds %s" % needs.getShortName())
1386
1395
  self.setIdentifiable(child_element, needs)
1387
1396
  self.setChildElementOptionalLiteral(child_element, "DIAG-ROUTINE-TYPE", needs.getDiagRoutineType())
1388
1397
  self.setChildElementOptionalIntegerValue(child_element, "RID-NUMBER", needs.getRidNumber())
1389
1398
 
1390
- def writeDiagnosticValueNeeds(self, element: ET.Element, needs: DiagnosticValueNeeds):
1399
+ def setDiagnosticValueNeeds(self, element: ET.Element, needs: DiagnosticValueNeeds):
1391
1400
  child_element = ET.SubElement(element, "DIAGNOSTIC-VALUE-NEEDS")
1392
1401
  self.logger.debug("write DiagnosticValueNeeds %s" % needs.getShortName())
1393
1402
  self.setIdentifiable(child_element, needs)
@@ -1410,21 +1419,27 @@ class ARXMLWriter(AbstractARXMLWriter):
1410
1419
  else:
1411
1420
  self.notImplemented("Unsupported DiagEventDebounceAlgorithm <%s>" % type(algorithm))
1412
1421
 
1413
- def writeDiagnosticEventNeeds(self, element: ET.Element, needs: DiagnosticEventNeeds):
1422
+ def setDiagnosticEventNeeds(self, element: ET.Element, needs: DiagnosticEventNeeds):
1414
1423
  child_element = ET.SubElement(element, "DIAGNOSTIC-EVENT-NEEDS")
1415
1424
  self.logger.debug("write DiagnosticEventNeeds %s" % needs.getShortName())
1416
1425
  self.setIdentifiable(child_element, needs)
1417
1426
  self.writeDiagEventDebounceAlgorithm(child_element, needs)
1418
1427
  self.setChildElementOptionalLiteral(child_element, "DTC-KIND", needs.getDtcKind())
1419
1428
  self.setChildElementOptionalIntegerValue(child_element, "UDS-DTC-NUMBER", needs.getUdsDtcNumber())
1429
+
1430
+ def setDiagnosticEventInfoNeeds(self, element: ET.Element, needs: DiagnosticEventInfoNeeds):
1431
+ child_element = ET.SubElement(element, "DIAGNOSTIC-EVENT-INFO-NEEDS")
1432
+ self.logger.debug("write DiagnosticEventNeeds %s" % needs.getShortName())
1433
+ self.setIdentifiable(child_element, needs)
1434
+ self.setChildElementOptionalPositiveInteger(child_element, "UDS-DTC-NUMBER", needs.getUdsDtcNumber())
1420
1435
 
1421
- def writeCryptoServiceNeeds(self, element: ET.Element, needs: CryptoServiceNeeds):
1436
+ def setCryptoServiceNeeds(self, element: ET.Element, needs: CryptoServiceNeeds):
1422
1437
  child_element = ET.SubElement(element, "CRYPTO-SERVICE-NEEDS")
1423
1438
  self.logger.debug("write CryptoServiceNeeds %s" % needs.getShortName())
1424
1439
  self.setIdentifiable(child_element, needs)
1425
1440
  self.setChildElementOptionalPositiveInteger(child_element, "MAXIMUM-KEY-LENGTH", needs.getMaximumKeyLength())
1426
1441
 
1427
- def writeEcuStateMgrUserNeeds(self, element: ET.Element, needs: EcuStateMgrUserNeeds):
1442
+ def setEcuStateMgrUserNeeds(self, element: ET.Element, needs: EcuStateMgrUserNeeds):
1428
1443
  child_element = ET.SubElement(element, "ECU-STATE-MGR-USER-NEEDS")
1429
1444
  self.logger.debug("write EcuStateMgrUserNeeds %s" % needs.getShortName())
1430
1445
  self.setIdentifiable(child_element, needs)
@@ -1435,21 +1450,23 @@ class ARXMLWriter(AbstractARXMLWriter):
1435
1450
  child_element = ET.SubElement(element, "SERVICE-NEEDS")
1436
1451
  for need in needs:
1437
1452
  if isinstance(need, NvBlockNeeds):
1438
- self.writeNvBlockNeeds(child_element, need)
1453
+ self.setNvBlockNeeds(child_element, need)
1439
1454
  elif isinstance(need, DiagnosticCommunicationManagerNeeds):
1440
- self.writeDiagnosticCommunicationManagerNeeds(child_element, need)
1455
+ self.setDiagnosticCommunicationManagerNeeds(child_element, need)
1441
1456
  elif isinstance(need, DiagnosticRoutineNeeds):
1442
- self.writeDiagnosticRoutineNeeds(child_element, need)
1457
+ self.setDiagnosticRoutineNeeds(child_element, need)
1443
1458
  elif isinstance(need, DiagnosticValueNeeds):
1444
- self.writeDiagnosticValueNeeds(child_element, need)
1459
+ self.setDiagnosticValueNeeds(child_element, need)
1445
1460
  elif isinstance(need, DiagnosticEventNeeds):
1446
- self.writeDiagnosticEventNeeds(child_element, need)
1461
+ self.setDiagnosticEventNeeds(child_element, need)
1462
+ elif isinstance(need, DiagnosticEventInfoNeeds):
1463
+ self.setDiagnosticEventInfoNeeds(child_element, need)
1447
1464
  elif isinstance(need, CryptoServiceNeeds):
1448
- self.writeCryptoServiceNeeds(child_element, need)
1465
+ self.setCryptoServiceNeeds(child_element, need)
1449
1466
  elif isinstance(need, EcuStateMgrUserNeeds):
1450
- self.writeEcuStateMgrUserNeeds(child_element, need)
1467
+ self.setEcuStateMgrUserNeeds(child_element, need)
1451
1468
  else:
1452
- self._raiseError("Unsupported service needs <%s>" % type(need))
1469
+ self.notImplemented("Unsupported service needs <%s>" % type(need))
1453
1470
 
1454
1471
  def writeSwcServiceDependency(self, element: ET.Element, dependency: SwcServiceDependency):
1455
1472
  child_element = ET.SubElement(element, "SWC-SERVICE-DEPENDENCY")
@@ -1480,21 +1497,24 @@ class ARXMLWriter(AbstractARXMLWriter):
1480
1497
  for type_ref in type_refs:
1481
1498
  self.setChildElementOptionalRefType(data_type_refs_tag, "DATA-TYPE-REF", type_ref)
1482
1499
 
1500
+
1483
1501
  def writeSwcInternalBehavior(self, element: ET.Element, behavior: SwcInternalBehavior):
1484
1502
  self.logger.debug("writeSwInternalBehavior %s" % behavior.getShortName())
1485
1503
 
1486
1504
  child_element = ET.SubElement(element, "SWC-INTERNAL-BEHAVIOR")
1487
1505
  self.writeInternalBehavior(child_element, behavior)
1506
+ self.writeSwcInternalBehaviorArTypedPerInstanceMemories(child_element, behavior)
1488
1507
  self.writeRTEEvents(child_element, behavior)
1489
1508
  self.writeExplicitInterRunnableVariables(child_element, behavior)
1490
- self.setChildElementOptionalLiteral(child_element, "HANDLE-TERMINATION-AND-RESTART", behavior.handleTerminationAndRestart)
1509
+ self.setChildElementOptionalLiteral(child_element, "HANDLE-TERMINATION-AND-RESTART", behavior.getHandleTerminationAndRestart())
1491
1510
  self.setIncludedDataTypeSets(child_element, behavior.getIncludedDataTypeSets())
1492
1511
  self.writePerInstanceMemories(child_element, behavior)
1493
- self.writePerInstanceParameters(child_element, behavior)
1512
+ self.setParameterDataPrototypes(child_element, "PER-INSTANCE-PARAMETERS", behavior.getPerInstanceParameters())
1494
1513
  self.writePortAPIOptions(child_element, behavior)
1495
1514
  self.writeSwcInternalBehaviorRunnableEntities(child_element, behavior)
1496
1515
  self.writeSwcInternalBehaviorServiceDependencies(child_element, behavior)
1497
- self.setChildElementOptionalBooleanValue(child_element, "SUPPORTS-MULTIPLE-INSTANTIATION", behavior.supportsMultipleInstantiation)
1516
+ self.setParameterDataPrototypes(child_element, "SHARED-PARAMETERS", behavior.getSharedParameters())
1517
+ self.setChildElementOptionalBooleanValue(child_element, "SUPPORTS-MULTIPLE-INSTANTIATION", behavior.getSupportsMultipleInstantiation())
1498
1518
 
1499
1519
  def writeAtomicSwComponentTypeInternalBehaviors(self, element: ET.Element, behavior: InternalBehavior):
1500
1520
  if behavior is not None:
@@ -1909,7 +1929,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1909
1929
  else:
1910
1930
  self._raiseError("Unsupported Runnable Mapping <%s>" % type(mapping))
1911
1931
 
1912
- def setSwcBswMapping(self, element: ET.Element, mapping: SwcBswMapping):
1932
+ def writeSwcBswMapping(self, element: ET.Element, mapping: SwcBswMapping):
1913
1933
  self.logger.debug("writeBswModuleDescription %s" % mapping.getShortName())
1914
1934
  child_element = ET.SubElement(element, "SWC-BSW-MAPPING")
1915
1935
  self.setIdentifiable(child_element, mapping)
@@ -2031,18 +2051,11 @@ class ARXMLWriter(AbstractARXMLWriter):
2031
2051
  self.setChildElementOptionalBooleanValue(element, "IS-SERVICE", port_interface.isService)
2032
2052
  self.setChildElementOptionalLiteral(element, "SERVICE-KIND", port_interface.serviceKind)
2033
2053
 
2034
- def writeParameterInterfaceParameters(self, element: ET.Element, param_interface: ParameterInterface):
2035
- parameters = param_interface.getParameters()
2036
- if len(parameters) > 0:
2037
- child_element = ET.SubElement(element, "PARAMETERS")
2038
- for prototype in parameters:
2039
- self.writeParameterDataPrototype(child_element, prototype)
2040
-
2041
2054
  def writeParameterInterface(self, element: ET.Element, param_interface: ParameterInterface):
2042
2055
  self.logger.debug("Write ParameterInterface %s" % param_interface.getShortName())
2043
2056
  child_element = ET.SubElement(element, "PARAMETER-INTERFACE")
2044
2057
  self.setPortInterface(child_element, param_interface)
2045
- self.writeParameterInterfaceParameters(child_element, param_interface)
2058
+ self.setParameterDataPrototypes(child_element, "PARAMETERS", param_interface.getParameters())
2046
2059
 
2047
2060
  def writeClientServerInterface(self, element: ET.Element, cs_interface: ClientServerInterface):
2048
2061
  self.logger.debug("writeClientServerInterface %s" % cs_interface.getShortName())
@@ -2492,27 +2505,129 @@ class ARXMLWriter(AbstractARXMLWriter):
2492
2505
  else:
2493
2506
  self.notImplemented("Unsupported PduTriggering <%s>" % type(triggering))
2494
2507
 
2495
- def writeCanPhysicalChannel(self, element: ET.Element, channel: CanPhysicalChannel):
2496
- self.logger.debug("CanPhysicalChannel %s" % channel.getShortName())
2508
+ def setCanPhysicalChannel(self, element: ET.Element, channel: CanPhysicalChannel):
2509
+ self.logger.debug("Set CanPhysicalChannel %s" % channel.getShortName())
2497
2510
  child_element = ET.SubElement(element, "CAN-PHYSICAL-CHANNEL")
2498
2511
  self.setIdentifiable(child_element, channel)
2499
2512
  self.writePhysicalChannel(child_element, channel)
2500
2513
 
2501
2514
  def writeLinPhysicalChannel(self, element: ET.Element, channel: LinPhysicalChannel):
2502
- self.logger.debug("LinPhysicalChannel %s" % channel.getShortName())
2515
+ self.logger.debug("Set LinPhysicalChannel %s" % channel.getShortName())
2503
2516
  child_element = ET.SubElement(element, "LIN-PHYSICAL-CHANNEL")
2504
2517
  self.setIdentifiable(child_element, channel)
2505
2518
  self.writePhysicalChannel(child_element, channel)
2506
2519
 
2520
+ def setIpv6Configuration(self, element: ET.Element, configuration: Ipv6Configuration):
2521
+ if configuration is not None:
2522
+ child_element = ET.SubElement(element, "IPV-6-CONFIGURATION")
2523
+ self.setChildElementOptionalPositiveInteger(child_element, "ASSIGNMENT-PRIORITY", configuration.getAssignmentPriority())
2524
+ self.setChildElementOptionalLiteral(child_element, "DEFAULT-ROUTER", configuration.getDefaultRouter())
2525
+ self.setChildElementOptionalBooleanValue(child_element, "ENABLE-ANYCAST", configuration.getEnableAnycast())
2526
+ self.setChildElementOptionalPositiveInteger(child_element, "HOP-COUNT", configuration.getHopCount())
2527
+ self.setChildElementOptionalPositiveInteger(child_element, "IP-ADDRESS-PREFIX-LENGTH", configuration.getIpAddressPrefixLength())
2528
+ self.setChildElementOptionalLiteral(child_element, "IPV-6-ADDRESS", configuration.getIpv6Address())
2529
+ self.setChildElementOptionalLiteral(child_element, "IPV-6-ADDRESS-SOURCE", configuration.getIpv6AddressSource())
2530
+
2531
+ def writeNetworkEndPointNetworkEndPointAddresses(self, element: ET.Element, addresses: List[NetworkEndpointAddress]):
2532
+ if len(addresses) > 0:
2533
+ child_element = ET.SubElement(element, "NETWORK-ENDPOINT-ADDRESSES")
2534
+ for address in addresses:
2535
+ if isinstance(address, Ipv6Configuration):
2536
+ self.setIpv6Configuration(child_element, address)
2537
+ else:
2538
+ self.notImplemented("Unsupported Network EndPoint Address <%s>" % type(address))
2539
+
2540
+ def writeNetworkEndPoint(self, element: ET.Element, end_point: NetworkEndpoint):
2541
+ self.logger.debug("Set NetworkEndpoint %s" % end_point.getShortName())
2542
+ child_element = ET.SubElement(element, "NETWORK-ENDPOINT")
2543
+ self.setIdentifiable(child_element, end_point)
2544
+ self.writeNetworkEndPointNetworkEndPointAddresses(child_element, end_point.getNetworkEndpointAddresses())
2545
+ self.setChildElementOptionalPositiveInteger(child_element, "PRIORITY", end_point.getPriority())
2546
+
2547
+ def writeEthernetPhysicalChannelNetworkEndPoints(self, element: ET.Element, end_points: List[NetworkEndpoint]):
2548
+ if len(end_points) > 0:
2549
+ child_element = ET.SubElement(element, "NETWORK-ENDPOINTS")
2550
+ for end_point in end_points:
2551
+ self.writeNetworkEndPoint(child_element, end_point)
2552
+
2553
+ def setSocketConnectionIpduIdentifier(self, element: ET.Element,identifier: SocketConnectionIpduIdentifier):
2554
+ if identifier is not None:
2555
+ child_element = ET.SubElement(element, "SOCKET-CONNECTION-IPDU-IDENTIFIER")
2556
+ self.setChildElementOptionalPositiveInteger(child_element, "HEADER-ID", identifier.getHeaderId())
2557
+ self.setChildElementOptionalLiteral(child_element, "PDU-COLLECTION-SEMANTICS", identifier.getPduCollectionSemantics())
2558
+ self.setChildElementOptionalLiteral(child_element, "PDU-COLLECTION-TRIGGER", identifier.getPduCollectionTrigger())
2559
+ self.setChildElementOptionalRefType(child_element, "PDU-REF", identifier.getPduRef())
2560
+ self.setChildElementOptionalRefType(child_element, "PDU-TRIGGERING-REF", identifier.getPduTriggeringRef())
2561
+
2562
+ def setSocketConnectionPdus(self, element: ET.Element, key: str, pdus: List[SocketConnectionIpduIdentifier]):
2563
+ if len(pdus) > 0:
2564
+ child_element = ET.SubElement(element, key)
2565
+ for pdu in pdus:
2566
+ if isinstance(pdu, SocketConnectionIpduIdentifier):
2567
+ self.setSocketConnectionIpduIdentifier(child_element, pdu)
2568
+ else:
2569
+ self.notImplemented("Unsupported Pdu <%s>" % type(pdu))
2570
+
2571
+ def setSocketConnection(self, element: ET.Element, connection: SocketConnection):
2572
+ if connection is not None:
2573
+ child_element = ET.SubElement(element, "SOCKET-CONNECTION")
2574
+ self.setChildElementOptionalRefType(child_element, "CLIENT-PORT-REF", connection.getClientPortRef())
2575
+ self.setSocketConnectionPdus(child_element, "PDUS", connection.getPdus())
2576
+ self.setChildElementOptionalPositiveInteger(child_element, "PDU-COLLECTION-MAX-BUFFER-SIZE", connection.getPduCollectionMaxBufferSize())
2577
+ self.setChildElementOptionalTimeValue(child_element, "PDU-COLLECTION-TIMEOUT", connection.getPduCollectionTimeout())
2578
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", connection.getShortLabel())
2579
+
2580
+ def writeSocketConnectionBundleConnections(self, element: ET.Element, bundle: SocketConnectionBundle):
2581
+ connections = bundle.getBundledConnections()
2582
+ if len(connections) > 0:
2583
+ child_element = ET.SubElement(element, "BUNDLED-CONNECTIONS")
2584
+ for connection in connections:
2585
+ if isinstance(connection, SocketConnection):
2586
+ self.setSocketConnection(child_element, connection)
2587
+ else:
2588
+ self.notImplemented("Unsupported Bundled Connection <%s>" % type(connection))
2589
+
2590
+ def writeSocketConnectionBundle(self, element: ET.Element, bundle: SocketConnectionBundle):
2591
+ if bundle is not None:
2592
+ child_element = ET.SubElement(element, "SOCKET-CONNECTION-BUNDLE")
2593
+ self.setReferable(child_element, bundle)
2594
+ self.writeSocketConnectionBundleConnections(child_element, bundle)
2595
+ self.setChildElementOptionalRefType(child_element, "SERVER-PORT-REF", bundle.getServerPortRef())
2596
+
2597
+ def writeSoAdConfigConnectionBundles(self, element: ET.Element, config: SoAdConfig):
2598
+ bundles = config.getConnectionBundles()
2599
+ if len(bundles) > 0:
2600
+ child_element = ET.SubElement(element, "CONNECTION-BUNDLES")
2601
+ for bundle in bundles:
2602
+ if isinstance(bundle, SocketConnectionBundle):
2603
+ self.writeSocketConnectionBundle(child_element, bundle)
2604
+ else:
2605
+ self.notImplemented("Unsupported Connection Bundle <%s>" % type(bundle))
2606
+
2607
+ def setSoAdConfig(self, element: ET.Element, key: str, config: SoAdConfig):
2608
+ if config is not None:
2609
+ child_element = ET.SubElement(element, key)
2610
+ self.writeSoAdConfigConnectionBundles(child_element, config)
2611
+
2612
+ def setEthernetPhysicalChannel(self, element: ET.Element, channel: EthernetPhysicalChannel):
2613
+ self.logger.debug("Set EthernetPhysicalChannel %s" % channel.getShortName())
2614
+ child_element = ET.SubElement(element, "ETHERNET-PHYSICAL-CHANNEL")
2615
+ self.setIdentifiable(child_element, channel)
2616
+ self.writePhysicalChannel(child_element, channel)
2617
+ self.writeEthernetPhysicalChannelNetworkEndPoints(child_element, channel.getNetworkEndpoints())
2618
+ self.setSoAdConfig(child_element, "SO-AD-CONFIG", channel.getSoAdConfig())
2619
+
2507
2620
  def writeCommunicationClusterPhysicalChannels(self, element: ET.Element, cluster: CommunicationCluster):
2508
2621
  channels = cluster.getPhysicalChannels()
2509
2622
  if len(channels) > 0:
2510
2623
  child_element = ET.SubElement(element, "PHYSICAL-CHANNELS")
2511
2624
  for channel in channels:
2512
2625
  if isinstance(channel, CanPhysicalChannel):
2513
- self.writeCanPhysicalChannel(child_element, channel)
2626
+ self.setCanPhysicalChannel(child_element, channel)
2514
2627
  elif isinstance(channel, LinPhysicalChannel):
2515
2628
  self.writeLinPhysicalChannel(child_element, channel)
2629
+ elif isinstance(channel, EthernetPhysicalChannel):
2630
+ self.setEthernetPhysicalChannel(child_element, channel)
2516
2631
  else:
2517
2632
  self.notImplemented("Unsupported Physical Channel <%s>" % type(channel))
2518
2633
 
@@ -2544,6 +2659,15 @@ class ARXMLWriter(AbstractARXMLWriter):
2544
2659
  self.writeCommunicationCluster(child_element, cluster)
2545
2660
  self.readAbstractCanCluster(child_element, cluster)
2546
2661
 
2662
+ def writeEthernetCluster(self, element: ET.Element, cluster: EthernetCluster):
2663
+ self.logger.debug("Set EthernetCluster %s" % cluster.getShortName())
2664
+ child_element = ET.SubElement(element, "ETHERNET-CLUSTER")
2665
+ self.setARElement(child_element, cluster)
2666
+
2667
+ child_element = ET.SubElement(child_element, "ETHERNET-CLUSTER-VARIANTS")
2668
+ child_element = ET.SubElement(child_element, "ETHERNET-CLUSTER-CONDITIONAL")
2669
+ self.writeCommunicationCluster(child_element, cluster)
2670
+
2547
2671
  def writeCanFrame(self, element: ET.Element, frame: CanFrame):
2548
2672
  self.logger.debug("Write CanFrame %s" % frame.getShortName())
2549
2673
  child_element = ET.SubElement(element, "CAN-FRAME")
@@ -2580,10 +2704,14 @@ class ARXMLWriter(AbstractARXMLWriter):
2580
2704
  else:
2581
2705
  self._raiseError("Unsupported CommConnectorPort <%s>" % type(port))
2582
2706
 
2583
- def writeCanCommunicationController(self, element: ET.Element, controller: CanCommunicationController):
2707
+ def setCanCommunicationController(self, element: ET.Element, controller: CanCommunicationController):
2584
2708
  self.logger.debug("Write CanCommunicationController %s" % controller.getShortName())
2585
2709
  self.setIdentifiable(element, controller)
2586
2710
 
2711
+ def setEthernetCommunicationController(self, element: ET.Element, controller: EthernetCommunicationController):
2712
+ self.logger.debug("Write EthernetCommunicationController %s" % controller.getShortName())
2713
+ self.setIdentifiable(element, controller)
2714
+
2587
2715
  def writeEcuInstanceCommControllers(self, element: ET.Element, instance: EcuInstance):
2588
2716
  controllers = instance.getCommControllers()
2589
2717
  if len(controllers) > 0:
@@ -2591,19 +2719,25 @@ class ARXMLWriter(AbstractARXMLWriter):
2591
2719
  for controller in controllers:
2592
2720
  if isinstance(controller, CanCommunicationController):
2593
2721
  child_element = ET.SubElement(controllers_tag, "CAN-COMMUNICATION-CONTROLLER")
2594
- self.writeCanCommunicationController(child_element, controller)
2722
+ self.setCanCommunicationController(child_element, controller)
2723
+ elif isinstance(controller, EthernetCommunicationController):
2724
+ child_element = ET.SubElement(controllers_tag, "ETHERNET-COMMUNICATION-CONTROLLER")
2725
+ self.setEthernetCommunicationController(child_element, controller)
2595
2726
  else:
2596
- self._raiseError("Unsupported Communication Controller <%s>" % type(controller))
2727
+ self.notImplemented("Unsupported Communication Controller <%s>" % type(controller))
2597
2728
 
2598
2729
  def writeCommunicationConnector(self, element: ET.Element, connector: CommunicationConnector):
2599
2730
  self.setIdentifiable(element, connector)
2600
2731
  self.setChildElementOptionalRefType(element, "COMM-CONTROLLER-REF", connector.getCommControllerRef())
2601
2732
  self.writeCommunicationConnectorEcuCommPortInstances(element, connector)
2602
2733
 
2603
-
2604
2734
  def writeCanCommunicationConnector(self, element: ET.Element, connector: CanCommunicationConnector):
2605
2735
  self.logger.debug("Write CanCommunicationConnector %s" % connector.getShortName())
2606
- self.writeCommunicationConnector(element, connector)
2736
+ self.writeCommunicationConnector(element, connector)
2737
+
2738
+ def writeEthernetCommunicationConnector(self, element: ET.Element, connector: EthernetCommunicationConnector):
2739
+ self.logger.debug("Write EthernetCommunicationConnector %s" % connector.getShortName())
2740
+ self.writeCommunicationConnector(element, connector)
2607
2741
 
2608
2742
  def writeEcuInstanceConnectors(self, element: ET.Element, instance: EcuInstance):
2609
2743
  connectors = instance.getConnectors()
@@ -2613,6 +2747,9 @@ class ARXMLWriter(AbstractARXMLWriter):
2613
2747
  if isinstance(connector, CanCommunicationConnector):
2614
2748
  child_element = ET.SubElement(connectors_tag, "CAN-COMMUNICATION-CONNECTOR")
2615
2749
  self.writeCanCommunicationConnector(child_element, connector)
2750
+ elif isinstance(connector, EthernetCommunicationConnector):
2751
+ child_element = ET.SubElement(connectors_tag, "ETHERNET-COMMUNICATION-CONNECTOR")
2752
+ self.writeEthernetCommunicationConnector(child_element, connector)
2616
2753
  else:
2617
2754
  self._raiseError("Unsupported Communication connector <%s>" % type(connector))
2618
2755
 
@@ -2726,7 +2863,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2726
2863
  self.writeRootSwCompositionPrototype(child_element, system)
2727
2864
  self.setChildElementOptionalRevisionLabelString(child_element, "SYSTEM-VERSION", system.getSystemVersion())
2728
2865
 
2729
- def setPhysicalDimension(self, element: ET.Element, dimension: PhysicalDimension):
2866
+ def writePhysicalDimension(self, element: ET.Element, dimension: PhysicalDimension):
2730
2867
  self.logger.debug("Set PhysicalDimension %s" % dimension.getShortName())
2731
2868
  child_element = ET.SubElement(element, "PHYSICAL-DIMENSION")
2732
2869
  self.setARElement(child_element, dimension)
@@ -2751,7 +2888,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2751
2888
  else:
2752
2889
  self.notImplemented("Unsupported Flat Map Instances <%s>" % type(instance))
2753
2890
 
2754
- def setFlatMap(self, element: ET.Element, map: FlatMap):
2891
+ def writeFlatMap(self, element: ET.Element, map: FlatMap):
2755
2892
  self.logger.debug("Set FlatMap %s" % map.getShortName())
2756
2893
  child_element = ET.SubElement(element, "FLAT-MAP")
2757
2894
  self.setARElement(child_element, map)
@@ -2784,7 +2921,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2784
2921
  else:
2785
2922
  self.notImplemented("Unsupported PortInterfaceMapping <%s>" % type(mapping))
2786
2923
 
2787
- def setPortInterfaceMappingSet(self, element: ET.Element, mapping_set: PortInterfaceMappingSet):
2924
+ def writePortInterfaceMappingSet(self, element: ET.Element, mapping_set: PortInterfaceMappingSet):
2788
2925
  self.logger.debug("Set PortInterfaceMappingSet %s" % mapping_set.getShortName())
2789
2926
  child_element = ET.SubElement(element, "PORT-INTERFACE-MAPPING-SET")
2790
2927
  self.setARElement(child_element, mapping_set)
@@ -2810,7 +2947,8 @@ class ARXMLWriter(AbstractARXMLWriter):
2810
2947
  child_element = ET.SubElement(element, "I-SIGNAL")
2811
2948
  self.setIdentifiable(child_element, signal)
2812
2949
  self.setChildElementOptionalLiteral(child_element, "DATA-TYPE-POLICY", signal.getDataTypePolicy())
2813
- self.setValueSpecification(element, "INIT-VALUE", signal.getInitValue())
2950
+ self.setChildElementOptionalLiteral(child_element, "I-SIGNAL-TYPE", signal.getISignalType())
2951
+ self.setValueSpecification(child_element, "INIT-VALUE", signal.getInitValue())
2814
2952
  self.setChildElementOptionalNumericalValue(child_element, "LENGTH", signal.getLength())
2815
2953
  self.setSwDataDefProps(child_element, "NETWORK-REPRESENTATION-PROPS", signal.getNetworkRepresentationProps())
2816
2954
  self.setChildElementOptionalRefType(child_element, "SYSTEM-SIGNAL-REF", signal.getSystemSignalRef())
@@ -2943,7 +3081,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2943
3081
  self.setChildElementOptionalRefType(child_element, "SYSTEM-SIGNAL-GROUP-REF", group.getSystemSignalGroupRef())
2944
3082
 
2945
3083
  def writeISignalIPduGroup(self, element: ET.Element, group: ISignalIPduGroup):
2946
- self.logger.debug("ISignalIPduGroup %s" % group.getShortName())
3084
+ self.logger.debug("Set ISignalIPduGroup %s" % group.getShortName())
2947
3085
  child_element = ET.SubElement(element, "I-SIGNAL-I-PDU-GROUP")
2948
3086
  self.setIdentifiable(child_element, group)
2949
3087
  self.setChildElementOptionalLiteral(child_element, "COMMUNICATION-DIRECTION", group.getCommunicationDirection())
@@ -2965,8 +3103,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2965
3103
  child_element = ET.SubElement(element, "SYSTEM-SIGNAL")
2966
3104
  self.setIdentifiable(child_element, signal)
2967
3105
  self.setChildElementOptionalBooleanValue(child_element, "DYNAMIC-LENGTH", signal.getDynamicLength())
2968
-
2969
-
3106
+ self.setSwDataDefProps(child_element, "PHYSICAL-PROPS", signal.getPhysicalProps())
2970
3107
 
2971
3108
  def writeGenericEthernetFrame(self, element: ET.Element, signal: GenericEthernetFrame):
2972
3109
  self.logger.debug("Write GenericEthernetFrame %s" % signal.getShortName())
@@ -3016,11 +3153,22 @@ class ARXMLWriter(AbstractARXMLWriter):
3016
3153
  self.setChildElementOptionalIntegerValue(child_element, "NUMBER-OF-REPETITIONS", timing.getNumberOfRepetitions())
3017
3154
  self.setTimeRangeType(child_element, "REPETITION-PERIOD", timing.getRepetitionPeriod())
3018
3155
 
3156
+ def setTimeRangeType(self, element: ET.Element, key: str, time_range: TimeRangeType):
3157
+ if time_range is not None:
3158
+ child_element = ET.SubElement(element, key)
3159
+ self.setChildElementOptionalTimeValue(child_element, "VALUE", time_range.getValue())
3160
+
3161
+ def setCyclicTiming(self, element: ET.Element, key: str, timing: CyclicTiming):
3162
+ if timing is not None:
3163
+ child_element = ET.SubElement(element, key)
3164
+ self.setTimeRangeType(child_element, "TIME-OFFSET", timing.getTimeOffset())
3165
+ self.setTimeRangeType(child_element, "TIME-PERIOD", timing.getTimePeriod())
3166
+
3019
3167
  def setTransmissionModeTiming(self, element: ET.Element, key: str, timing: TransmissionModeTiming):
3020
3168
  if timing is not None:
3021
3169
  self.logger.debug("Set TransmissionModeTiming of <%s>" % key)
3022
3170
  child_element = ET.SubElement(element, key)
3023
- #timing.getCyclicTiming(child_element, "")
3171
+ self.setCyclicTiming(child_element, "CYCLIC-TIMING", timing.getCyclicTiming())
3024
3172
  self.setEventControlledTiming(child_element, "EVENT-CONTROLLED-TIMING", timing.getEventControlledTiming())
3025
3173
 
3026
3174
  def setTransmissionModeDeclaration(self, element: ET.Element, key: str, decl : TransmissionModeDeclaration):
@@ -3033,6 +3181,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3033
3181
  if timing is not None:
3034
3182
  spec_tag = ET.SubElement(element, "I-PDU-TIMING-SPECIFICATIONS")
3035
3183
  child_element = ET.SubElement(spec_tag, "I-PDU-TIMING")
3184
+ self.setChildElementOptionalTimeValue(child_element, "MINIMUM-DELAY", timing.getMinimumDelay())
3036
3185
  self.setTransmissionModeDeclaration(child_element, "TRANSMISSION-MODE-DECLARATION", timing.getTransmissionModeDeclaration())
3037
3186
 
3038
3187
  def writeISignalIPdu(self, element: ET.Element, i_pdu: ISignalIPdu):
@@ -3052,13 +3201,13 @@ class ARXMLWriter(AbstractARXMLWriter):
3052
3201
  elif isinstance(ar_element, CompositionSwComponentType):
3053
3202
  self.writeCompositionSwComponentType(element, ar_element)
3054
3203
  elif isinstance(ar_element, ApplicationPrimitiveDataType):
3055
- self.setApplicationPrimitiveDataType(element, ar_element)
3204
+ self.writeApplicationPrimitiveDataType(element, ar_element)
3056
3205
  elif isinstance(ar_element, ApplicationRecordDataType):
3057
- self.setApplicationRecordDataType(element, ar_element)
3206
+ self.writeApplicationRecordDataType(element, ar_element)
3058
3207
  elif isinstance(ar_element, SwBaseType):
3059
- self.setSwBaseType(element, ar_element)
3208
+ self.writeSwBaseType(element, ar_element)
3060
3209
  elif isinstance(ar_element, CompuMethod):
3061
- self.setCompuMethod(element, ar_element)
3210
+ self.writeCompuMethod(element, ar_element)
3062
3211
  elif isinstance(ar_element, ConstantSpecification):
3063
3212
  self.writeConstantSpecification(element, ar_element)
3064
3213
  elif isinstance(ar_element, DataConstr):
@@ -3074,7 +3223,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3074
3223
  elif isinstance(ar_element, BswModuleEntry):
3075
3224
  self.writeBswModuleEntry(element, ar_element)
3076
3225
  elif isinstance(ar_element, SwcBswMapping):
3077
- self.setSwcBswMapping(element, ar_element)
3226
+ self.writeSwcBswMapping(element, ar_element)
3078
3227
  elif isinstance(ar_element, BswImplementation):
3079
3228
  self.writeBswImplementation(element, ar_element)
3080
3229
  elif isinstance(ar_element, ImplementationDataType):
@@ -3142,11 +3291,15 @@ class ARXMLWriter(AbstractARXMLWriter):
3142
3291
  elif isinstance(ar_element, LifeCycleInfoSet):
3143
3292
  self.writeLifeCycleInfoSet(element, ar_element)
3144
3293
  elif isinstance(ar_element, PhysicalDimension):
3145
- self.setPhysicalDimension(element, ar_element)
3294
+ self.writePhysicalDimension(element, ar_element)
3146
3295
  elif isinstance(ar_element, FlatMap):
3147
- self.setFlatMap(element, ar_element)
3296
+ self.writeFlatMap(element, ar_element)
3148
3297
  elif isinstance(ar_element, PortInterfaceMappingSet):
3149
- self.setPortInterfaceMappingSet(element, ar_element)
3298
+ self.writePortInterfaceMappingSet(element, ar_element)
3299
+ elif isinstance(ar_element, EthernetCluster):
3300
+ self.writeEthernetCluster(element, ar_element)
3301
+ elif isinstance(ar_element, ISignalIPduGroup):
3302
+ self.writeISignalIPduGroup(element, ar_element)
3150
3303
  else:
3151
3304
  self.notImplemented("Unsupported Elements of ARPackage <%s>" % type(ar_element))
3152
3305