armodel 1.7.1__py3-none-any.whl → 1.7.2__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 (34) hide show
  1. armodel/cli/arxml_dump_cli.py +2 -2
  2. armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +3 -3
  3. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +41 -19
  4. armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +22 -11
  5. armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +26 -9
  6. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +8 -0
  7. armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +711 -27
  8. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +0 -3
  9. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +3 -0
  10. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +43 -1
  11. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +41 -3
  12. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +53 -15
  13. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +23 -8
  14. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +44 -1
  15. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +46 -5
  16. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +55 -34
  17. armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +170 -23
  18. armodel/models/M2/MSR/DataDictionary/AuxillaryObjects.py +4 -4
  19. armodel/models/M2/MSR/DataDictionary/RecordLayout.py +130 -37
  20. armodel/models/__init__.py +1 -0
  21. armodel/parser/abstract_arxml_parser.py +26 -13
  22. armodel/parser/arxml_parser.py +361 -216
  23. armodel/tests/test_armodel/models/test_datatype.py +4 -4
  24. armodel/tests/test_armodel/models/test_m2_msr.py +5 -5
  25. armodel/tests/test_armodel/parser/test_sw_components.py +1 -1
  26. armodel/tests/test_armodel/parser/test_system.py +0 -1
  27. armodel/writer/abstract_arxml_writer.py +9 -0
  28. armodel/writer/arxml_writer.py +358 -173
  29. {armodel-1.7.1.dist-info → armodel-1.7.2.dist-info}/METADATA +21 -1
  30. {armodel-1.7.1.dist-info → armodel-1.7.2.dist-info}/RECORD +34 -34
  31. {armodel-1.7.1.dist-info → armodel-1.7.2.dist-info}/LICENSE +0 -0
  32. {armodel-1.7.1.dist-info → armodel-1.7.2.dist-info}/WHEEL +0 -0
  33. {armodel-1.7.1.dist-info → armodel-1.7.2.dist-info}/entry_points.txt +0 -0
  34. {armodel-1.7.1.dist-info → armodel-1.7.2.dist-info}/top_level.txt +0 -0
@@ -2,11 +2,7 @@ import xml.etree.cElementTree as ET
2
2
 
3
3
  from typing import List
4
4
 
5
- from armodel.models.M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
6
-
7
-
8
-
9
-
5
+ from ..models.M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
10
6
  from ..models.M2.MSR.AsamHdo.AdminData import AdminData
11
7
  from ..models.M2.MSR.AsamHdo.BaseTypes import BaseTypeDirectDefinition, SwBaseType
12
8
  from ..models.M2.MSR.AsamHdo.ComputationMethod import CompuConstTextContent, CompuMethod, CompuNominatorDenominator, CompuScale, CompuScaleConstantContents, CompuScaleRationalFormula, CompuScales
@@ -36,7 +32,7 @@ from ..models.M2.AUTOSARTemplates.CommonStructure.SwcBswMapping import SwcBswMap
36
32
  from ..models.M2.AUTOSARTemplates.CommonStructure.Implementation import Code, Implementation
37
33
  from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import SwcTiming, TimingExtension
38
34
  from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.ExecutionOrderConstraint import EOCExecutableEntityRef, ExecutionOrderConstraint
39
- from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import NvBlockNeeds, RoleBasedDataAssignment, ServiceDependency
35
+ from ..models.M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagEventDebounceMonitorInternal, DiagnosticCommunicationManagerNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, NvBlockNeeds, RoleBasedDataAssignment, RoleBasedDataTypeAssignment, ServiceDependency
40
36
  from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import ExecutableEntity
41
37
  from ..models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
42
38
  from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import InternalBehavior
@@ -51,15 +47,15 @@ from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPack
51
47
  from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType, ARLiteral, Limit
52
48
 
53
49
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.PortAPIOptions import PortAPIOption
54
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent, TimingEvent
50
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.RTEEvents import AsynchronousServerCallReturnsEvent, DataReceivedEvent, InitEvent, InternalTriggerOccurredEvent, OperationInvokedEvent, RTEEvent, SwcModeSwitchEvent, TimingEvent
55
51
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.IncludedDataTypes import IncludedDataTypeSet
56
52
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationArrayDataType, ApplicationCompositeDataType, ApplicationDataType, ApplicationPrimitiveDataType, ApplicationRecordDataType, AutosarDataType
57
53
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndDescription, EndToEndProtection, EndToEndProtectionVariablePrototype
58
54
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import IncludedModeDeclarationGroupSet
59
55
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import CompositeNetworkRepresentation, TransmissionAcknowledgementRequest
60
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import ApplicationSwComponentType, AtomicSwComponentType, ComplexDeviceDriverSwComponentType, CompositionSwComponentType, EcuAbstractionSwComponentType, PortGroup, SwComponentType, PPortPrototype, PortPrototype, RPortPrototype
56
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components import AbstractProvidedPortPrototype, AbstractRequiredPortPrototype, ApplicationSwComponentType, AtomicSwComponentType, ComplexDeviceDriverSwComponentType, CompositionSwComponentType, EcuAbstractionSwComponentType, PRPortPrototype, PortGroup, SwComponentType, PPortPrototype, PortPrototype, RPortPrototype
61
57
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import InnerPortGroupInCompositionInstanceRef, PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef, RModeInAtomicSwcInstanceRef, RVariableInAtomicSwcInstanceRef
62
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import RunnableEntity, RunnableEntityArgument, SwcInternalBehavior, SynchronousServerCallPoint
58
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import AsynchronousServerCallPoint, RunnableEntity, RunnableEntityArgument, SwcInternalBehavior, SynchronousServerCallPoint
63
59
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServerCall import ServerCallPoint
64
60
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.DataElements import ParameterAccess, VariableAccess
65
61
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition import AssemblySwConnector, DelegationSwConnector, SwComponentPrototype, SwConnector
@@ -111,13 +107,15 @@ class ARXMLWriter(AbstractARXMLWriter):
111
107
  def writeSds(self, parent: ET.Element, sdg: Sdg):
112
108
  for sd in sdg.getSds():
113
109
  sd_tag = ET.SubElement(parent, "SD")
114
- sd_tag.attrib['GID'] = sd.gid
110
+ if sd.gid is not None:
111
+ sd_tag.attrib['GID'] = sd.gid
115
112
  sd_tag.text = sd.value
116
113
 
117
114
  def setSdg(self, parent: ET.Element, sdg: Sdg):
118
115
  if sdg is not None:
119
116
  sdg_tag = ET.SubElement(parent, "SDG")
120
- sdg_tag.attrib['GID'] = sdg.gid
117
+ if sdg.gid is not None and sdg.gid != "":
118
+ sdg_tag.attrib['GID'] = sdg.gid
121
119
  self.writeSds(sdg_tag, sdg)
122
120
  for sdg_item in sdg.getSdgContentsTypes():
123
121
  self.setSdg(sdg_tag, sdg_item)
@@ -139,7 +137,7 @@ class ARXMLWriter(AbstractARXMLWriter):
139
137
 
140
138
  def setReferable(self, element: ET.Element, referrable: Referrable):
141
139
  self.setARObjectAttributes(element, referrable)
142
- self.setShortName(element, referrable.short_name)
140
+ self.setShortName(element, referrable.getShortName())
143
141
 
144
142
  def setLanguageSpecific(self, element: ET.Element, key: str, specific: LanguageSpecific):
145
143
  child_element = ET.SubElement(element, key)
@@ -253,7 +251,7 @@ class ARXMLWriter(AbstractARXMLWriter):
253
251
  elif isinstance(com_spec, ModeSwitchSenderComSpec):
254
252
  self.setModeSwitchSenderComSpec(com_specs_tag, com_spec)
255
253
  else:
256
- raise NotImplementedError("Unsupported PPortComSpec %s" % type(com_spec))
254
+ self.notImplemented("Unsupported PPortComSpec %s" % type(com_spec))
257
255
 
258
256
  def setApplicationCompositeElementInPortInterfaceInstanceRef(self, element: ET.Element, key:str, iref: ApplicationCompositeElementInPortInterfaceInstanceRef):
259
257
  if iref is not None:
@@ -266,8 +264,8 @@ class ARXMLWriter(AbstractARXMLWriter):
266
264
  if representation is not None:
267
265
  self.logger.debug("setCompositeNetworkRepresentation")
268
266
  child_element = ET.SubElement(element, "COMPOSITE-NETWORK-REPRESENTATION")
269
- self.setApplicationCompositeElementInPortInterfaceInstanceRef(child_element, "LEAF-ELEMENT-IREF", representation.leaf_element_iref)
270
- self.setSwDataDefProps(child_element, "NETWORK-REPRESENTATION", representation.network_representation)
267
+ self.setApplicationCompositeElementInPortInterfaceInstanceRef(child_element, "LEAF-ELEMENT-IREF", representation.getLeafElementIRef())
268
+ self.setSwDataDefProps(child_element, "NETWORK-REPRESENTATION", representation.getNetworkRepresentation())
271
269
 
272
270
  def writeReceiverComSpec(self, element: ET.Element, com_spec: ReceiverComSpec):
273
271
  representations = com_spec.getCompositeNetworkRepresentations()
@@ -275,10 +273,11 @@ class ARXMLWriter(AbstractARXMLWriter):
275
273
  child_element = ET.SubElement(element, "COMPOSITE-NETWORK-REPRESENTATIONS")
276
274
  for representation in representations:
277
275
  self.setCompositeNetworkRepresentation(child_element, representation)
278
- self.setChildElementOptionalRefType(element, "DATA-ELEMENT-REF", com_spec.dataElementRef)
279
- self.setSwDataDefProps(element, "NETWORK-REPRESENTATION", com_spec.networkRepresentation)
280
- self.setChildElementOptionalLiteral(element, "HANDLE-OUT-OF-RANGE", com_spec.handleOutOfRange)
281
- self.setChildElementOptionalBooleanValue(element, "USES-END-TO-END-PROTECTION", com_spec.usesEndToEndProtection)
276
+ self.setChildElementOptionalRefType(element, "DATA-ELEMENT-REF", com_spec.getDataElementRef())
277
+ self.setSwDataDefProps(element, "NETWORK-REPRESENTATION", com_spec.getNetworkRepresentation())
278
+ self.setChildElementOptionalLiteral(element, "HANDLE-OUT-OF-RANGE", com_spec.getHandleOutOfRange())
279
+ self.setChildElementOptionalLiteral(element, "HANDLE-OUT-OF-RANGE-STATUS", com_spec.getHandleOutOfRangeStatus())
280
+ self.setChildElementOptionalBooleanValue(element, "USES-END-TO-END-PROTECTION", com_spec.getUsesEndToEndProtection())
282
281
 
283
282
  def setSwValues(self, element: ET.Element, key: str, sw_values: SwValues):
284
283
  if sw_values is not None:
@@ -295,37 +294,41 @@ class ARXMLWriter(AbstractARXMLWriter):
295
294
  self.setChildElementOptionalFloatValue(child_element, "V", value_list.v)
296
295
 
297
296
  def writeSwValueCont(self, element: ET.Element, cont: SwValueCont):
