armodel 1.7.7__py3-none-any.whl → 1.7.8__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 (52) hide show
  1. armodel/cli/arxml_dump_cli.py +33 -22
  2. armodel/cli/arxml_format_cli.py +25 -13
  3. armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +64 -29
  4. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +322 -63
  5. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +134 -35
  6. armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +10 -1
  7. armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +18 -2
  8. armodel/models/M2/AUTOSARTemplates/ECUCDescriptionTemplate.py +20 -19
  9. armodel/models/M2/AUTOSARTemplates/EcuResourceTemplate/HwElementCategory.py +59 -0
  10. armodel/models/M2/AUTOSARTemplates/EcuResourceTemplate/__init__.py +145 -0
  11. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +214 -156
  12. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +60 -32
  13. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +63 -42
  14. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +1 -0
  15. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +13 -6
  16. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +111 -38
  17. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AccessCount.py +9 -1
  18. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py +5 -4
  19. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +9 -1
  20. armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +167 -5
  21. armodel/models/M2/AUTOSARTemplates/SystemTemplate/{ECUResourceMapping.py → EcuResourceMapping.py} +4 -3
  22. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanTopology.py +31 -21
  23. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetFrame.py +5 -3
  24. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/FlexrayCommunication.py +76 -0
  25. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/FlexrayTopology.py +654 -0
  26. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/__init__.py +0 -0
  27. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +64 -31
  28. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +158 -40
  29. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +19 -6
  30. armodel/models/M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py +2 -0
  31. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Transformer/__init__.py +524 -0
  32. armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +15 -13
  33. armodel/models/__init__.py +5 -1
  34. armodel/parser/abstract_arxml_parser.py +34 -30
  35. armodel/parser/arxml_parser.py +1196 -525
  36. armodel/parser/file_parser.py +5 -3
  37. armodel/tests/test_armodel/models/test_ar_package.py +6 -11
  38. armodel/tests/test_armodel/models/test_port_interface.py +116 -117
  39. armodel/tests/test_armodel/parser/test_bsw_module_descriiption.py +109 -109
  40. armodel/tests/test_armodel/parser/test_sw_components.py +38 -27
  41. armodel/tests/test_armodel/parser/test_system.py +2 -8
  42. armodel/transformer/__init__.py +0 -0
  43. armodel/transformer/abstract.py +6 -0
  44. armodel/transformer/admin_data.py +31 -0
  45. armodel/writer/abstract_arxml_writer.py +22 -29
  46. armodel/writer/arxml_writer.py +1198 -477
  47. {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/METADATA +41 -1
  48. {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/RECORD +52 -43
  49. {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/LICENSE +0 -0
  50. {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/WHEEL +0 -0
  51. {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/entry_points.txt +0 -0
  52. {armodel-1.7.7.dist-info → armodel-1.7.8.dist-info}/top_level.txt +0 -0
@@ -1,13 +1,11 @@
1
1
  import xml.etree.cElementTree as ET
2
2
  from typing import List
3
3
 
4
- from armodel.models.M2.AUTOSARTemplates.SystemTemplate.ECUResourceMapping import ECUMapping
5
- from armodel.models.M2.AUTOSARTemplates.SystemTemplate.SWmapping import SwcToImplMapping
6
-
7
- from ..models.M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
8
4
  from ..models.M2.MSR.AsamHdo.AdminData import AdminData
9
5
  from ..models.M2.MSR.AsamHdo.BaseTypes import BaseTypeDirectDefinition, SwBaseType
10
- from ..models.M2.MSR.AsamHdo.ComputationMethod import Compu, CompuConst, CompuConstContent, CompuConstFormulaContent, CompuConstNumericContent, CompuConstTextContent, CompuMethod, CompuNominatorDenominator, CompuScale, CompuScaleConstantContents, CompuScaleRationalFormula, CompuScales
6
+ from ..models.M2.MSR.AsamHdo.ComputationMethod import Compu, CompuConst, CompuConstContent, CompuConstFormulaContent, CompuConstNumericContent
7
+ from ..models.M2.MSR.AsamHdo.ComputationMethod import CompuConstTextContent, CompuMethod, CompuNominatorDenominator, CompuScale
8
+ from ..models.M2.MSR.AsamHdo.ComputationMethod import CompuScaleConstantContents, CompuScaleRationalFormula, CompuScales
11
9
  from ..models.M2.MSR.AsamHdo.Constraints.GlobalConstraints import DataConstr, InternalConstrs, PhysConstrs
12
10
  from ..models.M2.MSR.AsamHdo.SpecialData import Sdg
13
11
  from ..models.M2.MSR.AsamHdo.Units import PhysicalDimension, Unit
@@ -22,84 +20,181 @@ from ..models.M2.MSR.Documentation.Annotation import Annotation
22
20
  from ..models.M2.MSR.Documentation.TextModel.BlockElements import DocumentationBlock
23
21
  from ..models.M2.MSR.Documentation.TextModel.BlockElements.ListElements import ListElement
24
22
  from ..models.M2.MSR.Documentation.TextModel.LanguageDataModel import LLongName, LPlainText, LanguageSpecific
25
- from ..models.M2.MSR.Documentation.TextModel.MultilanguageData import MultiLanguageOverviewParagraph, MultiLanguageParagraph, MultiLanguagePlainText, MultilanguageLongName
23
+ from ..models.M2.MSR.Documentation.TextModel.MultilanguageData import MultiLanguageOverviewParagraph, MultiLanguageParagraph, MultiLanguagePlainText
24
+ from ..models.M2.MSR.Documentation.TextModel.MultilanguageData import MultilanguageLongName
26
25
 
27
26
  from ..models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
27
+ from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswApiOptions, BswBackgroundEvent, BswCalledEntity, BswDataReceivedEvent, BswInternalTriggerOccurredEvent, BswOperationInvokedEvent
28
+ from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswDataReceptionPolicy, BswEvent, BswExternalTriggerOccurredEvent
29
+ from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswInternalBehavior, BswInterruptEntity, BswModeSenderPolicy, BswModuleEntity
30
+ from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswQueuedDataReceptionPolicy, BswSchedulableEntity, BswScheduleEvent
31
+ from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswTimingEvent, BswVariableAccess
28
32
  from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswOverview import BswModuleDescription
29
33
  from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswImplementation import BswImplementation
30
34
  from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswInterfaces import BswModuleEntry
31
- from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswBehavior import BswBackgroundEvent, BswCalledEntity, BswDataReceivedEvent, BswEvent, BswExternalTriggerOccurredEvent, BswInternalBehavior, BswInterruptEntity, BswModeSenderPolicy, BswModuleEntity, BswSchedulableEntity, BswScheduleEvent, BswTimingEvent
32
- from ..models.M2.AUTOSARTemplates.CommonStructure import ApplicationValueSpecification, ArrayValueSpecification, ConstantReference, ConstantSpecification, NumericalValueSpecification, RecordValueSpecification, TextValueSpecification, ValueSpecification
35
+ from ..models.M2.AUTOSARTemplates.CommonStructure import ApplicationValueSpecification, ArrayValueSpecification, ConstantReference
36
+ from ..models.M2.AUTOSARTemplates.CommonStructure import ConstantSpecification, NumericalValueSpecification, RecordValueSpecification
37
+ from ..models.M2.AUTOSARTemplates.CommonStructure import TextValueSpecification, ValueSpecification
33
38
  from ..models.M2.AUTOSARTemplates.CommonStructure.FlatMap import FlatInstanceDescriptor, FlatMap
34
39
  from ..models.M2.AUTOSARTemplates.CommonStructure.Filter import DataFilter
35
- from ..models.M2.AUTOSARTemplates.CommonStructure.SwcBswMapping import SwcBswMapping, SwcBswRunnableMapping
36
40
  from ..models.M2.AUTOSARTemplates.CommonStructure.Implementation import Code, Implementation, ImplementationProps
37
- from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import SwcTiming, TimingExtension
38
- from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.ExecutionOrderConstraint import EOCExecutableEntityRef, ExecutionOrderConstraint
39
- from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagEventDebounceMonitorInternal, DiagnosticCommunicationManagerNeeds, DiagnosticEventInfoNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment, RoleBasedDataTypeAssignment, ServiceDependency
40
- from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import ExecutableEntity
41
41
  from ..models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
42
+ from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import ExecutableEntity
42
43
  from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import InternalBehavior
43
44
  from ..models.M2.AUTOSARTemplates.CommonStructure.ModeDeclaration import ModeDeclaration, ModeDeclarationGroup, ModeDeclarationGroupPrototype
44
45
  from ..models.M2.AUTOSARTemplates.CommonStructure.ResourceConsumption import ResourceConsumption
45
46
  from ..models.M2.AUTOSARTemplates.CommonStructure.ResourceConsumption.StackUsage import RoughEstimateStackUsage, StackUsage
47
+ from ..models.M2.AUTOSARTemplates.CommonStructure.SwcBswMapping import SwcBswMapping, SwcBswRunnableMapping
48
+ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagEventDebounceMonitorInternal
49
+ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import DiagnosticCommunicationManagerNeeds, DiagnosticEventInfoNeeds
50
+ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds
51
+ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment
52
+ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import RoleBasedDataTypeAssignment, ServiceDependency
53
+ from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import SwcTiming, TimingExtension
54
+ from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.ExecutionOrderConstraint import EOCExecutableEntityRef
55
+ from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.ExecutionOrderConstraint import ExecutionOrderConstraint
56
+ from ..models.M2.AUTOSARTemplates.CommonStructure.TriggerDeclaration import Trigger
46
57
  from ..models.M2.AUTOSARTemplates.DiagnosticExtract.DiagnosticContribution import DiagnosticServiceTable
47
- from ..models.M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucAbstractReferenceValue, EcucContainerValue, EcucInstanceReferenceValue, EcucModuleConfigurationValues, EcucNumericalParamValue, EcucParameterValue, EcucReferenceValue, EcucTextualParamValue, EcucValueCollection
48
- from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.EngineeringObject import AutosarEngineeringObject, EngineeringObject
49
- from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Identifiable, MultilanguageReferrable, Referrable
58
+ from ..models.M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucAbstractReferenceValue, EcucContainerValue, EcucInstanceReferenceValue
59
+ from ..models.M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucModuleConfigurationValues, EcucNumericalParamValue, EcucParameterValue
60
+ from ..models.M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucReferenceValue, EcucTextualParamValue, EcucValueCollection
61
+ from ..models.M2.AUTOSARTemplates.EcuResourceTemplate import HwDescriptionEntity, HwElement, HwPinGroup
62
+ from ..models.M2.AUTOSARTemplates.EcuResourceTemplate.HwElementCategory import HwAttributeDef, HwCategory, HwType
50
63
  from ..models.M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AnyInstanceRef
51
64
  from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage, ReferenceBase
65
+ from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.EngineeringObject import AutosarEngineeringObject, EngineeringObject
66
+ from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Describable, Identifiable
67
+ from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Referrable, MultilanguageReferrable
52
68
  from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType, ARLiteral, Limit
53
-
54
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.PortAPIOptions import PortAPIOption, PortDefinedArgumentValue
55
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import AsynchronousServerCallReturnsEvent, BackgroundEvent, DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent, ModeSwitchedAckEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent, TimingEvent
69
+ from ..models.M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
70
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import CompositeNetworkRepresentation, ModeSwitchedAckRequest
71
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import TransmissionAcknowledgementRequest
72
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import ClientComSpec, ModeSwitchReceiverComSpec, ModeSwitchSenderComSpec
73
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import NonqueuedReceiverComSpec, NonqueuedSenderComSpec, PPortComSpec
74
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import ParameterRequireComSpec, QueuedReceiverComSpec, QueuedSenderComSpec
75
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import RPortComSpec, ReceiverComSpec, SenderComSpec, ServerComSpec
76
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import AbstractProvidedPortPrototype, AbstractRequiredPortPrototype
77
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ApplicationSwComponentType, AtomicSwComponentType
78
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ComplexDeviceDriverSwComponentType, CompositionSwComponentType
79
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import EcuAbstractionSwComponentType, PRPortPrototype, PortGroup, SwComponentType
80
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import PPortPrototype, PortPrototype, RPortPrototype, SymbolProps
81
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ServiceSwComponentType
82
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import InnerPortGroupInCompositionInstanceRef
83
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import ModeGroupInAtomicSwcInstanceRef
84
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import PModeGroupInAtomicSwcInstanceRef
85
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import RModeGroupInAtomicSWCInstanceRef
86
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import RModeInAtomicSwcInstanceRef, RVariableInAtomicSwcInstanceRef
87
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition import AssemblySwConnector, DelegationSwConnector, SwComponentPrototype, SwConnector
88
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition.InstanceRefs import POperationInAtomicSwcInstanceRef, PPortInCompositionInstanceRef
89
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition.InstanceRefs import ROperationInAtomicSwcInstanceRef, RPortInCompositionInstanceRef
90
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ApplicationArrayElement
91
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ApplicationCompositeElementDataPrototype
92
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ApplicationRecordElement, AutosarDataPrototype, DataPrototype
93
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ParameterDataPrototype, VariableDataPrototype
94
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationArrayDataType, ApplicationCompositeDataType
95
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationDataType, ApplicationPrimitiveDataType
96
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationRecordDataType, AutosarDataType
97
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import DataTypeMappingSet
98
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndDescription, EndToEndProtection, EndToEndProtectionISignalIPdu
99
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndProtectionVariablePrototype
100
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndProtectionSet
101
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ApplicationError, ArgumentDataPrototype, ClientServerInterface
102
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ClientServerOperation, DataInterface
103
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import DataPrototypeMapping, ModeSwitchInterface, ParameterInterface
104
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import PortInterface, PortInterfaceMappingSet, SenderReceiverInterface
105
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import TriggerInterface, VariableAndParameterInterfaceMapping
106
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface.InstanceRefs import ApplicationCompositeElementInPortInterfaceInstanceRef
107
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import AsynchronousServerCallPoint, RunnableEntity, RunnableEntityArgument
108
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import SwcInternalBehavior, SynchronousServerCallPoint
109
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AutosarVariableRef import AutosarVariableRef
110
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.DataElements import ParameterAccess, VariableAccess
111
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef
112
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.PortAPIOptions import PortDefinedArgumentValue
113
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import AsynchronousServerCallReturnsEvent, BackgroundEvent
114
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent
115
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import ModeSwitchedAckEvent, OperationInvokedEvent, RTEEvent
116
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import SwcModeSwitchEvent, TimingEvent
56
117
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.IncludedDataTypes import IncludedDataTypeSet
57
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationArrayDataType, ApplicationCompositeDataType, ApplicationDataType, ApplicationPrimitiveDataType, ApplicationRecordDataType, AutosarDataType
58
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndDescription, EndToEndProtection, EndToEndProtectionVariablePrototype
59
118
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import IncludedModeDeclarationGroupSet
60
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import CompositeNetworkRepresentation, ModeSwitchedAckRequest, TransmissionAcknowledgementRequest
61
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import AbstractProvidedPortPrototype, AbstractRequiredPortPrototype, ApplicationSwComponentType, AtomicSwComponentType, ComplexDeviceDriverSwComponentType, CompositionSwComponentType, EcuAbstractionSwComponentType, PRPortPrototype, PortGroup, SwComponentType, PPortPrototype, PortPrototype, RPortPrototype, SymbolProps
62
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import InnerPortGroupInCompositionInstanceRef, PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef, RModeInAtomicSwcInstanceRef, RVariableInAtomicSwcInstanceRef
63
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import AsynchronousServerCallPoint, RunnableEntity, RunnableEntityArgument, SwcInternalBehavior, SynchronousServerCallPoint
64
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.AutosarVariableRef import AutosarVariableRef
119
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import ModeAccessPoint, ModeSwitchPoint
65
120
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServerCall import ServerCallPoint
66
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.DataElements import ParameterAccess, VariableAccess
67
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition import AssemblySwConnector, DelegationSwConnector, SwComponentPrototype, SwConnector
68
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition.InstanceRefs import POperationInAtomicSwcInstanceRef, PPortInCompositionInstanceRef, ROperationInAtomicSwcInstanceRef, RPortInCompositionInstanceRef
69
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface.InstanceRefs import ApplicationCompositeElementInPortInterfaceInstanceRef
70
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef, VariableInAtomicSWCTypeInstanceRef
71
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import ClientComSpec, ModeSwitchReceiverComSpec, ModeSwitchSenderComSpec, NonqueuedReceiverComSpec, NonqueuedSenderComSpec, PPortComSpec, ParameterRequireComSpec, QueuedReceiverComSpec, QueuedSenderComSpec, RPortComSpec, ReceiverComSpec, SenderComSpec, ServerComSpec
72
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef
73
121
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServiceMapping import RoleBasedPortAssignment, SwcServiceDependency
74
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ApplicationArrayElement, ApplicationCompositeElementDataPrototype, ApplicationRecordElement, AutosarDataPrototype, DataPrototype, ParameterDataPrototype, VariableDataPrototype
75
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ServiceSwComponentType
76
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import DataTypeMappingSet
77
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndProtectionSet
78
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ApplicationError, ClientServerInterface, ClientServerOperation, DataPrototypeMapping, ModeSwitchInterface, ParameterInterface, PortInterface, PortInterfaceMappingSet, SenderReceiverInterface, TriggerInterface, VariableAndParameterInterfaceMapping
79
122
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcImplementation import SwcImplementation
80
123
 
81
124
  from ..models.M2.AUTOSARTemplates.SystemTemplate import SwcToEcuMapping, System, SystemMapping
82
- from ..models.M2.AUTOSARTemplates.SystemTemplate.DataMapping import SenderReceiverToSignalGroupMapping, SenderReceiverToSignalMapping
125
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.DataMapping import SenderRecCompositeTypeMapping, SenderRecRecordElementMapping
126
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.DataMapping import SenderRecRecordTypeMapping, SenderReceiverToSignalGroupMapping
127
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.DataMapping import SenderReceiverToSignalMapping
83
128
  from ..models.M2.AUTOSARTemplates.SystemTemplate.DiagnosticConnection import DiagnosticConnection
84
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import DynamicPart, DynamicPartAlternative, FrameTriggering, GeneralPurposeIPdu, GeneralPurposePdu, IPdu, IPduTiming, ISignalGroup, ISignalIPdu, ISignalIPduGroup, ISignalToIPduMapping, ISignalTriggering, MultiplexedIPdu, MultiplexedPart, Pdu, PduTriggering, SecureCommunicationAuthenticationProps, SecureCommunicationFreshnessProps, SecureCommunicationProps, SecureCommunicationPropsSet, SecuredIPdu, SegmentPosition, StaticPart, SystemSignal, DcmIPdu, Frame, ISignal, NPdu, NmPdu, SystemSignalGroup, UserDefinedIPdu, UserDefinedPdu
85
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.EcuInstance import EcuInstance
86
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.Timing import CyclicTiming, EventControlledTiming, TimeRangeType, TransmissionModeCondition, TransmissionModeDeclaration, TransmissionModeTiming
87
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetCommunication import SoAdRoutingGroup, SocketConnection, SocketConnectionBundle, SocketConnectionIpduIdentifier
88
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetFrame import GenericEthernetFrame
89
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import CouplingPort, CouplingPortDetails, CouplingPortFifo, CouplingPortScheduler, CouplingPortStructuralElement, EthernetCluster, EthernetCommunicationConnector, EthernetCommunicationController, EthernetPriorityRegeneration, InitialSdDelayConfig, MacMulticastGroup, RequestResponseDelay, SdClientConfig, VlanMembership
90
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.NetworkEndpoint import DoIpEntity, InfrastructureServices, Ipv6Configuration, NetworkEndpoint, NetworkEndpointAddress
91
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import ApplicationEndpoint, ConsumedEventGroup, ConsumedServiceInstance, EventHandler, GenericTp, ProvidedServiceInstance, SdServerConfig, SoAdConfig, SocketAddress, TcpTp, TpPort, TransportProtocolConfiguration, UdpTp
92
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Multiplatform import Gateway, IPduMapping, ISignalMapping, TargetIPduRef
129
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.EcuResourceMapping import ECUMapping
93
130
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication import CanFrame, CanFrameTriggering, RxIdentifierRange
94
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import AbstractCanCommunicationController, AbstractCanCommunicationControllerAttributes, CanCommunicationConnector, CanCommunicationController, CanControllerConfigurationRequirements, CanControllerFdConfiguration, CanControllerFdConfigurationRequirements
95
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import ApplicationEntry, LinFrameTriggering, LinScheduleTable, LinUnconditionalFrame, ScheduleTableEntry
96
- from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import AbstractCanCluster, CanCluster, CanClusterBusOffRecovery, CanPhysicalChannel, CommConnectorPort, CommunicationCluster, CommunicationConnector, CommunicationController, EthernetPhysicalChannel, FramePort, IPduPort, ISignalPort, LinCluster, LinPhysicalChannel, PhysicalChannel
131
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import AbstractCanCommunicationController
132
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import AbstractCanCommunicationControllerAttributes
133
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import CanCommunicationConnector, CanCommunicationController
134
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import CanControllerConfigurationRequirements
135
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import CanControllerFdConfiguration
136
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import CanControllerFdConfigurationRequirements
137
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetCommunication import SoAdRoutingGroup, SocketConnection
138
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetCommunication import SocketConnectionBundle
139
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetCommunication import SocketConnectionIpduIdentifier
140
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetFrame import GenericEthernetFrame
141
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import CouplingPort, CouplingPortDetails, CouplingPortFifo
142
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import CouplingPortScheduler, CouplingPortStructuralElement
143
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import EthernetCluster, EthernetCommunicationConnector
144
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import EthernetCommunicationController
145
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import EthernetPriorityRegeneration, InitialSdDelayConfig
146
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import MacMulticastGroup, RequestResponseDelay, SdClientConfig
147
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.EthernetTopology import VlanMembership
148
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.NetworkEndpoint import DoIpEntity, InfrastructureServices, Ipv6Configuration
149
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.NetworkEndpoint import NetworkEndpoint, NetworkEndpointAddress
150
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import ApplicationEndpoint, ConsumedEventGroup
151
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import ConsumedServiceInstance, EventHandler, GenericTp
152
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import ProvidedServiceInstance, SdServerConfig, SoAdConfig
153
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import SocketAddress, TcpTp, TpPort
154
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.ServiceInstances import TransportProtocolConfiguration, UdpTp
155
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Flexray.FlexrayCommunication import FlexrayAbsolutelyScheduledTiming, FlexrayFrame
156
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Flexray.FlexrayCommunication import FlexrayFrameTriggering
157
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Flexray.FlexrayTopology import FlexrayCluster, FlexrayCommunicationConnector
158
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Flexray.FlexrayTopology import FlexrayCommunicationController
159
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import ApplicationEntry, LinFrameTriggering, LinScheduleTable
160
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import LinUnconditionalFrame, ScheduleTableEntry
97
161
  from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinTopology import LinCommunicationConnector, LinCommunicationController, LinMaster
162
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Multiplatform import Gateway, IPduMapping, ISignalMapping, TargetIPduRef
163
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import DynamicPart, DynamicPartAlternative, FrameTriggering
164
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import GeneralPurposeIPdu, GeneralPurposePdu, IPdu, IPduTiming
165
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import ISignalGroup, ISignalIPdu, ISignalIPduGroup
166
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import ISignalToIPduMapping, ISignalTriggering, MultiplexedIPdu
167
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import MultiplexedPart, Pdu, PduTriggering
168
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import SecureCommunicationAuthenticationProps
169
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import SecureCommunicationFreshnessProps, SecureCommunicationProps
170
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import SecureCommunicationPropsSet, SecuredIPdu, SegmentPosition
171
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import StaticPart, SystemSignal, DcmIPdu, Frame, ISignal, NPdu
172
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import NmPdu, SystemSignalGroup, UserDefinedIPdu, UserDefinedPdu
173
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import AbstractCanCluster, CanCluster, CanClusterBusOffRecovery
174
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import FlexrayPhysicalChannel, CommunicationCycle, CycleRepetition
175
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import CanPhysicalChannel, CommConnectorPort, CommunicationCluster
176
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import CommunicationConnector, CommunicationController
177
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import EthernetPhysicalChannel, FramePort, IPduPort, ISignalPort
178
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import LinCluster, LinPhysicalChannel, PhysicalChannel
179
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.EcuInstance import EcuInstance
180
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.Timing import CyclicTiming, EventControlledTiming, TimeRangeType
181
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.Timing import TransmissionModeCondition, TransmissionModeDeclaration
182
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.Timing import TransmissionModeTiming
98
183
  from ..models.M2.AUTOSARTemplates.SystemTemplate.InstanceRefs import ComponentInSystemInstanceRef, VariableDataPrototypeInSystemInstanceRef
99
- from ..models.M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import CanNmCluster, CanNmClusterCoupling, CanNmNode, NmCluster, NmConfig, NmEcu, NmNode, UdpNmCluster, UdpNmClusterCoupling, UdpNmEcu, UdpNmNode
100
- from ..models.M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpAddress, CanTpChannel, CanTpConfig, CanTpConnection, CanTpEcu, CanTpNode, DoIpLogicAddress, DoIpTpConfig, DoIpTpConnection, LinTpConfig, LinTpConnection, LinTpNode, TpAddress, TpConfig, TpConnection
184
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import CanNmCluster, CanNmClusterCoupling, CanNmNode, NmCluster, NmConfig, NmEcu
185
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import NmNode, UdpNmCluster, UdpNmClusterCoupling, UdpNmEcu, UdpNmNode
186
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.SWmapping import SwcToImplMapping
187
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Transformer import BufferProperties, DataTransformation, DataTransformationSet
188
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Transformer import EndToEndTransformationISignalProps, TransformationISignalProps
189
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Transformer import EndToEndTransformationDescription, TransformationDescription
190
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.Transformer import TransformationTechnology
191
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpAddress, CanTpChannel, CanTpConfig, CanTpConnection, CanTpEcu
192
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpNode, DoIpLogicAddress, DoIpTpConfig, DoIpTpConnection, LinTpConfig
193
+ from ..models.M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import LinTpConnection, LinTpNode, TpAddress, TpConfig, TpConnection
101
194
 
102
195
  from .abstract_arxml_writer import AbstractARXMLWriter
196
+
197
+
103
198
  class ARXMLWriter(AbstractARXMLWriter):
104
199
  def __init__(self, options=None) -> None:
105
200
  super().__init__(options)
@@ -113,7 +208,7 @@ class ARXMLWriter(AbstractARXMLWriter):
113
208
  def setChildElementRxIdentifierRange(self, element: ET.Element, key: str, range: RxIdentifierRange):
114
209
  if range is not None:
115
210
  child_element = ET.SubElement(element, key)
116
- self.setChildElementOptionalNumericalValue(child_element, "LOWER-CAN-ID", range.getLowerCanId())
211
+ self.setChildElementOptionalNumericalValue(child_element, "LOWER-CAN-ID", range.getLowerCanId())
117
212
  self.setChildElementOptionalNumericalValue(child_element, "UPPER-CAN-ID", range.getUpperCanId())
118
213
 
119
214
  def writeSds(self, parent: ET.Element, sdg: Sdg):
@@ -222,12 +317,12 @@ class ARXMLWriter(AbstractARXMLWriter):
222
317
 
223
318
  def writeARElement(self, parent: ET.Element, ar_element: ARElement):
224
319
  self.writeIdentifiable(parent, ar_element)
225
-
320
+
226
321
  def setTransmissionAcknowledgementRequest(self, element: ET.Element, acknowledge: TransmissionAcknowledgementRequest):
227
- if (acknowledge != None):
322
+ if (acknowledge is not None):
228
323
  child_element = ET.SubElement(element, "TRANSMISSION-ACKNOWLEDGE")
229
324
  self.writeARObjectAttributes(child_element, acknowledge)
230
- if acknowledge.timeout != None:
325
+ if acknowledge.timeout is not None:
231
326
  self.setChildElementOptionalFloatValue(child_element, "TIMEOUT", acknowledge.timeout)
232
327
 
233
328
  def setSenderComSpec(self, element: ET.Element, com_spec: SenderComSpec):
@@ -241,18 +336,18 @@ class ARXMLWriter(AbstractARXMLWriter):
241
336
  self.setChildElementOptionalLiteral(element, "HANDLE-OUT-OF-RANGE", com_spec.getHandleOutOfRange())
242
337
  self.setTransmissionAcknowledgementRequest(element, com_spec.getTransmissionAcknowledge())
243
338
  self.setChildElementOptionalBooleanValue(element, "USES-END-TO-END-PROTECTION", com_spec.getUsesEndToEndProtection())
244
-
339
+
245
340
  def setNonqueuedSenderComSpec(self, element: ET.Element, com_spec: NonqueuedSenderComSpec):
246
341
  child_element = ET.SubElement(element, "NONQUEUED-SENDER-COM-SPEC")
247
342
  self.writeARObjectAttributes(child_element, com_spec)
248
343
  self.setSenderComSpec(child_element, com_spec)
249
344
  self.setValueSpecification(child_element, "INIT-VALUE", com_spec.getInitValue())
250
-
345
+
251
346
  def setServerComSpec(self, element: ET.Element, com_spec: ServerComSpec):
252
347
  child_element = ET.SubElement(element, "SERVER-COM-SPEC")
253
348
  self.writeARObjectAttributes(child_element, com_spec)
254
349
  self.setChildElementOptionalRefType(child_element, "OPERATION-REF", com_spec.getOperationRef())
255
- self.setChildElementOptionalNumericalValue(child_element, "QUEUE-LENGTH", com_spec.getQueueLength())
350
+ self.setChildElementOptionalNumericalValue(child_element, "QUEUE-LENGTH", com_spec.getQueueLength())
256
351
 
257
352
  def setQueuedSenderComSpec(self, element: ET.Element, com_spec: QueuedSenderComSpec):
258
353
  child_element = ET.SubElement(element, "QUEUED-SENDER-COM-SPEC")
@@ -283,14 +378,14 @@ class ARXMLWriter(AbstractARXMLWriter):
283
378
  self.setModeSwitchSenderComSpec(com_specs_tag, com_spec)
284
379
  else:
285
380
  self.notImplemented("Unsupported PPortComSpec %s" % type(com_spec))
286
-
287
- def setApplicationCompositeElementInPortInterfaceInstanceRef(self, element: ET.Element, key:str, iref: ApplicationCompositeElementInPortInterfaceInstanceRef):
381
+
382
+ def setApplicationCompositeElementInPortInterfaceInstanceRef(self, element: ET.Element, key: str, iref: ApplicationCompositeElementInPortInterfaceInstanceRef): # noqa E501
288
383
  if iref is not None:
289
384
  child_element = ET.SubElement(element, key)
290
385
  self.setChildElementOptionalRefType(child_element, "ROOT-DATA-PROTOTYPE-REF", iref.root_data_prototype_ref)
291
386
  self.setChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF", iref.target_data_prototype_ref)
292
387
  return iref
293
-
388
+
294
389
  def setCompositeNetworkRepresentation(self, element: ET.Element, representation: CompositeNetworkRepresentation):
295
390
  if representation is not None:
296
391
  self.logger.debug("setCompositeNetworkRepresentation")
@@ -335,28 +430,21 @@ class ARXMLWriter(AbstractARXMLWriter):
335
430
  def writeValueSpecification(self, element: ET.Element, value_spec: ValueSpecification):
336
431
  if value_spec is not None:
337
432
  self.writeARObjectAttributes(element, value_spec)
338
- self.setChildElementOptionalLiteral(element, "SHORT-LABEL", value_spec.getShortLabel())
339
-
340
- def setApplicationValueSpecification(self, element: ET.Element, value_spec: ApplicationValueSpecification):
341
- if value_spec is not None:
342
- value_spec_tag = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
343
- self.writeValueSpecification(value_spec_tag, value_spec)
344
- self.setChildElementOptionalLiteral(value_spec_tag, "CATEGORY", value_spec.getCategory())
345
- self.writeSwValueCont(value_spec_tag, value_spec.getSwValueCont())
433
+ self.setChildElementOptionalLiteral(element, "SHORT-LABEL", value_spec.getShortLabel())
346
434
 
347
- def setTextValueSpecification(self, element: ET.Element, value_spec: TextValueSpecification):
435
+ def writeTextValueSpecification(self, element: ET.Element, value_spec: TextValueSpecification):
348
436
  if value_spec is not None:
349
437
  value_spec_tag = ET.SubElement(element, "TEXT-VALUE-SPECIFICATION")
350
438
  self.writeValueSpecification(value_spec_tag, value_spec)
351
439
  self.setChildElementOptionalLiteral(value_spec_tag, "VALUE", value_spec.getValue())
352
440
 
353
- def setNumericalValueSpecification(self, element: ET.Element, value_spec: NumericalValueSpecification):
441
+ def writeNumericalValueSpecification(self, element: ET.Element, value_spec: NumericalValueSpecification):
354
442
  if value_spec is not None:
355
443
  value_spec_tag = ET.SubElement(element, "NUMERICAL-VALUE-SPECIFICATION")
356
444
  self.writeValueSpecification(value_spec_tag, value_spec)
357
445
  self.setChildElementOptionalFloatValue(value_spec_tag, "VALUE", value_spec.getValue())
358
446
 
359
- def setArrayValueSpecification(self, element: ET.Element, value_spec: ArrayValueSpecification):
447
+ def writeArrayValueSpecification(self, element: ET.Element, value_spec: ArrayValueSpecification):
360
448
  value_spec_tag = ET.SubElement(element, "ARRAY-VALUE-SPECIFICATION")
361
449
  self.writeValueSpecification(value_spec_tag, value_spec)
362
450
  sub_elements = value_spec.getElements()
@@ -364,18 +452,18 @@ class ARXMLWriter(AbstractARXMLWriter):
364
452
  elements_tag = ET.SubElement(value_spec_tag, "ELEMENTS")
365
453
  for sub_element in sub_elements:
366
454
  if isinstance(sub_element, NumericalValueSpecification):
367
- self.setNumericalValueSpecification(elements_tag, sub_element)
455
+ self.writeNumericalValueSpecification(elements_tag, sub_element)
368
456
  elif isinstance(sub_element, ApplicationValueSpecification):
369
- self.setApplicationValueSpecification(elements_tag, sub_element)
457
+ self.writeApplicationValueSpecification(elements_tag, sub_element)
370
458
  elif isinstance(sub_element, TextValueSpecification):
371
- self.setTextValueSpecification(elements_tag, sub_element)
459
+ self.writeTextValueSpecification(elements_tag, sub_element)
372
460
  elif isinstance(sub_element, ArrayValueSpecification):
373
- self.setArrayValueSpecification(elements_tag, sub_element)
461
+ self.writeArrayValueSpecification(elements_tag, sub_element)
374
462
  elif isinstance(sub_element, RecordValueSpecification):
375
- self.setRecordValueSpecification(elements_tag, sub_element)
463
+ self.writeRecordValueSpecification(elements_tag, sub_element)
376
464
  else:
377
465
  self.notImplemented("Unsupported element type of <%s> of ArrayValueSpecification" % type(sub_element))
378
-
466
+
379
467
  def setConstantReference(self, element: ET.Element, value_spec: ConstantReference):
380
468
  value_spec_tag = ET.SubElement(element, "CONSTANT-REFERENCE")
381
469
  self.writeValueSpecification(value_spec_tag, value_spec)
@@ -385,17 +473,17 @@ class ARXMLWriter(AbstractARXMLWriter):
385
473
  if value_spec is not None:
386
474
  child_element = ET.SubElement(element, key)
387
475
  if isinstance(value_spec, ApplicationValueSpecification):
388
- self.setApplicationValueSpecification(child_element, value_spec)
476
+ self.writeApplicationValueSpecification(child_element, value_spec)
389
477
  elif isinstance(value_spec, TextValueSpecification):
390
- self.setTextValueSpecification(child_element, value_spec)
478
+ self.writeTextValueSpecification(child_element, value_spec)
391
479
  elif isinstance(value_spec, ConstantReference):
392
480
  self.setConstantReference(child_element, value_spec)
393
481
  elif isinstance(value_spec, NumericalValueSpecification):
394
- self.setNumericalValueSpecification(child_element, value_spec)
482
+ self.writeNumericalValueSpecification(child_element, value_spec)
395
483
  elif isinstance(value_spec, ArrayValueSpecification):
396
- self.setArrayValueSpecification(child_element, value_spec)
484
+ self.writeArrayValueSpecification(child_element, value_spec)
397
485
  elif isinstance(value_spec, RecordValueSpecification):
398
- self.setRecordValueSpecification(child_element, value_spec)
486
+ self.writeRecordValueSpecification(child_element, value_spec)
399
487
  else:
400
488
  self.notImplemented("Unsupported ValueSpecification %s" % type(value_spec))
401
489
 
@@ -471,7 +559,7 @@ class ARXMLWriter(AbstractARXMLWriter):
471
559
  if len(com_specs) > 0:
472
560
  com_specs_tag = ET.SubElement(element, "REQUIRED-COM-SPECS")
473
561
  for com_spec in com_specs:
474
- self.writeRPortComSpec(com_specs_tag, com_spec)
562
+ self.writeRPortComSpec(com_specs_tag, com_spec)
475
563
 
476
564
  def writeRPortPrototype(self, ports_tag: ET.Element, prototype: RPortPrototype):
477
565
  self.logger.debug("write RPortPrototype %s" % prototype.getShortName())
@@ -487,21 +575,24 @@ class ARXMLWriter(AbstractARXMLWriter):
487
575
  self.setAbstractProvidedPortPrototype(prototype_tag, prototype)
488
576
  self.setAbstractRequiredPortPrototype(prototype_tag, prototype)
489
577
  self.setChildElementOptionalRefType(prototype_tag, "PROVIDED-REQUIRED-INTERFACE-TREF", prototype.getProvidedRequiredInterface())
490
-
491
- def writePortPrototypes(self, ports_tag: ET.Element, port_prototypes: List[PortPrototype]):
492
- for port_prototype in port_prototypes:
493
- if isinstance(port_prototype, PPortPrototype):
494
- self.writePPortPrototype(ports_tag, port_prototype)
495
- elif isinstance(port_prototype, RPortPrototype):
496
- self.writeRPortPrototype(ports_tag, port_prototype)
497
- elif isinstance(port_prototype, PRPortPrototype):
498
- self.writePRPortPrototype(ports_tag, port_prototype)
499
- else:
500
- self._raiseError("Invalid PortPrototype")
578
+
579
+ def writeSwComponentTypePorts(self, element: ET.Element, sw_component: SwComponentType):
580
+ ports = sw_component.getPorts()
581
+ if len(ports) > 0:
582
+ child_element = ET.SubElement(element, "PORTS")
583
+ for port in ports:
584
+ if isinstance(port, PPortPrototype):
585
+ self.writePPortPrototype(child_element, port)
586
+ elif isinstance(port, RPortPrototype):
587
+ self.writeRPortPrototype(child_element, port)
588
+ elif isinstance(port, PRPortPrototype):
589
+ self.writePRPortPrototype(child_element, port)
590
+ else:
591
+ self.notImplemented("Unsupported Port Prototype <%s>" % type(port))
501
592
 
502
593
  def writeInnerGroupIRef(self, element: ET.Element, inner_group_iref: InnerPortGroupInCompositionInstanceRef):
503
594
  child_element = ET.SubElement(element, "INNER-GROUP-IREF")
504
- #self.setChildElementOptionalRefType(child_element, "CONTEXT-REF", inner_group_iref.contextRef)
595
+ # self.setChildElementOptionalRefType(child_element, "CONTEXT-REF", inner_group_iref.contextRef)
505
596
  self.setChildElementOptionalRefType(child_element, "TARGET-REF", inner_group_iref.getTargetRef())
506
597
 
507
598
  def writePortGroupInnerGroupIRefs(self, element: ET.Element, parent: PortGroup):
@@ -535,10 +626,7 @@ class ARXMLWriter(AbstractARXMLWriter):
535
626
 
536
627
  def writeSwComponentType(self, element: ET.Element, sw_component: SwComponentType):
537
628
  self.writeIdentifiable(element, sw_component)
538
- port_prototypes = sw_component.getPortPrototypes()
539
- if len(port_prototypes) > 0:
540
- ports_tag = ET.SubElement(element, "PORTS")
541
- self.writePortPrototypes(ports_tag, port_prototypes)
629
+ self.writeSwComponentTypePorts(element, sw_component)
542
630
  self.writeSwComponentTypePortGroups(element, sw_component)
543
631
 
544
632
  def writeSwComponentPrototype(self, element: ET.Element, prototype: SwComponentPrototype):
@@ -546,17 +634,19 @@ class ARXMLWriter(AbstractARXMLWriter):
546
634
  self.writeIdentifiable(prototype_tag, prototype)
547
635
  self.setChildElementOptionalRefType(prototype_tag, "TYPE-TREF", prototype.getTypeTRef())
548
636
 
549
- def writeSwComponentPrototypes(self, element: ET.Element, sw_component: CompositionSwComponentType):
550
- prototypes = sw_component.getSwComponentPrototypes()
551
- if len(prototypes) > 0:
637
+ def writeCompositionSwComponentTypeComponents(self, element: ET.Element, sw_component: CompositionSwComponentType):
638
+ components = sw_component.getComponents()
639
+ if len(components) > 0:
552
640
  components_tag = ET.SubElement(element, "COMPONENTS")
553
- for prototype in prototypes:
554
- self.writeSwComponentPrototype(components_tag, prototype)
641
+ for component in components:
642
+ if isinstance(component, SwComponentPrototype):
643
+ self.writeSwComponentPrototype(components_tag, component)
644
+ else:
645
+ self.notImplemented("Unsupported Component <%s>" % type(component))
555
646
 
556
647
  def writeAssemblySwConnector(self, element: ET.Element, sw_connector: AssemblySwConnector):
557
648
  child_element = ET.SubElement(element, "ASSEMBLY-SW-CONNECTOR")
558
- self.writeIdentifiable(child_element, sw_connector)
559
- self.setChildElementOptionalRefType(child_element, "MAPPING-REF", sw_connector.getMappingRef())
649
+ self.writeSwConnector(child_element, sw_connector)
560
650
 
561
651
  if sw_connector.getProviderIRef() is not None:
562
652
  provider_iref_tag = ET.SubElement(child_element, "PROVIDER-IREF")
@@ -592,27 +682,23 @@ class ARXMLWriter(AbstractARXMLWriter):
592
682
 
593
683
  if sw_connector.getOuterPortRef() is not None:
594
684
  self.setChildElementOptionalRefType(connector_tag, "OUTER-PORT-REF", sw_connector.getOuterPortRef())
595
- #self.writeChildOptionalRefElement(requester_iref_tag, "TARGET-R-PORT-REF", sw_connector.requester_iref.target_r_port_ref)
685
+ # self.writeChildOptionalRefElement(requester_iref_tag, "TARGET-R-PORT-REF", sw_connector.requester_iref.target_r_port_ref)
596
686
 
597
687
  def writeSwConnector(self, element: ET.Element, sw_connector: SwConnector):
598
- if isinstance(sw_connector, AssemblySwConnector):
599
- self.writeAssemblySwConnector(element, sw_connector)
600
- elif isinstance(sw_connector, DelegationSwConnector):
601
- self.writeDelegationSwConnector(element, sw_connector)
602
- else:
603
- self.notImplemented("Unsupported Sw Connector %s")
688
+ self.writeIdentifiable(element, sw_connector)
689
+ self.setChildElementOptionalRefType(element, "MAPPING-REF", sw_connector.getMappingRef())
604
690
 
605
- def writeSwConnectors(self, element: ET.Element, sw_component: CompositionSwComponentType):
691
+ def writeCompositionSwComponentTypeSwConnectors(self, element: ET.Element, sw_component: CompositionSwComponentType):
606
692
  sw_connectors = sw_component.getSwConnectors()
607
693
  if len(sw_connectors) > 0:
608
- connectors_tag = ET.SubElement(element, "CONNECTORS")
609
- # Change the implementation to compatible with AUTOSAR builder
694
+ child_element = ET.SubElement(element, "CONNECTORS")
610
695
  for sw_connector in sw_connectors:
611
- self.writeSwConnector(connectors_tag, sw_connector)
612
- #for sw_connector in sw_component.getAssemblySwConnectors():
613
- # self.writeSwConnector(connectors_tag, sw_connector)
614
- #for sw_connector in sw_component.getDelegationSwConnectors():
615
- # self.writeSwConnector(connectors_tag, sw_connector)
696
+ if isinstance(sw_connector, AssemblySwConnector):
697
+ self.writeAssemblySwConnector(child_element, sw_connector)
698
+ elif isinstance(sw_connector, DelegationSwConnector):
699
+ self.writeDelegationSwConnector(child_element, sw_connector)
700
+ else:
701
+ self.notImplemented("Unsupported Sw Connector %s" % type(sw_connector))
616
702
 
617
703
  def writeCompositionSwComponentTypeDataTypeMappingSet(self, element: ET.Element, parent: CompositionSwComponentType):
618
704
  data_type_mappings = parent.getDataTypeMappings()
@@ -626,8 +712,8 @@ class ARXMLWriter(AbstractARXMLWriter):
626
712
  child_element = ET.SubElement(parent, "COMPOSITION-SW-COMPONENT-TYPE")
627
713
 
628
714
  self.writeSwComponentType(child_element, sw_component)
629
- self.writeSwComponentPrototypes(child_element, sw_component)
630
- self.writeSwConnectors(child_element, sw_component)
715
+ self.writeCompositionSwComponentTypeComponents(child_element, sw_component)
716
+ self.writeCompositionSwComponentTypeSwConnectors(child_element, sw_component)
631
717
  self.writeCompositionSwComponentTypeDataTypeMappingSet(child_element, sw_component)
632
718
 
633
719
  def writeCompositionSwComponentTypes(self, element: ET.Element, ar_package: ARPackage):
@@ -671,7 +757,7 @@ class ARXMLWriter(AbstractARXMLWriter):
671
757
  self.setChildElementOptionalLiteral(element, "ANNOTATION-ORIGIN", annotation.getAnnotationOrigin())
672
758
  self.setDocumentationBlock(element, "ANNOTATION-TEXT", annotation.getAnnotationText())
673
759
 
674
- def setAnnotations(self, element: ET.Element, annotations: List[Annotation]) :
760
+ def setAnnotations(self, element: ET.Element, annotations: List[Annotation]):
675
761
  if len(annotations) > 0:
676
762
  annotations_tag = ET.SubElement(element, "ANNOTATIONS")
677
763
  for annotation in annotations:
@@ -683,7 +769,7 @@ class ARXMLWriter(AbstractARXMLWriter):
683
769
  self.writeARObjectAttributes(child_element, props)
684
770
  self.setChildElementOptionalRefType(child_element, "INPUT-VARIABLE-TYPE-REF", props.getInputVariableTypeRef())
685
771
  self.setChildElementOptionalRefType(child_element, "COMPU-METHOD-REF", props.getCompuMethodRef())
686
- self.setChildElementOptionalNumericalValue(child_element, "SW-MAX-AXIS-POINTS", props.getSwMaxAxisPoints())
772
+ self.setChildElementOptionalNumericalValue(child_element, "SW-MAX-AXIS-POINTS", props.getSwMaxAxisPoints())
687
773
  self.setChildElementOptionalNumericalValue(child_element, "SW-MIN-AXIS-POINTS", props.getSwMinAxisPoints())
688
774
  self.setChildElementOptionalRefType(child_element, "DATA-CONSTR-REF", props.getDataConstrRef())
689
775
 
@@ -703,7 +789,7 @@ class ARXMLWriter(AbstractARXMLWriter):
703
789
  elif isinstance(axis.sw_calprm_axis_type_props, SwAxisGrouped):
704
790
  self.setSwAxisGrouped(child_element, axis.sw_calprm_axis_type_props)
705
791
  else:
706
- self._raiseError("Unsupported SwCalprmAxisTypeProps %s" % type(axis.sw_calprm_axis_type_props))
792
+ self.notImplemented("Unsupported SwCalprmAxisTypeProps %s" % type(axis.sw_calprm_axis_type_props))
707
793
 
708
794
  def setSwCalprmAxisSet(self, element: ET.Element, key: str, set: SwCalprmAxisSet):
709
795
  axises = set.getSwCalprmAxises()
@@ -727,11 +813,11 @@ class ARXMLWriter(AbstractARXMLWriter):
727
813
  self.writeARObjectAttributes(conditional_tag, props.conditional)
728
814
  self.setAnnotations(conditional_tag, props.getAnnotations())
729
815
  self.setChildElementOptionalRefType(conditional_tag, "BASE-TYPE-REF", props.getBaseTypeRef())
816
+ self.setChildElementOptionalLiteral(conditional_tag, "SW-CALIBRATION-ACCESS", props.getSwCalibrationAccess())
730
817
  self.setChildElementOptionalRefType(conditional_tag, "COMPU-METHOD-REF", props.getCompuMethodRef())
731
818
  self.setValueSpecification(conditional_tag, "INVALID-VALUE", props.getInvalidValue())
732
819
  self.setChildElementOptionalFloatValue(conditional_tag, "STEP-SIZE", props.getStepSize())
733
820
  self.setChildElementOptionalRefType(conditional_tag, "SW-ADDR-METHOD-REF", props.getSwAddrMethodRef())
734
- self.setChildElementOptionalLiteral(conditional_tag, "SW-CALIBRATION-ACCESS", props.getSwCalibrationAccess())
735
821
  self.setChildElementOptionalRefType(conditional_tag, "DATA-CONSTR-REF", props.getDataConstrRef())
736
822
  self.setChildElementOptionalRefType(conditional_tag, "IMPLEMENTATION-DATA-TYPE-REF", props.getImplementationDataTypeRef())
737
823
  self.setSwCalprmAxisSet(conditional_tag, "SW-CALPRM-AXIS-SET", props.getSwCalprmAxisSet())
@@ -757,29 +843,32 @@ class ARXMLWriter(AbstractARXMLWriter):
757
843
  data_type_tag = ET.SubElement(element, "APPLICATION-PRIMITIVE-DATA-TYPE")
758
844
  self.setApplicationDataType(data_type_tag, data_type)
759
845
 
760
- def setDataPrototype(self, element: ET.Element, prototype: DataPrototype):
846
+ def writeDataPrototype(self, element: ET.Element, prototype: DataPrototype):
847
+ self.writeIdentifiable(element, prototype)
761
848
  self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", prototype.getSwDataDefProps())
762
849
 
763
- def setApplicationCompositeElementDataPrototype(self, element: ET.Element, prototype: ApplicationCompositeElementDataPrototype):
764
- self.writeIdentifiable(element, prototype)
765
- self.setDataPrototype(element, prototype)
850
+ def writeApplicationCompositeElementDataPrototype(self, element: ET.Element, prototype: ApplicationCompositeElementDataPrototype):
851
+ self.writeDataPrototype(element, prototype)
766
852
  self.setChildElementOptionalRefType(element, "TYPE-TREF", prototype.typeTRef)
767
853
 
768
- def setApplicationRecordElement(self, element: ET.Element, prototype: ApplicationRecordElement):
769
- self.setApplicationCompositeElementDataPrototype(element, prototype)
770
-
771
- def writeApplicationRecordElements(self, element: ET.Element, data_type: ApplicationRecordDataType):
772
- records = data_type.getApplicationRecordElements()
773
- if len(records) > 0:
774
- elements_tag = ET.SubElement(element, "ELEMENTS")
775
- for record in records:
776
- child_element = ET.SubElement(elements_tag, "APPLICATION-RECORD-ELEMENT")
777
- self.setApplicationRecordElement(child_element, record)
854
+ def writeApplicationRecordElement(self, element: ET.Element, prototype: ApplicationRecordElement):
855
+ child_element = ET.SubElement(element, "APPLICATION-RECORD-ELEMENT")
856
+ self.writeApplicationCompositeElementDataPrototype(child_element, prototype)
857
+
858
+ def writeApplicationRecordDataTypeElements(self, element: ET.Element, data_type: ApplicationRecordDataType):
859
+ record_elements = data_type.getApplicationRecordElements()
860
+ if len(record_elements) > 0:
861
+ child_element = ET.SubElement(element, "ELEMENTS")
862
+ for record_element in record_elements:
863
+ if isinstance(record_element, ApplicationRecordElement):
864
+ self.writeApplicationRecordElement(child_element, record_element)
865
+ else:
866
+ self.notImplemented("Unsupported ApplicationRecordDataType Element <%s>" % type(record_element))
778
867
 
779
868
  def writeApplicationRecordDataType(self, element: ET.Element, data_type: ApplicationRecordDataType):
780
869
  data_type_tag = ET.SubElement(element, "APPLICATION-RECORD-DATA-TYPE")
781
870
  self.setApplicationDataType(data_type_tag, data_type)
782
- self.writeApplicationRecordElements(data_type_tag, data_type)
871
+ self.writeApplicationRecordDataTypeElements(data_type_tag, data_type)
783
872
 
784
873
  def writeApplicationDataTypes(self, parent: ET.Element, ar_package: ARPackage):
785
874
  for data_type in ar_package.getApplicationDataType():
@@ -840,18 +929,22 @@ class ARXMLWriter(AbstractARXMLWriter):
840
929
  else:
841
930
  self.notImplemented("Unsupported CompuConstContent <%s>" % type(content))
842
931
 
932
+ def setCompuScale(self, element: ET.Element, key: str, compu_scale: CompuScale):
933
+ if compu_scale is not None:
934
+ child_element = ET.SubElement(element, key)
935
+ self.writeARObjectAttributes(child_element, compu_scale)
936
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", compu_scale.getShortLabel())
937
+ self.setChildElementOptionalLiteral(child_element, "SYMBOL", compu_scale.getSymbol())
938
+ self.setMultiLanguageOverviewParagraph(child_element, "DESC", compu_scale.getDesc())
939
+ self.setChildLimitElement(child_element, "LOWER-LIMIT", compu_scale.getLowerLimit())
940
+ self.setChildLimitElement(child_element, "UPPER-LIMIT", compu_scale.getUpperLimit())
941
+ self.writeCompuScaleContents(child_element, compu_scale)
942
+
843
943
  def setCompuScales(self, element: ET.Element, compu_scales: CompuScales):
844
944
  if compu_scales is not None:
845
- compu_scales_tag = ET.SubElement(element, "COMPU-SCALES")
945
+ child_element = ET.SubElement(element, "COMPU-SCALES")
846
946
  for compu_scale in compu_scales.getCompuScales():
847
- child_element = ET.SubElement(compu_scales_tag, "COMPU-SCALE")
848
- self.writeARObjectAttributes(child_element, compu_scale)
849
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", compu_scale.getShortLabel())
850
- self.setChildElementOptionalLiteral(child_element, "SYMBOL", compu_scale.getSymbol())
851
- self.setMultiLanguageOverviewParagraph(child_element, "DESC", compu_scale.getDesc())
852
- self.setChildLimitElement(child_element, "LOWER-LIMIT", compu_scale.getLowerLimit())
853
- self.setChildLimitElement(child_element, "UPPER-LIMIT", compu_scale.getUpperLimit())
854
- self.writeCompuScaleContents(child_element, compu_scale)
947
+ self.setCompuScale(child_element, "COMPU-SCALE", compu_scale)
855
948
 
856
949
  def setCompuConst(self, element: ET.Element, key: str, compu_const: CompuConst):
857
950
  if compu_const is not None:
@@ -860,7 +953,7 @@ class ARXMLWriter(AbstractARXMLWriter):
860
953
  self.setCompuConstContent(child_element, compu_const.getCompuConstContentType())
861
954
 
862
955
  def setCompu(self, element: ET.Element, key: str, compu: Compu):
863
- if compu is not None:
956
+ if compu is not None:
864
957
  child_element = ET.SubElement(element, key)
865
958
  self.writeARObjectAttributes(child_element, compu)
866
959
  self.setCompuScales(child_element, compu.getCompuContent())
@@ -874,13 +967,14 @@ class ARXMLWriter(AbstractARXMLWriter):
874
967
  self.setCompu(child_element, "COMPU-INTERNAL-TO-PHYS", compu_method.getCompuInternalToPhys())
875
968
  self.setCompu(child_element, "COMPU-PHYS-TO-INTERNAL", compu_method.getCompuPhysToInternal())
876
969
 
877
- def setApplicationValueSpecification(self, element: ET.Element, spec: ApplicationValueSpecification):
878
- spec_tag = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
879
- self.setChildElementOptionalLiteral(spec_tag, "SHORT-LABEL", spec.getShortLabel())
880
- self.setChildElementOptionalLiteral(spec_tag, "CATEGORY", spec.category)
881
- self.writeSwValueCont(spec_tag, spec.getSwValueCont())
970
+ def writeApplicationValueSpecification(self, element: ET.Element, value_spec: ApplicationValueSpecification):
971
+ if value_spec is not None:
972
+ child_element = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
973
+ self.writeValueSpecification(child_element, value_spec)
974
+ self.setChildElementOptionalLiteral(child_element, "CATEGORY", value_spec.getCategory())
975
+ self.writeSwValueCont(child_element, value_spec.getSwValueCont())
882
976
 
883
- def setRecordValueSpecification(self, element: ET.Element, spec: RecordValueSpecification):
977
+ def writeRecordValueSpecification(self, element: ET.Element, spec: RecordValueSpecification):
884
978
  child_element = ET.SubElement(element, "RECORD-VALUE-SPECIFICATION")
885
979
  self.writeARObjectAttributes(child_element, spec)
886
980
  self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", spec.getShortLabel())
@@ -889,15 +983,15 @@ class ARXMLWriter(AbstractARXMLWriter):
889
983
  fields_tag = ET.SubElement(child_element, "FIELDS")
890
984
  for field in fields:
891
985
  if isinstance(field, ApplicationValueSpecification):
892
- self.setApplicationValueSpecification(fields_tag, field)
986
+ self.writeApplicationValueSpecification(fields_tag, field)
893
987
  elif isinstance(field, NumericalValueSpecification):
894
- self.setNumericalValueSpecification(fields_tag, field)
988
+ self.writeNumericalValueSpecification(fields_tag, field)
895
989
  elif isinstance(field, TextValueSpecification):
896
- self.setTextValueSpecification(fields_tag, field)
990
+ self.writeTextValueSpecification(fields_tag, field)
897
991
  elif isinstance(field, ArrayValueSpecification):
898
- self.setArrayValueSpecification(fields_tag, field)
992
+ self.writeArrayValueSpecification(fields_tag, field)
899
993
  elif isinstance(field, RecordValueSpecification):
900
- self.setRecordValueSpecification(fields_tag, field)
994
+ self.writeRecordValueSpecification(fields_tag, field)
901
995
  else:
902
996
  self.notImplemented("Unsupported Field <%s>" % type(field))
903
997
 
@@ -941,7 +1035,7 @@ class ARXMLWriter(AbstractARXMLWriter):
941
1035
  def writeDataConstr(self, element: ET.Element, constr: DataConstr):
942
1036
  child_element = ET.SubElement(element, "DATA-CONSTR")
943
1037
  self.writeIdentifiable(child_element, constr)
944
- self.writeDataConstrRules(child_element, constr)
1038
+ self.writeDataConstrRules(child_element, constr)
945
1039
 
946
1040
  def writeUnit(self, element: ET.Element, unit: Unit):
947
1041
  self.logger.debug("writeUnit %s" % unit.getShortName())
@@ -957,7 +1051,7 @@ class ARXMLWriter(AbstractARXMLWriter):
957
1051
  self.writeARObjectAttributes(child_element, iref)
958
1052
  self.setChildElementOptionalRefType(child_element, "BASE", iref.getBaseRef())
959
1053
  self.setChildElementOptionalRefType(child_element, "CONTEXT-PORT-REF", iref.getContextPortRef())
960
- self.setChildElementOptionalRefType(child_element, "CONTEXT-MODE-DECLARATION-GROUP-PROTOTYPE-REF", iref.getContextModeDeclarationGroupPrototypeRef())
1054
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-MODE-DECLARATION-GROUP-PROTOTYPE-REF", iref.getContextModeDeclarationGroupPrototypeRef()) # noqa E501
961
1055
  self.setChildElementOptionalRefType(child_element, "TARGET-MODE-DECLARATION-REF", iref.getTargetModeDeclarationRef())
962
1056
 
963
1057
  def setPOperationInAtomicSwcInstanceRef(self, element: ET.Element, key: str, iref: POperationInAtomicSwcInstanceRef):
@@ -1037,7 +1131,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1037
1131
  child_element = ET.SubElement(element, "BACKGROUND-EVENT")
1038
1132
  self.setRTEEvent(child_element, event)
1039
1133
 
1040
- def writeRTEEvents(self, element: ET.Element, parent: SwcInternalBehavior):
1134
+ def writeSwcInternalBehaviorEvents(self, element: ET.Element, parent: SwcInternalBehavior):
1041
1135
  events = parent.getRteEvents()
1042
1136
  if len(events) > 0:
1043
1137
  child_element = ET.SubElement(element, "EVENTS")
@@ -1079,11 +1173,20 @@ class ARXMLWriter(AbstractARXMLWriter):
1079
1173
  for ref in refs:
1080
1174
  self.setChildElementOptionalRefType(refs_tag, "DATA-TYPE-MAPPING-REF", ref)
1081
1175
 
1176
+ def writeInternalBehaviorStaticMemories(self, element: ET.Element, behavior: InternalBehavior):
1177
+ memories = behavior.getStaticMemories()
1178
+ if len(memories) > 0:
1179
+ child_element = ET.SubElement(element, "STATIC-MEMORYS")
1180
+ for memory in memories:
1181
+ if isinstance(memory, VariableDataPrototype):
1182
+ self.writeVariableDataPrototype(child_element, memory)
1183
+
1082
1184
  def writeInternalBehavior(self, element: ET.Element, behavior: InternalBehavior):
1083
1185
  self.writeIdentifiable(element, behavior)
1084
- self.setParameterDataPrototypes(element, "CONSTANT-MEMORYS", behavior.getConstantMemories())
1186
+ self.writeSwcInternalBehaviorParameterDataPrototypes(element, "CONSTANT-MEMORYS", behavior.getConstantMemories())
1085
1187
  self.writeDataTypeMappingRefs(element, behavior)
1086
1188
  self.writeExclusiveAreas(element, behavior)
1189
+ self.writeInternalBehaviorStaticMemories(element, behavior)
1087
1190
 
1088
1191
  def setAutosarVariableRef(self, element: ET.Element, key: str, ref: AutosarVariableRef):
1089
1192
  if ref is not None:
@@ -1091,9 +1194,9 @@ class ARXMLWriter(AbstractARXMLWriter):
1091
1194
  self.writeARObjectAttributes(child_element, ref)
1092
1195
  if ref.getAutosarVariableIRef() is not None:
1093
1196
  child_element = ET.SubElement(child_element, "AUTOSAR-VARIABLE-IREF")
1094
- #self.setARObjectAttributes(child_element, ref)
1197
+ # self.setARObjectAttributes(child_element, ref)
1095
1198
  self.setChildElementOptionalRefType(child_element, "PORT-PROTOTYPE-REF", ref.getAutosarVariableIRef().getPortPrototypeRef())
1096
- self.setChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF", ref.getAutosarVariableIRef().getTargetDataPrototypeRef())
1199
+ self.setChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF", ref.getAutosarVariableIRef().getTargetDataPrototypeRef()) # noqa E501
1097
1200
  self.setChildElementOptionalRefType(child_element, "LOCAL-VARIABLE-REF", ref.getLocalVariableRef())
1098
1201
 
1099
1202
  def setComponentInSystemInstanceRef(self, element: ET.Element, tag_name: str, ref: ComponentInSystemInstanceRef):
@@ -1119,42 +1222,42 @@ class ARXMLWriter(AbstractARXMLWriter):
1119
1222
  self.writeIdentifiable(child_element, parameter_access)
1120
1223
  self.setAutosarParameterRef(child_element, "ACCESSED-PARAMETER", parameter_access.getAccessedParameter())
1121
1224
 
1122
- def writeParameterAccesses(self, element: ET.Element, entity: RunnableEntity):
1225
+ def writeRunnableEntityParameterAccesses(self, element: ET.Element, entity: RunnableEntity):
1123
1226
  parameter_accesses = entity.getParameterAccesses()
1124
1227
  if len(parameter_accesses) > 0:
1125
1228
  child_element = ET.SubElement(element, "PARAMETER-ACCESSS")
1126
1229
  for parameter_access in parameter_accesses:
1127
1230
  self.writeParameterAccess(child_element, parameter_access)
1128
1231
 
1129
- def writeDataReceivePointByArguments(self, element: ET.Element, entity: RunnableEntity):
1232
+ def writeRunnableEntityDataReceivePointByArguments(self, element: ET.Element, entity: RunnableEntity):
1130
1233
  accesses = entity.getDataReceivePointByArguments()
1131
1234
  if len(accesses) > 0:
1132
1235
  child_element = ET.SubElement(element, "DATA-RECEIVE-POINT-BY-ARGUMENTS")
1133
1236
  for access in accesses:
1134
1237
  self.setVariableAccess(child_element, access)
1135
1238
 
1136
- def writeDataSendPoints(self, element: ET.Element, entity: RunnableEntity):
1239
+ def writeRunnableEntityDataSendPoints(self, element: ET.Element, entity: RunnableEntity):
1137
1240
  points = entity.getDataSendPoints()
1138
1241
  if len(points) > 0:
1139
1242
  child_element = ET.SubElement(element, "DATA-SEND-POINTS")
1140
1243
  for point in points:
1141
1244
  self.setVariableAccess(child_element, point)
1142
1245
 
1143
- def writeDataReadAccesses(self, element: ET.Element, entity: RunnableEntity):
1246
+ def writeRunnableEntityDataReadAccesses(self, element: ET.Element, entity: RunnableEntity):
1144
1247
  accesses = entity.getDataReadAccesses()
1145
1248
  if len(accesses) > 0:
1146
1249
  child_element = ET.SubElement(element, "DATA-READ-ACCESSS")
1147
1250
  for access in accesses:
1148
1251
  self.setVariableAccess(child_element, access)
1149
1252
 
1150
- def writeDataWriteAccesses(self, element: ET.Element, entity: RunnableEntity):
1253
+ def writeRunnableEntityDataWriteAccesses(self, element: ET.Element, entity: RunnableEntity):
1151
1254
  accesses = entity.getDataWriteAccesses()
1152
1255
  if len(accesses) > 0:
1153
1256
  child_element = ET.SubElement(element, "DATA-WRITE-ACCESSS")
1154
1257
  for access in accesses:
1155
1258
  self.setVariableAccess(child_element, access)
1156
1259
 
1157
- def writeReadLocalVariables(self, element: ET.Element, entity: RunnableEntity):
1260
+ def writeRunnableEntityReadLocalVariables(self, element: ET.Element, entity: RunnableEntity):
1158
1261
  variables = entity.getReadLocalVariables()
1159
1262
  if len(variables) > 0:
1160
1263
  child_element = ET.SubElement(element, "READ-LOCAL-VARIABLES")
@@ -1182,7 +1285,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1182
1285
  self.writeIdentifiable(child_element, call_point)
1183
1286
  self.setServerCallPoint(child_element, call_point)
1184
1287
 
1185
- def writeServerCallPoints(self, element: ET.Element, entity: RunnableEntity):
1288
+ def writeRunnableEntityServerCallPoints(self, element: ET.Element, entity: RunnableEntity):
1186
1289
  call_points = entity.getServerCallPoints()
1187
1290
  if len(call_points) > 0:
1188
1291
  child_element = ET.SubElement(element, "SERVER-CALL-POINTS")
@@ -1192,44 +1295,81 @@ class ARXMLWriter(AbstractARXMLWriter):
1192
1295
  elif isinstance(call_point, AsynchronousServerCallPoint):
1193
1296
  self.setAsynchronousServerCallPoint(child_element, call_point)
1194
1297
  else:
1195
- self._raiseError("Unsupported ServerCallPoint type <%s>" % type(call_point))
1298
+ self.notImplemented("Unsupported ServerCallPoint type <%s>" % type(call_point))
1196
1299
 
1197
- def writeWrittenLocalVariable(self, element: ET.Element, entity: RunnableEntity):
1300
+ def writeRunnableEntityWrittenLocalVariable(self, element: ET.Element, entity: RunnableEntity):
1198
1301
  variables = entity.getWrittenLocalVariables()
1199
1302
  if len(variables) > 0:
1200
1303
  child_element = ET.SubElement(element, "WRITTEN-LOCAL-VARIABLES")
1201
1304
  for access in variables:
1202
1305
  self.setVariableAccess(child_element, access)
1203
1306
 
1204
- def setRModeGroupInAtomicSWCInstanceRef(self, element: ET.Element, tag: str, iref: RModeGroupInAtomicSWCInstanceRef):
1205
- if iref is not None:
1206
- child_element = ET.SubElement(element, tag)
1207
- instance_ref_tag = ET.SubElement(child_element, "R-MODE-GROUP-IN-ATOMIC-SWC-INSTANCE-REF")
1208
- self.setChildElementOptionalRefType(instance_ref_tag, "CONTEXT-R-PORT-REF", iref.getContextRPortRef())
1209
- self.setChildElementOptionalRefType(instance_ref_tag, "TARGET-MODE-GROUP-REF", iref.getTargetModeGroupRef())
1307
+ def writeModeGroupInAtomicSwcInstanceRef(self, element: ET.Element, instance_ref: ModeGroupInAtomicSwcInstanceRef):
1308
+ self.setChildElementOptionalRefType(element, "BASE-REF", instance_ref.getBaseRef())
1309
+ self.setChildElementOptionalRefType(element, "CONTEXT-PORT-REF", instance_ref.getContextPortRef())
1210
1310
 
1211
- def setPModeGroupInAtomicSWCInstanceRef(self, element: ET.Element, tag: str, iref: PModeGroupInAtomicSwcInstanceRef):
1212
- if iref is not None:
1213
- child_element = ET.SubElement(element, tag)
1214
- self.setChildElementOptionalRefType(child_element, "CONTEXT-P-PORT-REF", iref.getContextPPortRef())
1215
- self.setChildElementOptionalRefType(child_element, "TARGET-MODE-GROUP-REF", iref.getTargetModeGroupRef())
1311
+ def writeRModeGroupInAtomicSWCInstanceRef(self, element: ET.Element, instance_ref: RModeGroupInAtomicSWCInstanceRef):
1312
+ if instance_ref is not None:
1313
+ child_element = ET.SubElement(element, "R-MODE-GROUP-IN-ATOMIC-SWC-INSTANCE-REF")
1314
+ self.writeModeGroupInAtomicSwcInstanceRef(child_element, instance_ref)
1315
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-R-PORT-REF", instance_ref.getContextRPortRef())
1316
+ self.setChildElementOptionalRefType(child_element, "TARGET-MODE-GROUP-REF", instance_ref.getTargetModeGroupRef())
1216
1317
 
1217
- def writeModeAccessPoints(self, element: ET.Element, entity: RunnableEntity):
1318
+ def writePModeGroupInAtomicSWCInstanceRef(self, element: ET.Element, instance_ref: PModeGroupInAtomicSwcInstanceRef):
1319
+ if instance_ref is not None:
1320
+ child_element = ET.SubElement(element, "P-MODE-GROUP-IN-ATOMIC-SWC-INSTANCE-REF")
1321
+ self.writeModeGroupInAtomicSwcInstanceRef(child_element, instance_ref)
1322
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-P-PORT-REF", instance_ref.getContextPPortRef())
1323
+ self.setChildElementOptionalRefType(child_element, "TARGET-MODE-GROUP-REF", instance_ref.getTargetModeGroupRef())
1324
+
1325
+ def setModeGroupIRef(self, element: ET.Element, key: str, instance_ref: ModeGroupInAtomicSwcInstanceRef):
1326
+ if instance_ref is not None:
1327
+ child_element = ET.SubElement(element, key)
1328
+ if isinstance(instance_ref, PModeGroupInAtomicSwcInstanceRef):
1329
+ self.writePModeGroupInAtomicSWCInstanceRef(child_element, instance_ref)
1330
+ elif isinstance(instance_ref, RModeGroupInAtomicSWCInstanceRef):
1331
+ self.writeRModeGroupInAtomicSWCInstanceRef(child_element, instance_ref)
1332
+ else:
1333
+ self.notImplemented("Unsupported Mode Group IRef <%s>" % type(instance_ref))
1334
+ return instance_ref
1335
+
1336
+ def writeModeAccessPoint(self, element: ET.Element, point: ModeAccessPoint):
1337
+ if point is not None:
1338
+ child_element = ET.SubElement(element, "MODE-ACCESS-POINT")
1339
+ self.setModeGroupIRef(child_element, "MODE-GROUP-IREF", point.getModeGroupIRef())
1340
+
1341
+ def writeRunnableEntityModeAccessPoints(self, element: ET.Element, entity: RunnableEntity):
1218
1342
  points = entity.getModeAccessPoints()
1219
1343
  if len(points) > 0:
1220
- mode_access_points_tag = ET.SubElement(element, "MODE-ACCESS-POINTS")
1344
+ child_element = ET.SubElement(element, "MODE-ACCESS-POINTS")
1221
1345
  for point in points:
1222
- child_element = ET.SubElement(mode_access_points_tag, "MODE-ACCESS-POINT")
1223
- self.setRModeGroupInAtomicSWCInstanceRef(child_element, "MODE-GROUP-IREF", point.getModeGroupIRef())
1224
-
1225
- def writeModeSwitchPoints(self, element: ET.Element, entity: RunnableEntity):
1346
+ if isinstance(point, ModeAccessPoint):
1347
+ self.writeModeAccessPoint(child_element, point)
1348
+ else:
1349
+ self.notImplemented("Unsupported Mode Access Points <%s>" % type(point))
1350
+
1351
+ def writeModeSwitchPointModeGroupIRef(self, element: ET.Element, point: ModeSwitchPoint):
1352
+ if point is not None:
1353
+ child_element = ET.SubElement(element, "MODE-GROUP-IREF")
1354
+ instance_ref = point.getModeGroupIRef()
1355
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-P-PORT-REF", instance_ref.getContextPPortRef())
1356
+ self.setChildElementOptionalRefType(child_element, "TARGET-MODE-GROUP-REF", instance_ref.getTargetModeGroupRef())
1357
+
1358
+ def writeModeSwitchPoint(self, element: ET.Element, point: ModeSwitchPoint):
1359
+ if point is not None:
1360
+ child_element = ET.SubElement(element, "MODE-SWITCH-POINT")
1361
+ self.writeIdentifiable(child_element, point)
1362
+ self.writeModeSwitchPointModeGroupIRef(child_element, point)
1363
+
1364
+ def writeRunnableEntityModeSwitchPoints(self, element: ET.Element, entity: RunnableEntity):
1226
1365
  points = entity.getModeSwitchPoints()
1227
1366
  if len(points) > 0:
1228
- mode_access_points_tag = ET.SubElement(element, "MODE-SWITCH-POINTS")
1367
+ child_element = ET.SubElement(element, "MODE-SWITCH-POINTS")
1229
1368
  for point in points:
1230
- child_element = ET.SubElement(mode_access_points_tag, "MODE-SWITCH-POINT")
1231
- self.writeIdentifiable(child_element, point)
1232
- self.setPModeGroupInAtomicSWCInstanceRef(child_element, "MODE-GROUP-IREF", point.getModeGroupIRef())
1369
+ if isinstance(point, ModeSwitchPoint):
1370
+ self.writeModeSwitchPoint(child_element, point)
1371
+ else:
1372
+ self.notImplemented("unsupported Mode Switch Point <%s>" % type(point))
1233
1373
 
1234
1374
  def setRunnableEntityArgument(self, element: ET.Element, argument: RunnableEntityArgument):
1235
1375
  child_element = ET.SubElement(element, "RUNNABLE-ENTITY-ARGUMENT")
@@ -1245,7 +1385,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1245
1385
  else:
1246
1386
  self.notImplemented("Unsupported argument of Runnable Entity <%s>" % type(argument))
1247
1387
 
1248
- def writeAsynchronousServerCallResultPoint(self, element: ET.Element, entity: RunnableEntity):
1388
+ def writeRunnableEntityAsynchronousServerCallResultPoint(self, element: ET.Element, entity: RunnableEntity):
1249
1389
  points = entity.getAsynchronousServerCallResultPoints()
1250
1390
  if len(points) > 0:
1251
1391
  points_tag = ET.SubElement(element, "ASYNCHRONOUS-SERVER-CALL-RESULT-POINTS")
@@ -1257,23 +1397,23 @@ class ARXMLWriter(AbstractARXMLWriter):
1257
1397
  def writeRunnableEntity(self, element: ET.Element, entity: RunnableEntity):
1258
1398
  if entity is not None:
1259
1399
  child_element = ET.SubElement(element, "RUNNABLE-ENTITY")
1260
- self.setExecutableEntity(child_element, entity)
1400
+ self.writeExecutableEntity(child_element, entity)
1261
1401
  self.writeRunnableEntityArguments(child_element, entity)
1262
- self.writeAsynchronousServerCallResultPoint(child_element, entity)
1402
+ self.writeRunnableEntityAsynchronousServerCallResultPoint(child_element, entity)
1263
1403
  self.setChildElementOptionalBooleanValue(child_element, "CAN-BE-INVOKED-CONCURRENTLY", entity.getCanBeInvokedConcurrently())
1264
- self.writeDataReadAccesses(child_element, entity)
1265
- self.writeDataReceivePointByArguments(child_element, entity)
1266
- self.writeDataSendPoints(child_element, entity)
1267
- self.writeDataWriteAccesses(child_element, entity)
1268
- self.writeModeAccessPoints(child_element, entity)
1269
- self.writeModeSwitchPoints(child_element, entity)
1270
- self.writeParameterAccesses(child_element, entity)
1271
- self.writeReadLocalVariables(child_element, entity)
1272
- self.writeServerCallPoints(child_element, entity)
1404
+ self.writeRunnableEntityDataReadAccesses(child_element, entity)
1405
+ self.writeRunnableEntityDataReceivePointByArguments(child_element, entity)
1406
+ self.writeRunnableEntityDataSendPoints(child_element, entity)
1407
+ self.writeRunnableEntityDataWriteAccesses(child_element, entity)
1408
+ self.writeRunnableEntityModeAccessPoints(child_element, entity)
1409
+ self.writeRunnableEntityModeSwitchPoints(child_element, entity)
1410
+ self.writeRunnableEntityParameterAccesses(child_element, entity)
1411
+ self.writeRunnableEntityReadLocalVariables(child_element, entity)
1412
+ self.writeRunnableEntityServerCallPoints(child_element, entity)
1273
1413
  self.setChildElementOptionalLiteral(child_element, "SYMBOL", entity.symbol)
1274
- self.writeWrittenLocalVariable(child_element, entity)
1414
+ self.writeRunnableEntityWrittenLocalVariable(child_element, entity)
1275
1415
 
1276
- def writeSwcInternalBehaviorRunnableEntities(self, element: ET.Element, behavior: SwcInternalBehavior):
1416
+ def writeSwcInternalBehaviorRunnables(self, element: ET.Element, behavior: SwcInternalBehavior):
1277
1417
  entities = behavior.getRunnableEntities()
1278
1418
  if len(entities) > 0:
1279
1419
  runnables_tag = ET.SubElement(element, "RUNNABLES")
@@ -1291,9 +1431,9 @@ class ARXMLWriter(AbstractARXMLWriter):
1291
1431
  if isinstance(prototype, VariableDataPrototype):
1292
1432
  self.writeVariableDataPrototype(child_element, prototype)
1293
1433
  else:
1294
- self._raiseError("Unsupported ArTypedPerInstanceMemories <%s>" % type(prototype))
1295
-
1296
- def writeExplicitInterRunnableVariables(self, element: ET.Element, behavior: SwcInternalBehavior):
1434
+ self.notImplemented("Unsupported ArTypedPerInstanceMemories <%s>" % type(prototype))
1435
+
1436
+ def writeSwcInternalBehaviorExplicitInterRunnableVariables(self, element: ET.Element, behavior: SwcInternalBehavior):
1297
1437
  prototypes = behavior.getExplicitInterRunnableVariables()
1298
1438
  if len(prototypes) > 0:
1299
1439
  child_element = ET.SubElement(element, "EXPLICIT-INTER-RUNNABLE-VARIABLES")
@@ -1301,9 +1441,9 @@ class ARXMLWriter(AbstractARXMLWriter):
1301
1441
  if isinstance(prototype, VariableDataPrototype):
1302
1442
  self.writeVariableDataPrototype(child_element, prototype)
1303
1443
  else:
1304
- self._raiseError("Unsupported ExplicitInterRunnableVariables <%s>" % type(prototype))
1444
+ self.notImplemented("Unsupported ExplicitInterRunnableVariables <%s>" % type(prototype))
1305
1445
 
1306
- def writePerInstanceMemories(self, element: ET.Element, behavior: SwcInternalBehavior):
1446
+ def writeSwcInternalBehaviorPerInstanceMemories(self, element: ET.Element, behavior: SwcInternalBehavior):
1307
1447
  memories = behavior.getPerInstanceMemories()
1308
1448
  if len(memories) > 0:
1309
1449
  memories_tag = ET.SubElement(element, "PER-INSTANCE-MEMORYS")
@@ -1313,21 +1453,20 @@ class ARXMLWriter(AbstractARXMLWriter):
1313
1453
  self.setChildElementOptionalLiteral(child_element, "INIT-VALUE", memory.getInitValue())
1314
1454
  self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", memory.getSwDataDefProps())
1315
1455
  self.setChildElementOptionalLiteral(child_element, "TYPE", memory.getType())
1316
- self.setChildElementOptionalLiteral (child_element, "TYPE-DEFINITION", memory.getTypeDefinition())
1456
+ self.setChildElementOptionalLiteral(child_element, "TYPE-DEFINITION", memory.getTypeDefinition())
1317
1457
 
1318
- def setParameterDataPrototype(self, element: ET.Element, prototype: ParameterDataPrototype):
1458
+ def writeParameterDataPrototype(self, element: ET.Element, prototype: ParameterDataPrototype):
1319
1459
  child_element = ET.SubElement(element, "PARAMETER-DATA-PROTOTYPE")
1320
- self.writeIdentifiable(child_element, prototype)
1321
- self.setAutosarDataPrototype(child_element, prototype)
1460
+ self.writeAutosarDataPrototype(child_element, prototype)
1322
1461
  self.setValueSpecification(child_element, "INIT-VALUE", prototype.getInitValue())
1323
1462
 
1324
- def setParameterDataPrototypes(self, element: ET.Element, key: str, parameters: List[ParameterDataPrototype]):
1463
+ def writeSwcInternalBehaviorParameterDataPrototypes(self, element: ET.Element, key: str, parameters: List[ParameterDataPrototype]):
1325
1464
  if len(parameters) > 0:
1326
1465
  child_element = ET.SubElement(element, key)
1327
1466
  for parameter in parameters:
1328
- self.setParameterDataPrototype(child_element, parameter)
1467
+ self.writeParameterDataPrototype(child_element, parameter)
1329
1468
 
1330
- def writePortDefinedArgumentValues(self, element: ET.Element, argument_values: List[PortDefinedArgumentValue]) :
1469
+ def writePortDefinedArgumentValues(self, element: ET.Element, argument_values: List[PortDefinedArgumentValue]):
1331
1470
  if len(argument_values) > 0:
1332
1471
  child_element = ET.SubElement(element, "PORT-ARG-VALUES")
1333
1472
  for argument_value in argument_values:
@@ -1336,7 +1475,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1336
1475
  self.setValueSpecification(child_element, "VALUE", argument_value.getValue())
1337
1476
  self.setChildElementOptionalRefType(child_element, "VALUE-TYPE-TREF", argument_value.getValueTypeTRef())
1338
1477
 
1339
- def writePortAPIOptions(self, element: ET.Element, behavior: SwcInternalBehavior):
1478
+ def writeSwcInternalBehaviorPortAPIOptions(self, element: ET.Element, behavior: SwcInternalBehavior):
1340
1479
  options = behavior.getPortAPIOptions()
1341
1480
  if len(options) > 0:
1342
1481
  port_api_options_tag = ET.SubElement(element, "PORT-API-OPTIONS")
@@ -1361,7 +1500,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1361
1500
  if isinstance(data, RoleBasedDataTypeAssignment):
1362
1501
  self.writeRoleBasedDataTypeAssignment(child_element, data)
1363
1502
  else:
1364
- self._raiseError("Unsupported Assigned Data <%s>" % type(data))
1503
+ self.notImplemented("Unsupported Assigned Data <%s>" % type(data))
1365
1504
 
1366
1505
  def writeServiceDependency(self, element: ET.Element, dependency: ServiceDependency):
1367
1506
  self.writeIdentifiable(element, dependency)
@@ -1387,7 +1526,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1387
1526
  if isinstance(data, RoleBasedDataAssignment):
1388
1527
  self.writeRoleBasedDataAssignment(child_element, data)
1389
1528
  else:
1390
- self._raiseError("Unsupported Assigned Data <%s>" % type(data))
1529
+ self.notImplemented("Unsupported Assigned Data <%s>" % type(data))
1391
1530
 
1392
1531
  def writeSwcServiceDependencyAssignedPorts(self, element: ET.Element, dependency: SwcServiceDependency):
1393
1532
  assigned_data = dependency.getAssignedPorts()
@@ -1397,7 +1536,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1397
1536
  if isinstance(data, RoleBasedPortAssignment):
1398
1537
  self.writeRoleBasedPortAssignment(child_element, data)
1399
1538
  else:
1400
- self._raiseError("Unsupported Assigned Data <%s>" % type(data))
1539
+ self.notImplemented("Unsupported Assigned Data <%s>" % type(data))
1401
1540
 
1402
1541
  def setNvBlockNeeds(self, element: ET.Element, needs: NvBlockNeeds):
1403
1542
  child_element = ET.SubElement(element, "NV-BLOCK-NEEDS")
@@ -1427,8 +1566,8 @@ class ARXMLWriter(AbstractARXMLWriter):
1427
1566
  child_element = ET.SubElement(element, "DIAGNOSTIC-COMMUNICATION-MANAGER-NEEDS")
1428
1567
  self.logger.debug("write DiagnosticCommunicationManagerNeeds %s" % needs.getShortName())
1429
1568
  self.writeIdentifiable(child_element, needs)
1430
- self.setChildElementOptionalLiteral(child_element, "SERVICE-REQUEST-CALLBACK-TYPE", needs.getServiceRequestCallbackType())
1431
-
1569
+ self.setChildElementOptionalLiteral(child_element, "SERVICE-REQUEST-CALLBACK-TYPE", needs.getServiceRequestCallbackType())
1570
+
1432
1571
  def setDiagnosticRoutineNeeds(self, element: ET.Element, needs: DiagnosticRoutineNeeds):
1433
1572
  child_element = ET.SubElement(element, "DIAGNOSTIC-ROUTINE-NEEDS")
1434
1573
  self.logger.debug("write DiagnosticRoutineNeeds %s" % needs.getShortName())
@@ -1449,7 +1588,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1449
1588
  def setDiagEventDebounceMonitorInternal(self, element: ET.Element, algorithm: DiagEventDebounceMonitorInternal):
1450
1589
  child_element = ET.SubElement(element, "DIAG-EVENT-DEBOUNCE-MONITOR-INTERNAL")
1451
1590
  self.writeIdentifiable(child_element, algorithm)
1452
-
1591
+
1453
1592
  def writeDiagEventDebounceAlgorithm(self, element: ET.Element, needs: DiagnosticEventNeeds):
1454
1593
  algorithm = needs.getDiagEventDebounceAlgorithm()
1455
1594
  if algorithm is not None:
@@ -1472,7 +1611,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1472
1611
  self.logger.debug("write DiagnosticEventNeeds %s" % needs.getShortName())
1473
1612
  self.writeIdentifiable(child_element, needs)
1474
1613
  self.setChildElementOptionalPositiveInteger(child_element, "UDS-DTC-NUMBER", needs.getUdsDtcNumber())
1475
-
1614
+
1476
1615
  def setCryptoServiceNeeds(self, element: ET.Element, needs: CryptoServiceNeeds):
1477
1616
  child_element = ET.SubElement(element, "CRYPTO-SERVICE-NEEDS")
1478
1617
  self.logger.debug("write CryptoServiceNeeds %s" % needs.getShortName())
@@ -1506,7 +1645,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1506
1645
  elif isinstance(need, EcuStateMgrUserNeeds):
1507
1646
  self.setEcuStateMgrUserNeeds(child_element, need)
1508
1647
  else:
1509
- self.notImplemented("Unsupported service needs <%s>" % type(need))
1648
+ self.notImplemented("Unsupported service needs <%s>" % type(need))
1510
1649
 
1511
1650
  def writeSwcServiceDependency(self, element: ET.Element, dependency: SwcServiceDependency):
1512
1651
  child_element = ET.SubElement(element, "SWC-SERVICE-DEPENDENCY")
@@ -1523,7 +1662,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1523
1662
  if isinstance(dependency, SwcServiceDependency):
1524
1663
  self.writeSwcServiceDependency(child_element, dependency)
1525
1664
  else:
1526
- self._raiseError("Unsupported ServiceDependency <%s>" % type(dependency))
1665
+ self.notImplemented("Unsupported ServiceDependency <%s>" % type(dependency))
1527
1666
 
1528
1667
  def setIncludedDataTypeSets(self, element: ET.Element, sets: List[IncludedDataTypeSet]):
1529
1668
  if len(sets) > 0:
@@ -1537,23 +1676,43 @@ class ARXMLWriter(AbstractARXMLWriter):
1537
1676
  for type_ref in type_refs:
1538
1677
  self.setChildElementOptionalRefType(data_type_refs_tag, "DATA-TYPE-REF", type_ref)
1539
1678
 
1679
+ def writeIncludedModeDeclarationGroupSet(self, element: ET.Element, set: IncludedModeDeclarationGroupSet):
1680
+ if set is not None:
1681
+ child_element = ET.SubElement(element, "INCLUDED-MODE-DECLARATION-GROUP-SET")
1682
+ refs = set.getModeDeclarationGroupRefs()
1683
+ if len(refs) > 0:
1684
+ refs_tag = ET.SubElement(child_element, "MODE-DECLARATION-GROUP-REFS")
1685
+ for ref in refs:
1686
+ self.setChildElementOptionalRefType(refs_tag, "MODE-DECLARATION-GROUP-REF", ref)
1687
+ self.setChildElementOptionalLiteral(child_element, "PREFIX", set.getPrefix())
1688
+
1689
+ def writeSwcInternalBehaviorIncludedModeDeclarationGroupSets(self, element: ET.Element, behavior: SwcInternalBehavior):
1690
+ group_sets = behavior.getIncludedModeDeclarationGroupSets()
1691
+ if len(group_sets) > 0:
1692
+ child_element = ET.SubElement(element, "INCLUDED-MODE-DECLARATION-GROUP-SETS")
1693
+ for group_set in group_sets:
1694
+ if isinstance(group_set, IncludedModeDeclarationGroupSet):
1695
+ self.writeIncludedModeDeclarationGroupSet(child_element, group_set)
1696
+ else:
1697
+ self.notImplemented("Unsupported IncludedModeDeclarationGroupSet <%s>" % type(group_set))
1540
1698
 
1541
1699
  def writeSwcInternalBehavior(self, element: ET.Element, behavior: SwcInternalBehavior):
1542
1700
  self.logger.debug("writeSwInternalBehavior %s" % behavior.getShortName())
1543
-
1544
1701
  child_element = ET.SubElement(element, "SWC-INTERNAL-BEHAVIOR")
1545
1702
  self.writeInternalBehavior(child_element, behavior)
1703
+
1546
1704
  self.writeSwcInternalBehaviorArTypedPerInstanceMemories(child_element, behavior)
1547
- self.writeRTEEvents(child_element, behavior)
1548
- self.writeExplicitInterRunnableVariables(child_element, behavior)
1705
+ self.writeSwcInternalBehaviorEvents(child_element, behavior)
1706
+ self.writeSwcInternalBehaviorExplicitInterRunnableVariables(child_element, behavior)
1549
1707
  self.setChildElementOptionalLiteral(child_element, "HANDLE-TERMINATION-AND-RESTART", behavior.getHandleTerminationAndRestart())
1550
1708
  self.setIncludedDataTypeSets(child_element, behavior.getIncludedDataTypeSets())
1551
- self.writePerInstanceMemories(child_element, behavior)
1552
- self.setParameterDataPrototypes(child_element, "PER-INSTANCE-PARAMETERS", behavior.getPerInstanceParameters())
1553
- self.writePortAPIOptions(child_element, behavior)
1554
- self.writeSwcInternalBehaviorRunnableEntities(child_element, behavior)
1709
+ self.writeSwcInternalBehaviorIncludedModeDeclarationGroupSets(child_element, behavior)
1710
+ self.writeSwcInternalBehaviorPerInstanceMemories(child_element, behavior)
1711
+ self.writeSwcInternalBehaviorParameterDataPrototypes(child_element, "PER-INSTANCE-PARAMETERS", behavior.getPerInstanceParameters())
1712
+ self.writeSwcInternalBehaviorPortAPIOptions(child_element, behavior)
1713
+ self.writeSwcInternalBehaviorRunnables(child_element, behavior)
1555
1714
  self.writeSwcInternalBehaviorServiceDependencies(child_element, behavior)
1556
- self.setParameterDataPrototypes(child_element, "SHARED-PARAMETERS", behavior.getSharedParameters())
1715
+ self.writeSwcInternalBehaviorParameterDataPrototypes(child_element, "SHARED-PARAMETERS", behavior.getSharedParameters())
1557
1716
  self.setChildElementOptionalBooleanValue(child_element, "SUPPORTS-MULTIPLE-INSTANTIATION", behavior.getSupportsMultipleInstantiation())
1558
1717
 
1559
1718
  def writeAtomicSwComponentTypeInternalBehaviors(self, element: ET.Element, behavior: InternalBehavior):
@@ -1562,7 +1721,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1562
1721
  if isinstance(behavior, SwcInternalBehavior):
1563
1722
  self.writeSwcInternalBehavior(behaviors_tag, behavior)
1564
1723
  else:
1565
- self._raiseError("Unsupported Internal Behaviors <%s>" % type(behavior))
1724
+ self.notImplemented("Unsupported Internal Behaviors <%s>" % type(behavior))
1566
1725
 
1567
1726
  def writeAtomicSwComponentType(self, element: ET.Element, sw_component: AtomicSwComponentType):
1568
1727
  self.writeSwComponentType(element, sw_component)
@@ -1598,7 +1757,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1598
1757
  if isinstance(desc, Code):
1599
1758
  self.setCode(child_element, desc)
1600
1759
  else:
1601
- self._raiseError("Unsupported Code Descriptor <%s>" % type(desc))
1760
+ self.notImplemented("Unsupported Code Descriptor <%s>" % type(desc))
1602
1761
 
1603
1762
  def setMemorySectionOptions(self, element: ET.Element, options: List[ARLiteral]):
1604
1763
  if len(options) > 0:
@@ -1663,7 +1822,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1663
1822
  self.writeImplementation(child_element, impl)
1664
1823
  self.setChildElementOptionalRefType(child_element, "BEHAVIOR-REF", impl.getBehaviorRef())
1665
1824
 
1666
- def writeEndToEndDescriptionDataId(self, element: ET.Element, parent: EndToEndDescription):
1825
+ def writeEndToEndDescriptionDataIds(self, element: ET.Element, parent: EndToEndDescription):
1667
1826
  data_ids = parent.getDataIds()
1668
1827
  if len(data_ids) > 0:
1669
1828
  child_element = ET.SubElement(element, "DATA-IDS")
@@ -1673,24 +1832,28 @@ class ARXMLWriter(AbstractARXMLWriter):
1673
1832
  def setEndToEndDescription(self, element: ET.Element, key: str, desc: EndToEndDescription):
1674
1833
  if desc is not None:
1675
1834
  child_element = ET.SubElement(element, key)
1676
- self.setChildElementOptionalLiteral(child_element, "CATEGORY", desc.category)
1677
- self.writeEndToEndDescriptionDataId(child_element, desc)
1678
- self.setChildElementOptionalNumericalValue(child_element, "DATA-ID-MODE", desc.getDataIdMode())
1679
- self.setChildElementOptionalNumericalValue(child_element, "MAX-DELTA-COUNTER-INIT", desc.getMaxDeltaCounterInit())
1680
- self.setChildElementOptionalNumericalValue(child_element, "CRC-OFFSET", desc.getCrcOffset())
1681
- self.setChildElementOptionalNumericalValue(child_element, "COUNTER-OFFSET", desc.getCounterOffset())
1682
-
1683
- def setVariableDataPrototypeInSystemInstanceRef(self, element: ET.Element, key: str, iref: VariableDataPrototypeInSystemInstanceRef):
1684
- if iref is not None:
1835
+ self.writeARObjectAttributes(child_element, desc)
1836
+ self.setChildElementOptionalLiteral(child_element, "CATEGORY", desc.getCategory())
1837
+ self.writeEndToEndDescriptionDataIds(child_element, desc)
1838
+ self.setChildElementOptionalPositiveInteger(child_element, "DATA-ID-MODE", desc.getDataIdMode())
1839
+ self.setChildElementOptionalPositiveInteger(child_element, "DATA-LENGTH", desc.getDataLength())
1840
+ self.setChildElementOptionalPositiveInteger(child_element, "MAX-DELTA-COUNTER-INIT", desc.getMaxDeltaCounterInit())
1841
+ self.setChildElementOptionalPositiveInteger(child_element, "CRC-OFFSET", desc.getCrcOffset())
1842
+ self.setChildElementOptionalPositiveInteger(child_element, "COUNTER-OFFSET", desc.getCounterOffset())
1843
+
1844
+ def setVariableDataPrototypeInSystemInstanceRef(self, element: ET.Element, key: str, instance_ref: VariableDataPrototypeInSystemInstanceRef):
1845
+ if instance_ref is not None:
1685
1846
  child_element = ET.SubElement(element, key)
1686
- #self.setChildElementOptionalRefType(child_element, "CONTEXT-COMPONENT-REF", iref.getContextComponentRefs()) # TODO
1687
- self.setChildElementOptionalRefType(child_element, "CONTEXT-COMPOSITION-REF", iref.getContextCompositionRef())
1688
- self.setChildElementOptionalRefType(child_element, "CONTEXT-PORT-REF", iref.getContextPortRef())
1689
- self.setChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF", iref.getTargetDataPrototypeRef())
1847
+ for ref in instance_ref.getContextComponentRefs():
1848
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-COMPONENT-REF", ref)
1849
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-COMPOSITION-REF", instance_ref.getContextCompositionRef())
1850
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-PORT-REF", instance_ref.getContextPortRef())
1851
+ self.setChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF", instance_ref.getTargetDataPrototypeRef())
1690
1852
 
1691
- def setEndToEndProtectionVariablePrototype(self, element: ET.Element, key: str, prototype: EndToEndProtectionVariablePrototype):
1853
+ def writeEndToEndProtectionVariablePrototype(self, element: ET.Element, prototype: EndToEndProtectionVariablePrototype):
1692
1854
  if prototype is not None:
1693
- child_element = ET.SubElement(element, key)
1855
+ child_element = ET.SubElement(element, "END-TO-END-PROTECTION-VARIABLE-PROTOTYPE")
1856
+ self.writeARObjectAttributes(child_element, prototype)
1694
1857
  irefs = prototype.getReceiverIrefs()
1695
1858
  if len(irefs) > 0:
1696
1859
  child_element = ET.SubElement(child_element, "RECEIVER-IREFS")
@@ -1698,22 +1861,40 @@ class ARXMLWriter(AbstractARXMLWriter):
1698
1861
  self.setVariableDataPrototypeInSystemInstanceRef(child_element, "RECEIVER-IREF", iref)
1699
1862
  self.setVariableDataPrototypeInSystemInstanceRef(child_element, "SENDER-IREF", prototype.senderIRef)
1700
1863
 
1701
- def writeEndToEndProtectionVariablePrototypes(self, element: ET.Element, parent: EndToEndProtection):
1702
- prototypes = parent.getEndToEndProtectionVariablePrototypes()
1864
+ def writeEndToEndProtectionEndToEndProtectionVariablePrototypes(self, element: ET.Element, protection: EndToEndProtection):
1865
+ prototypes = protection.getEndToEndProtectionVariablePrototypes()
1703
1866
  if len(prototypes) > 0:
1704
1867
  child_element = ET.SubElement(element, "END-TO-END-PROTECTION-VARIABLE-PROTOTYPES")
1705
1868
  for prototype in prototypes:
1706
1869
  if isinstance(prototype, EndToEndProtectionVariablePrototype):
1707
- self.setEndToEndProtectionVariablePrototype(child_element, "END-TO-END-PROTECTION-VARIABLE-PROTOTYPE", prototype)
1870
+ self.writeEndToEndProtectionVariablePrototype(child_element, prototype)
1871
+ else:
1872
+ self.notImplemented("Unsupported End To End Protection Variable Prototype <%s>" % type(prototype))
1873
+
1874
+ def writeEndToEndProtectionISignalIPdu(self, element: ET.Element, ipdu: EndToEndProtectionISignalIPdu):
1875
+ if ipdu is not None:
1876
+ child_element = ET.SubElement(element, "END-TO-END-PROTECTION-I-SIGNAL-I-PDU")
1877
+ self.setChildElementOptionalIntegerValue(child_element, "DATA-OFFSET", ipdu.getDataOffset())
1878
+ self.setChildElementOptionalRefType(child_element, "I-SIGNAL-GROUP-REF", ipdu.getISignalGroupRef())
1879
+ self.setChildElementOptionalRefType(child_element, "I-SIGNAL-I-PDU-REF", ipdu.getISignalIPduRef())
1880
+
1881
+ def writeEndToEndProtectionEndToEndProtectionISignalIPdus(self, element: ET.Element, protection: EndToEndProtection):
1882
+ ipdus = protection.getEndToEndProtectionISignalIPdus()
1883
+ if len(ipdus) > 0:
1884
+ child_element = ET.SubElement(element, "END-TO-END-PROTECTION-I-SIGNAL-I-PDUS")
1885
+ for ipdu in ipdus:
1886
+ if isinstance(ipdu, EndToEndProtectionISignalIPdu):
1887
+ self.writeEndToEndProtectionISignalIPdu(child_element, ipdu)
1708
1888
  else:
1709
- self._raiseError("Unsupported End To End Protection Variable Prototype <%s>" % type(prototype))
1889
+ self.notImplemented("Unsupported EndToEndProtectionISignalIPdu <%s>" % type(ipdu))
1710
1890
 
1711
- def setEndToEndProtection(self, element: ET.Element, protection: EndToEndProtection):
1891
+ def writeEndToEndProtection(self, element: ET.Element, protection: EndToEndProtection):
1712
1892
  if protection is not None:
1713
1893
  child_element = ET.SubElement(element, "END-TO-END-PROTECTION")
1714
1894
  self.writeIdentifiable(child_element, protection)
1715
- self.setEndToEndDescription(child_element, "END-TO-END-PROFILE", protection.endToEndProfile)
1716
- self.writeEndToEndProtectionVariablePrototypes(child_element, protection)
1895
+ self.setEndToEndDescription(child_element, "END-TO-END-PROFILE", protection.getEndToEndProfile())
1896
+ self.writeEndToEndProtectionEndToEndProtectionISignalIPdus(child_element, protection)
1897
+ self.writeEndToEndProtectionEndToEndProtectionVariablePrototypes(child_element, protection)
1717
1898
 
1718
1899
  def writeEndToEndProtections(self, element: ET.Element, protection_set: EndToEndProtectionSet):
1719
1900
  protections = protection_set.getEndToEndProtections()
@@ -1721,7 +1902,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1721
1902
  child_element = ET.SubElement(element, "END-TO-END-PROTECTIONS")
1722
1903
  for protection in protections:
1723
1904
  if isinstance(protection, EndToEndProtection):
1724
- self.setEndToEndProtection(child_element, protection)
1905
+ self.writeEndToEndProtection(child_element, protection)
1725
1906
 
1726
1907
  def writeEndToEndProtectionSet(self, element: ET.Element, protection_set: EndToEndProtectionSet):
1727
1908
  self.logger.debug("writeEndToEndProtectionSet %s" % protection_set.getShortName())
@@ -1729,15 +1910,14 @@ class ARXMLWriter(AbstractARXMLWriter):
1729
1910
  self.writeIdentifiable(child_element, protection_set)
1730
1911
  self.writeEndToEndProtections(child_element, protection_set)
1731
1912
 
1732
- def setAutosarDataPrototype(self, element: ET.Element, prototype: AutosarDataPrototype):
1733
- self.setDataPrototype(element, prototype)
1913
+ def writeAutosarDataPrototype(self, element: ET.Element, prototype: AutosarDataPrototype):
1914
+ self.writeDataPrototype(element, prototype)
1734
1915
  self.setChildElementOptionalRefType(element, "TYPE-TREF", prototype.typeTRef)
1735
1916
 
1736
1917
  def writeVariableDataPrototype(self, element: ET.Element, prototype: VariableDataPrototype):
1737
1918
  self.logger.debug("writeVariableDataPrototype %s" % prototype.getShortName())
1738
1919
  child_element = ET.SubElement(element, "VARIABLE-DATA-PROTOTYPE")
1739
- self.writeIdentifiable(child_element, prototype)
1740
- self.setAutosarDataPrototype(child_element, prototype)
1920
+ self.writeAutosarDataPrototype(child_element, prototype)
1741
1921
  self.setValueSpecification(child_element, "INIT-VALUE", prototype.getInitValue())
1742
1922
 
1743
1923
  def writeSenderReceiverInterfaceDataElements(self, element: ET.Element, sr_interface: SenderReceiverInterface):
@@ -1748,7 +1928,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1748
1928
  if isinstance(data_element, VariableDataPrototype):
1749
1929
  self.writeVariableDataPrototype(data_elements_tag, data_element)
1750
1930
  else:
1751
- self._raiseError("Unsupported Data Element <%s>" % type(data_element))
1931
+ self.notImplemented("Unsupported Data Element <%s>" % type(data_element))
1752
1932
 
1753
1933
  def writeSenderReceiverInterfaceInvalidationPolicies(self, element: ET.Element, sr_interface: SenderReceiverInterface):
1754
1934
  policies = sr_interface.getInvalidationPolicies()
@@ -1767,25 +1947,38 @@ class ARXMLWriter(AbstractARXMLWriter):
1767
1947
  self.writeSenderReceiverInterfaceDataElements(child_element, sr_interface)
1768
1948
  self.writeSenderReceiverInterfaceInvalidationPolicies(child_element, sr_interface)
1769
1949
 
1770
- def writerBswModuleDescriptionImplementedEntry(self, element: ET.Element, desc: BswModuleDescription):
1771
- entries = desc.getImplementedEntries()
1772
- if len(entries) > 0:
1950
+ def writeBswModuleDescriptionImplementedEntryRefs(self, element: ET.Element, desc: BswModuleDescription):
1951
+ refs = desc.getImplementedEntryRefs()
1952
+ if len(refs) > 0:
1773
1953
  entries_tag = ET.SubElement(element, "PROVIDED-ENTRYS")
1774
- for entry in entries:
1954
+ for ref in refs:
1775
1955
  entry_tag = ET.SubElement(entries_tag, "BSW-MODULE-ENTRY-REF-CONDITIONAL")
1776
- self.setChildElementOptionalRefType(entry_tag, "BSW-MODULE-ENTRY-REF", entry)
1956
+ self.setChildElementOptionalRefType(entry_tag, "BSW-MODULE-ENTRY-REF", ref)
1777
1957
 
1778
- def setModeDeclarationGroupPrototype(self, element: ET.Element, prototype: ModeDeclarationGroupPrototype):
1779
- self.writeIdentifiable(element, prototype)
1780
- self.setChildElementOptionalRefType(element, "TYPE-TREF", prototype.type_tref)
1958
+ def writeModeDeclarationGroupPrototype(self, element: ET.Element, prototype: ModeDeclarationGroupPrototype):
1959
+ child_element = ET.SubElement(element, "MODE-DECLARATION-GROUP-PROTOTYPE")
1960
+ self.writeIdentifiable(child_element, prototype)
1961
+ self.setChildElementOptionalRefType(child_element, "TYPE-TREF", prototype.getTypeTRef())
1781
1962
 
1782
- def writeProvidedModeGroup(self, element: ET.Element, parent: BswModuleDescription):
1963
+ def writeBswModuleDescriptionProvidedModeGroups(self, element: ET.Element, parent: BswModuleDescription):
1783
1964
  mode_groups = parent.getProvidedModeGroups()
1784
1965
  if len(mode_groups) > 0:
1785
- mode_groups_tag = ET.SubElement(element, "PROVIDED-MODE-GROUPS")
1966
+ child_element = ET.SubElement(element, "PROVIDED-MODE-GROUPS")
1967
+ for mode_group in mode_groups:
1968
+ if isinstance(mode_group, ModeDeclarationGroupPrototype):
1969
+ self.writeModeDeclarationGroupPrototype(child_element, mode_group)
1970
+ else:
1971
+ self.notImplemented("Unsupported ProvidedModeGroup <%s>" % type(mode_group))
1972
+
1973
+ def writeBswModuleDescriptionRequiredModeGroups(self, element: ET.Element, desc: BswModuleDescription):
1974
+ mode_groups = desc.getRequiredModeGroups()
1975
+ if len(mode_groups) > 0:
1976
+ child_element = ET.SubElement(element, "REQUIRED-MODE-GROUPS")
1786
1977
  for mode_group in mode_groups:
1787
- child_element = ET.SubElement(mode_groups_tag, "MODE-DECLARATION-GROUP-PROTOTYPE")
1788
- self.setModeDeclarationGroupPrototype(child_element, mode_group)
1978
+ if isinstance(mode_group, ModeDeclarationGroupPrototype):
1979
+ self.writeModeDeclarationGroupPrototype(child_element, mode_group)
1980
+ else:
1981
+ self.notImplemented("Unsupported ProvidedModeGroup <%s>" % type(mode_group))
1789
1982
 
1790
1983
  def writeCanEnterExclusiveAreaRefs(self, element: ET.Element, entity: ExecutableEntity):
1791
1984
  refs = entity.getCanEnterExclusiveAreaRefs()
@@ -1794,13 +1987,13 @@ class ARXMLWriter(AbstractARXMLWriter):
1794
1987
  for ref in refs:
1795
1988
  self.setChildElementOptionalRefType(child_element, "CAN-ENTER-EXCLUSIVE-AREA-REF", ref)
1796
1989
 
1797
- def setExecutableEntity(self, element: ET.Element, entity: ExecutableEntity):
1990
+ def writeExecutableEntity(self, element: ET.Element, entity: ExecutableEntity):
1798
1991
  self.writeIdentifiable(element, entity)
1799
1992
  self.writeCanEnterExclusiveAreaRefs(element, entity)
1800
1993
  self.setChildElementOptionalFloatValue(element, "MINIMUM-START-INTERVAL", entity.getMinimumStartInterval())
1801
1994
  self.setChildElementOptionalRefType(element, "SW-ADDR-METHOD-REF", entity.getSwAddrMethodRef())
1802
1995
 
1803
- def writeBswModuleEntityManagedModeGroup(self, element: ET.Element, entity: BswModuleEntity):
1996
+ def writeBswModuleEntityManagedModeGroups(self, element: ET.Element, entity: BswModuleEntity):
1804
1997
  mode_group_refs = entity.getManagedModeGroupRefs()
1805
1998
  if len(mode_group_refs) > 0:
1806
1999
  mode_groups_tag = ET.SubElement(element, "MANAGED-MODE-GROUPS")
@@ -1808,48 +2001,85 @@ class ARXMLWriter(AbstractARXMLWriter):
1808
2001
  child_element = ET.SubElement(mode_groups_tag, "MODE-DECLARATION-GROUP-PROTOTYPE-REF-CONDITIONAL")
1809
2002
  self.setChildElementOptionalRefType(child_element, "MODE-DECLARATION-GROUP-PROTOTYPE-REF", mode_group_ref)
1810
2003
 
1811
- def setBswModuleEntity(self, element: ET.Element, entity: BswModuleEntity):
1812
- self.setExecutableEntity(element, entity)
2004
+ def writeBswVariableAccess(self, element: ET.Element, access: BswVariableAccess):
2005
+ if access is not None:
2006
+ child_element = ET.SubElement(element, "BSW-VARIABLE-ACCESS")
2007
+ self.writeReferrable(child_element, access)
2008
+ self.setChildElementOptionalRefType(child_element, "ACCESSED-VARIABLE-REF", access.getAccessedVariableRef())
2009
+
2010
+ def writeBswModuleEntityDataSendPoints(self, element: ET.Element, entity: BswModuleEntity):
2011
+ points = entity.getDataSendPoints()
2012
+ if len(points) > 0:
2013
+ child_element = ET.SubElement(element, "DATA-SEND-POINTS")
2014
+ for point in points:
2015
+ if isinstance(point, BswVariableAccess):
2016
+ self.writeBswVariableAccess(child_element, point)
2017
+ else:
2018
+ self.notImplemented("Unsupported Data Send Point <%s>" % type(point))
2019
+
2020
+ def writeBswModuleEntityDataReceivePoints(self, element: ET.Element, entity: BswModuleEntity):
2021
+ points = entity.getDataReceivePoints()
2022
+ if len(points) > 0:
2023
+ child_element = ET.SubElement(element, "DATA-RECEIVE-POINTS")
2024
+ for point in points:
2025
+ if isinstance(point, BswVariableAccess):
2026
+ self.writeBswVariableAccess(child_element, point)
2027
+ else:
2028
+ self.notImplemented("Unsupported Data Receive Point <%s>" % type(point))
2029
+
2030
+ def writeBswModuleEntityIssuedTriggerRefs(self, element: ET.Element, entity: BswModuleEntity):
2031
+ refs = entity.getIssuedTriggerRefs()
2032
+ if len(refs) > 0:
2033
+ child_element = ET.SubElement(element, "ISSUED-TRIGGERS")
2034
+ for ref in refs:
2035
+ cond_tag = ET.SubElement(child_element, "TRIGGER-REF-CONDITIONAL")
2036
+ self.setChildElementOptionalRefType(cond_tag, "TRIGGER-REF", ref)
2037
+
2038
+ def writeBswModuleEntity(self, element: ET.Element, entity: BswModuleEntity):
2039
+ self.writeExecutableEntity(element, entity)
2040
+ self.writeBswModuleEntityDataSendPoints(element, entity)
2041
+ self.writeBswModuleEntityDataReceivePoints(element, entity)
1813
2042
  self.setChildElementOptionalRefType(element, "IMPLEMENTED-ENTRY-REF", entity.implementedEntryRef)
1814
- self.writeBswModuleEntityManagedModeGroup(element, entity)
2043
+ self.writeBswModuleEntityManagedModeGroups(element, entity)
2044
+ self.writeBswModuleEntityIssuedTriggerRefs(element, entity)
1815
2045
 
1816
- def setBswCalledEntity(self, element: ET.Element, entity: BswCalledEntity):
1817
- self.logger.debug("setBswCalledEntity %s" % entity.getShortName())
2046
+ def writeBswCalledEntity(self, element: ET.Element, entity: BswCalledEntity):
2047
+ self.logger.debug("Write BswCalledEntity <%s>" % entity.getShortName())
1818
2048
  child_element = ET.SubElement(element, "BSW-CALLED-ENTITY")
1819
- self.setBswModuleEntity(child_element, entity)
2049
+ self.writeBswModuleEntity(child_element, entity)
1820
2050
 
1821
- def setBswSchedulableEntity(self, element: ET.Element, entity: BswSchedulableEntity):
1822
- self.logger.debug("set BswSchedulableEntity %s" % entity.getShortName())
2051
+ def writeBswSchedulableEntity(self, element: ET.Element, entity: BswSchedulableEntity):
2052
+ self.logger.debug("Write BswSchedulableEntity <%s>" % entity.getShortName())
1823
2053
  child_element = ET.SubElement(element, "BSW-SCHEDULABLE-ENTITY")
1824
- self.setBswModuleEntity(child_element, entity)
2054
+ self.writeBswModuleEntity(child_element, entity)
1825
2055
 
1826
2056
  def setBswInterruptEntity(self, element: ET.Element, entity: BswInterruptEntity):
1827
- self.logger.debug("read BswInterruptEntity %s" % entity.getShortName())
2057
+ self.logger.debug("Write BswInterruptEntity <%s>" % entity.getShortName())
1828
2058
  child_element = ET.SubElement(element, "BSW-INTERRUPT-ENTITY")
1829
- self.setBswModuleEntity(child_element, entity)
2059
+ self.writeBswModuleEntity(child_element, entity)
1830
2060
  self.setChildElementOptionalLiteral(child_element, "INTERRUPT-CATEGORY", entity.getInterruptCategory())
1831
2061
  self.setChildElementOptionalLiteral(child_element, "INTERRUPT-SOURCE", entity.getInterruptSource())
1832
2062
 
1833
2063
  def writeBswInternalBehaviorBswModuleEntities(self, element: ET.Element, parent: BswInternalBehavior):
1834
- entities = parent.getBswModuleEntities()
2064
+ entities = parent.getBswModuleEntities()
1835
2065
  if len(entities) > 0:
1836
2066
  child_element = ET.SubElement(element, "ENTITYS")
1837
2067
  for entity in entities:
1838
2068
  if isinstance(entity, BswCalledEntity):
1839
- self.setBswCalledEntity(child_element, entity)
2069
+ self.writeBswCalledEntity(child_element, entity)
1840
2070
  elif isinstance(entity, BswSchedulableEntity):
1841
- self.setBswSchedulableEntity(child_element, entity)
2071
+ self.writeBswSchedulableEntity(child_element, entity)
1842
2072
  elif isinstance(entity, BswInterruptEntity):
1843
2073
  self.setBswInterruptEntity(child_element, entity)
1844
2074
  else:
1845
2075
  self.notImplemented("Unsupported BswModuleEntity <%s>" % type(entity))
1846
2076
 
1847
- def setBswEvent(self, element: ET.Element, event: BswEvent):
2077
+ def writeBswEvent(self, element: ET.Element, event: BswEvent):
1848
2078
  self.writeIdentifiable(element, event)
1849
2079
  self.setChildElementOptionalRefType(element, "STARTS-ON-EVENT-REF", event.startsOnEventRef)
1850
2080
 
1851
2081
  def writeBswScheduleEvent(self, element: ET.Element, event: BswScheduleEvent):
1852
- self.setBswEvent(element, event)
2082
+ self.writeBswEvent(element, event)
1853
2083
 
1854
2084
  def writeBswTimingEvent(self, element: ET.Element, event: BswTimingEvent):
1855
2085
  self.logger.debug("Write BswTimingEvent <%s>" % event.getShortName())
@@ -1862,19 +2092,32 @@ class ARXMLWriter(AbstractARXMLWriter):
1862
2092
  child_element = ET.SubElement(element, "BSW-BACKGROUND-EVENT")
1863
2093
  self.writeBswScheduleEvent(child_element, event)
1864
2094
 
2095
+ def writeBswInternalTriggerOccurredEvent(self, element: ET.Element, event: BswInternalTriggerOccurredEvent):
2096
+ self.logger.debug("Write BswInternalTriggerOccurredEvent <%s>" % event.getShortName())
2097
+ child_element = ET.SubElement(element, "BSW-INTERNAL-TRIGGER-OCCURRED-EVENT")
2098
+ self.writeBswScheduleEvent(child_element, event)
2099
+ self.setChildElementOptionalRefType(child_element, "EVENT-SOURCE-REF", event.getEventSourceRef())
2100
+
1865
2101
  def writeBswExternalTriggerOccurredEvent(self, element: ET.Element, event: BswExternalTriggerOccurredEvent):
1866
- self.logger.debug("Write BswExternalTriggerOccurredEvent %s" % event.getShortName())
2102
+ self.logger.debug("Write BswExternalTriggerOccurredEvent <%s>" % event.getShortName())
1867
2103
  child_element = ET.SubElement(element, "BSW-EXTERNAL-TRIGGER-OCCURRED-EVENT")
1868
2104
  self.writeBswScheduleEvent(child_element, event)
1869
2105
  self.setChildElementOptionalRefType(child_element, "TRIGGER-REF", event.getTriggerRef())
1870
2106
 
1871
2107
  def writeBswDataReceivedEvent(self, element: ET.Element, event: BswDataReceivedEvent):
1872
- self.logger.debug("Write BswDataReceivedEvent %s" % event.getShortName())
2108
+ self.logger.debug("Write BswDataReceivedEvent <%s>" % event.getShortName())
1873
2109
  # Read the Inherit BswScheduleEvent
1874
2110
  child_element = ET.SubElement(element, "BSW-DATA-RECEIVED-EVENT")
1875
2111
  self.writeBswScheduleEvent(child_element, event)
1876
2112
  self.setChildElementOptionalRefType(child_element, "DATA-REF", event.getDataRef())
1877
2113
 
2114
+ def writeBswOperationInvokedEvent(self, element: ET.Element, event: BswOperationInvokedEvent):
2115
+ self.logger.debug("Write BswOperationInvokedEvent <%s>" % event.getShortName())
2116
+ # Read the Inherit BswScheduleEvent
2117
+ child_element = ET.SubElement(element, "BSW-OPERATION-INVOKED-EVENT")
2118
+ self.writeBswEvent(child_element, event)
2119
+ self.setChildElementOptionalRefType(child_element, "ENTRY-REF", event.getEntryRef())
2120
+
1878
2121
  def writeBswInternalBehaviorBswEvents(self, element: ET.Element, parent: BswInternalBehavior):
1879
2122
  events = parent.getBswEvents()
1880
2123
  if len(events) > 0:
@@ -1884,12 +2127,16 @@ class ARXMLWriter(AbstractARXMLWriter):
1884
2127
  self.writeBswTimingEvent(child_element, event)
1885
2128
  elif isinstance(event, BswBackgroundEvent):
1886
2129
  self.writeBswBackgroundEvent(child_element, event)
2130
+ elif isinstance(event, BswInternalTriggerOccurredEvent):
2131
+ self.writeBswInternalTriggerOccurredEvent(child_element, event)
1887
2132
  elif isinstance(event, BswExternalTriggerOccurredEvent):
1888
2133
  self.writeBswExternalTriggerOccurredEvent(child_element, event)
1889
2134
  elif isinstance(event, BswDataReceivedEvent):
1890
2135
  self.writeBswDataReceivedEvent(child_element, event)
2136
+ elif isinstance(event, BswOperationInvokedEvent):
2137
+ self.writeBswOperationInvokedEvent(child_element, event)
1891
2138
  else:
1892
- self._raiseError("Unsupported BswModuleEntity <%s>" % type(event))
2139
+ self.notImplemented("Unsupported BswModuleEntity <%s>" % type(event))
1893
2140
 
1894
2141
  def setBswModeSenderPolicy(self, element: ET.Element, policy: BswModeSenderPolicy):
1895
2142
  child_element = ET.SubElement(element, "BSW-MODE-SENDER-POLICY")
@@ -1904,52 +2151,114 @@ class ARXMLWriter(AbstractARXMLWriter):
1904
2151
  if isinstance(policy, BswModeSenderPolicy):
1905
2152
  self.setBswModeSenderPolicy(child_element, policy)
1906
2153
  else:
1907
- self._raiseError("Unsupported ModeSenderPolicy type <%s>." % type(policy))
1908
-
1909
- def setIncludedModeDeclarationGroupSet(self, element: ET.Element, group_set: IncludedModeDeclarationGroupSet):
1910
- child_element = ET.SubElement(element, "INCLUDED-MODE-DECLARATION-GROUP-SET")
2154
+ self.notImplemented("Unsupported ModeSenderPolicy type <%s>." % type(policy))
1911
2155
 
1912
2156
  def writeBswInternalBehaviorIncludedModeDeclarationGroupSets(self, element: ET.Element, behavior: BswInternalBehavior):
1913
2157
  group_sets = behavior.getIncludedModeDeclarationGroupSets()
1914
2158
  if len(group_sets) > 0:
1915
2159
  child_element = ET.SubElement(element, "INCLUDED-MODE-DECLARATION-GROUP-SETS")
1916
2160
  for group_set in group_sets:
1917
- self.setIncludedModeDeclarationGroupSet(child_element, group_set)
2161
+ self.writeIncludedModeDeclarationGroupSet(child_element, group_set)
2162
+
2163
+ def writeBswApiOptions(self, element: ET.Element, options: BswApiOptions):
2164
+ self.writeARObjectAttributes(element, options)
2165
+ self.setChildElementOptionalBooleanValue(element, "ENABLE-TAKE-ADDRESS", options.getEnableTakeAddress())
2166
+
2167
+ def writeBswDataReceptionPolicy(self, element: ET.Element, policy: BswDataReceptionPolicy):
2168
+ self.writeBswApiOptions(element, policy)
2169
+ self.setChildElementOptionalRefType(element, "RECEIVED-DATA-REF", policy.getReceivedDataRef())
2170
+
2171
+ def writeBswQueuedDataReceptionPolicy(self, element: ET.Element, policy: BswQueuedDataReceptionPolicy):
2172
+ child_element = ET.SubElement(element, "BSW-QUEUED-DATA-RECEPTION-POLICY")
2173
+ self.writeBswDataReceptionPolicy(child_element, policy)
2174
+ self.setChildElementOptionalPositiveInteger(child_element, "QUEUE-LENGTH", policy.getQueueLength())
1918
2175
 
1919
- def setBswInternalBehavior(self, element: ET.Element, behavior: BswInternalBehavior):
2176
+ def writeBswInternalBehaviorReceptionPolicies(self, element: ET.Element, behavior: BswInternalBehavior):
2177
+ policies = behavior.getReceptionPolicies()
2178
+ if len(policies) > 0:
2179
+ child_element = ET.SubElement(element, "RECEPTION-POLICYS")
2180
+ for policy in policies:
2181
+ if isinstance(policy, BswQueuedDataReceptionPolicy):
2182
+ self.writeBswQueuedDataReceptionPolicy(child_element, policy)
2183
+ else:
2184
+ self.notImplemented("Unsupported Reception Policies <%s>" % type(policy))
2185
+
2186
+ def writeBswInternalBehavior(self, element: ET.Element, behavior: BswInternalBehavior):
1920
2187
  child_element = ET.SubElement(element, "BSW-INTERNAL-BEHAVIOR")
1921
2188
  self.writeInternalBehavior(child_element, behavior)
1922
2189
  self.writeBswInternalBehaviorBswModuleEntities(child_element, behavior)
1923
2190
  self.writeBswInternalBehaviorBswEvents(child_element, behavior)
1924
2191
  self.writeBswInternalBehaviorModeSenderPolicy(child_element, behavior)
1925
2192
  self.writeBswInternalBehaviorIncludedModeDeclarationGroupSets(child_element, behavior)
2193
+ self.writeBswInternalBehaviorReceptionPolicies(child_element, behavior)
1926
2194
 
1927
- def writeBswModuleDescriptionInternalBehaviors(self, element: ET.Element, behaviors: List[InternalBehavior]):
2195
+ def writeBswModuleDescriptionInternalBehaviors(self, element: ET.Element, desc: BswModuleDescription):
2196
+ behaviors = desc.getInternalBehaviors()
1928
2197
  if len(behaviors) > 0:
1929
2198
  child_element = ET.SubElement(element, "INTERNAL-BEHAVIORS")
1930
2199
  for behavior in behaviors:
1931
2200
  if isinstance(behavior, BswInternalBehavior):
1932
- self.setBswInternalBehavior(child_element, behavior)
2201
+ self.writeBswInternalBehavior(child_element, behavior)
1933
2202
  else:
1934
- self._raiseError("Unsupported BswInternalBehavior <%s>" % type(behavior))
1935
-
2203
+ self.notImplemented("Unsupported Internal Behavior <%s>" % type(behavior))
2204
+
2205
+ def writeTrigger(self, element: ET.Element, trigger: Trigger):
2206
+ child_element = ET.SubElement(element, "TRIGGER")
2207
+ self.writeIdentifiable(child_element, trigger)
2208
+
2209
+ def writeBswModuleDescriptionReleasedTriggers(self, element: ET.Element, desc: BswModuleDescription):
2210
+ triggers = desc.getReleasedTriggers()
2211
+ if len(triggers) > 0:
2212
+ child_element = ET.SubElement(element, "RELEASED-TRIGGERS")
2213
+ for trigger in triggers:
2214
+ if isinstance(trigger, Trigger):
2215
+ self.writeTrigger(child_element, trigger)
2216
+ else:
2217
+ self.notImplemented("Unsupported Released Trigger <%s>" % type(trigger))
2218
+
2219
+ def writeBswModuleDescriptionRequiredTriggers(self, element: ET.Element, desc: BswModuleDescription):
2220
+ triggers = desc.getRequiredTriggers()
2221
+ if len(triggers) > 0:
2222
+ child_element = ET.SubElement(element, "REQUIRED-TRIGGERS")
2223
+ for trigger in triggers:
2224
+ if isinstance(trigger, Trigger):
2225
+ self.writeTrigger(child_element, trigger)
2226
+ else:
2227
+ self.notImplemented("Unsupported Required Trigger <%s>" % type(trigger))
2228
+
2229
+ def writeBswModuleDescriptionProvidedDatas(self, element: ET.Element, desc: BswModuleDescription):
2230
+ datas = desc.getProvidedDatas()
2231
+ if len(datas) > 0:
2232
+ child_element = ET.SubElement(element, "PROVIDED-DATAS")
2233
+ for data in datas:
2234
+ if isinstance(data, VariableDataPrototype):
2235
+ self.writeVariableDataPrototype(child_element, data)
2236
+ else:
2237
+ self.notImplemented("Unsupported Provided Data <%s>" % type(data))
2238
+
2239
+ def writeBswModuleDescriptionRequiredDatas(self, element: ET.Element, desc: BswModuleDescription):
2240
+ datas = desc.getRequiredDatas()
2241
+ if len(datas) > 0:
2242
+ child_element = ET.SubElement(element, "REQUIRED-DATAS")
2243
+ for data in datas:
2244
+ if isinstance(data, VariableDataPrototype):
2245
+ self.writeVariableDataPrototype(child_element, data)
2246
+ else:
2247
+ self.notImplemented("Unsupported Required Data <%s>" % type(data))
2248
+
1936
2249
  def writeBswModuleDescription(self, element: ET.Element, desc: BswModuleDescription):
1937
2250
  self.logger.debug("writeBswModuleDescription %s" % desc.getShortName())
1938
2251
  child_element = ET.SubElement(element, "BSW-MODULE-DESCRIPTION")
1939
2252
  self.writeIdentifiable(child_element, desc)
1940
2253
  self.setChildElementOptionalNumericalValue(child_element, "MODULE-ID", desc.getModuleId())
1941
- self.writerBswModuleDescriptionImplementedEntry(child_element, desc)
1942
- self.writeProvidedModeGroup(child_element, desc)
1943
- #self.readRequiredModeGroup(element, bsw_module_description)
1944
- self.writeBswModuleDescriptionInternalBehaviors(child_element, desc.getBswInternalBehaviors())
1945
-
1946
- def writeBswModuleEntityManagedModeGroup(self, element: ET.Element, entity: BswModuleEntity):
1947
- mode_group_refs = entity.getManagedModeGroupRefs()
1948
- if len(mode_group_refs) > 0:
1949
- mode_groups_tag = ET.SubElement(element, "MANAGED-MODE-GROUPS")
1950
- for mode_group_ref in mode_group_refs:
1951
- child_element = ET.SubElement(mode_groups_tag, "MODE-DECLARATION-GROUP-PROTOTYPE-REF-CONDITIONAL")
1952
- self.setChildElementOptionalRefType(child_element, "MODE-DECLARATION-GROUP-PROTOTYPE-REF", mode_group_ref)
2254
+ self.writeBswModuleDescriptionImplementedEntryRefs(child_element, desc)
2255
+ self.writeBswModuleDescriptionProvidedModeGroups(child_element, desc)
2256
+ self.writeBswModuleDescriptionRequiredModeGroups(child_element, desc)
2257
+ self.writeBswModuleDescriptionReleasedTriggers(child_element, desc)
2258
+ self.writeBswModuleDescriptionRequiredTriggers(child_element, desc)
2259
+ self.writeBswModuleDescriptionProvidedDatas(child_element, desc)
2260
+ self.writeBswModuleDescriptionRequiredDatas(child_element, desc)
2261
+ self.writeBswModuleDescriptionInternalBehaviors(child_element, desc)
1953
2262
 
1954
2263
  def setSwServiceArg(self, element: ET.Element, arg: SwServiceArg):
1955
2264
  self.logger.debug("Set SwServiceArg <%s>" % arg.getShortName())
@@ -1991,7 +2300,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1991
2300
  if isinstance(mapping, SwcBswRunnableMapping):
1992
2301
  self.setSwcBswRunnableMapping(child_element, mapping)
1993
2302
  else:
1994
- self._raiseError("Unsupported Runnable Mapping <%s>" % type(mapping))
2303
+ self.notImplemented("Unsupported Runnable Mapping <%s>" % type(mapping))
1995
2304
 
1996
2305
  def writeSwcBswMapping(self, element: ET.Element, mapping: SwcBswMapping):
1997
2306
  self.logger.debug("writeBswModuleDescription %s" % mapping.getShortName())
@@ -2019,13 +2328,13 @@ class ARXMLWriter(AbstractARXMLWriter):
2019
2328
  if isinstance(artifact_desc, AutosarEngineeringObject):
2020
2329
  self.setAutosarEngineeringObject(child_element, artifact_desc)
2021
2330
  else:
2022
- self._raiseError("Unsupported Artifact descriptor <%s>" % type(artifact_desc))
2331
+ self.notImplemented("Unsupported Artifact descriptor <%s>" % type(artifact_desc))
2023
2332
 
2024
2333
  def writeBswImplementationVendorSpecificModuleDefRefs(self, element: ET.Element, parent: BswImplementation):
2025
2334
  refs = parent.getVendorSpecificModuleDefRefs()
2026
2335
  if len(refs) > 0:
2027
2336
  child_element = ET.SubElement(element, "VENDOR-SPECIFIC-MODULE-DEF-REFS")
2028
- if child_element != None:
2337
+ if child_element is not None:
2029
2338
  for ref in refs:
2030
2339
  self.setChildElementOptionalRefType(child_element, "VENDOR-SPECIFIC-MODULE-DEF-REF", ref)
2031
2340
 
@@ -2035,6 +2344,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2035
2344
  self.writeImplementation(child_element, impl)
2036
2345
  self.setChildElementOptionalLiteral(child_element, "AR-RELEASE-VERSION", impl.getArReleaseVersion())
2037
2346
  self.setChildElementOptionalRefType(child_element, "BEHAVIOR-REF", impl.getBehaviorRef())
2347
+ self.setChildElementOptionalLiteral(child_element, "VENDOR-API-INFIX", impl.getVendorApiInfix())
2038
2348
  self.writeBswImplementationVendorSpecificModuleDefRefs(child_element, impl)
2039
2349
 
2040
2350
  def writeImplementationDataTypeElements(self, element: ET.Element, parent: ImplementationDataType):
@@ -2071,33 +2381,37 @@ class ARXMLWriter(AbstractARXMLWriter):
2071
2381
  self.writeImplementationDataTypeSymbolProps(child_element, data_type)
2072
2382
  self.setChildElementOptionalLiteral(child_element, "TYPE-EMITTER", data_type.getTypeEmitter())
2073
2383
 
2074
- def writeArgumentDataPrototypes(self, element: ET.Element, parent: ClientServerOperation):
2075
- arguments = parent.getArgumentDataPrototypes()
2384
+ def writeArgumentDataPrototype(self, element: ET.Element, prototype: ArgumentDataPrototype):
2385
+ child_element = ET.SubElement(element, "ARGUMENT-DATA-PROTOTYPE")
2386
+ self.writeAutosarDataPrototype(child_element, prototype)
2387
+ self.setChildElementOptionalLiteral(child_element, "DIRECTION", prototype.getDirection())
2388
+ self.setChildElementOptionalLiteral(child_element, "SERVER-ARGUMENT-IMPL-POLICY", prototype.getServerArgumentImplPolicy())
2389
+
2390
+ def writeClientServerOperationArguments(self, element: ET.Element, parent: ClientServerOperation):
2391
+ arguments = parent.getArguments()
2076
2392
  if len(arguments) > 0:
2077
- arguments_tag = ET.SubElement(element, "ARGUMENTS")
2078
- for prototype in arguments:
2079
- child_element = ET.SubElement(arguments_tag, "ARGUMENT-DATA-PROTOTYPE")
2080
- self.writeIdentifiable(child_element, prototype)
2081
- self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", prototype.swDataDefProps)
2082
- self.setChildElementOptionalRefType(child_element, "TYPE-TREF", prototype.typeTRef)
2083
- self.setChildElementOptionalLiteral(child_element, "DIRECTION", prototype.direction)
2084
- self.setChildElementOptionalLiteral(child_element, "SERVER-ARGUMENT-IMPL-POLICY", prototype.serverArgumentImplPolicy)
2085
-
2086
- def writePossibleErrorRefs(self, element: ET.Element, parent: ClientServerOperation):
2087
- error_refs = parent.getPossbileErrorRefs()
2393
+ child_element = ET.SubElement(element, "ARGUMENTS")
2394
+ for argument in arguments:
2395
+ if isinstance(argument, ArgumentDataPrototype):
2396
+ self.writeArgumentDataPrototype(child_element, argument)
2397
+ else:
2398
+ self.notImplemented("Unsupported Argument <%s>" % type(argument))
2399
+
2400
+ def writeClientServerOperationPossibleErrorRefs(self, element: ET.Element, parent: ClientServerOperation):
2401
+ error_refs = parent.getPossibleErrorRefs()
2088
2402
  if len(error_refs) > 0:
2089
- error_refs_tag = ET.SubElement(element, "POSSIBLE-ERROR-REFS")
2403
+ child_element = ET.SubElement(element, "POSSIBLE-ERROR-REFS")
2090
2404
  for error_ref in error_refs:
2091
- self.setChildElementOptionalRefType(error_refs_tag, "POSSIBLE-ERROR-REF", error_ref)
2405
+ self.setChildElementOptionalRefType(child_element, "POSSIBLE-ERROR-REF", error_ref)
2092
2406
 
2093
2407
  def writeClientServerOperation(self, element: ET.Element, operation: ClientServerOperation):
2094
2408
  self.logger.debug("writeClientServerOperation %s" % operation.getShortName())
2095
2409
  child_element = ET.SubElement(element, "CLIENT-SERVER-OPERATION")
2096
2410
  self.writeIdentifiable(child_element, operation)
2097
- self.writeArgumentDataPrototypes(child_element, operation)
2098
- self.writePossibleErrorRefs(child_element, operation)
2411
+ self.writeClientServerOperationArguments(child_element, operation)
2412
+ self.writeClientServerOperationPossibleErrorRefs(child_element, operation)
2099
2413
 
2100
- def writeOperations(self, element: ET.Element, parent: ClientServerInterface):
2414
+ def writeClientServerInterfaceOperations(self, element: ET.Element, parent: ClientServerInterface):
2101
2415
  operations = parent.getOperations()
2102
2416
  if len(operations) > 0:
2103
2417
  operations_tag = ET.SubElement(element, "OPERATIONS")
@@ -2105,7 +2419,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2105
2419
  if isinstance(operation, ClientServerOperation):
2106
2420
  self.writeClientServerOperation(operations_tag, operation)
2107
2421
  else:
2108
- self._raiseError("Unsupported Operation <%s>" % type(operation))
2422
+ self.notImplemented("Unsupported Operation <%s>" % type(operation))
2109
2423
 
2110
2424
  def writeApplicationError(self, element: ET.Element, error: ApplicationError):
2111
2425
  self.logger.debug("writeApplicationError %s" % error.getShortName())
@@ -2121,24 +2435,27 @@ class ARXMLWriter(AbstractARXMLWriter):
2121
2435
  if isinstance(error, ApplicationError):
2122
2436
  self.writeApplicationError(errors_tag, error)
2123
2437
  else:
2124
- self._raiseError("Unsupported PossibleError %s" % type(error))
2438
+ self.notImplemented("Unsupported PossibleError %s" % type(error))
2125
2439
 
2126
- def setPortInterface(self, element: ET.Element, port_interface: PortInterface):
2440
+ def writePortInterface(self, element: ET.Element, port_interface: PortInterface):
2127
2441
  self.writeIdentifiable(element, port_interface)
2128
2442
  self.setChildElementOptionalBooleanValue(element, "IS-SERVICE", port_interface.isService)
2129
2443
  self.setChildElementOptionalLiteral(element, "SERVICE-KIND", port_interface.serviceKind)
2130
2444
 
2131
- def writeParameterInterface(self, element: ET.Element, param_interface: ParameterInterface):
2132
- self.logger.debug("Write ParameterInterface %s" % param_interface.getShortName())
2445
+ def writeDataInterface(self, element: ET.Element, interface: DataInterface):
2446
+ self.writePortInterface(element, interface)
2447
+
2448
+ def writeParameterInterface(self, element: ET.Element, interface: ParameterInterface):
2449
+ self.logger.debug("Write ParameterInterface %s" % interface.getShortName())
2133
2450
  child_element = ET.SubElement(element, "PARAMETER-INTERFACE")
2134
- self.setPortInterface(child_element, param_interface)
2135
- self.setParameterDataPrototypes(child_element, "PARAMETERS", param_interface.getParameters())
2451
+ self.writeDataInterface(child_element, interface)
2452
+ self.writeSwcInternalBehaviorParameterDataPrototypes(child_element, "PARAMETERS", interface.getParameters())
2136
2453
 
2137
2454
  def writeClientServerInterface(self, element: ET.Element, cs_interface: ClientServerInterface):
2138
2455
  self.logger.debug("writeClientServerInterface %s" % cs_interface.getShortName())
2139
2456
  child_element = ET.SubElement(element, "CLIENT-SERVER-INTERFACE")
2140
- self.setPortInterface(child_element, cs_interface)
2141
- self.writeOperations(child_element, cs_interface)
2457
+ self.writePortInterface(child_element, cs_interface)
2458
+ self.writeClientServerInterfaceOperations(child_element, cs_interface)
2142
2459
  self.writePossibleErrors(child_element, cs_interface)
2143
2460
 
2144
2461
  def writeApplicationSwComponentType(self, element: ET.Element, sw_component: ApplicationSwComponentType):
@@ -2154,7 +2471,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2154
2471
  def setApplicationArrayElement(self, element: ET.Element, array_element: ApplicationArrayElement):
2155
2472
  if array_element is not None:
2156
2473
  child_element = ET.SubElement(element, "ELEMENT")
2157
- self.setApplicationCompositeElementDataPrototype(child_element, array_element)
2474
+ self.writeApplicationCompositeElementDataPrototype(child_element, array_element)
2158
2475
  self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE-HANDLING", array_element.getArraySizeHandling())
2159
2476
  self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE-SEMANTICS", array_element.getArraySizeSemantics())
2160
2477
  self.setChildElementOptionalNumericalValue(child_element, "MAX-NUMBER-OF-ELEMENTS", array_element.getMaxNumberOfElements())
@@ -2185,12 +2502,12 @@ class ARXMLWriter(AbstractARXMLWriter):
2185
2502
  child_element = ET.SubElement(element, key)
2186
2503
  self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", group.getShortLabel())
2187
2504
  self.setChildElementOptionalLiteral(child_element, "CATEGORY", group.getCategory())
2188
- #self.writeSwRecordLayoutGroupSwRecordLayoutGroupContentType(child_element, group)
2189
2505
  self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-AXIS", group.getSwRecordLayoutGroupAxis())
2190
2506
  self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-INDEX", group.getSwRecordLayoutGroupIndex())
2191
2507
  self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-FROM", group.getSwRecordLayoutGroupFrom())
2192
2508
  self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-TO", group.getSwRecordLayoutGroupTo())
2193
2509
  self.setChildElementOptionalIntegerValue(child_element, "SW-RECORD-LAYOUT-GROUP-STEP", group.getSwRecordLayoutGroupStep())
2510
+ self.writeSwRecordLayoutGroupSwRecordLayoutGroupContentType(child_element, group)
2194
2511
 
2195
2512
  def writeSwRecordLayout(self, element: ET.Element, layout: SwRecordLayout):
2196
2513
  self.logger.debug("writeSwRecordLayout %s" % layout.getShortName())
@@ -2213,7 +2530,8 @@ class ARXMLWriter(AbstractARXMLWriter):
2213
2530
 
2214
2531
  def writeTriggerInterface(self, element: ET.Element, trigger_if: TriggerInterface):
2215
2532
  self.logger.debug("writeTriggerInterface %s" % trigger_if.getShortName())
2216
- child_element = ET.SubElement(element, "TRIGGER-INTERFACE")
2533
+ # child_element = ET.SubElement(element, "TRIGGER-INTERFACE")
2534
+ # self.writePortInterface()
2217
2535
 
2218
2536
  def writeServiceSwComponentType(self, element: ET.Element, sw_component: ServiceSwComponentType):
2219
2537
  self.logger.debug("writeServiceSwComponentType %s" % sw_component.getShortName())
@@ -2278,7 +2596,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2278
2596
  def writeModeSwitchInterface(self, element: ET.Element, mode_interface: ModeSwitchInterface):
2279
2597
  self.logger.debug("writeModeSwitchInterface %s" % mode_interface.getShortName())
2280
2598
  child_element = ET.SubElement(element, "MODE-SWITCH-INTERFACE")
2281
- self.setPortInterface(child_element, mode_interface)
2599
+ self.writePortInterface(child_element, mode_interface)
2282
2600
  self.writeModeSwitchInterfaceModeGroup(child_element, mode_interface)
2283
2601
 
2284
2602
  def setEOCExecutableEntityRefSuccessorRefs(self, element: ET.Element, successor_refs: List[RefType]):
@@ -2300,7 +2618,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2300
2618
  if isinstance(order_element, EOCExecutableEntityRef):
2301
2619
  self.writeEOCExecutableEntityRef(child_element, order_element)
2302
2620
  else:
2303
- self._raiseError("Unsupported order element <%s>" % type(order_element))
2621
+ self.notImplemented("Unsupported order element <%s>" % type(order_element))
2304
2622
 
2305
2623
  def writeExecutionOrderConstraint(self, element: ET.Element, constraint: ExecutionOrderConstraint):
2306
2624
  self.logger.debug("writeExecutionOrderConstraint %s" % constraint.getShortName())
@@ -2316,7 +2634,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2316
2634
  if isinstance(requirement, ExecutionOrderConstraint):
2317
2635
  self.writeExecutionOrderConstraint(child_element, requirement)
2318
2636
  else:
2319
- self._raiseError("Unsupported timing requirement <%s>" % type(requirement))
2637
+ self.notImplemented("Unsupported timing requirement <%s>" % type(requirement))
2320
2638
 
2321
2639
  def writeTimingExtension(self, element: ET.Element, extension: TimingExtension):
2322
2640
  self.writeTimingRequirements(element, extension)
@@ -2340,7 +2658,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2340
2658
 
2341
2659
  def writeFrame(self, element: ET.Element, frame: Frame):
2342
2660
  self.writeIdentifiable(element, frame)
2343
- self.setChildElementOptionalNumericalValue(element, "FRAME-LENGTH", frame.frameLength)
2661
+ self.setChildElementOptionalNumericalValue(element, "FRAME-LENGTH", frame.frameLength)
2344
2662
  self.writePduToFrameMappings(element, frame)
2345
2663
 
2346
2664
  def writeLinUnconditionalFrame(self, element: ET.Element, frame: LinUnconditionalFrame):
@@ -2417,7 +2735,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2417
2735
  self.logger.debug("Write NmConfigNmClusterCouplings <%s>" % config.getShortName())
2418
2736
  couplings = config.getNmClusterCouplings()
2419
2737
  if len(couplings) > 0:
2420
- child_element= ET.SubElement(element, "NM-CLUSTER-COUPLINGS")
2738
+ child_element = ET.SubElement(element, "NM-CLUSTER-COUPLINGS")
2421
2739
  for coupling in couplings:
2422
2740
  if isinstance(coupling, CanNmClusterCoupling):
2423
2741
  self.writeCanNmClusterCoupling(child_element, coupling)
@@ -2573,7 +2891,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2573
2891
  if props is not None:
2574
2892
  child_element = ET.SubElement(element, key)
2575
2893
  self.setChildElementOptionalPositiveInteger(child_element, "AUTH-DATA-FRESHNESS-LENGTH", props.getAuthDataFreshnessLength())
2576
- self.setChildElementOptionalPositiveInteger(child_element, "AUTH-DATA-FRESHNESS-START-POSITION", props.getAuthDataFreshnessStartPosition())
2894
+ self.setChildElementOptionalPositiveInteger(child_element, "AUTH-DATA-FRESHNESS-START-POSITION", props.getAuthDataFreshnessStartPosition()) # noqa E501
2577
2895
  self.setChildElementOptionalPositiveInteger(child_element, "AUTH-INFO-TX-LENGTH", props.getAuthInfoTxLength())
2578
2896
  self.setChildElementOptionalPositiveInteger(child_element, "AUTHENTICATION-BUILD-ATTEMPTS", props.getAuthenticationBuildAttempts())
2579
2897
  self.setChildElementOptionalPositiveInteger(child_element, "AUTHENTICATION-RETRIES", props.getAuthenticationRetries())
@@ -2712,7 +3030,6 @@ class ARXMLWriter(AbstractARXMLWriter):
2712
3030
  else:
2713
3031
  self.notImplemented("Unsupported TpNode <%s>" % type(tp_node))
2714
3032
 
2715
-
2716
3033
  def writeCanTpConfig(self, element: ET.Element, config: CanTpConfig):
2717
3034
  self.logger.debug("Write CanTpConfig <%s>" % config.getShortName())
2718
3035
  child_element = ET.SubElement(element, "CAN-TP-CONFIG")
@@ -2791,6 +3108,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2791
3108
  self.writeLinTpConfigTpNodes(child_element, config)
2792
3109
 
2793
3110
  def writeFrameTriggering(self, element: ET.Element, triggering: FrameTriggering):
3111
+ self.writeIdentifiable(element, triggering)
2794
3112
  ref_list = triggering.getFramePortRefs()
2795
3113
  if len(ref_list) > 0:
2796
3114
  frame_port_refs_tag = ET.SubElement(element, "FRAME-PORT-REFS")
@@ -2802,13 +3120,12 @@ class ARXMLWriter(AbstractARXMLWriter):
2802
3120
  if len(refs) > 0:
2803
3121
  triggerings_tag = ET.SubElement(element, "PDU-TRIGGERINGS")
2804
3122
  for ref in refs:
2805
- child_element = ET.SubElement(triggerings_tag, 'PDU-TRIGGERING-REF-CONDITIONAL')
2806
- self.setChildElementOptionalRefType(child_element, "PDU-TRIGGERING-REF", ref)
3123
+ child_element = ET.SubElement(triggerings_tag, 'PDU-TRIGGERING-REF-CONDITIONAL')
3124
+ self.setChildElementOptionalRefType(child_element, "PDU-TRIGGERING-REF", ref)
2807
3125
 
2808
3126
  def writeCanFrameTriggering(self, element: ET.Element, triggering: CanFrameTriggering):
2809
3127
  self.logger.debug("WRite CanFrameTriggering %s" % triggering.getShortName())
2810
3128
  child_element = ET.SubElement(element, "CAN-FRAME-TRIGGERING")
2811
- self.writeIdentifiable(child_element, triggering)
2812
3129
  self.writeFrameTriggering(child_element, triggering)
2813
3130
  self.setChildElementOptionalLiteral(child_element, "CAN-ADDRESSING-MODE", triggering.getCanAddressingMode())
2814
3131
  self.setChildElementOptionalBooleanValue(child_element, "CAN-FD-FRAME-SUPPORT", triggering.getCanFdFrameSupport())
@@ -2820,11 +3137,55 @@ class ARXMLWriter(AbstractARXMLWriter):
2820
3137
  def writeLinFrameTriggering(self, element: ET.Element, triggering: LinFrameTriggering):
2821
3138
  self.logger.debug("Write LinFrameTriggering %s" % triggering.getShortName())
2822
3139
  child_element = ET.SubElement(element, "LIN-FRAME-TRIGGERING")
2823
- self.writeIdentifiable(child_element, triggering)
2824
3140
  self.writeFrameTriggering(child_element, triggering)
2825
3141
  self.setChildElementOptionalNumericalValue(child_element, "IDENTIFIER", triggering.getIdentifier())
2826
3142
  self.setChildElementOptionalLiteral(child_element, "LIN-CHECKSUM", triggering.getLinChecksum())
2827
3143
 
3144
+ def writeCommunicationCycle(self, element: ET.Element, cycle: CommunicationCycle):
3145
+ self.writeARObjectAttributes(element, cycle)
3146
+
3147
+ def writeCycleRepetition(self, element: ET.Element, cycle: CycleRepetition):
3148
+ if cycle is not None:
3149
+ child_element = ET.SubElement(element, "CYCLE-REPETITION")
3150
+ self.writeCommunicationCycle(child_element, cycle)
3151
+ self.setChildElementOptionalIntegerValue(child_element, "BASE-CYCLE", cycle.getBaseCycle())
3152
+ self.setChildElementOptionalLiteral(child_element, "CYCLE-REPETITION", cycle.getCycleRepetition())
3153
+
3154
+ def writeFlexrayAbsolutelyScheduledTimingCommunicationCycle(self, element: ET.Element, timing: FlexrayAbsolutelyScheduledTiming):
3155
+ cycle = timing.getCommunicationCycle()
3156
+ if cycle is not None:
3157
+ child_element = ET.SubElement(element, "COMMUNICATION-CYCLE")
3158
+ if isinstance(cycle, CycleRepetition):
3159
+ self.writeCycleRepetition(child_element, cycle)
3160
+ else:
3161
+ self.notImplemented("Unsupported CommunicationCycle <%s>" % type(child_element))
3162
+
3163
+ def writeFlexrayAbsolutelyScheduledTiming(self, element: ET.Element, timing: FlexrayAbsolutelyScheduledTiming):
3164
+ if timing is not None:
3165
+ child_element = ET.SubElement(element, "FLEXRAY-ABSOLUTELY-SCHEDULED-TIMING")
3166
+ self.writeARObjectAttributes(child_element, timing)
3167
+ self.writeFlexrayAbsolutelyScheduledTimingCommunicationCycle(child_element, timing)
3168
+ self.setChildElementOptionalPositiveInteger(child_element, "SLOT-ID", timing.getSlotID())
3169
+
3170
+ def writeFlexrayFrameTriggeringAbsolutelyScheduledTimings(self, element: ET.Element, triggering: FlexrayFrameTriggering):
3171
+ timings = triggering.getAbsolutelyScheduledTimings()
3172
+ if len(timings) > 0:
3173
+ child_element = ET.SubElement(element, "ABSOLUTELY-SCHEDULED-TIMINGS")
3174
+ for timing in timings:
3175
+ if isinstance(timing, FlexrayAbsolutelyScheduledTiming):
3176
+ self.writeFlexrayAbsolutelyScheduledTiming(child_element, timing)
3177
+ else:
3178
+ self.notImplemented("Unsupported AbsolutelyScheduledTiming <%s>" % type(timing))
3179
+
3180
+ def writeFlexrayFrameTriggering(self, element: ET.Element, triggering: FlexrayFrameTriggering):
3181
+ self.logger.debug("Write FlexrayFrameTriggering %s" % triggering.getShortName())
3182
+ child_element = ET.SubElement(element, "FLEXRAY-FRAME-TRIGGERING")
3183
+ self.writeFrameTriggering(child_element, triggering)
3184
+ self.writeFlexrayFrameTriggeringAbsolutelyScheduledTimings(child_element, triggering)
3185
+ self.setChildElementOptionalBooleanValue(child_element, "ALLOW-DYNAMIC-L-SDU-LENGTH", triggering.getAllowDynamicLSduLength())
3186
+ self.setChildElementOptionalPositiveInteger(child_element, "MESSAGE-ID", triggering.getMessageId())
3187
+ self.setChildElementOptionalBooleanValue(child_element, "PAYLOAD-PREAMBLE-INDICATOR", triggering.getPayloadPreambleIndicator())
3188
+
2828
3189
  def writeISignalTriggering(self, element: ET.Element, triggering: ISignalTriggering):
2829
3190
  self.logger.debug("Write ISignalTriggering %s" % triggering.getShortName())
2830
3191
  child_element = ET.SubElement(element, "I-SIGNAL-TRIGGERING")
@@ -2852,17 +3213,18 @@ class ARXMLWriter(AbstractARXMLWriter):
2852
3213
  if len(refs) > 0:
2853
3214
  triggerings_tag = ET.SubElement(child_element, "I-SIGNAL-TRIGGERINGS")
2854
3215
  for ref in refs:
2855
- child_element = ET.SubElement(triggerings_tag, 'I-SIGNAL-TRIGGERING-REF-CONDITIONAL')
2856
- self.setChildElementOptionalRefType(child_element, "I-SIGNAL-TRIGGERING-REF", ref)
3216
+ child_element = ET.SubElement(triggerings_tag, 'I-SIGNAL-TRIGGERING-REF-CONDITIONAL')
3217
+ self.setChildElementOptionalRefType(child_element, "I-SIGNAL-TRIGGERING-REF", ref)
2857
3218
 
2858
- def writePhysicalChannel(self, element: ET.Element, channel: PhysicalChannel):
3219
+ def writePhysicalChannelCommConnectorRefs(self, element, channel):
2859
3220
  connectors = channel.getCommConnectorRefs()
2860
3221
  if len(connectors) > 0:
2861
3222
  connectors_tag = ET.SubElement(element, "COMM-CONNECTORS")
2862
3223
  for connector in connectors:
2863
- child_element = ET.SubElement(connectors_tag, 'COMMUNICATION-CONNECTOR-REF-CONDITIONAL')
2864
- self.setChildElementOptionalRefType(child_element, "COMMUNICATION-CONNECTOR-REF", connector)
3224
+ child_element = ET.SubElement(connectors_tag, 'COMMUNICATION-CONNECTOR-REF-CONDITIONAL')
3225
+ self.setChildElementOptionalRefType(child_element, "COMMUNICATION-CONNECTOR-REF", connector)
2865
3226
 
3227
+ def writePhysicalChannelFrameTriggerings(self, element, channel):
2866
3228
  triggerings = channel.getFrameTriggerings()
2867
3229
  if len(triggerings) > 0:
2868
3230
  triggerings_tag = ET.SubElement(element, "FRAME-TRIGGERINGS")
@@ -2871,9 +3233,12 @@ class ARXMLWriter(AbstractARXMLWriter):
2871
3233
  self.writeCanFrameTriggering(triggerings_tag, triggering)
2872
3234
  elif isinstance(triggering, LinFrameTriggering):
2873
3235
  self.writeLinFrameTriggering(triggerings_tag, triggering)
3236
+ elif isinstance(triggering, FlexrayFrameTriggering):
3237
+ self.writeFlexrayFrameTriggering(triggerings_tag, triggering)
2874
3238
  else:
2875
3239
  self.notImplemented("Unsupported Frame Triggering <%s>" % type(triggering))
2876
-
3240
+
3241
+ def writePhysicalChannelISignalTriggerings(self, element, channel):
2877
3242
  triggerings = channel.getISignalTriggerings()
2878
3243
  if len(triggerings) > 0:
2879
3244
  triggerings_tag = ET.SubElement(element, "I-SIGNAL-TRIGGERINGS")
@@ -2882,7 +3247,8 @@ class ARXMLWriter(AbstractARXMLWriter):
2882
3247
  self.writeISignalTriggering(triggerings_tag, triggering)
2883
3248
  else:
2884
3249
  self.notImplemented("Unsupported ISignalTriggering <%s>" % type(triggering))
2885
-
3250
+
3251
+ def writePhysicalChannelPduTriggerings(self, element, channel):
2886
3252
  triggerings = channel.getPduTriggerings()
2887
3253
  if len(triggerings) > 0:
2888
3254
  triggerings_tag = ET.SubElement(element, "PDU-TRIGGERINGS")
@@ -2892,10 +3258,17 @@ class ARXMLWriter(AbstractARXMLWriter):
2892
3258
  else:
2893
3259
  self.notImplemented("Unsupported PduTriggering <%s>" % type(triggering))
2894
3260
 
3261
+ def writePhysicalChannel(self, element: ET.Element, channel: PhysicalChannel):
3262
+ self.writeIdentifiable(element, channel)
3263
+
3264
+ self.writePhysicalChannelCommConnectorRefs(element, channel)
3265
+ self.writePhysicalChannelFrameTriggerings(element, channel)
3266
+ self.writePhysicalChannelISignalTriggerings(element, channel)
3267
+ self.writePhysicalChannelPduTriggerings(element, channel)
3268
+
2895
3269
  def writeCanPhysicalChannel(self, element: ET.Element, channel: CanPhysicalChannel):
2896
3270
  self.logger.debug("Set CanPhysicalChannel %s" % channel.getShortName())
2897
3271
  child_element = ET.SubElement(element, "CAN-PHYSICAL-CHANNEL")
2898
- self.writeIdentifiable(child_element, channel)
2899
3272
  self.writePhysicalChannel(child_element, channel)
2900
3273
 
2901
3274
  def writeScheduleTableEntry(self, element: ET.Element, entry: ScheduleTableEntry):
@@ -2938,7 +3311,6 @@ class ARXMLWriter(AbstractARXMLWriter):
2938
3311
  def writeLinPhysicalChannel(self, element: ET.Element, channel: LinPhysicalChannel):
2939
3312
  self.logger.debug("Set LinPhysicalChannel %s" % channel.getShortName())
2940
3313
  child_element = ET.SubElement(element, "LIN-PHYSICAL-CHANNEL")
2941
- self.writeIdentifiable(child_element, channel)
2942
3314
  self.writePhysicalChannel(child_element, channel)
2943
3315
  self.writeLinPhysicalChannelScheduleTables(child_element, channel)
2944
3316
 
@@ -2986,7 +3358,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2986
3358
  for end_point in end_points:
2987
3359
  self.writeNetworkEndPoint(child_element, end_point)
2988
3360
 
2989
- def setSocketConnectionIpduIdentifier(self, element: ET.Element,identifier: SocketConnectionIpduIdentifier):
3361
+ def setSocketConnectionIpduIdentifier(self, element: ET.Element, identifier: SocketConnectionIpduIdentifier):
2990
3362
  if identifier is not None:
2991
3363
  child_element = ET.SubElement(element, "SOCKET-CONNECTION-IPDU-IDENTIFIER")
2992
3364
  self.setChildElementOptionalPositiveInteger(child_element, "HEADER-ID", identifier.getHeaderId())
@@ -3007,8 +3379,8 @@ class ARXMLWriter(AbstractARXMLWriter):
3007
3379
  def setSocketConnection(self, element: ET.Element, connection: SocketConnection):
3008
3380
  if connection is not None:
3009
3381
  child_element = ET.SubElement(element, "SOCKET-CONNECTION")
3010
- self.setChildElementOptionalBooleanValue(child_element, "CLIENT-IP-ADDR-FROM-CONNECTION-REQUEST", connection.getClientIpAddrFromConnectionRequest())
3011
- self.setChildElementOptionalBooleanValue(child_element, "CLIENT-PORT-FROM-CONNECTION-REQUEST", connection.getClientPortFromConnectionRequest())
3382
+ self.setChildElementOptionalBooleanValue(child_element, "CLIENT-IP-ADDR-FROM-CONNECTION-REQUEST", connection.getClientIpAddrFromConnectionRequest()) # noqa E501
3383
+ self.setChildElementOptionalBooleanValue(child_element, "CLIENT-PORT-FROM-CONNECTION-REQUEST", connection.getClientPortFromConnectionRequest()) # noqa E501
3012
3384
  self.setChildElementOptionalRefType(child_element, "CLIENT-PORT-REF", connection.getClientPortRef())
3013
3385
  self.setSocketConnectionPdus(child_element, "PDUS", connection.getPdus())
3014
3386
  self.setChildElementOptionalPositiveInteger(child_element, "PDU-COLLECTION-MAX-BUFFER-SIZE", connection.getPduCollectionMaxBufferSize())
@@ -3095,14 +3467,6 @@ class ARXMLWriter(AbstractARXMLWriter):
3095
3467
  self.setChildElementOptionalTimeValue(child_element, "MAX-VALUE", delay.getMaxValue())
3096
3468
  self.setChildElementOptionalTimeValue(child_element, "MIN-VALUE", delay.getMinValue())
3097
3469
 
3098
- def setInitialSdDelayConfig(self, element: ET.Element, key: str, config: InitialSdDelayConfig):
3099
- if config is not None:
3100
- child_element = ET.SubElement(element, key)
3101
- self.setChildElementOptionalTimeValue(child_element, "INITIAL-DELAY-MAX-VALUE", config.getInitialDelayMaxValue())
3102
- self.setChildElementOptionalTimeValue(child_element, "INITIAL-DELAY-MIN-VALUE", config.getInitialDelayMinValue())
3103
- self.setChildElementOptionalTimeValue(child_element, "INITIAL-REPETITIONS-BASE-DELAY", config.getInitialRepetitionsBaseDelay())
3104
- self.setChildElementOptionalPositiveInteger(child_element, "INITIAL-REPETITIONS-MAX", config.getInitialRepetitionsMax())
3105
-
3106
3470
  def setSdClientConfig(self, element: ET.Element, key: str, config: SdClientConfig):
3107
3471
  if config is not None:
3108
3472
  child_element = ET.SubElement(element, key)
@@ -3130,7 +3494,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3130
3494
  if isinstance(group, ConsumedEventGroup):
3131
3495
  self.writeConsumedEventGroup(child_element, group)
3132
3496
  else:
3133
- self.notImplemented("Unsupported ConsumedEventGroups <%s>" % type(group))
3497
+ self.notImplemented("Unsupported ConsumedEventGroups <%s>" % type(group))
3134
3498
 
3135
3499
  def writeConsumedServiceInstance(self, element: ET.Element, instance: ConsumedServiceInstance):
3136
3500
  if instance is not None:
@@ -3147,7 +3511,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3147
3511
  for instance in instances:
3148
3512
  if isinstance(instance, ConsumedServiceInstance):
3149
3513
  self.writeConsumedServiceInstance(child_element, instance)
3150
- else:
3514
+ else:
3151
3515
  self.notImplemented("Unsupported ConsumedServiceInstances <%s>" % type(instance))
3152
3516
 
3153
3517
  def setInitialSdDelayConfig(self, element: ET.Element, key: str, config: InitialSdDelayConfig):
@@ -3241,7 +3605,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3241
3605
  self.writeIdentifiable(child_element, address)
3242
3606
  self.writeSocketAddressApplicationEndpoint(child_element, address)
3243
3607
  self.writeSocketAddressMulticastConnectorRefs(child_element, address)
3244
- self.setChildElementOptionalRefType(child_element, "CONNECTOR-REF", address.getConnectorRef())
3608
+ self.setChildElementOptionalRefType(child_element, "CONNECTOR-REF", address.getConnectorRef())
3245
3609
  self.setChildElementOptionalPositiveInteger(child_element, "PORT-ADDRESS", address.getPortAddress())
3246
3610
 
3247
3611
  def writeSoAdConfigSocketAddresses(self, element: ET.Element, config: SoAdConfig):
@@ -3270,12 +3634,17 @@ class ARXMLWriter(AbstractARXMLWriter):
3270
3634
  def writeEthernetPhysicalChannel(self, element: ET.Element, channel: EthernetPhysicalChannel):
3271
3635
  self.logger.debug("Set EthernetPhysicalChannel %s" % channel.getShortName())
3272
3636
  child_element = ET.SubElement(element, "ETHERNET-PHYSICAL-CHANNEL")
3273
- self.writeIdentifiable(child_element, channel)
3274
3637
  self.writePhysicalChannel(child_element, channel)
3275
3638
  self.writeEthernetPhysicalChannelNetworkEndPoints(child_element, channel.getNetworkEndpoints())
3276
3639
  self.writeSoAdConfig(child_element, "SO-AD-CONFIG", channel.getSoAdConfig())
3277
3640
  self.writeEthernetPhysicalChannelVlan(child_element, channel)
3278
3641
 
3642
+ def writeFlexrayPhysicalChannel(self, element: ET.Element, channel: FlexrayPhysicalChannel):
3643
+ self.logger.debug("Set FlexrayPhysicalChannel %s" % channel.getShortName())
3644
+ child_element = ET.SubElement(element, "FLEXRAY-PHYSICAL-CHANNEL")
3645
+ self.writePhysicalChannel(child_element, channel)
3646
+ self.setChildElementOptionalLiteral(child_element, "CHANNEL-NAME", channel.getChannelName())
3647
+
3279
3648
  def writeCommunicationClusterPhysicalChannels(self, element: ET.Element, cluster: CommunicationCluster):
3280
3649
  channels = cluster.getPhysicalChannels()
3281
3650
  if len(channels) > 0:
@@ -3287,6 +3656,8 @@ class ARXMLWriter(AbstractARXMLWriter):
3287
3656
  self.writeLinPhysicalChannel(child_element, channel)
3288
3657
  elif isinstance(channel, EthernetPhysicalChannel):
3289
3658
  self.writeEthernetPhysicalChannel(child_element, channel)
3659
+ elif isinstance(channel, FlexrayPhysicalChannel):
3660
+ self.writeFlexrayPhysicalChannel(child_element, channel)
3290
3661
  else:
3291
3662
  self.notImplemented("Unsupported Physical Channel <%s>" % type(channel))
3292
3663
 
@@ -3309,22 +3680,68 @@ class ARXMLWriter(AbstractARXMLWriter):
3309
3680
  self.setChildElementOptionalNumericalValue(element, "SPEED", cluster.getSpeed())
3310
3681
 
3311
3682
  def writeLinCluster(self, element: ET.Element, cluster: LinCluster):
3312
- self.logger.debug("LinCluster %s" % cluster.getShortName())
3313
- child_element = ET.SubElement(element, "LIN-CLUSTER")
3314
- self.writeIdentifiable(child_element, cluster)
3315
- child_element = ET.SubElement(child_element, "LIN-CLUSTER-VARIANTS")
3316
- child_element = ET.SubElement(child_element, "LIN-CLUSTER-CONDITIONAL")
3317
- self.writeCommunicationCluster(child_element, cluster)
3683
+ if cluster is not None:
3684
+ self.logger.debug("LinCluster %s" % cluster.getShortName())
3685
+ child_element = ET.SubElement(element, "LIN-CLUSTER")
3686
+ self.writeIdentifiable(child_element, cluster)
3687
+
3688
+ child_element = ET.SubElement(child_element, "LIN-CLUSTER-VARIANTS")
3689
+ child_element = ET.SubElement(child_element, "LIN-CLUSTER-CONDITIONAL")
3690
+ self.writeCommunicationCluster(child_element, cluster)
3318
3691
 
3319
3692
  def writeCanCluster(self, element: ET.Element, cluster: CanCluster):
3320
- self.logger.debug("CanCluster %s" % cluster.getShortName())
3321
- child_element = ET.SubElement(element, "CAN-CLUSTER")
3322
- self.writeIdentifiable(child_element, cluster)
3323
-
3324
- child_element = ET.SubElement(child_element, "CAN-CLUSTER-VARIANTS")
3325
- child_element = ET.SubElement(child_element, "CAN-CLUSTER-CONDITIONAL")
3326
- self.writeCommunicationCluster(child_element, cluster)
3327
- self.writeAbstractCanCluster(child_element, cluster)
3693
+ if cluster is not None:
3694
+ self.logger.debug("CanCluster %s" % cluster.getShortName())
3695
+ child_element = ET.SubElement(element, "CAN-CLUSTER")
3696
+ self.writeIdentifiable(child_element, cluster)
3697
+
3698
+ child_element = ET.SubElement(child_element, "CAN-CLUSTER-VARIANTS")
3699
+ child_element = ET.SubElement(child_element, "CAN-CLUSTER-CONDITIONAL")
3700
+ self.writeCommunicationCluster(child_element, cluster)
3701
+ self.writeAbstractCanCluster(child_element, cluster)
3702
+
3703
+ def writeFlexrayCluster(self, element: ET.Element, cluster: FlexrayCluster):
3704
+ if cluster is not None:
3705
+ self.logger.debug("Write FlexrayCluster <%s>" % cluster.getShortName())
3706
+ child_element = ET.SubElement(element, "FLEXRAY-CLUSTER")
3707
+ self.writeIdentifiable(child_element, cluster)
3708
+
3709
+ child_element = ET.SubElement(child_element, "FLEXRAY-CLUSTER-VARIANTS")
3710
+ child_element = ET.SubElement(child_element, "FLEXRAY-CLUSTER-CONDITIONAL")
3711
+ self.writeCommunicationCluster(child_element, cluster)
3712
+
3713
+ self.setChildElementOptionalIntegerValue(child_element, "ACTION-POINT-OFFSET", cluster.getActionPointOffset())
3714
+ self.setChildElementOptionalTimeValue(child_element, "BIT", cluster.getBit())
3715
+ self.setChildElementOptionalIntegerValue(child_element, "CAS-RX-LOW-MAX", cluster.getCasRxLowMax())
3716
+ self.setChildElementOptionalIntegerValue(child_element, "COLD-START-ATTEMPTS", cluster.getColdStartAttempts())
3717
+ self.setChildElementOptionalTimeValue(child_element, "CYCLE", cluster.getCycle())
3718
+ self.setChildElementOptionalIntegerValue(child_element, "CYCLE-COUNT-MAX", cluster.getCycleCountMax())
3719
+ self.setChildElementOptionalBooleanValue(child_element, "DETECT-NIT-ERROR", cluster.getDetectNitError())
3720
+ self.setChildElementOptionalIntegerValue(child_element, "DYNAMIC-SLOT-IDLE-PHASE", cluster.getDynamicSlotIdlePhase())
3721
+ self.setChildElementOptionalIntegerValue(child_element, "IGNORE-AFTER-TX", cluster.getIgnoreAfterTx())
3722
+ self.setChildElementOptionalIntegerValue(child_element, "LISTEN-NOISE", cluster.getListenNoise())
3723
+ self.setChildElementOptionalIntegerValue(child_element, "MACRO-PER-CYCLE", cluster.getMacroPerCycle())
3724
+ self.setChildElementOptionalTimeValue(child_element, "MACROTICK-DURATION", cluster.getMacrotickDuration())
3725
+ self.setChildElementOptionalIntegerValue(child_element, "MAX-WITHOUT-CLOCK-CORRECTION-FATAL", cluster.getMaxWithoutClockCorrectionFatal())
3726
+ self.setChildElementOptionalIntegerValue(child_element, "MAX-WITHOUT-CLOCK-CORRECTION-PASSIVE", cluster.getMaxWithoutClockCorrectionPassive()) # noqa E501
3727
+ self.setChildElementOptionalIntegerValue(child_element, "MINISLOT-ACTION-POINT-OFFSET", cluster.getMinislotActionPointOffset())
3728
+ self.setChildElementOptionalIntegerValue(child_element, "MINISLOT-DURATION", cluster.getMinislotDuration())
3729
+ self.setChildElementOptionalIntegerValue(child_element, "NETWORK-IDLE-TIME", cluster.getNetworkIdleTime())
3730
+ self.setChildElementOptionalIntegerValue(child_element, "NETWORK-MANAGEMENT-VECTOR-LENGTH", cluster.getNetworkManagementVectorLength())
3731
+ self.setChildElementOptionalIntegerValue(child_element, "NUMBER-OF-MINISLOTS", cluster.getNumberOfMinislots())
3732
+ self.setChildElementOptionalIntegerValue(child_element, "NUMBER-OF-STATIC-SLOTS", cluster.getNumberOfStaticSlots())
3733
+ self.setChildElementOptionalIntegerValue(child_element, "OFFSET-CORRECTION-START", cluster.getOffsetCorrectionStart())
3734
+ self.setChildElementOptionalIntegerValue(child_element, "PAYLOAD-LENGTH-STATIC", cluster.getPayloadLengthStatic())
3735
+ self.setChildElementOptionalIntegerValue(child_element, "SAFETY-MARGIN", cluster.getSafetyMargin())
3736
+ self.setChildElementOptionalTimeValue(child_element, "SAMPLE-CLOCK-PERIOD", cluster.getSampleClockPeriod())
3737
+ self.setChildElementOptionalIntegerValue(child_element, "STATIC-SLOT-DURATION", cluster.getStaticSlotDuration())
3738
+ self.setChildElementOptionalIntegerValue(child_element, "SYNC-FRAME-ID-COUNT-MAX", cluster.getSyncFrameIdCountMax())
3739
+ self.setChildElementOptionalIntegerValue(child_element, "TRANSMISSION-START-SEQUENCE-DURATION", cluster.getTransmissionStartSequenceDuration()) # noqa E501
3740
+ self.setChildElementOptionalIntegerValue(child_element, "WAKEUP-RX-IDLE", cluster.getWakeupRxIdle())
3741
+ self.setChildElementOptionalIntegerValue(child_element, "WAKEUP-RX-LOW", cluster.getWakeupRxLow())
3742
+ self.setChildElementOptionalIntegerValue(child_element, "WAKEUP-RX-WINDOW", cluster.getWakeupRxWindow())
3743
+ self.setChildElementOptionalIntegerValue(child_element, "WAKEUP-TX-ACTIVE", cluster.getWakeupTxActive())
3744
+ self.setChildElementOptionalIntegerValue(child_element, "WAKEUP-TX-IDLE", cluster.getWakeupTxIdle())
3328
3745
 
3329
3746
  def writeMacMulticastGroup(self, element: ET.Element, group: MacMulticastGroup):
3330
3747
  if group is not None:
@@ -3390,27 +3807,28 @@ class ARXMLWriter(AbstractARXMLWriter):
3390
3807
  elif isinstance(port, ISignalPort):
3391
3808
  self.writeISignalPort(instances_tag, port)
3392
3809
  else:
3393
- self._raiseError("Unsupported CommConnectorPort <%s>" % type(port))
3810
+ self.notImplemented("Unsupported CommConnectorPort <%s>" % type(port))
3394
3811
 
3395
3812
  def writeCommunicationController(self, element: ET.Element, controller: CommunicationController):
3396
3813
  self.setChildElementOptionalBooleanValue(element, "WAKE-UP-BY-CONTROLLER-SUPPORTED", controller.getWakeUpByControllerSupported())
3397
3814
 
3398
3815
  def setCanControllerFdConfiguration(self, element: ET.Element, key: str, configuration: CanControllerFdConfiguration):
3399
3816
  if configuration is not None:
3400
- child_element = ET.SubElement(element, key)
3401
- #TODO: need to implemented
3817
+ pass
3818
+ # child_element = ET.SubElement(element, key)
3819
+ # TODO: need to implemented
3402
3820
 
3403
3821
  def setCanControllerFdConfigurationRequirements(self, element: ET.Element, key: str, requirements: CanControllerFdConfigurationRequirements):
3404
3822
  if requirements is not None:
3405
3823
  child_element = ET.SubElement(element, key)
3406
- self.setChildElementOptionalIntegerValue(child_element, "MAX-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMaxNumberOfTimeQuantaPerBit())
3824
+ self.setChildElementOptionalIntegerValue(child_element, "MAX-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMaxNumberOfTimeQuantaPerBit()) # noqa E501
3407
3825
  self.setChildElementOptionalFloatValue(child_element, "MAX-SAMPLE-POINT", requirements.getMaxSamplePoint())
3408
3826
  self.setChildElementOptionalFloatValue(child_element, "MAX-SYNC-JUMP-WIDTH", requirements.getMaxSyncJumpWidth())
3409
- self.setChildElementOptionalTimeValue(child_element, "MAX-TRCV-DELAY-COMPENSATION-OFFSET", requirements.getMaxTrcvDelayCompensationOffset())
3410
- self.setChildElementOptionalIntegerValue(child_element, "MIN-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMinNumberOfTimeQuantaPerBit())
3827
+ self.setChildElementOptionalTimeValue(child_element, "MAX-TRCV-DELAY-COMPENSATION-OFFSET", requirements.getMaxTrcvDelayCompensationOffset()) # noqa E501
3828
+ self.setChildElementOptionalIntegerValue(child_element, "MIN-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMinNumberOfTimeQuantaPerBit()) # noqa E501
3411
3829
  self.setChildElementOptionalFloatValue(child_element, "MIN-SAMPLE-POINT", requirements.getMinSamplePoint())
3412
3830
  self.setChildElementOptionalFloatValue(child_element, "MIN-SYNC-JUMP-WIDTH", requirements.getMinSyncJumpWidth())
3413
- self.setChildElementOptionalTimeValue(child_element, "MIN-TRCV-DELAY-COMPENSATION-OFFSET", requirements.getMinTrcvDelayCompensationOffset())
3831
+ self.setChildElementOptionalTimeValue(child_element, "MIN-TRCV-DELAY-COMPENSATION-OFFSET", requirements.getMinTrcvDelayCompensationOffset()) # noqa E501
3414
3832
  self.setChildElementOptionalBooleanValue(child_element, "TX-BIT-RATE-SWITCH", requirements.getTxBitRateSwitch())
3415
3833
 
3416
3834
  def writeAbstractCanCommunicationControllerAttributes(self, element: ET.Element, attributes: AbstractCanCommunicationControllerAttributes):
@@ -3421,10 +3839,10 @@ class ARXMLWriter(AbstractARXMLWriter):
3421
3839
  if requirements is not None:
3422
3840
  child_element = ET.SubElement(element, "CAN-CONTROLLER-CONFIGURATION-REQUIREMENTS")
3423
3841
  self.writeAbstractCanCommunicationControllerAttributes(child_element, requirements)
3424
- self.setChildElementOptionalIntegerValue(child_element, "MAX-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMaxNumberOfTimeQuantaPerBit())
3842
+ self.setChildElementOptionalIntegerValue(child_element, "MAX-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMaxNumberOfTimeQuantaPerBit()) # noqa E501
3425
3843
  self.setChildElementOptionalFloatValue(child_element, "MAX-SAMPLE-POINT", requirements.getMaxSamplePoint())
3426
3844
  self.setChildElementOptionalFloatValue(child_element, "MAX-SYNC-JUMP-WIDTH", requirements.getMaxSyncJumpWidth())
3427
- self.setChildElementOptionalIntegerValue(child_element, "MIN-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMinNumberOfTimeQuantaPerBit())
3845
+ self.setChildElementOptionalIntegerValue(child_element, "MIN-NUMBER-OF-TIME-QUANTA-PER-BIT", requirements.getMinNumberOfTimeQuantaPerBit()) # noqa E501
3428
3846
  self.setChildElementOptionalFloatValue(child_element, "MIN-SAMPLE-POINT", requirements.getMinSamplePoint())
3429
3847
  self.setChildElementOptionalFloatValue(child_element, "MIN-SYNC-JUMP-WIDTH", requirements.getMinSyncJumpWidth())
3430
3848
 
@@ -3435,7 +3853,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3435
3853
  if isinstance(attributes, CanControllerConfigurationRequirements):
3436
3854
  self.writeCanControllerConfigurationRequirements(child_element, attributes)
3437
3855
  else:
3438
- self.notImplemented("Unsupported CanControllerAttributes <%s>" % type(attributes))
3856
+ self.notImplemented("Unsupported CanControllerAttributes <%s>" % type(attributes))
3439
3857
 
3440
3858
  def writeAbstractCanCommunicationController(self, element: ET.Element, controller: AbstractCanCommunicationController):
3441
3859
  self.writeCommunicationController(element, controller)
@@ -3494,10 +3912,10 @@ class ARXMLWriter(AbstractARXMLWriter):
3494
3912
 
3495
3913
  def setCouplingPortDetails(self, element: ET.Element, key: str, details: CouplingPortDetails):
3496
3914
  if details is not None:
3497
- child_element = ET.SubElement(element, key)
3498
- self.writeCouplingPortDetailsCouplingPortStructuralElements(child_element, details)
3499
- self.writeCouplingPortDetailsEthernetPriorityRegenerations(child_element, details)
3500
- self.setChildElementOptionalRefType(child_element, "LAST-EGRESS-SCHEDULER-REF", details.getLastEgressSchedulerRef())
3915
+ child_element = ET.SubElement(element, key)
3916
+ self.writeCouplingPortDetailsCouplingPortStructuralElements(child_element, details)
3917
+ self.writeCouplingPortDetailsEthernetPriorityRegenerations(child_element, details)
3918
+ self.setChildElementOptionalRefType(child_element, "LAST-EGRESS-SCHEDULER-REF", details.getLastEgressSchedulerRef())
3501
3919
 
3502
3920
  def writeVlanMembership(self, element: ET.Element, membership: VlanMembership):
3503
3921
  if membership is not None:
@@ -3519,7 +3937,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3519
3937
  child_element = ET.SubElement(element, "COUPLING-PORT")
3520
3938
  self.writeIdentifiable(child_element, port)
3521
3939
  self.setCouplingPortDetails(child_element, "COUPLING-PORT-DETAILS", port.getCouplingPortDetails())
3522
- self.setChildElementOptionalLiteral(child_element, "MAC-LAYER-TYPE", port.getMacAddressVlanAssignments())
3940
+ self.setChildElementOptionalLiteral(child_element, "MAC-LAYER-TYPE", port.getMacLayerType())
3523
3941
  self.writeCouplingPortVlanMemberships(child_element, port)
3524
3942
 
3525
3943
  def writeEthernetCommunicationControllerCouplingPorts(self, element: ET.Element, controller: EthernetCommunicationController):
@@ -3552,6 +3970,8 @@ class ARXMLWriter(AbstractARXMLWriter):
3552
3970
  self.writeEthernetCommunicationController(child_element, controller)
3553
3971
  elif isinstance(controller, LinMaster):
3554
3972
  self.writeLinMaster(child_element, controller)
3973
+ elif isinstance(controller, FlexrayCommunicationController):
3974
+ self.writeFlexrayCommunicationController(child_element, controller)
3555
3975
  else:
3556
3976
  self.notImplemented("Unsupported Communication Controller <%s>" % type(controller))
3557
3977
 
@@ -3582,6 +4002,10 @@ class ARXMLWriter(AbstractARXMLWriter):
3582
4002
  self.logger.debug("Write LinCommunicationConnector %s" % connector.getShortName())
3583
4003
  self.writeCommunicationConnector(element, connector)
3584
4004
 
4005
+ def writeFlexrayCommunicationConnector(self, element: ET.Element, connector: FlexrayCommunicationConnector):
4006
+ self.logger.debug("Write FlexrayCommunicationConnector %s" % connector.getShortName())
4007
+ self.writeCommunicationConnector(element, connector)
4008
+
3585
4009
  def writeEcuInstanceConnectors(self, element: ET.Element, instance: EcuInstance):
3586
4010
  connectors = instance.getConnectors()
3587
4011
  if len(connectors) > 0:
@@ -3596,8 +4020,11 @@ class ARXMLWriter(AbstractARXMLWriter):
3596
4020
  elif isinstance(connector, LinCommunicationConnector):
3597
4021
  child_element = ET.SubElement(connectors_tag, "LIN-COMMUNICATION-CONNECTOR")
3598
4022
  self.writeLinCommunicationConnector(child_element, connector)
4023
+ elif isinstance(connector, FlexrayCommunicationConnector):
4024
+ child_element = ET.SubElement(connectors_tag, "FLEXRAY-COMMUNICATION-CONNECTOR")
4025
+ self.writeFlexrayCommunicationConnector(child_element, connector)
3599
4026
  else:
3600
- self._raiseError("Unsupported Communication connector <%s>" % type(connector))
4027
+ self.notImplemented("Unsupported Communication connector <%s>" % type(connector))
3601
4028
 
3602
4029
  def writeEcuInstanceAssociatedComIPduGroupRefs(self, element: ET.Element, instance: EcuInstance):
3603
4030
  refs = instance.getAssociatedComIPduGroupRefs()
@@ -3614,7 +4041,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3614
4041
  self.setChildElementOptionalTimeValue(child_element, "COM-CONFIGURATION-GW-TIME-BASE", instance.getComConfigurationGwTimeBase())
3615
4042
  self.setChildElementOptionalTimeValue(child_element, "COM-CONFIGURATION-RX-TIME-BASE", instance.getComConfigurationRxTimeBase())
3616
4043
  self.setChildElementOptionalTimeValue(child_element, "COM-CONFIGURATION-TX-TIME-BASE", instance.getComConfigurationTxTimeBase())
3617
- self.setChildElementOptionalBooleanValue(child_element, "COM-ENABLE-MDT-FOR-CYCLIC-TRANSMISSION", instance.getComEnableMDTForCyclicTransmission())
4044
+ self.setChildElementOptionalBooleanValue(child_element, "COM-ENABLE-MDT-FOR-CYCLIC-TRANSMISSION", instance.getComEnableMDTForCyclicTransmission()) # noqa E501
3618
4045
  self.writeEcuInstanceCommControllers(child_element, instance)
3619
4046
  self.writeEcuInstanceConnectors(child_element, instance)
3620
4047
  self.setChildElementOptionalIntegerValue(child_element, "DIAGNOSTIC-ADDRESS", instance.getDiagnosticAddress())
@@ -3631,16 +4058,53 @@ class ARXMLWriter(AbstractARXMLWriter):
3631
4058
  for signal_ref in signal_refs:
3632
4059
  self.setChildElementOptionalRefType(signal_refs_tag, "SYSTEM-SIGNAL-REF", signal_ref)
3633
4060
 
3634
- def setSenderReceiverToSignalMapping(self, element: ET.Element, mapping: SenderReceiverToSignalMapping):
4061
+ def writeSenderReceiverToSignalMapping(self, element: ET.Element, mapping: SenderReceiverToSignalMapping):
3635
4062
  child_element = ET.SubElement(element, "SENDER-RECEIVER-TO-SIGNAL-MAPPING")
3636
4063
  self.setChildElementOptionalLiteral(child_element, "COMMUNICATION-DIRECTION", mapping.getCommunicationDirection())
3637
4064
  self.setVariableDataPrototypeInSystemInstanceRef(child_element, "DATA-ELEMENT-IREF", mapping.getDataElementIRef())
3638
4065
  self.setChildElementOptionalRefType(child_element, "SYSTEM-SIGNAL-REF", mapping.getSystemSignalRef())
3639
4066
 
3640
- def setSenderReceiverToSignalGroupMapping(self, element: ET.Element, mapping: SenderReceiverToSignalGroupMapping):
4067
+ def writeSenderRecCompositeTypeMapping(self, element: ET.Element, mapping: SenderRecCompositeTypeMapping):
4068
+ self.writeARObjectAttributes(element, mapping)
4069
+
4070
+ def writeSenderRecRecordElementMapping(self, element: ET.Element, mapping: SenderRecRecordElementMapping):
4071
+ if mapping is not None:
4072
+ child_element = ET.SubElement(element, "SENDER-REC-RECORD-ELEMENT-MAPPING")
4073
+ self.writeARObjectAttributes(child_element, mapping)
4074
+ self.setChildElementOptionalRefType(child_element, "APPLICATION-RECORD-ELEMENT-REF", mapping.getApplicationRecordElementRef())
4075
+ self.setChildElementOptionalRefType(child_element, "IMPLEMENTATION-RECORD-ELEMENT-REF", mapping.getImplementationRecordElementRef())
4076
+ self.setChildElementOptionalRefType(child_element, "SYSTEM-SIGNAL-REF", mapping.getSystemSignalRef())
4077
+
4078
+ def writeSenderRecArrayTypeMappingRecordElementMapping(self, element: ET.Element, mapping: SenderRecRecordTypeMapping):
4079
+ record_element_mappings = mapping.getRecordElementMappings()
4080
+ if len(record_element_mappings) > 0:
4081
+ child_element = ET.SubElement(element, "RECORD-ELEMENT-MAPPINGS")
4082
+ for record_element_mapping in record_element_mappings:
4083
+ if isinstance(record_element_mapping, SenderRecRecordElementMapping):
4084
+ self.writeSenderRecRecordElementMapping(child_element, record_element_mapping)
4085
+ else:
4086
+ self.notImplemented("Unsupported RecordElementMapping %s" % type(record_element_mapping))
4087
+
4088
+ def writeSenderRecRecordTypeMapping(self, element: ET.Element, mapping: SenderRecRecordTypeMapping):
4089
+ if mapping is not None:
4090
+ child_element = ET.SubElement(element, "SENDER-REC-RECORD-TYPE-MAPPING")
4091
+ self.writeSenderRecCompositeTypeMapping(child_element, mapping)
4092
+ self.writeSenderRecArrayTypeMappingRecordElementMapping(child_element, mapping)
4093
+
4094
+ def writeSenderReceiverToSignalGroupMappingTypeMapping(self, element: ET.Element, mapping: SenderReceiverToSignalGroupMapping):
4095
+ type_mapping = mapping.getTypeMapping()
4096
+ if type_mapping is not None:
4097
+ child_element = ET.SubElement(element, "TYPE-MAPPING")
4098
+ if isinstance(type_mapping, SenderRecRecordTypeMapping):
4099
+ self.writeSenderRecRecordTypeMapping(child_element, type_mapping)
4100
+ else:
4101
+ self.notImplemented("Unsupported Type Mapping %s" % type(type_mapping))
4102
+
4103
+ def writeSenderReceiverToSignalGroupMapping(self, element: ET.Element, mapping: SenderReceiverToSignalGroupMapping):
3641
4104
  child_element = ET.SubElement(element, "SENDER-RECEIVER-TO-SIGNAL-GROUP-MAPPING")
3642
4105
  self.setVariableDataPrototypeInSystemInstanceRef(child_element, "DATA-ELEMENT-IREF", mapping.getDataElementIRef())
3643
4106
  self.setChildElementOptionalRefType(child_element, "SIGNAL-GROUP-REF", mapping.getSignalGroupRef())
4107
+ self.writeSenderReceiverToSignalGroupMappingTypeMapping(child_element, mapping)
3644
4108
 
3645
4109
  def writeSystemMappingDataMappings(self, element: ET.Element, system_mapping: SystemMapping):
3646
4110
  data_mappings = system_mapping.getDataMappings()
@@ -3648,9 +4112,9 @@ class ARXMLWriter(AbstractARXMLWriter):
3648
4112
  child_element = ET.SubElement(element, "DATA-MAPPINGS")
3649
4113
  for data_mapping in data_mappings:
3650
4114
  if isinstance(data_mapping, SenderReceiverToSignalMapping):
3651
- self.setSenderReceiverToSignalMapping(child_element, data_mapping)
4115
+ self.writeSenderReceiverToSignalMapping(child_element, data_mapping)
3652
4116
  elif isinstance(data_mapping, SenderReceiverToSignalGroupMapping):
3653
- self.setSenderReceiverToSignalGroupMapping(child_element, data_mapping)
4117
+ self.writeSenderReceiverToSignalGroupMapping(child_element, data_mapping)
3654
4118
  else:
3655
4119
  self.notImplemented("Unsupported Data Mapping %s" % type(data_mapping))
3656
4120
 
@@ -3873,7 +4337,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3873
4337
  ecuc_values_tag = ET.SubElement(element, "ECUC-VALUES")
3874
4338
  for value_ref in value_refs:
3875
4339
  child_element = ET.SubElement(ecuc_values_tag, "ECUC-MODULE-CONFIGURATION-VALUES-REF-CONDITIONAL")
3876
- self.setChildElementOptionalRefType(child_element, "ECUC-MODULE-CONFIGURATION-VALUES-REF", value_ref)
4340
+ self.setChildElementOptionalRefType(child_element, "ECUC-MODULE-CONFIGURATION-VALUES-REF", value_ref)
3877
4341
 
3878
4342
  def writeEcucValueCollection(self, element: ET.Element, collection: EcucValueCollection):
3879
4343
  self.logger.debug("EcucValueCollection %s" % collection.getShortName())
@@ -3890,7 +4354,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3890
4354
  if isinstance(sub_container, EcucContainerValue):
3891
4355
  self.writeEcucContainValue(sub_containers_tag, sub_container)
3892
4356
  else:
3893
- self.notImplemented("Unsupported Sub Container %s" % type(container))
4357
+ self.notImplemented("Unsupported Sub Container %s" % type(container))
3894
4358
 
3895
4359
  def writeEcucParameterValue(self, element: ET.Element, param_value: EcucParameterValue):
3896
4360
  self.setChildElementOptionalRefType(element, "DEFINITION-REF", param_value.getDefinitionRef())
@@ -3909,7 +4373,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3909
4373
  def writeEcucContainerValueParameterValues(self, element: ET.Element, container_value: EcucContainerValue):
3910
4374
  param_values = container_value.getParameterValues()
3911
4375
  if len(param_values) > 0:
3912
- child_element = ET.SubElement(element, "PARAMETER-VALUES")
4376
+ child_element = ET.SubElement(element, "PARAMETER-VALUES")
3913
4377
  for param_value in param_values:
3914
4378
  if isinstance(param_value, EcucTextualParamValue):
3915
4379
  self.setEcucTextualParamValue(child_element, param_value)
@@ -3922,7 +4386,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3922
4386
  self.setChildElementOptionalRefType(element, "DEFINITION-REF", value.getDefinitionRef())
3923
4387
  self.setAnnotations(element, value.getAnnotations())
3924
4388
 
3925
- def setEcucReferenceValue(self, element: ET.Element, value = EcucReferenceValue()):
4389
+ def setEcucReferenceValue(self, element: ET.Element, value=EcucReferenceValue()):
3926
4390
  child_element = ET.SubElement(element, "ECUC-REFERENCE-VALUE")
3927
4391
  self.writeEcucAbstractReferenceValue(child_element, value)
3928
4392
  self.setChildElementOptionalRefType(child_element, "VALUE-REF", value.getValueRef())
@@ -3931,13 +4395,13 @@ class ARXMLWriter(AbstractARXMLWriter):
3931
4395
  def setAnyInstanceRef(self, element: ET.Element, key, instance_ref: AnyInstanceRef):
3932
4396
  if instance_ref is not None:
3933
4397
  child_element = ET.SubElement(element, key)
3934
- self.setChildElementOptionalRefType(child_element, "BASE-REF", instance_ref.getBaseRef())
4398
+ self.setChildElementOptionalRefType(child_element, "BASE-REF", instance_ref.getBaseRef())
3935
4399
  for ref in instance_ref.getContextElementRefs():
3936
4400
  self.setChildElementOptionalRefType(child_element, "CONTEXT-ELEMENT-REF", ref)
3937
4401
  self.setChildElementOptionalRefType(child_element, "TARGET-REF", instance_ref.getTargetRef())
3938
4402
  return instance_ref
3939
4403
 
3940
- def setEcucInstanceReferenceValue(self, element: ET.Element, value : EcucInstanceReferenceValue):
4404
+ def setEcucInstanceReferenceValue(self, element: ET.Element, value: EcucInstanceReferenceValue):
3941
4405
  child_element = ET.SubElement(element, "ECUC-INSTANCE-REFERENCE-VALUE")
3942
4406
  self.writeEcucAbstractReferenceValue(child_element, value)
3943
4407
  self.setAnyInstanceRef(child_element, "VALUE-IREF", value.getValueIRef())
@@ -3946,7 +4410,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3946
4410
  def writeEcucContainerValueReferenceValues(self, element: ET.Element, container_value: EcucContainerValue):
3947
4411
  reference_values = container_value.getReferenceValues()
3948
4412
  if len(reference_values) > 0:
3949
- child_element = ET.SubElement(element, "REFERENCE-VALUES")
4413
+ child_element = ET.SubElement(element, "REFERENCE-VALUES")
3950
4414
  for reference_value in reference_values:
3951
4415
  if isinstance(reference_value, EcucReferenceValue):
3952
4416
  self.setEcucReferenceValue(child_element, reference_value)
@@ -3972,7 +4436,7 @@ class ARXMLWriter(AbstractARXMLWriter):
3972
4436
  if isinstance(container, EcucContainerValue):
3973
4437
  self.writeEcucContainValue(containers_tag, container)
3974
4438
  else:
3975
- self.notImplemented("Unsupported Container %s" % type(container))
4439
+ self.notImplemented("Unsupported Container %s" % type(container))
3976
4440
 
3977
4441
  def writeEcucModuleConfigurationValues(self, element: ET.Element, values: EcucModuleConfigurationValues):
3978
4442
  self.logger.debug("EcucModuleConfigurationValues %s" % values.getShortName())
@@ -3983,16 +4447,58 @@ class ARXMLWriter(AbstractARXMLWriter):
3983
4447
  self.setChildElementOptionalRefType(child_element, "MODULE-DESCRIPTION-REF", values.getModuleDescriptionRef())
3984
4448
  self.writeEcucModuleConfigurationValuesContainers(child_element, values)
3985
4449
 
4450
+ def writeISignalGroupISignalRef(self, element: ET.Element, group: ISignalGroup):
4451
+ signal_refs = group.getISignalRefs()
4452
+ if len(signal_refs) > 0:
4453
+ child_element = ET.SubElement(element, "I-SIGNAL-REFS")
4454
+ for signal_ref in signal_refs:
4455
+ self.setChildElementOptionalRefType(child_element, "I-SIGNAL-REF", signal_ref)
4456
+
4457
+ def writeISignalGroupComBasedSignalGroupTransformation(self, element: ET.Element, group: ISignalGroup):
4458
+ refs = group.getComBasedSignalGroupTransformationRefs()
4459
+ if len(refs) > 0:
4460
+ com_based_element = ET.SubElement(element, "COM-BASED-SIGNAL-GROUP-TRANSFORMATIONS")
4461
+ cond_element = ET.SubElement(com_based_element, "DATA-TRANSFORMATION-REF-CONDITIONAL")
4462
+ for ref in refs:
4463
+ self.setChildElementOptionalRefType(cond_element, "DATA-TRANSFORMATION-REF", ref)
4464
+
4465
+ def writeTransformationISignalProps(self, element: ET.Element, props: TransformationISignalProps):
4466
+ self.writeDescribable(element, props)
4467
+
4468
+ def writeEndToEndTransformationISignalPropsDataIds(self, element: ET.Element, props: EndToEndTransformationISignalProps):
4469
+ ids = props.getDataIds()
4470
+ if len(ids) > 0:
4471
+ child_element = ET.SubElement(element, "DATA-IDS")
4472
+ for id in ids:
4473
+ self.setChildElementOptionalPositiveInteger(child_element, "DATA-ID", id)
4474
+
4475
+ def writeEndToEndTransformationISignalProps(self, element: ET.Element, props: EndToEndTransformationISignalProps):
4476
+ if props is not None:
4477
+ props_element = ET.SubElement(element, "END-TO-END-TRANSFORMATION-I-SIGNAL-PROPS")
4478
+ variant_element = ET.SubElement(props_element, "END-TO-END-TRANSFORMATION-I-SIGNAL-PROPS-VARIANTS")
4479
+ child_element = ET.SubElement(variant_element, "END-TO-END-TRANSFORMATION-I-SIGNAL-PROPS-CONDITIONAL")
4480
+ self.writeTransformationISignalProps(child_element, props)
4481
+ self.setChildElementOptionalRefType(child_element, "TRANSFORMER-REF", props.getTransformerRef())
4482
+ self.writeEndToEndTransformationISignalPropsDataIds(child_element, props)
4483
+ self.setChildElementOptionalPositiveInteger(child_element, "DATA-LENGTH", props.getDataLength())
4484
+
4485
+ def writeISignalGroupTransformationISignalProps(self, element: ET.Element, group: ISignalGroup):
4486
+ props = group.getTransformationISignalProps()
4487
+ if props is not None:
4488
+ child_element = ET.SubElement(element, "TRANSFORMATION-I-SIGNAL-PROPSS")
4489
+ if isinstance(props, EndToEndTransformationISignalProps):
4490
+ self.writeEndToEndTransformationISignalProps(child_element, props)
4491
+ else:
4492
+ self.notImplemented("Unsupported TransformationISignalProps %s" % type(props))
4493
+
3986
4494
  def writeISignalGroup(self, element: ET.Element, group: ISignalGroup):
3987
4495
  self.logger.debug("ISignalGroup %s" % group.getShortName())
3988
4496
  child_element = ET.SubElement(element, "I-SIGNAL-GROUP")
3989
4497
  self.writeIdentifiable(child_element, group)
3990
- signal_refs = group.getISignalRefs()
3991
- if len(signal_refs) > 0:
3992
- signal_refs_tag = ET.SubElement(child_element, "I-SIGNAL-REFS")
3993
- for signal_ref in signal_refs:
3994
- self.setChildElementOptionalRefType(signal_refs_tag, "I-SIGNAL-REF", signal_ref)
4498
+ self.writeISignalGroupComBasedSignalGroupTransformation(child_element, group)
4499
+ self.writeISignalGroupISignalRef(child_element, group)
3995
4500
  self.setChildElementOptionalRefType(child_element, "SYSTEM-SIGNAL-GROUP-REF", group.getSystemSignalGroupRef())
4501
+ self.writeISignalGroupTransformationISignalProps(child_element, group)
3996
4502
 
3997
4503
  def writeISignalIPduGroup(self, element: ET.Element, group: ISignalIPduGroup):
3998
4504
  self.logger.debug("Set ISignalIPduGroup %s" % group.getShortName())
@@ -4252,6 +4758,66 @@ class ARXMLWriter(AbstractARXMLWriter):
4252
4758
  self.writeDoIpTpConfigDoIpLogicAddresses(child_element, config)
4253
4759
  self.writeDoIpTpConfigTpConnections(child_element, config)
4254
4760
 
4761
+ def writeHwDescriptionEntityHwCategoryRefs(self, element: ET.Element, entity: HwDescriptionEntity):
4762
+ refs = entity.getHwCategoryRefs()
4763
+ if len(refs) > 0:
4764
+ child_element = ET.SubElement(element, "HW-CATEGORY-REFS")
4765
+ for ref in refs:
4766
+ self.setChildElementOptionalRefType(child_element, "HW-CATEGORY-REF", ref)
4767
+
4768
+ def writeHwDescriptionEntity(self, element: ET.Element, entity: HwDescriptionEntity):
4769
+ self.writeARElement(element, entity)
4770
+ self.writeHwDescriptionEntityHwCategoryRefs(element, entity)
4771
+
4772
+ def writeHwPinGroup(self, element: ET.SubElement, pin_group: HwPinGroup):
4773
+ if pin_group is not None:
4774
+ child_element = ET.SubElement(element, "HW-PIN-GROUP")
4775
+ self.writeHwDescriptionEntity(child_element, pin_group)
4776
+
4777
+ def writeHwElementHwPinGroups(self, element: ET.Element, hw_element: HwElement):
4778
+ pin_groups = hw_element.getHwPinGroups()
4779
+ if len(pin_groups) > 0:
4780
+ child_element = ET.SubElement(element, "HW-PIN-GROUPS")
4781
+ for pin_group in pin_groups:
4782
+ if isinstance(pin_group, HwPinGroup):
4783
+ self.writeHwPinGroup(child_element, pin_group)
4784
+ else:
4785
+ self.notImplemented("Unsupported Hw Pin Group <%s>" % type(pin_group))
4786
+
4787
+ def writeHwElement(self, element: ET.Element, hw_element: HwElement):
4788
+ if hw_element is not None:
4789
+ self.logger.debug("Write HwElement <%s>" % hw_element.getShortName())
4790
+ child_element = ET.SubElement(element, "HW-ELEMENT")
4791
+ self.writeHwDescriptionEntity(child_element, hw_element)
4792
+ self.writeHwElementHwPinGroups(child_element, hw_element)
4793
+
4794
+ def writeHwAttributeDef(self, element: ET.Element, attribute_def: HwAttributeDef):
4795
+ if attribute_def is not None:
4796
+ child_element = ET.SubElement(element, "HW-ATTRIBUTE-DEF")
4797
+ self.writeIdentifiable(child_element, attribute_def)
4798
+ self.setChildElementOptionalRefType(child_element, "UNIT-REF", attribute_def.getUnitRef())
4799
+
4800
+ def writeHwCategoryHwAttributeDef(self, element: ET.Element, hw_category: HwCategory):
4801
+ attribute_defs = hw_category.getHwAttributeDefs()
4802
+ if len(attribute_defs) > 0:
4803
+ child_element = ET.SubElement(element, "HW-ATTRIBUTE-DEFS")
4804
+ for attribute_def in attribute_defs:
4805
+ if isinstance(attribute_def, HwAttributeDef):
4806
+ self.writeHwAttributeDef(child_element, attribute_def)
4807
+ else:
4808
+ self.notImplemented("Unsupported Hw Attribute Defs <%s>" % type(attribute_def))
4809
+
4810
+ def writeHwCategory(self, element: ET.Element, hw_category: HwCategory):
4811
+ self.logger.debug("write HwCategory <%s>" % hw_category.getShortName())
4812
+ child_element = ET.SubElement(element, "HW-CATEGORY")
4813
+ self.writeARElement(child_element, hw_category)
4814
+ self.writeHwCategoryHwAttributeDef(child_element, hw_category)
4815
+
4816
+ def writeHwType(self, element: ET.Element, type: HwType):
4817
+ self.logger.debug("Write HwType <%s>" % type.getShortName())
4818
+ child_element = ET.SubElement(element, "HW-TYPE")
4819
+ self.writeARElement(child_element, type)
4820
+
4255
4821
  def writeLinCommunicationController(self, element: ET.Element, controller: LinCommunicationController):
4256
4822
  self.writeCommunicationController(element, controller)
4257
4823
  self.setChildElementOptionalLiteral(element, "PROTOCOL-VERSION", controller.getProtocolVersion())
@@ -4296,7 +4862,7 @@ class ARXMLWriter(AbstractARXMLWriter):
4296
4862
  self.setChildElementOptionalRefType(child_element, "I-SIGNAL-IN-I-PDU-REF", condition.getISignalInIPduRef())
4297
4863
 
4298
4864
  def setTimeRangeType(self, element: ET.Element, key: str, time_range: TimeRangeType):
4299
- if time_range is not None:
4865
+ if time_range is not None:
4300
4866
  child_element = ET.SubElement(element, key)
4301
4867
  self.setChildElementOptionalTimeValue(child_element, "VALUE", time_range.getValue())
4302
4868
 
@@ -4305,12 +4871,7 @@ class ARXMLWriter(AbstractARXMLWriter):
4305
4871
  child_element = ET.SubElement(element, key)
4306
4872
  self.setChildElementOptionalIntegerValue(child_element, "NUMBER-OF-REPETITIONS", timing.getNumberOfRepetitions())
4307
4873
  self.setTimeRangeType(child_element, "REPETITION-PERIOD", timing.getRepetitionPeriod())
4308
-
4309
- def setTimeRangeType(self, element: ET.Element, key: str, time_range: TimeRangeType):
4310
- if time_range is not None:
4311
- child_element = ET.SubElement(element, key)
4312
- self.setChildElementOptionalTimeValue(child_element, "VALUE", time_range.getValue())
4313
-
4874
+
4314
4875
  def setCyclicTiming(self, element: ET.Element, key: str, timing: CyclicTiming):
4315
4876
  if timing is not None:
4316
4877
  child_element = ET.SubElement(element, key)
@@ -4324,7 +4885,7 @@ class ARXMLWriter(AbstractARXMLWriter):
4324
4885
  self.setCyclicTiming(child_element, "CYCLIC-TIMING", timing.getCyclicTiming())
4325
4886
  self.setEventControlledTiming(child_element, "EVENT-CONTROLLED-TIMING", timing.getEventControlledTiming())
4326
4887
 
4327
- def setTransmissionModeDeclaration(self, element: ET.Element, key: str, decl : TransmissionModeDeclaration):
4888
+ def setTransmissionModeDeclaration(self, element: ET.Element, key: str, decl: TransmissionModeDeclaration):
4328
4889
  if decl is not None:
4329
4890
  child_element = ET.SubElement(element, key)
4330
4891
  self.setTransmissionModeConditions(child_element, "TRANSMISSION-MODE-CONDITIONS", decl.getTransmissionModeConditions())
@@ -4347,6 +4908,144 @@ class ARXMLWriter(AbstractARXMLWriter):
4347
4908
  self.writeISignalToPduMappings(child_element, ipdu)
4348
4909
  self.setChildElementOptionalIntegerValue(child_element, "UNUSED-BIT-PATTERN", ipdu.getUnusedBitPattern())
4349
4910
 
4911
+ def writeFlexrayFrame(self, element: ET.Element, frame: FlexrayFrame):
4912
+ if frame is not None:
4913
+ self.logger.debug("Write FlexrayFrame <%s>" % frame.getShortName())
4914
+ child_element = ET.SubElement(element, "FLEXRAY-FRAME")
4915
+ self.writeFrame(child_element, frame)
4916
+
4917
+ def writeFlexrayCommunicationController(self, element: ET.Element, controller: FlexrayCommunicationController):
4918
+ if controller is not None:
4919
+ self.logger.debug("Write FlexrayCommunicationController <%s>" % controller.getShortName())
4920
+ controller_element = ET.SubElement(element, "FLEXRAY-COMMUNICATION-CONTROLLER")
4921
+ self.writeIdentifiable(controller_element, controller)
4922
+ variant_element = ET.SubElement(controller_element, "FLEXRAY-COMMUNICATION-CONTROLLER-VARIANTS")
4923
+ child_element = ET.SubElement(variant_element, "FLEXRAY-COMMUNICATION-CONTROLLER-CONDITIONAL")
4924
+ self.writeCommunicationController(controller_element, controller)
4925
+ self.setChildElementOptionalIntegerValue(child_element, "ACCEPTED-STARTUP-RANGE", controller.getAcceptedStartupRange())
4926
+ self.setChildElementOptionalBooleanValue(child_element, "ALLOW-HALT-DUE-TO-CLOCK", controller.getAllowHaltDueToClock())
4927
+ self.setChildElementOptionalIntegerValue(child_element, "ALLOW-PASSIVE-TO-ACTIVE", controller.getAllowPassiveToActive())
4928
+ self.setChildElementOptionalIntegerValue(child_element, "CLUSTER-DRIFT-DAMPING", controller.getClusterDriftDamping())
4929
+ self.setChildElementOptionalIntegerValue(child_element, "DECODING-CORRECTION", controller.getDecodingCorrection())
4930
+ self.setChildElementOptionalIntegerValue(child_element, "DELAY-COMPENSATION-A", controller.getDelayCompensationA())
4931
+ self.setChildElementOptionalIntegerValue(child_element, "DELAY-COMPENSATION-B", controller.getDelayCompensationB())
4932
+ self.setChildElementOptionalBooleanValue(child_element, "KEY-SLOT-ONLY-ENABLED", controller.getKeySlotOnlyEnabled())
4933
+ self.setChildElementOptionalBooleanValue(child_element, "KEY-SLOT-USED-FOR-START-UP", controller.getKeySlotUsedForStartUp())
4934
+ self.setChildElementOptionalBooleanValue(child_element, "KEY-SLOT-USED-FOR-SYNC", controller.getKeySlotUsedForSync())
4935
+ self.setChildElementOptionalIntegerValue(child_element, "LATEST-TX", controller.getLatestTX())
4936
+ self.setChildElementOptionalIntegerValue(child_element, "LISTEN-TIMEOUT", controller.getListenTimeout())
4937
+ self.setChildElementOptionalIntegerValue(child_element, "MACRO-INITIAL-OFFSET-A", controller.getMacroInitialOffsetA())
4938
+ self.setChildElementOptionalIntegerValue(child_element, "MACRO-INITIAL-OFFSET-B", controller.getMacroInitialOffsetB())
4939
+ self.setChildElementOptionalIntegerValue(child_element, "MAXIMUM-DYNAMIC-PAYLOAD-LENGTH", controller.getMaximumDynamicPayloadLength())
4940
+ self.setChildElementOptionalIntegerValue(child_element, "MICRO-INITIAL-OFFSET-A", controller.getMicroInitialOffsetA())
4941
+ self.setChildElementOptionalIntegerValue(child_element, "MICRO-INITIAL-OFFSET-B", controller.getMicroInitialOffsetB())
4942
+ self.setChildElementOptionalIntegerValue(child_element, "MICRO-PER-CYCLE", controller.getMicroPerCycle())
4943
+ self.setChildElementOptionalTimeValue(child_element, "MICROTICK-DURATION", controller.getMicrotickDuration())
4944
+ self.setChildElementOptionalIntegerValue(child_element, "OFFSET-CORRECTION-OUT", controller.getOffsetCorrectionOut())
4945
+ self.setChildElementOptionalIntegerValue(child_element, "RATE-CORRECTION-OUT", controller.getRateCorrectionOut())
4946
+ self.setChildElementOptionalIntegerValue(child_element, "SAMPLES-PER-MICROTICK", controller.getSamplesPerMicrotick())
4947
+ self.setChildElementOptionalIntegerValue(child_element, "WAKE-UP-PATTERN", controller.getWakeUpPattern())
4948
+
4949
+ def writeDataTransformationTransformerChainRefs(self, element: ET.Element, dtf: DataTransformation):
4950
+ refs = dtf.getTransformerChainRefs()
4951
+ if len(refs) > 0:
4952
+ child_element = ET.SubElement(element, "TRANSFORMER-CHAIN-REFS")
4953
+ for ref in refs:
4954
+ self.setChildElementOptionalRefType(child_element, "TRANSFORMER-CHAIN-REF", ref)
4955
+
4956
+ def writeDataTransformation(self, element: ET.Element, dtf: DataTransformation):
4957
+ if dtf is not None:
4958
+ child_element = ET.SubElement(element, "DATA-TRANSFORMATION")
4959
+ self.writeIdentifiable(child_element, dtf)
4960
+ self.setChildElementOptionalBooleanValue(child_element, "EXECUTE-DESPITE-DATA-UNAVAILABILITY", dtf.getExecuteDespiteDataUnavailability())
4961
+ self.writeDataTransformationTransformerChainRefs(child_element, dtf)
4962
+
4963
+ def writeDataTransformationSetDataTransformations(self, element: ET.Element, dtf_set: DataTransformationSet):
4964
+ dtfs = dtf_set.getDataTransformations()
4965
+ if len(dtfs) > 0:
4966
+ child_element = ET.SubElement(element, "DATA-TRANSFORMATIONS")
4967
+ for dtf in dtfs:
4968
+ if isinstance(dtf, DataTransformation):
4969
+ self.writeDataTransformation(child_element, dtf)
4970
+ else:
4971
+ self.notImplemented("Unsupported DataTransformation <%s>" % type(dtf))
4972
+
4973
+ def writeDataTransformationSetTransformationTechnologies(self, element: ET.Element, dtf_set: DataTransformationSet):
4974
+ techs = dtf_set.getTransformationTechnologies()
4975
+ if len(techs) > 0:
4976
+ child_element = ET.SubElement(element, "TRANSFORMATION-TECHNOLOGYS")
4977
+ for tech in techs:
4978
+ if isinstance(tech, TransformationTechnology):
4979
+ self.writeTransformationTechnology(child_element, tech)
4980
+ else:
4981
+ self.notImplemented("Unsupported TransformationTechnology <%s>" % type(tech))
4982
+
4983
+ def writeBufferPropertiesBufferComputation(self, element: ET.Element, properties: BufferProperties):
4984
+ computation = properties.getBufferComputation()
4985
+ if computation is not None:
4986
+ self.setCompuScale(element, "BUFFER-COMPUTATION", computation)
4987
+
4988
+ def setBufferProperties(self, element: ET.Element, key: str, properties: BufferProperties):
4989
+ if properties is not None:
4990
+ child_element = ET.SubElement(element, key)
4991
+ self.writeBufferPropertiesBufferComputation(child_element, properties)
4992
+ self.setChildElementOptionalIntegerValue(child_element, "HEADER-LENGTH", properties.getHeaderLength())
4993
+ self.setChildElementOptionalBooleanValue(child_element, "IN-PLACE", properties.getInPlace())
4994
+
4995
+ def writeDescribable(self, element: ET.Element, desc: Describable):
4996
+ self.writeARObjectAttributes(element, desc)
4997
+
4998
+ def writeTransformationDescription(self, element: ET.Element, desc: TransformationDescription):
4999
+ self.writeDescribable(element, desc)
5000
+
5001
+ def writeEndToEndTransformationDescription(self, element: ET.Element, desc: EndToEndTransformationDescription):
5002
+ if desc is not None:
5003
+ child_element = ET.SubElement(element, "END-TO-END-TRANSFORMATION-DESCRIPTION")
5004
+ self.writeTransformationDescription(child_element, desc)
5005
+ self.setChildElementOptionalLiteral(child_element, "DATA-ID-MODE", desc.getDataIdMode())
5006
+ self.setChildElementOptionalPositiveInteger(child_element, "MAX-DELTA-COUNTER", desc.getMaxDeltaCounter())
5007
+ self.setChildElementOptionalPositiveInteger(child_element, "MAX-ERROR-STATE-INIT", desc.getMaxErrorStateInit())
5008
+ self.setChildElementOptionalPositiveInteger(child_element, "MAX-ERROR-STATE-INVALID", desc.getMaxErrorStateInvalid())
5009
+ self.setChildElementOptionalPositiveInteger(child_element, "MAX-ERROR-STATE-VALID", desc.getMaxErrorStateValid())
5010
+ self.setChildElementOptionalPositiveInteger(child_element, "MAX-NO-NEW-OR-REPEATED-DATA", desc.getMaxNoNewOrRepeatedData())
5011
+ self.setChildElementOptionalPositiveInteger(child_element, "MIN-OK-STATE-INIT", desc.getMinOkStateInit())
5012
+ self.setChildElementOptionalPositiveInteger(child_element, "MIN-OK-STATE-INVALID", desc.getMinOkStateInvalid())
5013
+ self.setChildElementOptionalPositiveInteger(child_element, "MIN-OK-STATE-VALID", desc.getMinOkStateValid())
5014
+ self.setChildElementOptionalLiteral(child_element, "PROFILE-BEHAVIOR", desc.getProfileBehavior())
5015
+ self.setChildElementOptionalLiteral(child_element, "PROFILE-NAME", desc.getProfileName())
5016
+ self.setChildElementOptionalPositiveInteger(child_element, "SYNC-COUNTER-INIT", desc.getSyncCounterInit())
5017
+ self.setChildElementOptionalPositiveInteger(child_element, "UPPER-HEADER-BITS-TO-SHIFT", desc.getUpperHeaderBitsToShift())
5018
+ self.setChildElementOptionalPositiveInteger(child_element, "WINDOW-SIZE-INIT", desc.getWindowSizeInit())
5019
+ self.setChildElementOptionalPositiveInteger(child_element, "WINDOW-SIZE-INVALID", desc.getWindowSizeInvalid())
5020
+ self.setChildElementOptionalPositiveInteger(child_element, "WINDOW-SIZE-VALID", desc.getWindowSizeValid())
5021
+
5022
+ def writeTransformationTechnologyTransformationDescriptions(self, element: ET.Element, tech: TransformationTechnology):
5023
+ desc = tech.getTransformationDescription()
5024
+ if desc is not None:
5025
+ child_element = ET.SubElement(element, "TRANSFORMATION-DESCRIPTIONS")
5026
+ if isinstance(desc, EndToEndTransformationDescription):
5027
+ self.writeEndToEndTransformationDescription(child_element, desc)
5028
+ else:
5029
+ self.notImplemented("Unsupported TransformationDescription <%s>" % type(desc))
5030
+
5031
+ def writeTransformationTechnology(self, element: ET.Element, tech: TransformationTechnology):
5032
+ if tech is not None:
5033
+ child_element = ET.SubElement(element, "TRANSFORMATION-TECHNOLOGY")
5034
+ self.writeIdentifiable(child_element, tech)
5035
+ self.setBufferProperties(child_element, "BUFFER-PROPERTIES", tech.getBufferProperties())
5036
+ self.setChildElementOptionalBooleanValue(child_element, "NEEDS-ORIGINAL-DATA", tech.getNeedsOriginalData())
5037
+ self.setChildElementOptionalLiteral(child_element, "PROTOCOL", tech.getProtocol())
5038
+ self.writeTransformationTechnologyTransformationDescriptions(child_element, tech)
5039
+ self.setChildElementOptionalLiteral(child_element, "TRANSFORMER-CLASS", tech.getTransformerClass())
5040
+ self.setChildElementOptionalLiteral(child_element, "VERSION", tech.getVersion())
5041
+
5042
+ def writeDataTransformationSet(self, element: ET.Element, dtf_set: DataTransformationSet):
5043
+ if dtf_set is not None:
5044
+ child_element = ET.SubElement(element, "DATA-TRANSFORMATION-SET")
5045
+ self.writeIdentifiable(child_element, dtf_set)
5046
+ self.writeDataTransformationSetDataTransformations(child_element, dtf_set)
5047
+ self.writeDataTransformationSetTransformationTechnologies(child_element, dtf_set)
5048
+
4350
5049
  def writeARPackageElement(self, element: ET.Element, ar_element: ARElement):
4351
5050
  if isinstance(ar_element, ComplexDeviceDriverSwComponentType):
4352
5051
  self.writeComplexDeviceDriverSwComponentType(element, ar_element)
@@ -4476,9 +5175,25 @@ class ARXMLWriter(AbstractARXMLWriter):
4476
5175
  self.writeSoAdRoutingGroup(element, ar_element)
4477
5176
  elif isinstance(ar_element, DoIpTpConfig):
4478
5177
  self.writeDoIpTpConfig(element, ar_element)
5178
+ elif isinstance(ar_element, HwElement):
5179
+ self.writeHwElement(element, ar_element)
5180
+ elif isinstance(ar_element, HwCategory):
5181
+ self.writeHwCategory(element, ar_element)
5182
+ elif isinstance(ar_element, HwType):
5183
+ self.writeHwType(element, ar_element)
5184
+ elif isinstance(ar_element, DataTransformationSet):
5185
+ self.writeDataTransformationSet(element, ar_element)
5186
+ elif isinstance(ar_element, FlexrayFrame):
5187
+ self.writeFlexrayFrame(element, ar_element)
5188
+ elif isinstance(ar_element, ISignalGroup):
5189
+ self.writeISignalGroup(element, ar_element)
5190
+ elif isinstance(ar_element, SystemSignalGroup):
5191
+ self.writeSystemSignalGroup(element, ar_element)
5192
+ elif isinstance(ar_element, FlexrayCluster):
5193
+ self.writeFlexrayCluster(element, ar_element)
4479
5194
  else:
4480
5195
  self.notImplemented("Unsupported Elements of ARPackage <%s>" % type(ar_element))
4481
-
5196
+
4482
5197
  def writeReferenceBases(self, element: ET.Element, bases: List[ReferenceBase]):
4483
5198
  self.logger.debug("Write ReferenceBases")
4484
5199
  if len(bases) > 0:
@@ -4488,40 +5203,46 @@ class ARXMLWriter(AbstractARXMLWriter):
4488
5203
  self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", base.getShortLabel())
4489
5204
  self.setChildElementOptionalBooleanValue(child_element, "IS-DEFAULT", base.getIsDefault())
4490
5205
  self.setChildElementOptionalBooleanValue(child_element, "IS-GLOBAL", base.getIsDefault())
4491
- self.setChildElementOptionalBooleanValue(child_element, "BASE-IS-THIS-PACKAGE", base.getBaseIsThisPackage())
5206
+ self.setChildElementOptionalBooleanValue(child_element, "BASE-IS-THIS-PACKAGE", base.getBaseIsThisPackage())
4492
5207
  self.setChildElementOptionalRefType(child_element, "PACKAGE-REF", base.getPackageRef())
4493
-
4494
- def writeARPackages(self, element: ET.Element, pkgs: List[ARPackage]):
4495
- if len(pkgs) > 0:
4496
- pkgs_tag = ET.SubElement(element, "AR-PACKAGES")
4497
5208
 
4498
- for pkg in pkgs:
4499
- pkg_tag = ET.SubElement(pkgs_tag, "AR-PACKAGE")
4500
-
4501
- self.writeIdentifiable(pkg_tag, pkg)
4502
- self.logger.debug("writeARPackage %s" % pkg.full_name)
5209
+ def writeARPackage(self, element: ET.Element, pkg: ARPackage):
5210
+ self.logger.debug("Write ARPackage %s" % pkg.getFullName())
5211
+ child_element = ET.SubElement(element, "AR-PACKAGE")
4503
5212
 
4504
- self.writeReferenceBases(pkg_tag, pkg.getReferenceBases())
5213
+ self.writeIdentifiable(child_element, pkg)
5214
+ self.writeReferenceBases(child_element, pkg.getReferenceBases())
5215
+ self.writeARPackageElements(child_element, pkg)
5216
+ self.writeARPackages(child_element, pkg.getARPackages())
4505
5217
 
4506
- if pkg.getTotalElement() > 0:
4507
- elements_tag = ET.SubElement(pkg_tag, "ELEMENTS")
5218
+ def writeARPackageElements(self, element: ET.Element, pkg: ARPackage):
5219
+ if pkg.getTotalElement() > 0:
5220
+ elements_tag = ET.SubElement(element, "ELEMENTS")
4508
5221
 
4509
- for ar_element in pkg.getElements():
4510
- if not isinstance(ar_element, ARPackage):
4511
- self.writeARPackageElement(elements_tag, ar_element)
5222
+ for ar_element in pkg.getElements():
5223
+ if not isinstance(ar_element, ARPackage):
5224
+ self.writeARPackageElement(elements_tag, ar_element)
4512
5225
 
4513
- self.writeARPackages(pkg_tag, pkg.getARPackages())
4514
-
5226
+ def writeARPackages(self, element: ET.Element, pkgs: List[ARPackage]):
5227
+ if len(pkgs) > 0:
5228
+ child_element = ET.SubElement(element, "AR-PACKAGES")
5229
+ for pkg in pkgs:
5230
+ if isinstance(pkg, ARPackage):
5231
+ self.writeARPackage(child_element, pkg)
5232
+ else:
5233
+ self.notImplemented("Unsupported ARPackage <%s>" % type(pkg))
4515
5234
 
4516
5235
  def save(self, filename, document: AUTOSAR):
4517
5236
  self.logger.info("Saving %s ..." % filename)
4518
5237
 
4519
5238
  root = ET.Element("AUTOSAR", self.nsmap)
4520
5239
  root.attrib["xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance"
4521
- root.attrib["xsi:schemaLocation"] = document.schema_location
5240
+ if document.schema_location is not None:
5241
+ root.attrib["xsi:schemaLocation"] = document.schema_location
5242
+ else:
5243
+ root.attrib["xsi:schemaLocation"] = "http://autosar.org/schema/r4.0 AUTOSAR_4-0-3.xsd"
4522
5244
 
4523
5245
  self.setAdminData(root, document.getAdminData())
4524
5246
  self.writeARPackages(root, document.getARPackages())
4525
5247
 
4526
5248
  self.saveToFile(filename, root)
4527
-