298
- child_element = ET.SubElement(element, "SW-VALUE-CONT")
299
- self.setARObjectAttributes(child_element, cont)
300
- self.setChildElementOptionalRefType(child_element, "UNIT-REF", cont.unit_ref)
301
- self.setValueList(child_element, "SW-ARRAYSIZE", cont.sw_arraysize)
302
- self.setSwValues(child_element, "SW-VALUES-PHYS", cont.sw_values_phys)
297
+ if cont is not None:
298
+ child_element = ET.SubElement(element, "SW-VALUE-CONT")
299
+ self.setARObjectAttributes(child_element, cont)
300
+ self.setChildElementOptionalRefType(child_element, "UNIT-REF", cont.unit_ref)
301
+ self.setValueList(child_element, "SW-ARRAYSIZE", cont.sw_arraysize)
302
+ self.setSwValues(child_element, "SW-VALUES-PHYS", cont.sw_values_phys)
303
303
 
304
304
  def writeValueSpecification(self, element: ET.Element, value_spec: ValueSpecification):
305
- self.setARObjectAttributes(element, value_spec)
306
- if value_spec.short_label is not None:
307
- self.setChildElementOptionalLiteral(element, "SHORT-LABEL", value_spec.short_label)
305
+ if value_spec is not None:
306
+ self.setARObjectAttributes(element, value_spec)
307
+ self.setChildElementOptionalLiteral(element, "SHORT-LABEL", value_spec.getShortLabel())
308
308
 
309
309
  def setApplicationValueSpecification(self, element: ET.Element, value_spec: ApplicationValueSpecification):
310
- value_spec_tag = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
311
- self.writeValueSpecification(value_spec_tag, value_spec)
312
- self.setChildElementOptionalLiteral(value_spec_tag, "CATEGORY", value_spec.category)
313
- self.writeSwValueCont(value_spec_tag, value_spec.sw_value_cont)
310
+ if value_spec is not None:
311
+ value_spec_tag = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
312
+ self.writeValueSpecification(value_spec_tag, value_spec)
313
+ self.setChildElementOptionalLiteral(value_spec_tag, "CATEGORY", value_spec.getCategory())
314
+ self.writeSwValueCont(value_spec_tag, value_spec.getSwValueCont())
314
315
 
315
316
  def setTextValueSpecification(self, element: ET.Element, value_spec: TextValueSpecification):
316
- value_spec_tag = ET.SubElement(element, "TEXT-VALUE-SPECIFICATION")
317
- self.writeValueSpecification(value_spec_tag, value_spec)
318
- self.setChildElementOptionalLiteral(value_spec_tag, "VALUE", value_spec.value)
317
+ if value_spec is not None:
318
+ value_spec_tag = ET.SubElement(element, "TEXT-VALUE-SPECIFICATION")
319
+ self.writeValueSpecification(value_spec_tag, value_spec)
320
+ self.setChildElementOptionalLiteral(value_spec_tag, "VALUE", value_spec.getValue())
319
321
 
320
322
  def setNumericalValueSpecification(self, element: ET.Element, value_spec: NumericalValueSpecification):
321
- value_spec_tag = ET.SubElement(element, "NUMERICAL-VALUE-SPECIFICATION")
322
- self.writeValueSpecification(value_spec_tag, value_spec)
323
- self.setChildElementOptionalFloatValue(value_spec_tag, "VALUE", value_spec.value)
323
+ if value_spec is not None:
324
+ value_spec_tag = ET.SubElement(element, "NUMERICAL-VALUE-SPECIFICATION")
325
+ self.writeValueSpecification(value_spec_tag, value_spec)
326
+ self.setChildElementOptionalFloatValue(value_spec_tag, "VALUE", value_spec.getValue())
324
327
 
325
328
  def setArrayValueSpecification(self, element: ET.Element, value_spec: ArrayValueSpecification):
326
329
  value_spec_tag = ET.SubElement(element, "ARRAY-VALUE-SPECIFICATION")
327
330
  self.writeValueSpecification(value_spec_tag, value_spec)
328
- sub_elements = value_spec.get_elements()
331
+ sub_elements = value_spec.getElements()
329
332
  if len(sub_elements) > 0:
330
333
  elements_tag = ET.SubElement(value_spec_tag, "ELEMENTS")
331
334
  for sub_element in sub_elements:
@@ -333,8 +336,14 @@ class ARXMLWriter(AbstractARXMLWriter):
333
336
  self.setNumericalValueSpecification(elements_tag, sub_element)
334
337
  elif isinstance(sub_element, ApplicationValueSpecification):
335
338
  self.setApplicationValueSpecification(elements_tag, sub_element)
339
+ elif isinstance(sub_element, TextValueSpecification):
340
+ self.setTextValueSpecification(elements_tag, sub_element)
341
+ elif isinstance(sub_element, ArrayValueSpecification):
342
+ self.setArrayValueSpecification(elements_tag, sub_element)
343
+ elif isinstance(sub_element, RecordValueSpecification):
344
+ self.setRecordValueSpecification(elements_tag, sub_element)
336
345
  else:
337
- raise NotImplementedError("Unsupported element type of <%s> of ArrayValueSpecification" % type(sub_element))
346
+ self.notImplemented("Unsupported element type of <%s> of ArrayValueSpecification" % type(sub_element))
338
347
 
339
348
  def setConstantReference(self, element: ET.Element, value_spec: ConstantReference):
340
349
  value_spec_tag = ET.SubElement(element, "CONSTANT-REFERENCE")
@@ -356,7 +365,7 @@ class ARXMLWriter(AbstractARXMLWriter):
356
365
  elif isinstance(value_spec, RecordValueSpecification):
357
366
  self.setRecordValueSpecification(element, value_spec)
358
367
  else:
359
- raise NotImplementedError("Unsupported ValueSpecification %s" % type(value_spec))
368
+ self.notImplemented("Unsupported ValueSpecification %s" % type(value_spec))
360
369
 
361
370
  def setInitValue(self, element: ET.Element, init_value: ValueSpecification):
362
371
  if init_value is not None:
@@ -411,31 +420,43 @@ class ARXMLWriter(AbstractARXMLWriter):
411
420
  self.writeParameterRequireComSpec(element, com_spec)
412
421
  else:
413
422
  raise ValueError("Unsupported RPortComSpec %s" % type(com_spec))
423
+
424
+ def setAbstractProvidedPortPrototype(self, element: ET.Element, prototype: AbstractProvidedPortPrototype):
425
+ com_specs = prototype.getProvidedComSpecs()
426
+ if len(com_specs):
427
+ com_specs_tag = ET.SubElement(element, "PROVIDED-COM-SPECS")
428
+ for com_spec in com_specs:
429
+ self.writePPortComSpec(com_specs_tag, com_spec)
414
430
 
415
431
  def writePPortPrototype(self, ports_tag: ET.Element, prototype: PPortPrototype):
416
432
  prototype_tag = ET.SubElement(ports_tag, "P-PORT-PROTOTYPE")
417
433
 
418
434
  self.setIdentifiable(prototype_tag, prototype)
419
- self.logger.debug("writePPortPrototype %s" % prototype.short_name)
435
+ self.logger.debug("write PPortPrototype %s" % prototype.short_name)
436
+ self.setAbstractProvidedPortPrototype(prototype_tag, prototype)
437
+ self.setChildElementOptionalRefType(prototype_tag, "PROVIDED-INTERFACE-TREF", prototype.getProvidedInterfaceTRef())
420
438
 
421
- com_specs = prototype.getProvidedComSpecs()
422
- if len(com_specs):
423
- com_specs_tag = ET.SubElement(prototype_tag, "PROVIDED-COM-SPECS")
439
+ def setAbstractRequiredPortPrototype(self, element: ET.Element, prototype: AbstractRequiredPortPrototype):
440
+ com_specs = prototype.getRequiredComSpecs()
441
+ if len(com_specs) > 0:
442
+ com_specs_tag = ET.SubElement(element, "REQUIRED-COM-SPECS")
424
443
  for com_spec in com_specs:
425
- self.writePPortComSpec(com_specs_tag, com_spec)
426
-
427
- self.setChildElementOptionalRefType(prototype_tag, "PROVIDED-INTERFACE-TREF", prototype.getProvidedInterfaceTRef())
444
+ self.writeRPortComSpec(com_specs_tag, com_spec)
428
445
 
429
446
  def writeRPortPrototype(self, ports_tag: ET.Element, prototype: RPortPrototype):
430
- self.logger.debug("writeRPortPrototype %s" % prototype.short_name)
447
+ self.logger.debug("write RPortPrototype %s" % prototype.short_name)
431
448
  prototype_tag = ET.SubElement(ports_tag, "R-PORT-PROTOTYPE")
432
449
  self.setIdentifiable(prototype_tag, prototype)
433
- com_specs = prototype.getRequiredComSpecs()
434
- if len(com_specs) > 0:
435
- com_specs_tag = ET.SubElement(prototype_tag, "REQUIRED-COM-SPECS")
436
- for com_spec in com_specs:
437
- self.writeRPortComSpec(com_specs_tag, com_spec)
450
+ self.setAbstractRequiredPortPrototype(prototype_tag, prototype)
438
451
  self.setChildElementOptionalRefType(prototype_tag, "REQUIRED-INTERFACE-TREF", prototype.getRequiredInterfaceTRef())
452
+
453
+ def writePRPortPrototype(self, ports_tag: ET.Element, prototype: PRPortPrototype):
454
+ self.logger.debug("write PRPortPrototype %s" % prototype.short_name)
455
+ prototype_tag = ET.SubElement(ports_tag, "PR-PORT-PROTOTYPE")
456
+ self.setIdentifiable(prototype_tag, prototype)
457
+ self.setAbstractProvidedPortPrototype(prototype_tag, prototype)
458
+ self.setAbstractRequiredPortPrototype(prototype_tag, prototype)
459
+ self.setChildElementOptionalRefType(prototype_tag, "PROVIDED-REQUIRED-INTERFACE-TREF", prototype.getProvidedRequiredInterface())
439
460
 
440
461
  def writePortPrototypes(self, ports_tag: ET.Element, port_prototypes: List[PortPrototype]):
441
462
  for port_prototype in port_prototypes:
@@ -443,6 +464,8 @@ class ARXMLWriter(AbstractARXMLWriter):
443
464
  self.writePPortPrototype(ports_tag, port_prototype)
444
465
  elif isinstance(port_prototype, RPortPrototype):
445
466
  self.writeRPortPrototype(ports_tag, port_prototype)
467
+ elif isinstance(port_prototype, PRPortPrototype):
468
+ self.writePRPortPrototype(ports_tag, port_prototype)
446
469
  else:
447
470
  self._raiseError("Invalid PortPrototype")
448
471
 
@@ -546,7 +569,7 @@ class ARXMLWriter(AbstractARXMLWriter):
546
569
  elif isinstance(sw_connector, DelegationSwConnector):
547
570
  self.writeDelegationSwConnector(element, sw_connector)
548
571
  else:
549
- raise NotImplementedError("Unsupported Sw Connector %s")
572
+ self.notImplemented("Unsupported Sw Connector %s")
550
573
 
551
574
  def writeSwConnectors(self, element: ET.Element, sw_component: CompositionSwComponentType):
552
575
  sw_connectors = sw_component.getSwConnectors()
@@ -677,6 +700,7 @@ class ARXMLWriter(AbstractARXMLWriter):
677
700
  self.setSwCalprmAxisSet(sw_data_def_props_conditional_tag, "SW-CALPRM-AXIS-SET", sw_data_def_props.getSwCalprmAxisSet())
678
701
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "COMPU-METHOD-REF", sw_data_def_props.getCompuMethodRef())
679
702
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "DATA-CONSTR-REF", sw_data_def_props.getDataConstrRef())
703
+ self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "SW-ADDR-METHOD-REF", sw_data_def_props.getSwAddrMethodRef())
680
704
  self.setChildElementOptionalLiteral(sw_data_def_props_conditional_tag, "SW-IMPL-POLICY", sw_data_def_props.getSwImplPolicy())
681
705
  self.setChildElementOptionalNumericalValue(sw_data_def_props_conditional_tag, "SW-INTENDED-RESOLUTION", sw_data_def_props.getSwIntendedResolution())
682
706
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "IMPLEMENTATION-DATA-TYPE-REF", sw_data_def_props.getImplementationDataTypeRef())
@@ -684,23 +708,23 @@ class ARXMLWriter(AbstractARXMLWriter):
684
708
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "VALUE-AXIS-DATA-TYPE-REF", sw_data_def_props.getValueAxisDataTypeRef())
685
709
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "UNIT-REF", sw_data_def_props.getUnitRef())
686
710
 
687
- def writeApplicationDataType(self, element: ET.Element, data_type: ApplicationDataType):
688
- self.writeAutosarDataType(element, data_type)
711
+ def setApplicationDataType(self, element: ET.Element, data_type: ApplicationDataType):
712
+ self.setAutosarDataType(element, data_type)
689
713
 
690
- def writeApplicationCompositeDataType(self, element: ET.Element, data_type: ApplicationCompositeDataType):
691
- self.writeApplicationDataType(element, data_type)
714
+ def setApplicationCompositeDataType(self, element: ET.Element, data_type: ApplicationCompositeDataType):
715
+ self.setApplicationDataType(element, data_type)
692
716
 
693
- def writeAutosarDataType(self, element: ET.Element, data_type: AutosarDataType):
717
+ def setAutosarDataType(self, element: ET.Element, data_type: AutosarDataType):
694
718
  self.setARElement(element, data_type)
695
- self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", data_type.swDataDefProps)
719
+ self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", data_type.getSwDataDefProps())
696
720
 
697
721
  def writeApplicationPrimitiveDataType(self, element: ET.Element, data_type: ApplicationPrimitiveDataType):
698
- self.logger.debug("writeApplicationPrimitiveDataType %s" % data_type.short_name)
722
+ self.logger.debug("writeApplicationPrimitiveDataType %s" % data_type.getShortName())
699
723
  data_type_tag = ET.SubElement(element, "APPLICATION-PRIMITIVE-DATA-TYPE")
700
- self.writeApplicationDataType(data_type_tag, data_type)
724
+ self.setApplicationDataType(data_type_tag, data_type)
701
725
 
702
726
  def setDataPrototype(self, element: ET.Element, prototype: DataPrototype):
703
- self.setIdentifiable(element, prototype)
727
+ self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", prototype.getSwDataDefProps())
704
728
 
705
729
  def setApplicationCompositeElementDataPrototype(self, element: ET.Element, prototype: ApplicationCompositeElementDataPrototype):
706
730
  self.setDataPrototype(element, prototype)
@@ -719,7 +743,7 @@ class ARXMLWriter(AbstractARXMLWriter):
719
743
 
720
744
  def writeApplicationRecordDataType(self, element: ET.Element, data_type: ApplicationRecordDataType):
721
745
  data_type_tag = ET.SubElement(element, "APPLICATION-RECORD-DATA-TYPE")
722
- self.writeApplicationDataType(data_type_tag, data_type)
746
+ self.setApplicationDataType(data_type_tag, data_type)
723
747
  self.writeApplicationRecordElements(data_type_tag, data_type)
724
748
 
725
749
  def writeApplicationDataTypes(self, parent: ET.Element, ar_package: ARPackage):
@@ -729,7 +753,7 @@ class ARXMLWriter(AbstractARXMLWriter):
729
753
  elif isinstance(data_type, ApplicationRecordDataType):
730
754
  self.writeApplicationRecordDataType(parent, data_type)
731
755
  else:
732
- raise NotImplementedError("Unsupported ApplicationDataType <%s>" % type(data_type))
756
+ self.notImplemented("Unsupported ApplicationDataType <%s>" % type(data_type))
733
757
 
734
758
  def writeBaseTypeDirectDefinition(self, element: ET.Element, base_type_definition: BaseTypeDirectDefinition):
735
759
  self.setChildElementOptionalNumericalValue(element, "BASE-TYPE-SIZE", base_type_definition.baseTypeSize)
@@ -744,8 +768,8 @@ class ARXMLWriter(AbstractARXMLWriter):
744
768
 
745
769
  def writeCompuScaleConstantContents(self, element: ET.Element, contents: CompuScaleConstantContents):
746
770
  compu_const_tag = ET.SubElement(element, "COMPU-CONST")
747
- if isinstance(contents.compu_const.compu_const_content_type, CompuConstTextContent):
748
- self.setChildElementOptionalLiteral(compu_const_tag, "VT", contents.compu_const.compu_const_content_type.vt)
771
+ if isinstance(contents.compuConst.compuConstContentType, CompuConstTextContent):
772
+ self.setChildElementOptionalLiteral(compu_const_tag, "VT", contents.compuConst.compuConstContentType.vt)
749
773
 
750
774
  def writeCompuNominatorDenominator(self, element: ET.Element, key: str, parent: CompuNominatorDenominator):
751
775
  child_element = ET.SubElement(element, key)
@@ -754,12 +778,12 @@ class ARXMLWriter(AbstractARXMLWriter):
754
778
  v_tag.text = v
755
779
 
756
780
  def writeCompuScaleRationalFormula(self, element: ET.Element, contents: CompuScaleRationalFormula):
757
- if contents.compu_rational_coeffs is not None:
781
+ if contents.compuRationalCoeffs is not None:
758
782
  coeffs_tag = ET.SubElement(element, "COMPU-RATIONAL-COEFFS")
759
- if contents.compu_rational_coeffs.compu_numerator:
760
- self.writeCompuNominatorDenominator(coeffs_tag, "COMPU-NUMERATOR", contents.compu_rational_coeffs.compu_numerator)
761
- if contents.compu_rational_coeffs.compu_denominator:
762
- self.writeCompuNominatorDenominator(coeffs_tag, "COMPU-DENOMINATOR", contents.compu_rational_coeffs.compu_denominator)
783
+ if contents.compuRationalCoeffs.compuNumerator:
784
+ self.writeCompuNominatorDenominator(coeffs_tag, "COMPU-NUMERATOR", contents.compuRationalCoeffs.compuNumerator)
785
+ if contents.compuRationalCoeffs.compuDenominator:
786
+ self.writeCompuNominatorDenominator(coeffs_tag, "COMPU-DENOMINATOR", contents.compuRationalCoeffs.compuDenominator)
763
787
 
764
788
  def writeCompuScaleContents(self, element: ET.Element, compu_scale: CompuScale):
765
789
  if isinstance(compu_scale.compuScaleContents, CompuScaleConstantContents):
@@ -767,44 +791,62 @@ class ARXMLWriter(AbstractARXMLWriter):
767
791
  elif isinstance(compu_scale.compuScaleContents, CompuScaleRationalFormula):
768
792
  self.writeCompuScaleRationalFormula(element, compu_scale.compuScaleContents)
769
793
  else:
770
- raise NotImplementedError("Unsupported CompuScaleContents %s" % type(compu_scale.compuScaleContents))
794
+ self.notImplemented("Unsupported CompuScaleContents %s" % type(compu_scale.compuScaleContents))
771
795
 
772
796
  def writeCompuScales(self, element: ET.Element, compu_scales: CompuScales):
773
797
  compu_scales_tag = ET.SubElement(element, "COMPU-SCALES")
774
798
  for compu_scale in compu_scales.getCompuScales():
775
799
  child_element = ET.SubElement(compu_scales_tag, "COMPU-SCALE")
776
800
  self.setARObjectAttributes(child_element, compu_scale)
777
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", compu_scale.short_label)
778
- self.setChildElementOptionalLiteral(child_element, "SYMBOL", compu_scale.symbol)
779
- self.writeChildLimitElement(child_element, "LOWER-LIMIT", compu_scale.lowerLimit)
780
- self.writeChildLimitElement(child_element, "UPPER-LIMIT", compu_scale.upperLimit)
801
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", compu_scale.getShortLabel())
802
+ self.setChildElementOptionalLiteral(child_element, "SYMBOL", compu_scale.getSymbol())
803
+ self.writeChildLimitElement(child_element, "LOWER-LIMIT", compu_scale.getLowerLimit())
804
+ self.writeChildLimitElement(child_element, "UPPER-LIMIT", compu_scale.getUpperLimit())
781
805
  self.writeCompuScaleContents(child_element, compu_scale)
782
806
 
783
807
  def writeCompuInternalToPhys(self, element: ET.Element, compu_method: CompuMethod):
784
- if compu_method.compu_internal_to_phys is not None:
785
- compu_internal_to_phys_tag = ET.SubElement(element, "COMPU-INTERNAL-TO-PHYS")
786
- self.setARObjectAttributes(compu_internal_to_phys_tag, compu_method.compu_internal_to_phys)
787
- if isinstance(compu_method.compu_internal_to_phys.compu_content, CompuScales):
788
- self.writeCompuScales(compu_internal_to_phys_tag, compu_method.compu_internal_to_phys.compu_content)
808
+ compu = compu_method.getCompuInternalToPhys()
809
+ if compu is not None:
810
+ child_element = ET.SubElement(element, "COMPU-INTERNAL-TO-PHYS")
811
+ self.setARObjectAttributes(child_element, compu)
812
+ compu_content = compu.getCompuContent()
813
+ if compu_content is not None:
814
+ if isinstance(compu_content, CompuScales):
815
+ self.writeCompuScales(child_element, compu_content)
816
+ else:
817
+ self.notImplemented("Unsupported CompuContent <%s>" % type(compu_content))
818
+
819
+ def writeCompuPhysToInternal(self, element: ET.Element, compu_method: CompuMethod):
820
+ compu = compu_method.getCompuPhysToInternal()
821
+ if compu is not None:
822
+ child_element = ET.SubElement(element, "COMPU-PHYS-TO-INTERNAL")
823
+ self.setARObjectAttributes(child_element, compu)
824
+ compu_content = compu.getCompuContent()
825
+ if compu_content is not None:
826
+ if isinstance(compu_content, CompuScales):
827
+ self.writeCompuScales(child_element, compu_content)
828
+ else:
829
+ self.notImplemented("Unsupported CompuContent <%s>" % type(compu_content))
789
830
 
790
831
  def writeCompuMethod(self, element: ET.Element, compu_method: CompuMethod):
791
- compu_method_tag = ET.SubElement(element, "COMPU-METHOD")
792
- self.logger.debug("writeCompuMethods %s" % compu_method.short_name)
793
- self.setIdentifiable(compu_method_tag, compu_method)
794
- self.setChildElementOptionalRefType(compu_method_tag, "UNIT-REF", compu_method.unit_ref)
795
- self.writeCompuInternalToPhys(compu_method_tag, compu_method)
832
+ child_element = ET.SubElement(element, "COMPU-METHOD")
833
+ self.logger.debug("writeCompuMethods %s" % compu_method.getShortName())
834
+ self.setIdentifiable(child_element, compu_method)
835
+ self.setChildElementOptionalRefType(child_element, "UNIT-REF", compu_method.getUnitRef())
836
+ self.writeCompuInternalToPhys(child_element, compu_method)
837
+ self.writeCompuPhysToInternal(child_element, compu_method)
796
838
 
797
839
  def setApplicationValueSpecification(self, element: ET.Element, spec: ApplicationValueSpecification):
798
840
  spec_tag = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
799
- self.setChildElementOptionalLiteral(spec_tag, "SHORT-LABEL", spec.short_label)
841
+ self.setChildElementOptionalLiteral(spec_tag, "SHORT-LABEL", spec.getShortLabel())
800
842
  self.setChildElementOptionalLiteral(spec_tag, "CATEGORY", spec.category)
801
- self.writeSwValueCont(spec_tag, spec.sw_value_cont)
843
+ self.writeSwValueCont(spec_tag, spec.getSwValueCont())
802
844
 
803
845
  def setRecordValueSpecification(self, element: ET.Element, spec: RecordValueSpecification):
804
846
  child_element = ET.SubElement(element, "RECORD-VALUE-SPECIFICATION")
805
847
  self.setARObjectAttributes(child_element, spec)
806
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", spec.short_label)
807
- fields = spec.get_fields()
848
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", spec.getShortLabel())
849
+ fields = spec.getFields()
808
850
  if len(fields) > 0:
809
851
  fields_tag = ET.SubElement(child_element, "FIELDS")
810
852
  for field in fields:
@@ -816,8 +858,10 @@ class ARXMLWriter(AbstractARXMLWriter):
816
858
  self.setTextValueSpecification(fields_tag, field)
817
859
  elif isinstance(field, ArrayValueSpecification):
818
860
  self.setArrayValueSpecification(fields_tag, field)
861
+ elif isinstance(field, RecordValueSpecification):
862
+ self.setRecordValueSpecification(fields_tag, field)
819
863
  else:
820
- raise NotImplementedError("Unsupported Field <%s>" % type(field))
864
+ self.notImplemented("Unsupported Field <%s>" % type(field))
821
865
 
822
866
  def writeConstantSpecification(self, element: ET.Element, spec: ConstantSpecification):
823
867
  spec_tag = ET.SubElement(element, "CONSTANT-SPECIFICATION")
@@ -873,15 +917,18 @@ class ARXMLWriter(AbstractARXMLWriter):
873
917
 
874
918
  def setRModeInAtomicSwcInstanceRef(self, element: ET.Element, key: str, iref: RModeInAtomicSwcInstanceRef):
875
919
  child_element = ET.SubElement(element, key)
920
+ self.setARObjectAttributes(child_element, iref)
876
921
  self.setChildElementOptionalRefType(child_element, "BASE", iref.getBaseRef())
877
922
  self.setChildElementOptionalRefType(child_element, "CONTEXT-PORT-REF", iref.getContextPortRef())
878
923
  self.setChildElementOptionalRefType(child_element, "CONTEXT-MODE-DECLARATION-GROUP-PROTOTYPE-REF", iref.getContextModeDeclarationGroupPrototypeRef())
879
924
  self.setChildElementOptionalRefType(child_element, "TARGET-MODE-DECLARATION-REF", iref.getTargetModeDeclarationRef())
880
925
 
881
926
  def setPOperationInAtomicSwcInstanceRef(self, element: ET.Element, key: str, iref: POperationInAtomicSwcInstanceRef):
882
- child_element = ET.SubElement(element, key)
883
- self.setChildElementOptionalRefType(child_element, "CONTEXT-P-PORT-REF", iref.context_p_port_ref)
884
- self.setChildElementOptionalRefType(child_element, "TARGET-PROVIDED-OPERATION-REF", iref.target_provided_operation_ref)
927
+ if iref is not None:
928
+ child_element = ET.SubElement(element, key)
929
+ self.setARObjectAttributes(child_element, iref)
930
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-P-PORT-REF", iref.getContextPPortRef())
931
+ self.setChildElementOptionalRefType(child_element, "TARGET-PROVIDED-OPERATION-REF", iref.getTargetProvidedOperationRef())
885
932
 
886
933
  def setRTEEvent(self, element: ET.Element, event: RTEEvent):
887
934
  self.setIdentifiable(element, event)
@@ -896,7 +943,8 @@ class ARXMLWriter(AbstractARXMLWriter):
896
943
  if event is not None:
897
944
  child_element = ET.SubElement(element, "TIMING-EVENT")
898
945
  self.setRTEEvent(child_element, event)
899
- self.setChildElementOptionalFloatValue(child_element, "PERIOD", event.period)
946
+ self.setChildElementOptionalTimeValue(child_element, "OFFSET", event.getOffset())
947
+ self.setChildElementOptionalTimeValue(child_element, "PERIOD", event.getPeriod())
900
948
 
901
949
  def setOperationInvokedEvent(self, element: ET.Element, event: OperationInvokedEvent):
902
950
  if event is not None:
@@ -935,6 +983,12 @@ class ARXMLWriter(AbstractARXMLWriter):
935
983
  child_element = ET.SubElement(element, "INIT-EVENT")
936
984
  self.setRTEEvent(child_element, event)
937
985
 
986
+ def setAsynchronousServerCallReturnsEvent(self, element: ET.Element, event: InitEvent):
987
+ if event is not None:
988
+ child_element = ET.SubElement(element, "ASYNCHRONOUS-SERVER-CALL-RETURNS-EVENT")
989
+ self.setRTEEvent(child_element, event)
990
+ self.setChildElementOptionalRefType(child_element, "EVENT-SOURCE-REF", event.getActivationReasonRepresentationRef())
991
+
938
992
  def writeRTEEvents(self, element: ET.Element, parent: SwcInternalBehavior):
939
993
  events = parent.getRteEvents()
940
994
  if len(events) > 0:
@@ -953,8 +1007,10 @@ class ARXMLWriter(AbstractARXMLWriter):
953
1007
  self.setInternalTriggerOccurredEvent(child_element, event)
954
1008
  elif isinstance(event, InitEvent):
955
1009
  self.setInitEvent(child_element, event)
1010
+ elif isinstance(event, AsynchronousServerCallReturnsEvent):
1011
+ self.setAsynchronousServerCallReturnsEvent(child_element, event)
956
1012
  else:
957
- raise NotImplementedError("Unsupported Event <%s>" % type(event))
1013
+ self.notImplemented("Unsupported Event <%s>" % type(event))
958
1014
 
959
1015
  def writeExclusiveAreas(self, element: ET.Element, behavior: InternalBehavior):
960
1016
  areas = behavior.getExclusiveAreas()
@@ -990,6 +1046,7 @@ class ARXMLWriter(AbstractARXMLWriter):
990
1046
  self.setARObjectAttributes(child_element, ref)
991
1047
  if ref.getAutosarVariableIRef() is not None:
992
1048
  child_element = ET.SubElement(child_element, "AUTOSAR-VARIABLE-IREF")
1049
+ #self.setARObjectAttributes(child_element, ref)
993
1050
  self.setChildElementOptionalRefType(child_element, "PORT-PROTOTYPE-REF", ref.getAutosarVariableIRef().getPortPrototypeRef())
994
1051
  self.setChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF", ref.getAutosarVariableIRef().getTargetDataPrototypeRef())
995
1052
  self.setChildElementOptionalRefType(child_element, "LOCAL-VARIABLE-REF", ref.getLocalVariableRef())
@@ -1059,8 +1116,9 @@ class ARXMLWriter(AbstractARXMLWriter):
1059
1116
  def setROperationInAtomicSwcInstanceRef(self, element: ET.Element, key: str, iref: ROperationInAtomicSwcInstanceRef):
1060
1117
  if iref is not None:
1061
1118
  child_element = ET.SubElement(element, key)
1062
- self.setChildElementOptionalRefType(child_element, "CONTEXT-R-PORT-REF", iref.context_r_port_ref)
1063
- self.setChildElementOptionalRefType(child_element, "TARGET-REQUIRED-OPERATION-REF", iref.target_required_operation_ref)
1119
+ self.setARObjectAttributes(child_element, iref)
1120
+ self.setChildElementOptionalRefType(child_element, "CONTEXT-R-PORT-REF", iref.getContextRPortRef())
1121
+ self.setChildElementOptionalRefType(child_element, "TARGET-REQUIRED-OPERATION-REF", iref.getTargetRequiredOperationRef())
1064
1122
 
1065
1123
  def setServerCallPoint(self, element: ET.Element, call_point: ServerCallPoint):
1066
1124
  self.setROperationInAtomicSwcInstanceRef(element, "OPERATION-IREF", call_point.getOperationIRef())
@@ -1071,6 +1129,11 @@ class ARXMLWriter(AbstractARXMLWriter):
1071
1129
  self.setIdentifiable(child_element, call_point)
1072
1130
  self.setServerCallPoint(child_element, call_point)
1073
1131
 
1132
+ def setAsynchronousServerCallPoint(self, element: ET.Element, call_point: SynchronousServerCallPoint):
1133
+ child_element = ET.SubElement(element, "ASYNCHRONOUS-SERVER-CALL-POINT")
1134
+ self.setIdentifiable(child_element, call_point)
1135
+ self.setServerCallPoint(child_element, call_point)
1136
+
1074
1137
  def writeServerCallPoints(self, element: ET.Element, entity: RunnableEntity):
1075
1138
  call_points = entity.getServerCallPoints()
1076
1139
  if len(call_points) > 0:
@@ -1078,6 +1141,8 @@ class ARXMLWriter(AbstractARXMLWriter):
1078
1141
  for call_point in call_points:
1079
1142
  if isinstance(call_point, SynchronousServerCallPoint):
1080
1143
  self.setSynchronousServerCallPoint(child_element, call_point)
1144
+ elif isinstance(call_point, AsynchronousServerCallPoint):
1145
+ self.setAsynchronousServerCallPoint(child_element, call_point)
1081
1146
  else:
1082
1147
  self._raiseError("Unsupported ServerCallPoint type <%s>" % type(call_point))
1083
1148
 
@@ -1130,13 +1195,23 @@ class ARXMLWriter(AbstractARXMLWriter):
1130
1195
  if isinstance(argument, RunnableEntityArgument):
1131
1196
  self.setRunnableEntityArgument(child_element, argument)
1132
1197
  else:
1133
- raise NotImplementedError("Unsupported argument of Runnable Entity <%s>" % type(argument))
1198
+ self.notImplemented("Unsupported argument of Runnable Entity <%s>" % type(argument))
1199
+
1200
+ def writeAsynchronousServerCallResultPoint(self, element: ET.Element, entity: RunnableEntity):
1201
+ points = entity.getAsynchronousServerCallResultPoints()
1202
+ if len(points) > 0:
1203
+ points_tag = ET.SubElement(element, "ASYNCHRONOUS-SERVER-CALL-RESULT-POINTS")
1204
+ for point in points:
1205
+ child_element = ET.SubElement(points_tag, "ASYNCHRONOUS-SERVER-CALL-RESULT-POINT")
1206
+ self.setIdentifiable(child_element, point)
1207
+ self.setChildElementOptionalRefType(child_element, "ASYNCHRONOUS-SERVER-CALL-POINT-REF", point.getAsynchronousServerCallPointRef())
1134
1208
 
1135
1209
  def writeRunnableEntity(self, element: ET.Element, entity: RunnableEntity):
1136
1210
  if entity is not None:
1137
1211
  child_element = ET.SubElement(element, "RUNNABLE-ENTITY")
1138
1212
  self.setExecutableEntity(child_element, entity)
1139
1213
  self.writeRunnableEntityArguments(child_element, entity)
1214
+ self.writeAsynchronousServerCallResultPoint(child_element, entity)
1140
1215
  self.setChildElementOptionalBooleanValue(child_element, "CAN-BE-INVOKED-CONCURRENTLY", entity.getCanBeInvokedConcurrently())
1141
1216
  self.writeParameterAccesses(child_element, entity)
1142
1217
  self.writeDataReceivePointByArguments(child_element, entity)
@@ -1157,7 +1232,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1157
1232
  if isinstance(entity, RunnableEntity):
1158
1233
  self.writeRunnableEntity(runnables_tag, entity)
1159
1234
  else:
1160
- raise NotImplementedError("Unsupported RunnableEntity <%s>" % type(entity))
1235
+ self.notImplemented("Unsupported RunnableEntity <%s>" % type(entity))
1161
1236
 
1162
1237
  def writeExplicitInterRunnableVariables(self, element: ET.Element, behavior: SwcInternalBehavior):
1163
1238
  prototypes = behavior.getExplicitInterRunnableVariables()
@@ -1176,18 +1251,18 @@ class ARXMLWriter(AbstractARXMLWriter):
1176
1251
  for memory in memories:
1177
1252
  child_element = ET.SubElement(memories_tag, "PER-INSTANCE-MEMORY")
1178
1253
  self.setIdentifiable(child_element, memory)
1179
- self.setChildElementOptionalLiteral(child_element, "INIT-VALUE", memory.initValue)
1180
- self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", memory.swDataDefProps)
1181
- self.setChildElementOptionalLiteral(child_element, "TYPE", memory.type)
1182
- self.setChildElementOptionalLiteral (child_element, "TYPE-DEFINITION", memory.typeDefinition)
1254
+ self.setChildElementOptionalLiteral(child_element, "INIT-VALUE", memory.getInitValue())
1255
+ self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", memory.getSwDataDefProps())
1256
+ self.setChildElementOptionalLiteral(child_element, "TYPE", memory.getType())
1257
+ self.setChildElementOptionalLiteral (child_element, "TYPE-DEFINITION", memory.getTypeDefinition())
1183
1258
 
1184
1259
  def writeParameterDataPrototype(self, element: ET.Element, prototype: ParameterDataPrototype):
1185
1260
  child_element = ET.SubElement(element, "PARAMETER-DATA-PROTOTYPE")
1186
1261
  self.setIdentifiable(child_element, prototype)
1187
- self.writeAutosarDataPrototype(child_element, prototype)
1188
- self.setInitValue(child_element, prototype.initValue)
1262
+ self.setAutosarDataPrototype(child_element, prototype)
1263
+ self.setInitValue(child_element, prototype.getInitValue())
1189
1264
 
1190
- def writeParameterDataPrototypes(self, element: ET.Element, behavior: SwcInternalBehavior):
1265
+ def writePerInstanceParameters(self, element: ET.Element, behavior: SwcInternalBehavior):
1191
1266
  prototypes = behavior.getPerInstanceParameters()
1192
1267
  if len(prototypes) > 0:
1193
1268
  child_element = ET.SubElement(element, "PER-INSTANCE-PARAMETERS")
@@ -1216,14 +1291,30 @@ class ARXMLWriter(AbstractARXMLWriter):
1216
1291
  self.writePortDefinedArgumentValues(child_element, option)
1217
1292
  self.setChildElementOptionalRefType(child_element, "PORT-REF", option.portRef)
1218
1293
 
1294
+ def writeRoleBasedDataTypeAssignment(self, element: ET.Element, assignment: RoleBasedDataTypeAssignment):
1295
+ child_element = ET.SubElement(element, "ROLE-BASED-DATA-TYPE-ASSIGNMENT")
1296
+ self.setChildElementOptionalLiteral(child_element, "ROLE", assignment.role)
1297
+ self.setChildElementOptionalRefType(child_element, "USED-IMPLEMENTATION-DATA-TYPE-REF", assignment.usedImplementationDataTypeRef)
1298
+
1299
+ def writeServiceDependencyAssignedDataType(self, element: ET.Element, dependency: ServiceDependency):
1300
+ assigned_data = dependency.getAssignedDataTypes()
1301
+ if len(assigned_data) > 0:
1302
+ child_element = ET.SubElement(element, "ASSIGNED-DATA-TYPES")
1303
+ for data in assigned_data:
1304
+ if isinstance(data, RoleBasedDataTypeAssignment):
1305
+ self.writeRoleBasedDataTypeAssignment(child_element, data)
1306
+ else:
1307
+ self._raiseError("Unsupported Assigned Data <%s>" % type(data))
1308
+
1219
1309
  def writeServiceDependency(self, element: ET.Element, dependency: ServiceDependency):
1220
1310
  self.setIdentifiable(element, dependency)
1311
+ self.writeServiceDependencyAssignedDataType(element, dependency)
1221
1312
 
1222
1313
  def writeRoleBasedDataAssignment(self, element: ET.Element, assignment: RoleBasedDataAssignment):
1223
1314
  child_element = ET.SubElement(element, "ROLE-BASED-DATA-ASSIGNMENT")
1224
1315
  self.setChildElementOptionalLiteral(child_element, "ROLE", assignment.role)
1225
- self.setAutosarParameterRef(child_element, "USED-PARAMETER-ELEMENT", assignment.used_parameter_element)
1226
- self.setChildElementOptionalRefType(child_element, "USED-PIM-REF", assignment.used_pim_ref)
1316
+ self.setAutosarParameterRef(child_element, "USED-PARAMETER-ELEMENT", assignment.getUsedParameterElement())
1317
+ self.setChildElementOptionalRefType(child_element, "USED-PIM-REF", assignment.getUsedPimRef())
1227
1318
 
1228
1319
  def writeRoleBasedPortAssignment(self, element: ET.Element, assignment: RoleBasedPortAssignment):
1229
1320
  child_element = ET.SubElement(element, "ROLE-BASED-PORT-ASSIGNMENT")
@@ -1252,20 +1343,76 @@ class ARXMLWriter(AbstractARXMLWriter):
1252
1343
 
1253
1344
  def writeNvBlockNeeds(self, element: ET.Element, needs: NvBlockNeeds):
1254
1345
  child_element = ET.SubElement(element, "NV-BLOCK-NEEDS")
1255
- self.logger.debug("writeNvBlockNeeds %s" % needs.short_name)
1346
+ self.logger.debug("write NvBlockNeeds %s" % needs.short_name)
1347
+ self.setIdentifiable(child_element, needs)
1348
+ self.setChildElementOptionalBooleanValue(child_element, "CALC-RAM-BLOCK-CRC", needs.getCalcRamBlockCrc())
1349
+ self.setChildElementOptionalBooleanValue(child_element, "CHECK-STATIC-BLOCK-ID", needs.getCheckStaticBlockId())
1350
+ self.setChildElementOptionalNumericalValue(child_element, "N-DATA-SETS", needs.getNDataSets())
1351
+ self.setChildElementOptionalNumericalValue(child_element, "N-ROM-BLOCKS", needs.getNRomBlocks())
1352
+ self.setChildElementOptionalLiteral(child_element, "RAM-BLOCK-STATUS-CONTROL", needs.getRamBlockStatusControl())
1353
+ self.setChildElementOptionalBooleanValue(child_element, "READONLY", needs.getReadonly())
1354
+ self.setChildElementOptionalLiteral(child_element, "RELIABILITY", needs.getReliability())
1355
+ self.setChildElementOptionalBooleanValue(child_element, "RESISTANT-TO-CHANGED-SW", needs.getResistantToChangedSw())
1356
+ self.setChildElementOptionalBooleanValue(child_element, "RESTORE-AT-START", needs.getRestoreAtStart())
1357
+ self.setChildElementOptionalBooleanValue(child_element, "STORE-AT-SHUTDOWN", needs.getStoreAtShutdown())
1358
+ self.setChildElementOptionalBooleanValue(child_element, "STORE-CYCLIC", needs.getStoreCyclic())
1359
+ self.setChildElementOptionalBooleanValue(child_element, "STORE-EMERGENCY", needs.getStoreEmergency())
1360
+ self.setChildElementOptionalBooleanValue(child_element, "STORE-IMMEDIATE", needs.getStoreImmediate())
1361
+ self.setChildElementOptionalBooleanValue(child_element, "USE-AUTO-VALIDATION-AT-SHUT-DOWN", needs.getUseAutoValidationAtShutDown())
1362
+ self.setChildElementOptionalBooleanValue(child_element, "USE-CRC-COMP-MECHANISM", needs.getUseCRCCompMechanism())
1363
+ self.setChildElementOptionalBooleanValue(child_element, "WRITE-ONLY-ONCE", needs.getWriteOnlyOnce())
1364
+ self.setChildElementOptionalBooleanValue(child_element, "WRITE-VERIFICATION", needs.getWriteVerification())
1365
+ self.setChildElementOptionalLiteral(child_element, "WRITING-PRIORITY", needs.getWritingPriority())
1366
+
1367
+ def writeDiagnosticCommunicationManagerNeeds(self, element: ET.Element, needs: DiagnosticCommunicationManagerNeeds):
1368
+ child_element = ET.SubElement(element, "DIAGNOSTIC-COMMUNICATION-MANAGER-NEEDS")
1369
+ self.logger.debug("write DiagnosticCommunicationManagerNeeds %s" % needs.short_name)
1370
+ self.setIdentifiable(child_element, needs)
1371
+ self.setChildElementOptionalLiteral(child_element, "SERVICE-REQUEST-CALLBACK-TYPE", needs.getServiceRequestCallbackType())
1372
+
1373
+ def writeDiagnosticRoutineNeeds(self, element: ET.Element, needs: DiagnosticRoutineNeeds):
1374
+ child_element = ET.SubElement(element, "DIAGNOSTIC-ROUTINE-NEEDS")
1375
+ self.logger.debug("write DiagnosticRoutineNeeds %s" % needs.short_name)
1256
1376
  self.setIdentifiable(child_element, needs)
1257
- self.setChildElementOptionalBooleanValue(child_element, "CALC-RAM-BLOCK-CRC", needs.calc_ram_block_crc)
1258
- self.setChildElementOptionalBooleanValue(child_element, "CHECK-STATIC-BLOCK-ID", needs.check_static_block_id)
1259
- self.setChildElementOptionalNumericalValue(child_element, "N-DATA-SETS", needs.n_data_sets)
1260
- self.setChildElementOptionalNumericalValue(child_element, "N-ROM-BLOCKS", needs.n_rom_blocks)
1261
- self.setChildElementOptionalBooleanValue(child_element, "READONLY", needs.readonly)
1262
- self.setChildElementOptionalLiteral(child_element, "RELIABILITY", needs.reliability)
1263
- self.setChildElementOptionalBooleanValue(child_element, "RESISTANT-TO-CHANGED-SW", needs.resistant_to_changed_sw)
1264
- self.setChildElementOptionalBooleanValue(child_element, "RESTORE-AT-START", needs.restore_at_start)
1265
- self.setChildElementOptionalBooleanValue(child_element, "STORE-AT-SHUTDOWN", needs.store_at_shutdown)
1266
- self.setChildElementOptionalBooleanValue(child_element, "WRITE-ONLY-ONCE", needs.write_only_once)
1267
- self.setChildElementOptionalBooleanValue(child_element, "WRITE-VERIFICATION", needs.write_verification)
1268
- self.setChildElementOptionalLiteral(child_element, "WRITING-PRIORITY", needs.writing_priority)
1377
+ self.setChildElementOptionalLiteral(child_element, "DIAG-ROUTINE-TYPE", needs.getDiagRoutineType())
1378
+ self.setChildElementOptionalIntegerValue(child_element, "RID-NUMBER", needs.getRidNumber())
1379
+
1380
+ def writeDiagnosticValueNeeds(self, element: ET.Element, needs: DiagnosticValueNeeds):
1381
+ child_element = ET.SubElement(element, "DIAGNOSTIC-VALUE-NEEDS")
1382
+ self.logger.debug("write DiagnosticValueNeeds %s" % needs.short_name)
1383
+ self.setIdentifiable(child_element, needs)
1384
+ self.setChildElementOptionalPositiveInteger(child_element, "DATA-LENGTH", needs.getDataLength())
1385
+ self.setChildElementOptionalLiteral(child_element, "DIAGNOSTIC-VALUE-ACCESS", needs.getDiagnosticValueAccess())
1386
+ self.setChildElementOptionalIntegerValue(child_element, "DID-NUMBER", needs.getDidNumber())
1387
+ self.setChildElementOptionalBooleanValue(child_element, "FIXED-LENGTH", needs.getFixedLength())
1388
+ self.setChildElementOptionalLiteral(child_element, "PROCESSING-STYLE", needs.getProcessingStyle())
1389
+
1390
+ def setDiagEventDebounceMonitorInternal(self, element: ET.Element, algorithm: DiagEventDebounceMonitorInternal):
1391
+ child_element = ET.SubElement(element, "DIAG-EVENT-DEBOUNCE-MONITOR-INTERNAL")
1392
+ self.setIdentifiable(child_element, algorithm)
1393
+
1394
+ def writeDiagEventDebounceAlgorithm(self, element: ET.Element, needs: DiagnosticEventNeeds):
1395
+ algorithm = needs.getDiagEventDebounceAlgorithm()
1396
+ if algorithm is not None:
1397
+ child_element = ET.SubElement(element, "DIAG-EVENT-DEBOUNCE-ALGORITHM")
1398
+ if isinstance(algorithm, DiagEventDebounceMonitorInternal):
1399
+ self.setDiagEventDebounceMonitorInternal(child_element, algorithm)
1400
+ else:
1401
+ self.notImplemented("Unsupported DiagEventDebounceAlgorithm <%s>" % type(algorithm))
1402
+
1403
+ def writeDiagnosticEventNeeds(self, element: ET.Element, needs: DiagnosticEventNeeds):
1404
+ child_element = ET.SubElement(element, "DIAGNOSTIC-EVENT-NEEDS")
1405
+ self.logger.debug("write DiagnosticEventNeeds %s" % needs.short_name)
1406
+ self.setIdentifiable(child_element, needs)
1407
+ self.writeDiagEventDebounceAlgorithm(child_element, needs)
1408
+ self.setChildElementOptionalLiteral(child_element, "DTC-KIND", needs.getDtcKind())
1409
+ self.setChildElementOptionalIntegerValue(child_element, "UDS-DTC-NUMBER", needs.getUdsDtcNumber())
1410
+
1411
+ def writeCryptoServiceNeeds(self, element: ET.Element, needs: CryptoServiceNeeds):
1412
+ child_element = ET.SubElement(element, "CRYPTO-SERVICE-NEEDS")
1413
+ self.logger.debug("write CryptoServiceNeeds %s" % needs.short_name)
1414
+ self.setIdentifiable(child_element, needs)
1415
+ self.setChildElementOptionalPositiveInteger(child_element, "MAXIMUM-KEY-LENGTH", needs.getMaximumKeyLength())
1269
1416
 
1270
1417
  def writeSwcServiceDependencyServiceNeeds(self, element: ET.Element, parent: SwcServiceDependency):
1271
1418
  needs = parent.getServiceNeeds()
@@ -1273,7 +1420,17 @@ class ARXMLWriter(AbstractARXMLWriter):
1273
1420
  child_element = ET.SubElement(element, "SERVICE-NEEDS")
1274
1421
  for need in needs:
1275
1422
  if isinstance(need, NvBlockNeeds):
1276
- self.writeNvBlockNeeds(child_element, need)
1423
+ self.writeNvBlockNeeds(child_element, need)
1424
+ elif isinstance(need, DiagnosticCommunicationManagerNeeds):
1425
+ self.writeDiagnosticCommunicationManagerNeeds(child_element, need)
1426
+ elif isinstance(need, DiagnosticRoutineNeeds):
1427
+ self.writeDiagnosticRoutineNeeds(child_element, need)
1428
+ elif isinstance(need, DiagnosticValueNeeds):
1429
+ self.writeDiagnosticValueNeeds(child_element, need)
1430
+ elif isinstance(need, DiagnosticEventNeeds):
1431
+ self.writeDiagnosticEventNeeds(child_element, need)
1432
+ elif isinstance(need, CryptoServiceNeeds):
1433
+ self.writeCryptoServiceNeeds(child_element, need)
1277
1434
  else:
1278
1435
  self._raiseError("Unsupported service needs <%s>" % type(need))
1279
1436
 
@@ -1316,7 +1473,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1316
1473
  self.setChildElementOptionalLiteral(child_element, "HANDLE-TERMINATION-AND-RESTART", behavior.handle_termination_and_restart)
1317
1474
  self.setIncludedDataTypeSets(child_element, behavior.getIncludedDataTypeSets())
1318
1475
  self.writePerInstanceMemories(child_element, behavior)
1319
- self.writeParameterDataPrototypes(child_element, behavior)
1476
+ self.writePerInstanceParameters(child_element, behavior)
1320
1477
  self.writePortAPIOptions(child_element, behavior)
1321
1478
  self.writeSwcInternalBehaviorRunnableEntities(child_element, behavior)
1322
1479
  self.writeSwcInternalBehaviorServiceDependencies(child_element, behavior)
@@ -1379,12 +1536,13 @@ class ARXMLWriter(AbstractARXMLWriter):
1379
1536
  for memory_section in memory_sections:
1380
1537
  child_element = ET.SubElement(sections_tag, "MEMORY-SECTION")
1381
1538
  self.setIdentifiable(child_element, memory_section)
1382
- self.setChildElementOptionalLiteral(child_element, "ALIGNMENT", memory_section.alignment)
1539
+ self.setChildElementOptionalLiteral(child_element, "ALIGNMENT", memory_section.getAlignment())
1540
+ self.setChildElementOptionalLiteral(child_element, "MEM-CLASS-SYMBOL", memory_section.getMemClassSymbol())
1383
1541
  self.setMemorySectionOptions(child_element, memory_section.getOptions())
1384
- self.setChildElementOptionalNumericalValue(child_element, "SIZE", memory_section.size)
1385
- self.setChildElementOptionalRefType(child_element, "SW-ADDRMETHOD-REF", memory_section.swAddrMethodRef)
1386
- self.setChildElementOptionalLiteral(child_element, "SYMBOL", memory_section.symbol)
1387
- self.logger.debug("writeMemorySections %s" % memory_section.short_name)
1542
+ self.setChildElementOptionalNumericalValue(child_element, "SIZE", memory_section.getSize())
1543
+ self.setChildElementOptionalRefType(child_element, "SW-ADDRMETHOD-REF", memory_section.getSwAddrMethodRef())
1544
+ self.setChildElementOptionalLiteral(child_element, "SYMBOL", memory_section.getSymbol())
1545
+ self.logger.debug("write MemorySection %s" % memory_section.getShortName())
1388
1546
 
1389
1547
  def setResourceConsumption(self, element: ET.Element, consumption: ResourceConsumption):
1390
1548
  if consumption is not None:
@@ -1474,15 +1632,15 @@ class ARXMLWriter(AbstractARXMLWriter):
1474
1632
  self.setIdentifiable(child_element, protection_set)
1475
1633
  self.writeEndToEndProtections(child_element, protection_set)
1476
1634
 
1477
- def writeAutosarDataPrototype(self, element: ET.Element, prototype: AutosarDataPrototype):
1635
+ def setAutosarDataPrototype(self, element: ET.Element, prototype: AutosarDataPrototype):
1636
+ self.setDataPrototype(element, prototype)
1478
1637
  self.setChildElementOptionalRefType(element, "TYPE-TREF", prototype.typeTRef)
1479
1638
 
1480
1639
  def writeVariableDataPrototype(self, element: ET.Element, prototype: VariableDataPrototype):
1481
1640
  self.logger.debug("writeVariableDataPrototype %s" % prototype.short_name)
1482
1641
  child_element = ET.SubElement(element, "VARIABLE-DATA-PROTOTYPE")
1483
1642
  self.setIdentifiable(child_element, prototype)
1484
- self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", prototype.swDataDefProps)
1485
- self.writeAutosarDataPrototype(child_element, prototype)
1643
+ self.setAutosarDataPrototype(child_element, prototype)
1486
1644
  self.setInitValue(child_element, prototype.initValue)
1487
1645
 
1488
1646
  def writeSenderReceiverInterfaceDataElements(self, element: ET.Element, sr_interface: SenderReceiverInterface):
@@ -1510,6 +1668,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1510
1668
  self.setIdentifiable(child_element, sr_interface)
1511
1669
  self.setChildElementOptionalBooleanValue(child_element, "IS-SERVICE", sr_interface.getIsService())
1512
1670
  self.writeSenderReceiverInterfaceDataElements(child_element, sr_interface)
1671
+ self.writeSenderReceiverInterfaceInvalidationPolicies(child_element, sr_interface)
1513
1672
 
1514
1673
  def writerBswModuleDescriptionImplementedEntry(self, element: ET.Element, desc: BswModuleDescription):
1515
1674
  entries = desc.getImplementedEntries()
@@ -1590,7 +1749,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1590
1749
  self.logger.debug("setBswTimingEvent %s" % event.short_name)
1591
1750
  child_element = ET.SubElement(element, "BSW-TIMING-EVENT")
1592
1751
  self.setBswScheduleEvent(child_element, event)
1593
- self.setChildElementOptionalFloatValue(child_element, "PERIOD", event.period)
1752
+ self.setChildElementOptionalTimeValue(child_element, "PERIOD", event.getPeriod())
1594
1753
 
1595
1754
  def writeBswInternalBehaviorBswEvents(self, element: ET.Element, parent: BswInternalBehavior):
1596
1755
  events = parent.getBswEvents()
@@ -1741,13 +1900,16 @@ class ARXMLWriter(AbstractARXMLWriter):
1741
1900
  child_element = ET.SubElement(sub_elements_tag, "IMPLEMENTATION-DATA-TYPE-ELEMENT")
1742
1901
  self.setIdentifiable(child_element, type_element)
1743
1902
  self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE", type_element.getArraySize())
1903
+ self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE-HANDLING", type_element.getArraySizeHandling())
1744
1904
  self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE-SEMANTICS", type_element.getArraySizeSemantics())
1905
+ self.writeImplementationDataTypeElements(child_element, type_element)
1745
1906
  self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", type_element.getSwDataDefProps())
1746
1907
 
1747
1908
  def writeImplementationDataType(self, element: ET.Element, data_type: ImplementationDataType):
1748
1909
  self.logger.debug("writeImplementationDataType %s" % data_type.short_name)
1749
1910
  child_element = ET.SubElement(element, "IMPLEMENTATION-DATA-TYPE")
1750
- self.writeAutosarDataType(child_element, data_type)
1911
+ self.setAutosarDataType(child_element, data_type)
1912
+ self.setChildElementOptionalLiteral(child_element, "DYNAMIC-ARRAY-SIZE-PROFILE", data_type.getDynamicArraySizeProfile())
1751
1913
  self.writeImplementationDataTypeElements(child_element, data_type)
1752
1914
  self.setChildElementOptionalLiteral(child_element, "TYPE-EMITTER", data_type.getTypeEmitter())
1753
1915
 
@@ -1808,6 +1970,19 @@ class ARXMLWriter(AbstractARXMLWriter):
1808
1970
  self.setChildElementOptionalBooleanValue(element, "IS-SERVICE", port_interface.isService)
1809
1971
  self.setChildElementOptionalLiteral(element, "SERVICE-KIND", port_interface.serviceKind)
1810
1972
 
1973
+ def writeParameterInterfaceParameters(self, element: ET.Element, param_interface: ParameterInterface):
1974
+ parameters = param_interface.getParameters()
1975
+ if len(parameters) > 0:
1976
+ child_element = ET.SubElement(element, "PARAMETERS")
1977
+ for prototype in parameters:
1978
+ self.writeParameterDataPrototype(child_element, prototype)
1979
+
1980
+ def writeParameterInterface(self, element: ET.Element, param_interface: ParameterInterface):
1981
+ self.logger.debug("Write ParameterInterface %s" % param_interface.short_name)
1982
+ child_element = ET.SubElement(element, "PARAMETER-INTERFACE")
1983
+ self.setPortInterface(child_element, param_interface)
1984
+ self.writeParameterInterfaceParameters(child_element, param_interface)
1985
+
1811
1986
  def writeClientServerInterface(self, element: ET.Element, cs_interface: ClientServerInterface):
1812
1987
  self.logger.debug("writeClientServerInterface %s" % cs_interface.short_name)
1813
1988
  child_element = ET.SubElement(element, "CLIENT-SERVER-INTERFACE")
@@ -1835,44 +2010,54 @@ class ARXMLWriter(AbstractARXMLWriter):
1835
2010
  def writeApplicationArrayDataType(self, element: ET.Element, data_type: ApplicationArrayDataType):
1836
2011
  self.logger.debug("writeApplicationArrayDataType %s" % data_type.short_name)
1837
2012
  child_element = ET.SubElement(element, "APPLICATION-ARRAY-DATA-TYPE")
1838
- self.writeApplicationCompositeDataType(child_element, data_type)
2013
+ self.setApplicationCompositeDataType(child_element, data_type)
1839
2014
  self.setApplicationArrayElement(child_element, data_type.element)
1840
2015
 
1841
2016
  def setSwRecordLayoutV(self, element: ET.Element, key: str, layout_v: SwRecordLayoutV):
1842
2017
  if layout_v is not None:
1843
2018
  child_element = ET.SubElement(element, key)
1844
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", layout_v.shortLabel)
1845
- self.setChildElementOptionalRefType(child_element, "BASE-TYPE-REF", layout_v.baseTypeRef)
1846
- self.setChildElementOptionalNumericalValue(child_element, "SW-RECORD-LAYOUT-V-AXIS", layout_v.swRecordLayoutVAxis)
1847
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-PROP", layout_v.swRecordLayoutVProp)
1848
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-INDEX", layout_v.swRecordLayoutVIndex)
2019
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", layout_v.getShortLabel())
2020
+ self.setChildElementOptionalRefType(child_element, "BASE-TYPE-REF", layout_v.getBaseTypeRef())
2021
+ self.setChildElementOptionalNumericalValue(child_element, "SW-RECORD-LAYOUT-V-AXIS", layout_v.getSwRecordLayoutVAxis())
2022
+ self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-PROP", layout_v.getSwRecordLayoutVProp())
2023
+ self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-INDEX", layout_v.getSwRecordLayoutVIndex())
1849
2024
 
1850
2025
  def setSwRecordLayoutGroup(self, element: ET.Element, key: str, group: SwRecordLayoutGroup):
1851
2026
  if group is not None:
1852
2027
  child_element = ET.SubElement(element, key)
1853
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", group.shortLabel)
1854
- self.setChildElementOptionalLiteral(child_element, "CATEGORY", group.category)
1855
- self.setChildElementOptionalNumericalValue(child_element, "SW-RECORD-LAYOUT-GROUP-AXIS", group.swRecordLayoutGroupAxis)
1856
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-INDEX", group.swRecordLayoutGroupIndex)
1857
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-FROM", group.swRecordLayoutGroupFrom)
1858
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-TO", group.swRecordLayoutGroupTo)
1859
- self.setSwRecordLayoutV(child_element, "SW-RECORD-LAYOUT-V", group.swRecordLayoutGroupContentType.swRecordLayoutV)
1860
- self.setSwRecordLayoutGroup(child_element, "SW-RECORD-LAYOUT-GROUP", group.swRecordLayoutGroupContentType.swRecordLayoutGroup)
2028
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", group.getShortLabel())
2029
+ self.setChildElementOptionalLiteral(child_element, "CATEGORY", group.getCategory())
2030
+ self.setChildElementOptionalNumericalValue(child_element, "SW-RECORD-LAYOUT-GROUP-AXIS", group.getSwRecordLayoutGroupAxis())
2031
+ self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-INDEX", group.getSwRecordLayoutGroupIndex())
2032
+ self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-FROM", group.getSwRecordLayoutGroupFrom())
2033
+ self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-TO", group.getSwRecordLayoutGroupTo())
2034
+ self.setChildElementOptionalIntegerValue(child_element, "SW-RECORD-LAYOUT-GROUP-STEP", group.getSwRecordLayoutGroupStep())
2035
+ #self.setSwRecordLayoutV(child_element, "SW-RECORD-LAYOUT-V", group.swRecordLayoutGroupContentType.swRecordLayoutV)
2036
+ #self.setSwRecordLayoutGroup(child_element, "SW-RECORD-LAYOUT-GROUP", group.swRecordLayoutGroupContentType.swRecordLayoutGroup)
1861
2037
  return group
1862
2038
 
1863
2039
  def writeSwRecordLayout(self, element: ET.Element, layout: SwRecordLayout):
1864
2040
  self.logger.debug("writeSwRecordLayout %s" % layout.short_name)
1865
2041
  child_element = ET.SubElement(element, "SW-RECORD-LAYOUT")
1866
2042
  self.setIdentifiable(child_element, layout)
1867
- self.setSwRecordLayoutGroup(child_element, "SW-RECORD-LAYOUT-GROUP", layout.swRecordLayoutGroup)
2043
+ self.setSwRecordLayoutGroup(child_element, "SW-RECORD-LAYOUT-GROUP", layout.getSwRecordLayoutGroup())
1868
2044
 
1869
2045
  def writeSwAddrMethod(self, element: ET.Element, method: SwAddrMethod):
1870
2046
  self.logger.debug("writeSwAddrMethod %s" % method.short_name)
1871
- child_element = ET.SubElement(element, "SW-RECORD-LAYOUT")
2047
+ child_element = ET.SubElement(element, "SW-ADDR-METHOD")
2048
+ self.setIdentifiable(child_element, method)
2049
+ self.setChildElementOptionalLiteral(child_element, "MEMORY-ALLOCATION-KEYWORD-POLICY", method.getMemoryAllocationKeywordPolicy())
2050
+ options = method.getOptions()
2051
+ if len(options) > 0:
2052
+ options_tag = ET.SubElement(child_element, "OPTIONS")
2053
+ for option in options:
2054
+ self.setChildElementOptionalLiteral(options_tag, "OPTION", option)
2055
+ self.setChildElementOptionalLiteral(child_element, "SECTION-INITIALIZATION-POLICY", method.getSectionInitializationPolicy())
2056
+ self.setChildElementOptionalLiteral(child_element, "SECTION-TYPE", method.getSectionType())
1872
2057
 
1873
2058
  def writeTriggerInterface(self, element: ET.Element, trigger_if: TriggerInterface):
1874
2059
  self.logger.debug("writeTriggerInterface %s" % trigger_if.short_name)
1875
- child_element = ET.SubElement(element, "SW-RECORD-LAYOUT")
2060
+ child_element = ET.SubElement(element, "TRIGGER-INTERFACE")
1876
2061
 
1877
2062
  def writeServiceSwComponentType(self, element: ET.Element, sw_component: ServiceSwComponentType):
1878
2063
  self.logger.debug("writeServiceSwComponentType %s" % sw_component.short_name)
@@ -1886,8 +2071,8 @@ class ARXMLWriter(AbstractARXMLWriter):
1886
2071
  for map in maps:
1887
2072
  child_element = ET.SubElement(maps_tag, "DATA-TYPE-MAP")
1888
2073
  self.setARObjectAttributes(child_element, map)
1889
- self.setChildElementOptionalRefType(child_element, "APPLICATION-DATA-TYPE-REF", map.application_data_type_ref)
1890
- self.setChildElementOptionalRefType(child_element, "IMPLEMENTATION-DATA-TYPE-REF", map.implementation_data_type_ref)
2074
+ self.setChildElementOptionalRefType(child_element, "APPLICATION-DATA-TYPE-REF", map.getApplicationDataTypeRef())
2075
+ self.setChildElementOptionalRefType(child_element, "IMPLEMENTATION-DATA-TYPE-REF", map.getImplementationDataTypeRef())
1891
2076
 
1892
2077
  def writeModeRequestTypeMaps(self, element: ET.Element, parent: DataTypeMappingSet):
1893
2078
  maps = parent.getModeRequestTypeMaps()
@@ -1896,8 +2081,8 @@ class ARXMLWriter(AbstractARXMLWriter):
1896
2081
  for map in maps:
1897
2082
  child_element = ET.SubElement(maps_tag, "MODE-REQUEST-TYPE-MAP")
1898
2083
  self.setARObjectAttributes(child_element, map)
1899
- self.setChildElementOptionalRefType(child_element, "IMPLEMENTATION-DATA-TYPE-REF", map.implementation_data_type_ref)
1900
- self.setChildElementOptionalRefType(child_element, "MODE-GROUP-REF", map.mode_group_ref)
2084
+ self.setChildElementOptionalRefType(child_element, "IMPLEMENTATION-DATA-TYPE-REF", map.getImplementationDataTypeRef())
2085
+ self.setChildElementOptionalRefType(child_element, "MODE-GROUP-REF", map.getModeGroupRef())
1901
2086
 
1902
2087
  def writeDataTypeMappingSet(self, element: ET.Element, mapping_set: DataTypeMappingSet):
1903
2088
  self.logger.debug("writeDataTypeMappingSet %s" % mapping_set.short_name)
@@ -1922,7 +2107,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1922
2107
  self.logger.debug("writeModeDeclarationGroup %s" % group.short_name)
1923
2108
  child_element = ET.SubElement(element, "MODE-DECLARATION-GROUP")
1924
2109
  self.setIdentifiable(child_element, group)
1925
- self.setChildElementOptionalRefType(child_element, "INITIAL-MODE-REF", group._initial_mode_ref)
2110
+ self.setChildElementOptionalRefType(child_element, "INITIAL-MODE-REF", group.initialModeRef)
1926
2111
  self.writeModeDeclarationGroupModeDeclaration(child_element, group)
1927
2112
  self.setChildElementOptionalNumericalValue(child_element, "ON-TRANSITION-VALUE", group.getOnTransitionValue())
1928
2113
 
@@ -2226,7 +2411,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2226
2411
  elif isinstance(triggering, LinFrameTriggering):
2227
2412
  self.writeLinFrameTriggering(triggerings_tag, triggering)
2228
2413
  else:
2229
- raise NotImplementedError("Unsupported Frame Triggering <%s>" % type(triggering))
2414
+ self.notImplemented("Unsupported Frame Triggering <%s>" % type(triggering))
2230
2415
 
2231
2416
  triggerings = channel.getISignalTriggerings()
2232
2417
  if len(triggerings) > 0:
@@ -2235,7 +2420,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2235
2420
  if isinstance(triggering, ISignalTriggering):
2236
2421
  self.writeISignalTriggering(triggerings_tag, triggering)
2237
2422
  else:
2238
- raise NotImplementedError("Unsupported ISignalTriggering <%s>" % type(triggering))
2423
+ self.notImplemented("Unsupported ISignalTriggering <%s>" % type(triggering))
2239
2424
 
2240
2425
  triggerings = channel.getPduTriggerings()
2241
2426
  if len(triggerings) > 0:
@@ -2244,7 +2429,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2244
2429
  if isinstance(triggering, PduTriggering):
2245
2430
  self.writePduTriggering(triggerings_tag, triggering)
2246
2431
  else:
2247
- raise NotImplementedError("Unsupported PduTriggering <%s>" % type(triggering))
2432
+ self.notImplemented("Unsupported PduTriggering <%s>" % type(triggering))
2248
2433
 
2249
2434
  def writeCanPhysicalChannel(self, element: ET.Element, channel: CanPhysicalChannel):
2250
2435
  self.logger.debug("CanPhysicalChannel %s" % channel.short_name)
@@ -2268,7 +2453,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2268
2453
  elif isinstance(channel, LinPhysicalChannel):
2269
2454
  self.writeLinPhysicalChannel(child_element, channel)
2270
2455
  else:
2271
- raise NotImplementedError("Unsupported Physical Channel <%s>" % type(channel))
2456
+ self.notImplemented("Unsupported Physical Channel <%s>" % type(channel))
2272
2457
 
2273
2458
  def writeCommunicationCluster(self, element: ET.Element, cluster: CommunicationCluster):
2274
2459
  self.setChildElementOptionalNumericalValue(element, "BAUDRATE", cluster.getBaudrate())
@@ -2413,7 +2598,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2413
2598
  elif isinstance(data_mapping, SenderReceiverToSignalGroupMapping):
2414
2599
  self.setSenderReceiverToSignalGroupMapping(child_element, data_mapping)
2415
2600
  else:
2416
- raise NotImplementedError("Unsupported Data Mapping %s" % type(data_mapping))
2601
+ self.notImplemented("Unsupported Data Mapping %s" % type(data_mapping))
2417
2602
 
2418
2603
  def setSwcToEcuMapping(self, element: ET.Element, mapping: SwcToEcuMapping):
2419
2604
  child_element = ET.SubElement(element, "SWC-TO-ECU-MAPPING")
@@ -2433,7 +2618,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2433
2618
  if isinstance(sw_mapping, SwcToEcuMapping):
2434
2619
  self.setSwcToEcuMapping(child_element, sw_mapping)
2435
2620
  else:
2436
- raise NotImplementedError("Unsupported Sw Mapping %s" % type(sw_mapping))
2621
+ self.notImplemented("Unsupported Sw Mapping %s" % type(sw_mapping))
2437
2622
 
2438
2623
  def writeSystemMapping(self, element: ET.Element, mapping: SystemMapping):
2439
2624
  self.logger.debug("Write SystemMapping %s" % mapping.short_name)
@@ -2450,7 +2635,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2450
2635
  if isinstance(mapping, SystemMapping):
2451
2636
  self.writeSystemMapping(mappings_tag, mapping)
2452
2637
  else:
2453
- raise NotImplementedError("Unsupported Mapping %s" % type(mapping))
2638
+ self.notImplemented("Unsupported Mapping %s" % type(mapping))
2454
2639
 
2455
2640
  def writeRootSwCompositionPrototype(self, element: ET.Element, system: System):
2456
2641
  prototype = system.getRootSoftwareComposition()
@@ -2484,6 +2669,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2484
2669
  self.setARElement(child_element, dimension)
2485
2670
  self.setChildElementOptionalNumericalValue(child_element, "CURRENT-EXP", dimension.getCurrentExp())
2486
2671
  self.setChildElementOptionalNumericalValue(child_element, "LENGTH-EXP", dimension.getLengthExp())
2672
+ self.setChildElementOptionalNumericalValue(child_element, "TIME-EXP", dimension.getTimeExp())
2487
2673
 
2488
2674
  def setISignalMappings(self, element: ET.Element, mappings: List[ISignalMapping]):
2489
2675
  if len(mappings) > 0:
@@ -2533,7 +2719,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2533
2719
  if isinstance(sub_container, EcucContainerValue):
2534
2720
  self.writeEcucContainValue(sub_containers_tag, sub_container)
2535
2721
  else:
2536
- raise NotImplementedError("Unsupported Sub Container %s" % type(container))
2722
+ self.notImplemented("Unsupported Sub Container %s" % type(container))
2537
2723
 
2538
2724
  def writeEcucParameterValue(self, element: ET.Element, param_value: EcucParameterValue):
2539
2725
  self.setChildElementOptionalRefType(element, "DEFINITION-REF", param_value.getDefinitionRef())
@@ -2559,7 +2745,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2559
2745
  elif isinstance(param_value, EcucNumericalParamValue):
2560
2746
  self.setEcucNumericalParamValue(child_element, param_value)
2561
2747
  else:
2562
- raise NotImplementedError("Unsupported EcucParameterValue <%s>" % type(param_value))
2748
+ self.notImplemented("Unsupported EcucParameterValue <%s>" % type(param_value))
2563
2749
 
2564
2750
  def writeEcucAbstractReferenceValue(self, element: ET.Element, value: EcucAbstractReferenceValue):
2565
2751
  self.setChildElementOptionalRefType(element, "DEFINITION-REF", value.getDefinitionRef())
@@ -2595,7 +2781,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2595
2781
  elif isinstance(reference_value, EcucInstanceReferenceValue):
2596
2782
  self.setEcucInstanceReferenceValue(child_element, reference_value)
2597
2783
  else:
2598
- raise NotImplementedError("Unsupported EcucParameterValue <%s>" % type(reference_value))
2784
+ self.notImplemented("Unsupported EcucParameterValue <%s>" % type(reference_value))
2599
2785
 
2600
2786
  def writeEcucContainValue(self, element: ET.Element, container_value: EcucContainerValue):
2601
2787
  self.logger.debug("EcucContainerValue %s" % container_value.short_name)
@@ -2614,7 +2800,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2614
2800
  if isinstance(container, EcucContainerValue):
2615
2801
  self.writeEcucContainValue(containers_tag, container)
2616
2802
  else:
2617
- raise NotImplementedError("Unsupported Container %s" % type(container))
2803
+ self.notImplemented("Unsupported Container %s" % type(container))
2618
2804
 
2619
2805
  def writeEcucModuleConfigurationValues(self, element: ET.Element, values: EcucModuleConfigurationValues):
2620
2806
  self.logger.debug("EcucModuleConfigurationValues %s" % values.short_name)
@@ -2660,10 +2846,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2660
2846
  self.setIdentifiable(child_element, signal)
2661
2847
  self.setChildElementOptionalBooleanValue(child_element, "DYNAMIC-LENGTH", signal.getDynamicLength())
2662
2848
 
2663
- def writeParameterInterface(self, element: ET.Element, signal: SystemSignal):
2664
- self.logger.debug("Write ParameterInterface %s" % signal.short_name)
2665
- child_element = ET.SubElement(element, "PARAMETER-INTERFACE")
2666
- self.setIdentifiable(child_element, signal)
2849
+
2667
2850
 
2668
2851
  def writeGenericEthernetFrame(self, element: ET.Element, signal: GenericEthernetFrame):
2669
2852
  self.logger.debug("Write GenericEthernetFrame %s" % signal.short_name)
@@ -2837,8 +3020,10 @@ class ARXMLWriter(AbstractARXMLWriter):
2837
3020
  self.writeGenericEthernetFrame(element, ar_element)
2838
3021
  elif isinstance(ar_element, LifeCycleInfoSet):
2839
3022
  self.writeLifeCycleInfoSet(element, ar_element)
3023
+ elif isinstance(ar_element, PhysicalDimension):
3024
+ self.writePhysicalDimension(element, ar_element)
2840
3025
  else:
2841
- raise NotImplementedError("Unsupported Elements of ARPackage <%s>" % type(ar_element))
3026
+ self.notImplemented("Unsupported Elements of ARPackage <%s>" % type(ar_element))
2842
3027
 
2843
3028
  def writeReferenceBases(self, element: ET.Element, bases: List[ReferenceBase]):
2844
3029
  self.logger.debug("Write ReferenceBases")