armodel 1.7.0__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 (47) hide show
  1. armodel/cli/arxml_dump_cli.py +2 -2
  2. armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +53 -16
  3. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +41 -19
  4. armodel/models/M2/AUTOSARTemplates/CommonStructure/Filter.py +14 -14
  5. armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +22 -11
  6. armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +26 -9
  7. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +8 -0
  8. armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +711 -27
  9. armodel/models/M2/AUTOSARTemplates/ECUCDescriptionTemplate.py +1 -1
  10. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +91 -14
  11. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +17 -4
  12. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +78 -11
  13. armodel/models/M2/AUTOSARTemplates/GenericStructure/LifeCycles.py +5 -0
  14. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +41 -3
  15. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +53 -15
  16. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +23 -8
  17. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +44 -1
  18. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +46 -5
  19. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +56 -35
  20. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Multiplatform.py +1 -1
  21. armodel/models/M2/MSR/AsamHdo/AdminData.py +34 -8
  22. armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +170 -23
  23. armodel/models/M2/MSR/DataDictionary/AuxillaryObjects.py +4 -4
  24. armodel/models/M2/MSR/DataDictionary/RecordLayout.py +130 -37
  25. armodel/models/M2/MSR/Documentation/Annotation.py +1 -1
  26. armodel/models/M2/MSR/Documentation/TextModel/BlockElements/ListElements.py +54 -0
  27. armodel/models/M2/MSR/Documentation/TextModel/BlockElements/PaginationAndView.py +9 -0
  28. armodel/models/M2/MSR/Documentation/TextModel/BlockElements/__init__.py +25 -0
  29. armodel/models/M2/MSR/Documentation/TextModel/LanguageDataModel.py +33 -5
  30. armodel/models/M2/MSR/Documentation/TextModel/MultilanguageData.py +15 -2
  31. armodel/models/M2/MSR/Documentation/__init__.py +1 -1
  32. armodel/models/__init__.py +4 -1
  33. armodel/parser/abstract_arxml_parser.py +31 -15
  34. armodel/parser/arxml_parser.py +456 -237
  35. armodel/tests/test_armodel/models/test_ar_ref.py +7 -4
  36. armodel/tests/test_armodel/models/test_datatype.py +4 -4
  37. armodel/tests/test_armodel/models/test_m2_msr.py +5 -5
  38. armodel/tests/test_armodel/parser/test_sw_components.py +10 -1
  39. armodel/tests/test_armodel/parser/test_system.py +0 -1
  40. armodel/writer/abstract_arxml_writer.py +17 -8
  41. armodel/writer/arxml_writer.py +436 -195
  42. {armodel-1.7.0.dist-info → armodel-1.7.2.dist-info}/METADATA +29 -1
  43. {armodel-1.7.0.dist-info → armodel-1.7.2.dist-info}/RECORD +47 -43
  44. {armodel-1.7.0.dist-info → armodel-1.7.2.dist-info}/LICENSE +0 -0
  45. {armodel-1.7.0.dist-info → armodel-1.7.2.dist-info}/WHEEL +0 -0
  46. {armodel-1.7.0.dist-info → armodel-1.7.2.dist-info}/entry_points.txt +0 -0
  47. {armodel-1.7.0.dist-info → armodel-1.7.2.dist-info}/top_level.txt +0 -0
@@ -2,10 +2,7 @@ import xml.etree.cElementTree as ET
2
2
 
3
3
  from typing import List
4
4
 
5
-
6
-
7
-
8
-
5
+ from ..models.M2.AUTOSARTemplates.GenericStructure.LifeCycles import LifeCycleInfoSet
9
6
  from ..models.M2.MSR.AsamHdo.AdminData import AdminData
10
7
  from ..models.M2.MSR.AsamHdo.BaseTypes import BaseTypeDirectDefinition, SwBaseType
11
8
  from ..models.M2.MSR.AsamHdo.ComputationMethod import CompuConstTextContent, CompuMethod, CompuNominatorDenominator, CompuScale, CompuScaleConstantContents, CompuScaleRationalFormula, CompuScales
@@ -19,8 +16,10 @@ from ..models.M2.MSR.DataDictionary.CalibrationParameter import SwCalprmAxis, Sw
19
16
  from ..models.M2.MSR.DataDictionary.DataDefProperties import SwDataDefProps, ValueList
20
17
  from ..models.M2.MSR.DataDictionary.RecordLayout import SwRecordLayout, SwRecordLayoutGroup, SwRecordLayoutV
21
18
  from ..models.M2.MSR.Documentation.Annotation import Annotation
22
- from ..models.M2.MSR.Documentation.BlockElements import DocumentationBlock
23
- from ..models.M2.MSR.Documentation.TextModel.MultilanguageData import MultiLanguageOverviewParagraph, MultiLanguageParagraph, MultilanguageLongName
19
+ from ..models.M2.MSR.Documentation.TextModel.BlockElements import DocumentationBlock
20
+ from ..models.M2.MSR.Documentation.TextModel.BlockElements.ListElements import ListElement
21
+ from ..models.M2.MSR.Documentation.TextModel.LanguageDataModel import LLongName, LPlainText, LanguageSpecific
22
+ from ..models.M2.MSR.Documentation.TextModel.MultilanguageData import MultiLanguageOverviewParagraph, MultiLanguageParagraph, MultiLanguagePlainText, MultilanguageLongName
24
23
 
25
24
  from ..models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
26
25
  from ..models.M2.AUTOSARTemplates.BswModuleTemplate.BswOverview import BswModuleDescription
@@ -33,7 +32,7 @@ from ..models.M2.AUTOSARTemplates.CommonStructure.SwcBswMapping import SwcBswMap
33
32
  from ..models.M2.AUTOSARTemplates.CommonStructure.Implementation import Code, Implementation
34
33
  from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import SwcTiming, TimingExtension
35
34
  from ..models.M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.ExecutionOrderConstraint import EOCExecutableEntityRef, ExecutionOrderConstraint
36
- 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
37
36
  from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import ExecutableEntity
38
37
  from ..models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
39
38
  from ..models.M2.AUTOSARTemplates.CommonStructure.InternalBehavior import InternalBehavior
@@ -44,19 +43,19 @@ from ..models.M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucAbstractRef
44
43
  from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.EngineeringObject import AutosarEngineeringObject, EngineeringObject
45
44
  from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Identifiable, MultilanguageReferrable, Referrable
46
45
  from ..models.M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AnyInstanceRef
47
- from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage
46
+ from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage, ReferenceBase
48
47
  from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType, ARLiteral, Limit
49
48
 
50
49
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.PortAPIOptions import PortAPIOption
51
- 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
52
51
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.IncludedDataTypes import IncludedDataTypeSet
53
52
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationArrayDataType, ApplicationCompositeDataType, ApplicationDataType, ApplicationPrimitiveDataType, ApplicationRecordDataType, AutosarDataType
54
53
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndDescription, EndToEndProtection, EndToEndProtectionVariablePrototype
55
54
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ModeDeclarationGroup import IncludedModeDeclarationGroupSet
56
55
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Communication import CompositeNetworkRepresentation, TransmissionAcknowledgementRequest
57
- 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
58
57
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Components.InstanceRefs import InnerPortGroupInCompositionInstanceRef, PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef, RModeInAtomicSwcInstanceRef, RVariableInAtomicSwcInstanceRef
59
- from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import RunnableEntity, RunnableEntityArgument, SwcInternalBehavior, SynchronousServerCallPoint
58
+ from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior import AsynchronousServerCallPoint, RunnableEntity, RunnableEntityArgument, SwcInternalBehavior, SynchronousServerCallPoint
60
59
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.ServerCall import ServerCallPoint
61
60
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.DataElements import ParameterAccess, VariableAccess
62
61
  from ..models.M2.AUTOSARTemplates.SWComponentTemplate.Composition import AssemblySwConnector, DelegationSwConnector, SwComponentPrototype, SwConnector
@@ -108,13 +107,15 @@ class ARXMLWriter(AbstractARXMLWriter):
108
107
  def writeSds(self, parent: ET.Element, sdg: Sdg):
109
108
  for sd in sdg.getSds():
110
109
  sd_tag = ET.SubElement(parent, "SD")
111
- sd_tag.attrib['GID'] = sd.gid
110
+ if sd.gid is not None:
111
+ sd_tag.attrib['GID'] = sd.gid
112
112
  sd_tag.text = sd.value
113
113
 
114
114
  def setSdg(self, parent: ET.Element, sdg: Sdg):
115
115
  if sdg is not None:
116
116
  sdg_tag = ET.SubElement(parent, "SDG")
117
- sdg_tag.attrib['GID'] = sdg.gid
117
+ if sdg.gid is not None and sdg.gid != "":
118
+ sdg_tag.attrib['GID'] = sdg.gid
118
119
  self.writeSds(sdg_tag, sdg)
119
120
  for sdg_item in sdg.getSdgContentsTypes():
120
121
  self.setSdg(sdg_tag, sdg_item)
@@ -136,46 +137,64 @@ class ARXMLWriter(AbstractARXMLWriter):
136
137
 
137
138
  def setReferable(self, element: ET.Element, referrable: Referrable):
138
139
  self.setARObjectAttributes(element, referrable)
139
- self.setShortName(element, referrable.short_name)
140
+ self.setShortName(element, referrable.getShortName())
141
+
142
+ def setLanguageSpecific(self, element: ET.Element, key: str, specific: LanguageSpecific):
143
+ child_element = ET.SubElement(element, key)
144
+ self.setARObjectAttributes(child_element, specific)
145
+ if specific.l is not None:
146
+ child_element.attrib['L'] = specific.l
147
+ child_element.text = specific.value
148
+
149
+ def setLLongName(self, element: ET.Element, name: LLongName):
150
+ self.setLanguageSpecific(element, "L-4", name)
140
151
 
141
152
  def setMultiLongName(self, element: ET.Element, key: str, long_name: MultilanguageLongName):
142
153
  if long_name is not None:
143
- long_name_tag = ET.SubElement(element, key)
144
- self.setARObjectAttributes(long_name_tag, long_name)
154
+ child_element = ET.SubElement(element, key)
155
+ self.setARObjectAttributes(child_element, long_name)
145
156
  for l4 in long_name.getL4s():
146
- l4_tag = ET.SubElement(long_name_tag, "L-4")
147
- self.setARObjectAttributes(l4_tag, l4)
148
- if l4.l is not None:
149
- l4_tag.attrib['L'] = l4.l
150
- l4_tag.text = l4.value
157
+ self.setLLongName(child_element, l4)
158
+
159
+ def setLOverviewParagraph(self, element: ET.Element, name: LLongName):
160
+ self.setLanguageSpecific(element, "L-2", name)
151
161
 
152
162
  def setMultiLanguageOverviewParagraph(self, element: ET.Element, key: str, paragraph: MultiLanguageOverviewParagraph):
153
163
  if paragraph is not None:
154
- long_name_tag = ET.SubElement(element, key)
155
- self.setARObjectAttributes(long_name_tag, paragraph)
164
+ child_element = ET.SubElement(element, key)
165
+ self.setARObjectAttributes(child_element, paragraph)
156
166
  for l2 in paragraph.getL2s():
157
- l2_tag = ET.SubElement(long_name_tag, "L-2")
158
- self.setARObjectAttributes(l2_tag, l2)
159
- if l2.l is not None:
160
- l2_tag.attrib['L'] = l2.l
161
- l2_tag.text = l2.value
167
+ self.setLOverviewParagraph(child_element, l2)
162
168
 
163
169
  def setMultilanguageReferrable(self, element: ET.Element, referrable: MultilanguageReferrable):
164
170
  self.setReferable(element, referrable)
165
171
  if referrable.longName is not None:
166
172
  self.setMultiLongName(element, "LONG-NAME", referrable.longName)
167
173
 
174
+ def setLPlainText(self, element: ET.Element, text: LPlainText):
175
+ self.setLanguageSpecific(element, "L-10", text)
176
+
177
+ def setMultiLanguagePlainText(self, element: ET.Element, key: str, paragraph: MultiLanguagePlainText):
178
+ if paragraph is not None:
179
+ child_element = ET.SubElement(element, key)
180
+ self.setARObjectAttributes(child_element, paragraph)
181
+ for l10 in paragraph.getL10s():
182
+ self.setLPlainText(child_element, l10)
183
+
168
184
  def setAdminData(self, element: ET.Element, admin_data: AdminData):
169
- element = ET.SubElement(element, "ADMIN-DATA")
170
- self.writeSdgs(element, admin_data)
185
+ if admin_data is not None:
186
+ child_element = ET.SubElement(element, "ADMIN-DATA")
187
+ self.setChildElementOptionalLiteral(child_element, "LANGUAGE", admin_data.getLanguage())
188
+ self.setMultiLanguagePlainText(child_element, "USED-LANGUAGES", admin_data.getUsedLanguages())
189
+ self.writeSdgs(child_element, admin_data)
171
190
 
172
191
  def setIdentifiable(self, element: ET.Element, identifiable: Identifiable):
173
192
  self.setMultilanguageReferrable(element, identifiable)
174
193
  self.setAnnotations(element, identifiable.getAnnotations())
175
194
  self.setMultiLanguageOverviewParagraph(element, "DESC", identifiable.getDesc())
176
195
  self.setChildElementOptionalLiteral(element, "CATEGORY", identifiable.getCategory())
177
- if identifiable.getAdminData() is not None:
178
- self.setAdminData(element, identifiable.getAdminData())
196
+ self.setDocumentationBlock(element, "INTRODUCTION", identifiable.getIntroduction())
197
+ self.setAdminData(element, identifiable.getAdminData())
179
198
 
180
199
  def setARElement(self, parent: ET.Element, ar_element: ARElement):
181
200
  self.setIdentifiable(parent, ar_element)
@@ -232,7 +251,7 @@ class ARXMLWriter(AbstractARXMLWriter):
232
251
  elif isinstance(com_spec, ModeSwitchSenderComSpec):
233
252
  self.setModeSwitchSenderComSpec(com_specs_tag, com_spec)
234
253
  else:
235
- raise NotImplementedError("Unsupported PPortComSpec %s" % type(com_spec))
254
+ self.notImplemented("Unsupported PPortComSpec %s" % type(com_spec))
236
255
 
237
256
  def setApplicationCompositeElementInPortInterfaceInstanceRef(self, element: ET.Element, key:str, iref: ApplicationCompositeElementInPortInterfaceInstanceRef):
238
257
  if iref is not None:
@@ -245,8 +264,8 @@ class ARXMLWriter(AbstractARXMLWriter):
245
264
  if representation is not None:
246
265
  self.logger.debug("setCompositeNetworkRepresentation")
247
266
  child_element = ET.SubElement(element, "COMPOSITE-NETWORK-REPRESENTATION")
248
- self.setApplicationCompositeElementInPortInterfaceInstanceRef(child_element, "LEAF-ELEMENT-IREF", representation.leaf_element_iref)
249
- 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())
250
269
 
251
270
  def writeReceiverComSpec(self, element: ET.Element, com_spec: ReceiverComSpec):
252
271
  representations = com_spec.getCompositeNetworkRepresentations()
@@ -254,10 +273,11 @@ class ARXMLWriter(AbstractARXMLWriter):
254
273
  child_element = ET.SubElement(element, "COMPOSITE-NETWORK-REPRESENTATIONS")
255
274
  for representation in representations:
256
275
  self.setCompositeNetworkRepresentation(child_element, representation)
257
- self.setChildElementOptionalRefType(element, "DATA-ELEMENT-REF", com_spec.dataElementRef)
258
- self.setSwDataDefProps(element, "NETWORK-REPRESENTATION", com_spec.networkRepresentation)
259
- self.setChildElementOptionalLiteral(element, "HANDLE-OUT-OF-RANGE", com_spec.handleOutOfRange)
260
- 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())
261
281
 
262
282
  def setSwValues(self, element: ET.Element, key: str, sw_values: SwValues):
263
283
  if sw_values is not None:
@@ -274,37 +294,41 @@ class ARXMLWriter(AbstractARXMLWriter):
274
294
  self.setChildElementOptionalFloatValue(child_element, "V", value_list.v)
275
295
 
276
296
  def writeSwValueCont(self, element: ET.Element, cont: SwValueCont):
277
- child_element = ET.SubElement(element, "SW-VALUE-CONT")
278
- self.setARObjectAttributes(child_element, cont)
279
- self.setChildElementOptionalRefType(child_element, "UNIT-REF", cont.unit_ref)
280
- self.setValueList(child_element, "SW-ARRAYSIZE", cont.sw_arraysize)
281
- 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)
282
303
 
283
304
  def writeValueSpecification(self, element: ET.Element, value_spec: ValueSpecification):
284
- self.setARObjectAttributes(element, value_spec)
285
- if value_spec.short_label is not None:
286
- 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())
287
308
 
288
309
  def setApplicationValueSpecification(self, element: ET.Element, value_spec: ApplicationValueSpecification):
289
- value_spec_tag = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
290
- self.writeValueSpecification(value_spec_tag, value_spec)
291
- self.setChildElementOptionalLiteral(value_spec_tag, "CATEGORY", value_spec.category)
292
- 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())
293
315
 
294
316
  def setTextValueSpecification(self, element: ET.Element, value_spec: TextValueSpecification):
295
- value_spec_tag = ET.SubElement(element, "TEXT-VALUE-SPECIFICATION")
296
- self.writeValueSpecification(value_spec_tag, value_spec)
297
- 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())
298
321
 
299
322
  def setNumericalValueSpecification(self, element: ET.Element, value_spec: NumericalValueSpecification):
300
- value_spec_tag = ET.SubElement(element, "NUMERICAL-VALUE-SPECIFICATION")
301
- self.writeValueSpecification(value_spec_tag, value_spec)
302
- 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())
303
327
 
304
328
  def setArrayValueSpecification(self, element: ET.Element, value_spec: ArrayValueSpecification):
305
329
  value_spec_tag = ET.SubElement(element, "ARRAY-VALUE-SPECIFICATION")
306
330
  self.writeValueSpecification(value_spec_tag, value_spec)
307
- sub_elements = value_spec.get_elements()
331
+ sub_elements = value_spec.getElements()
308
332
  if len(sub_elements) > 0:
309
333
  elements_tag = ET.SubElement(value_spec_tag, "ELEMENTS")
310
334
  for sub_element in sub_elements:
@@ -312,8 +336,14 @@ class ARXMLWriter(AbstractARXMLWriter):
312
336
  self.setNumericalValueSpecification(elements_tag, sub_element)
313
337
  elif isinstance(sub_element, ApplicationValueSpecification):
314
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)
315
345
  else:
316
- 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))
317
347
 
318
348
  def setConstantReference(self, element: ET.Element, value_spec: ConstantReference):
319
349
  value_spec_tag = ET.SubElement(element, "CONSTANT-REFERENCE")
@@ -335,7 +365,7 @@ class ARXMLWriter(AbstractARXMLWriter):
335
365
  elif isinstance(value_spec, RecordValueSpecification):
336
366
  self.setRecordValueSpecification(element, value_spec)
337
367
  else:
338
- raise NotImplementedError("Unsupported ValueSpecification %s" % type(value_spec))
368
+ self.notImplemented("Unsupported ValueSpecification %s" % type(value_spec))
339
369
 
340
370
  def setInitValue(self, element: ET.Element, init_value: ValueSpecification):
341
371
  if init_value is not None:
@@ -390,31 +420,43 @@ class ARXMLWriter(AbstractARXMLWriter):
390
420
  self.writeParameterRequireComSpec(element, com_spec)
391
421
  else:
392
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)
393
430
 
394
431
  def writePPortPrototype(self, ports_tag: ET.Element, prototype: PPortPrototype):
395
432
  prototype_tag = ET.SubElement(ports_tag, "P-PORT-PROTOTYPE")
396
433
 
397
434
  self.setIdentifiable(prototype_tag, prototype)
398
- 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())
399
438
 
400
- com_specs = prototype.getProvidedComSpecs()
401
- if len(com_specs):
402
- 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")
403
443
  for com_spec in com_specs:
404
- self.writePPortComSpec(com_specs_tag, com_spec)
405
-
406
- self.setChildElementOptionalRefType(prototype_tag, "PROVIDED-INTERFACE-TREF", prototype.getProvidedInterfaceTRef())
444
+ self.writeRPortComSpec(com_specs_tag, com_spec)
407
445
 
408
446
  def writeRPortPrototype(self, ports_tag: ET.Element, prototype: RPortPrototype):
409
- self.logger.debug("writeRPortPrototype %s" % prototype.short_name)
447
+ self.logger.debug("write RPortPrototype %s" % prototype.short_name)
410
448
  prototype_tag = ET.SubElement(ports_tag, "R-PORT-PROTOTYPE")
411
449
  self.setIdentifiable(prototype_tag, prototype)
412
- com_specs = prototype.getRequiredComSpecs()
413
- if len(com_specs) > 0:
414
- com_specs_tag = ET.SubElement(prototype_tag, "REQUIRED-COM-SPECS")
415
- for com_spec in com_specs:
416
- self.writeRPortComSpec(com_specs_tag, com_spec)
450
+ self.setAbstractRequiredPortPrototype(prototype_tag, prototype)
417
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())
418
460
 
419
461
  def writePortPrototypes(self, ports_tag: ET.Element, port_prototypes: List[PortPrototype]):
420
462
  for port_prototype in port_prototypes:
@@ -422,6 +464,8 @@ class ARXMLWriter(AbstractARXMLWriter):
422
464
  self.writePPortPrototype(ports_tag, port_prototype)
423
465
  elif isinstance(port_prototype, RPortPrototype):
424
466
  self.writeRPortPrototype(ports_tag, port_prototype)
467
+ elif isinstance(port_prototype, PRPortPrototype):
468
+ self.writePRPortPrototype(ports_tag, port_prototype)
425
469
  else:
426
470
  self._raiseError("Invalid PortPrototype")
427
471
 
@@ -525,7 +569,7 @@ class ARXMLWriter(AbstractARXMLWriter):
525
569
  elif isinstance(sw_connector, DelegationSwConnector):
526
570
  self.writeDelegationSwConnector(element, sw_connector)
527
571
  else:
528
- raise NotImplementedError("Unsupported Sw Connector %s")
572
+ self.notImplemented("Unsupported Sw Connector %s")
529
573
 
530
574
  def writeSwConnectors(self, element: ET.Element, sw_component: CompositionSwComponentType):
531
575
  sw_connectors = sw_component.getSwConnectors()
@@ -573,12 +617,23 @@ class ARXMLWriter(AbstractARXMLWriter):
573
617
  self.setARObjectAttributes(child_element, paragraph)
574
618
  self.writeLParagraphs(child_element, paragraph)
575
619
  return paragraphs
620
+
621
+ def setListElement(self, element: ET.Element, key: str, list: ListElement):
622
+ if list is not None:
623
+ child_element = ET.SubElement(element, key)
624
+ type = list.getType()
625
+ if type is not None:
626
+ child_element.attrib['TYPE'] = type
627
+ for item in list.getItems():
628
+ self.setDocumentationBlock(child_element, "ITEM", item)
576
629
 
577
630
  def setDocumentationBlock(self, element: ET.Element, key: str, block: DocumentationBlock):
578
631
  if block is not None:
579
632
  child_element = ET.SubElement(element, key)
580
633
  self.setARObjectAttributes(child_element, block)
581
634
  self.setMultiLanguageParagraphs(child_element, "P", block.getPs())
635
+ for list in block.getLists():
636
+ self.setListElement(child_element, "LIST", list)
582
637
 
583
638
  def writeGeneralAnnotation(self, element: ET.Element, annotation: Annotation):
584
639
  self.setMultiLongName(element, "LABEL", annotation.getLabel())
@@ -644,30 +699,32 @@ class ARXMLWriter(AbstractARXMLWriter):
644
699
  self.setChildElementOptionalLiteral(sw_data_def_props_conditional_tag, "SW-CALIBRATION-ACCESS", sw_data_def_props.getSwCalibrationAccess())
645
700
  self.setSwCalprmAxisSet(sw_data_def_props_conditional_tag, "SW-CALPRM-AXIS-SET", sw_data_def_props.getSwCalprmAxisSet())
646
701
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "COMPU-METHOD-REF", sw_data_def_props.getCompuMethodRef())
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())
647
704
  self.setChildElementOptionalLiteral(sw_data_def_props_conditional_tag, "SW-IMPL-POLICY", sw_data_def_props.getSwImplPolicy())
705
+ self.setChildElementOptionalNumericalValue(sw_data_def_props_conditional_tag, "SW-INTENDED-RESOLUTION", sw_data_def_props.getSwIntendedResolution())
648
706
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "IMPLEMENTATION-DATA-TYPE-REF", sw_data_def_props.getImplementationDataTypeRef())
649
- self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "DATA-CONSTR-REF", sw_data_def_props.getDataConstrRef())
650
707
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "SW-RECORD-LAYOUT-REF", sw_data_def_props.getSwRecordLayoutRef())
651
708
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "VALUE-AXIS-DATA-TYPE-REF", sw_data_def_props.getValueAxisDataTypeRef())
652
709
  self.setChildElementOptionalRefType(sw_data_def_props_conditional_tag, "UNIT-REF", sw_data_def_props.getUnitRef())
653
710
 
654
- def writeApplicationDataType(self, element: ET.Element, data_type: ApplicationDataType):
655
- self.writeAutosarDataType(element, data_type)
711
+ def setApplicationDataType(self, element: ET.Element, data_type: ApplicationDataType):
712
+ self.setAutosarDataType(element, data_type)
656
713
 
657
- def writeApplicationCompositeDataType(self, element: ET.Element, data_type: ApplicationCompositeDataType):
658
- self.writeApplicationDataType(element, data_type)
714
+ def setApplicationCompositeDataType(self, element: ET.Element, data_type: ApplicationCompositeDataType):
715
+ self.setApplicationDataType(element, data_type)
659
716
 
660
- def writeAutosarDataType(self, element: ET.Element, data_type: AutosarDataType):
717
+ def setAutosarDataType(self, element: ET.Element, data_type: AutosarDataType):
661
718
  self.setARElement(element, data_type)
662
- self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", data_type.swDataDefProps)
719
+ self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", data_type.getSwDataDefProps())
663
720
 
664
721
  def writeApplicationPrimitiveDataType(self, element: ET.Element, data_type: ApplicationPrimitiveDataType):
665
- self.logger.debug("writeApplicationPrimitiveDataType %s" % data_type.short_name)
722
+ self.logger.debug("writeApplicationPrimitiveDataType %s" % data_type.getShortName())
666
723
  data_type_tag = ET.SubElement(element, "APPLICATION-PRIMITIVE-DATA-TYPE")
667
- self.writeApplicationDataType(data_type_tag, data_type)
724
+ self.setApplicationDataType(data_type_tag, data_type)
668
725
 
669
726
  def setDataPrototype(self, element: ET.Element, prototype: DataPrototype):
670
- self.setIdentifiable(element, prototype)
727
+ self.setSwDataDefProps(element, "SW-DATA-DEF-PROPS", prototype.getSwDataDefProps())
671
728
 
672
729
  def setApplicationCompositeElementDataPrototype(self, element: ET.Element, prototype: ApplicationCompositeElementDataPrototype):
673
730
  self.setDataPrototype(element, prototype)
@@ -686,7 +743,7 @@ class ARXMLWriter(AbstractARXMLWriter):
686
743
 
687
744
  def writeApplicationRecordDataType(self, element: ET.Element, data_type: ApplicationRecordDataType):
688
745
  data_type_tag = ET.SubElement(element, "APPLICATION-RECORD-DATA-TYPE")
689
- self.writeApplicationDataType(data_type_tag, data_type)
746
+ self.setApplicationDataType(data_type_tag, data_type)
690
747
  self.writeApplicationRecordElements(data_type_tag, data_type)
691
748
 
692
749
  def writeApplicationDataTypes(self, parent: ET.Element, ar_package: ARPackage):
@@ -696,7 +753,7 @@ class ARXMLWriter(AbstractARXMLWriter):
696
753
  elif isinstance(data_type, ApplicationRecordDataType):
697
754
  self.writeApplicationRecordDataType(parent, data_type)
698
755
  else:
699
- raise NotImplementedError("Unsupported ApplicationDataType <%s>" % type(data_type))
756
+ self.notImplemented("Unsupported ApplicationDataType <%s>" % type(data_type))
700
757
 
701
758
  def writeBaseTypeDirectDefinition(self, element: ET.Element, base_type_definition: BaseTypeDirectDefinition):
702
759
  self.setChildElementOptionalNumericalValue(element, "BASE-TYPE-SIZE", base_type_definition.baseTypeSize)
@@ -711,8 +768,8 @@ class ARXMLWriter(AbstractARXMLWriter):
711
768
 
712
769
  def writeCompuScaleConstantContents(self, element: ET.Element, contents: CompuScaleConstantContents):
713
770
  compu_const_tag = ET.SubElement(element, "COMPU-CONST")
714
- if isinstance(contents.compu_const.compu_const_content_type, CompuConstTextContent):
715
- 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)
716
773
 
717
774
  def writeCompuNominatorDenominator(self, element: ET.Element, key: str, parent: CompuNominatorDenominator):
718
775
  child_element = ET.SubElement(element, key)
@@ -721,12 +778,12 @@ class ARXMLWriter(AbstractARXMLWriter):
721
778
  v_tag.text = v
722
779
 
723
780
  def writeCompuScaleRationalFormula(self, element: ET.Element, contents: CompuScaleRationalFormula):
724
- if contents.compu_rational_coeffs is not None:
781
+ if contents.compuRationalCoeffs is not None:
725
782
  coeffs_tag = ET.SubElement(element, "COMPU-RATIONAL-COEFFS")
726
- if contents.compu_rational_coeffs.compu_numerator:
727
- self.writeCompuNominatorDenominator(coeffs_tag, "COMPU-NUMERATOR", contents.compu_rational_coeffs.compu_numerator)
728
- if contents.compu_rational_coeffs.compu_denominator:
729
- 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)
730
787
 
731
788
  def writeCompuScaleContents(self, element: ET.Element, compu_scale: CompuScale):
732
789
  if isinstance(compu_scale.compuScaleContents, CompuScaleConstantContents):
@@ -734,44 +791,62 @@ class ARXMLWriter(AbstractARXMLWriter):
734
791
  elif isinstance(compu_scale.compuScaleContents, CompuScaleRationalFormula):
735
792
  self.writeCompuScaleRationalFormula(element, compu_scale.compuScaleContents)
736
793
  else:
737
- raise NotImplementedError("Unsupported CompuScaleContents %s" % type(compu_scale.compuScaleContents))
794
+ self.notImplemented("Unsupported CompuScaleContents %s" % type(compu_scale.compuScaleContents))
738
795
 
739
796
  def writeCompuScales(self, element: ET.Element, compu_scales: CompuScales):
740
797
  compu_scales_tag = ET.SubElement(element, "COMPU-SCALES")
741
798
  for compu_scale in compu_scales.getCompuScales():
742
799
  child_element = ET.SubElement(compu_scales_tag, "COMPU-SCALE")
743
800
  self.setARObjectAttributes(child_element, compu_scale)
744
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", compu_scale.short_label)
745
- self.setChildElementOptionalLiteral(child_element, "SYMBOL", compu_scale.symbol)
746
- self.writeChildLimitElement(child_element, "LOWER-LIMIT", compu_scale.lowerLimit)
747
- 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())
748
805
  self.writeCompuScaleContents(child_element, compu_scale)
749
806
 
750
807
  def writeCompuInternalToPhys(self, element: ET.Element, compu_method: CompuMethod):
751
- if compu_method.compu_internal_to_phys is not None:
752
- compu_internal_to_phys_tag = ET.SubElement(element, "COMPU-INTERNAL-TO-PHYS")
753
- self.setARObjectAttributes(compu_internal_to_phys_tag, compu_method.compu_internal_to_phys)
754
- if isinstance(compu_method.compu_internal_to_phys.compu_content, CompuScales):
755
- 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))
756
830
 
757
831
  def writeCompuMethod(self, element: ET.Element, compu_method: CompuMethod):
758
- compu_method_tag = ET.SubElement(element, "COMPU-METHOD")
759
- self.logger.debug("writeCompuMethods %s" % compu_method.short_name)
760
- self.setIdentifiable(compu_method_tag, compu_method)
761
- self.setChildElementOptionalRefType(compu_method_tag, "UNIT-REF", compu_method.unit_ref)
762
- 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)
763
838
 
764
839
  def setApplicationValueSpecification(self, element: ET.Element, spec: ApplicationValueSpecification):
765
840
  spec_tag = ET.SubElement(element, "APPLICATION-VALUE-SPECIFICATION")
766
- self.setChildElementOptionalLiteral(spec_tag, "SHORT-LABEL", spec.short_label)
841
+ self.setChildElementOptionalLiteral(spec_tag, "SHORT-LABEL", spec.getShortLabel())
767
842
  self.setChildElementOptionalLiteral(spec_tag, "CATEGORY", spec.category)
768
- self.writeSwValueCont(spec_tag, spec.sw_value_cont)
843
+ self.writeSwValueCont(spec_tag, spec.getSwValueCont())
769
844
 
770
845
  def setRecordValueSpecification(self, element: ET.Element, spec: RecordValueSpecification):
771
846
  child_element = ET.SubElement(element, "RECORD-VALUE-SPECIFICATION")
772
847
  self.setARObjectAttributes(child_element, spec)
773
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", spec.short_label)
774
- fields = spec.get_fields()
848
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", spec.getShortLabel())
849
+ fields = spec.getFields()
775
850
  if len(fields) > 0:
776
851
  fields_tag = ET.SubElement(child_element, "FIELDS")
777
852
  for field in fields:
@@ -783,8 +858,10 @@ class ARXMLWriter(AbstractARXMLWriter):
783
858
  self.setTextValueSpecification(fields_tag, field)
784
859
  elif isinstance(field, ArrayValueSpecification):
785
860
  self.setArrayValueSpecification(fields_tag, field)
861
+ elif isinstance(field, RecordValueSpecification):
862
+ self.setRecordValueSpecification(fields_tag, field)
786
863
  else:
787
- raise NotImplementedError("Unsupported Field <%s>" % type(field))
864
+ self.notImplemented("Unsupported Field <%s>" % type(field))
788
865
 
789
866
  def writeConstantSpecification(self, element: ET.Element, spec: ConstantSpecification):
790
867
  spec_tag = ET.SubElement(element, "CONSTANT-SPECIFICATION")
@@ -840,15 +917,18 @@ class ARXMLWriter(AbstractARXMLWriter):
840
917
 
841
918
  def setRModeInAtomicSwcInstanceRef(self, element: ET.Element, key: str, iref: RModeInAtomicSwcInstanceRef):
842
919
  child_element = ET.SubElement(element, key)
920
+ self.setARObjectAttributes(child_element, iref)
843
921
  self.setChildElementOptionalRefType(child_element, "BASE", iref.getBaseRef())
844
922
  self.setChildElementOptionalRefType(child_element, "CONTEXT-PORT-REF", iref.getContextPortRef())
845
923
  self.setChildElementOptionalRefType(child_element, "CONTEXT-MODE-DECLARATION-GROUP-PROTOTYPE-REF", iref.getContextModeDeclarationGroupPrototypeRef())
846
924
  self.setChildElementOptionalRefType(child_element, "TARGET-MODE-DECLARATION-REF", iref.getTargetModeDeclarationRef())
847
925
 
848
926
  def setPOperationInAtomicSwcInstanceRef(self, element: ET.Element, key: str, iref: POperationInAtomicSwcInstanceRef):
849
- child_element = ET.SubElement(element, key)
850
- self.setChildElementOptionalRefType(child_element, "CONTEXT-P-PORT-REF", iref.context_p_port_ref)
851
- 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())
852
932
 
853
933
  def setRTEEvent(self, element: ET.Element, event: RTEEvent):
854
934
  self.setIdentifiable(element, event)
@@ -863,7 +943,8 @@ class ARXMLWriter(AbstractARXMLWriter):
863
943
  if event is not None:
864
944
  child_element = ET.SubElement(element, "TIMING-EVENT")
865
945
  self.setRTEEvent(child_element, event)
866
- self.setChildElementOptionalFloatValue(child_element, "PERIOD", event.period)
946
+ self.setChildElementOptionalTimeValue(child_element, "OFFSET", event.getOffset())
947
+ self.setChildElementOptionalTimeValue(child_element, "PERIOD", event.getPeriod())
867
948
 
868
949
  def setOperationInvokedEvent(self, element: ET.Element, event: OperationInvokedEvent):
869
950
  if event is not None:
@@ -902,6 +983,12 @@ class ARXMLWriter(AbstractARXMLWriter):
902
983
  child_element = ET.SubElement(element, "INIT-EVENT")
903
984
  self.setRTEEvent(child_element, event)
904
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
+
905
992
  def writeRTEEvents(self, element: ET.Element, parent: SwcInternalBehavior):
906
993
  events = parent.getRteEvents()
907
994
  if len(events) > 0:
@@ -920,8 +1007,10 @@ class ARXMLWriter(AbstractARXMLWriter):
920
1007
  self.setInternalTriggerOccurredEvent(child_element, event)
921
1008
  elif isinstance(event, InitEvent):
922
1009
  self.setInitEvent(child_element, event)
1010
+ elif isinstance(event, AsynchronousServerCallReturnsEvent):
1011
+ self.setAsynchronousServerCallReturnsEvent(child_element, event)
923
1012
  else:
924
- raise NotImplementedError("Unsupported Event <%s>" % type(event))
1013
+ self.notImplemented("Unsupported Event <%s>" % type(event))
925
1014
 
926
1015
  def writeExclusiveAreas(self, element: ET.Element, behavior: InternalBehavior):
927
1016
  areas = behavior.getExclusiveAreas()
@@ -957,6 +1046,7 @@ class ARXMLWriter(AbstractARXMLWriter):
957
1046
  self.setARObjectAttributes(child_element, ref)
958
1047
  if ref.getAutosarVariableIRef() is not None:
959
1048
  child_element = ET.SubElement(child_element, "AUTOSAR-VARIABLE-IREF")
1049
+ #self.setARObjectAttributes(child_element, ref)
960
1050
  self.setChildElementOptionalRefType(child_element, "PORT-PROTOTYPE-REF", ref.getAutosarVariableIRef().getPortPrototypeRef())
961
1051
  self.setChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF", ref.getAutosarVariableIRef().getTargetDataPrototypeRef())
962
1052
  self.setChildElementOptionalRefType(child_element, "LOCAL-VARIABLE-REF", ref.getLocalVariableRef())
@@ -1026,8 +1116,9 @@ class ARXMLWriter(AbstractARXMLWriter):
1026
1116
  def setROperationInAtomicSwcInstanceRef(self, element: ET.Element, key: str, iref: ROperationInAtomicSwcInstanceRef):
1027
1117
  if iref is not None:
1028
1118
  child_element = ET.SubElement(element, key)
1029
- self.setChildElementOptionalRefType(child_element, "CONTEXT-R-PORT-REF", iref.context_r_port_ref)
1030
- 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())
1031
1122
 
1032
1123
  def setServerCallPoint(self, element: ET.Element, call_point: ServerCallPoint):
1033
1124
  self.setROperationInAtomicSwcInstanceRef(element, "OPERATION-IREF", call_point.getOperationIRef())
@@ -1038,6 +1129,11 @@ class ARXMLWriter(AbstractARXMLWriter):
1038
1129
  self.setIdentifiable(child_element, call_point)
1039
1130
  self.setServerCallPoint(child_element, call_point)
1040
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
+
1041
1137
  def writeServerCallPoints(self, element: ET.Element, entity: RunnableEntity):
1042
1138
  call_points = entity.getServerCallPoints()
1043
1139
  if len(call_points) > 0:
@@ -1045,6 +1141,8 @@ class ARXMLWriter(AbstractARXMLWriter):
1045
1141
  for call_point in call_points:
1046
1142
  if isinstance(call_point, SynchronousServerCallPoint):
1047
1143
  self.setSynchronousServerCallPoint(child_element, call_point)
1144
+ elif isinstance(call_point, AsynchronousServerCallPoint):
1145
+ self.setAsynchronousServerCallPoint(child_element, call_point)
1048
1146
  else:
1049
1147
  self._raiseError("Unsupported ServerCallPoint type <%s>" % type(call_point))
1050
1148
 
@@ -1097,13 +1195,23 @@ class ARXMLWriter(AbstractARXMLWriter):
1097
1195
  if isinstance(argument, RunnableEntityArgument):
1098
1196
  self.setRunnableEntityArgument(child_element, argument)
1099
1197
  else:
1100
- 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())
1101
1208
 
1102
1209
  def writeRunnableEntity(self, element: ET.Element, entity: RunnableEntity):
1103
1210
  if entity is not None:
1104
1211
  child_element = ET.SubElement(element, "RUNNABLE-ENTITY")
1105
1212
  self.setExecutableEntity(child_element, entity)
1106
1213
  self.writeRunnableEntityArguments(child_element, entity)
1214
+ self.writeAsynchronousServerCallResultPoint(child_element, entity)
1107
1215
  self.setChildElementOptionalBooleanValue(child_element, "CAN-BE-INVOKED-CONCURRENTLY", entity.getCanBeInvokedConcurrently())
1108
1216
  self.writeParameterAccesses(child_element, entity)
1109
1217
  self.writeDataReceivePointByArguments(child_element, entity)
@@ -1124,7 +1232,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1124
1232
  if isinstance(entity, RunnableEntity):
1125
1233
  self.writeRunnableEntity(runnables_tag, entity)
1126
1234
  else:
1127
- raise NotImplementedError("Unsupported RunnableEntity <%s>" % type(entity))
1235
+ self.notImplemented("Unsupported RunnableEntity <%s>" % type(entity))
1128
1236
 
1129
1237
  def writeExplicitInterRunnableVariables(self, element: ET.Element, behavior: SwcInternalBehavior):
1130
1238
  prototypes = behavior.getExplicitInterRunnableVariables()
@@ -1143,18 +1251,18 @@ class ARXMLWriter(AbstractARXMLWriter):
1143
1251
  for memory in memories:
1144
1252
  child_element = ET.SubElement(memories_tag, "PER-INSTANCE-MEMORY")
1145
1253
  self.setIdentifiable(child_element, memory)
1146
- self.setChildElementOptionalLiteral(child_element, "INIT-VALUE", memory.initValue)
1147
- self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", memory.swDataDefProps)
1148
- self.setChildElementOptionalLiteral(child_element, "TYPE", memory.type)
1149
- 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())
1150
1258
 
1151
1259
  def writeParameterDataPrototype(self, element: ET.Element, prototype: ParameterDataPrototype):
1152
1260
  child_element = ET.SubElement(element, "PARAMETER-DATA-PROTOTYPE")
1153
1261
  self.setIdentifiable(child_element, prototype)
1154
- self.writeAutosarDataPrototype(child_element, prototype)
1155
- self.setInitValue(child_element, prototype.initValue)
1262
+ self.setAutosarDataPrototype(child_element, prototype)
1263
+ self.setInitValue(child_element, prototype.getInitValue())
1156
1264
 
1157
- def writeParameterDataPrototypes(self, element: ET.Element, behavior: SwcInternalBehavior):
1265
+ def writePerInstanceParameters(self, element: ET.Element, behavior: SwcInternalBehavior):
1158
1266
  prototypes = behavior.getPerInstanceParameters()
1159
1267
  if len(prototypes) > 0:
1160
1268
  child_element = ET.SubElement(element, "PER-INSTANCE-PARAMETERS")
@@ -1183,14 +1291,30 @@ class ARXMLWriter(AbstractARXMLWriter):
1183
1291
  self.writePortDefinedArgumentValues(child_element, option)
1184
1292
  self.setChildElementOptionalRefType(child_element, "PORT-REF", option.portRef)
1185
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
+
1186
1309
  def writeServiceDependency(self, element: ET.Element, dependency: ServiceDependency):
1187
1310
  self.setIdentifiable(element, dependency)
1311
+ self.writeServiceDependencyAssignedDataType(element, dependency)
1188
1312
 
1189
1313
  def writeRoleBasedDataAssignment(self, element: ET.Element, assignment: RoleBasedDataAssignment):
1190
1314
  child_element = ET.SubElement(element, "ROLE-BASED-DATA-ASSIGNMENT")
1191
1315
  self.setChildElementOptionalLiteral(child_element, "ROLE", assignment.role)
1192
- self.setAutosarParameterRef(child_element, "USED-PARAMETER-ELEMENT", assignment.used_parameter_element)
1193
- 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())
1194
1318
 
1195
1319
  def writeRoleBasedPortAssignment(self, element: ET.Element, assignment: RoleBasedPortAssignment):
1196
1320
  child_element = ET.SubElement(element, "ROLE-BASED-PORT-ASSIGNMENT")
@@ -1219,20 +1343,76 @@ class ARXMLWriter(AbstractARXMLWriter):
1219
1343
 
1220
1344
  def writeNvBlockNeeds(self, element: ET.Element, needs: NvBlockNeeds):
1221
1345
  child_element = ET.SubElement(element, "NV-BLOCK-NEEDS")
1222
- 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)
1223
1370
  self.setIdentifiable(child_element, needs)
1224
- self.setChildElementOptionalBooleanValue(child_element, "CALC-RAM-BLOCK-CRC", needs.calc_ram_block_crc)
1225
- self.setChildElementOptionalBooleanValue(child_element, "CHECK-STATIC-BLOCK-ID", needs.check_static_block_id)
1226
- self.setChildElementOptionalNumericalValue(child_element, "N-DATA-SETS", needs.n_data_sets)
1227
- self.setChildElementOptionalNumericalValue(child_element, "N-ROM-BLOCKS", needs.n_rom_blocks)
1228
- self.setChildElementOptionalBooleanValue(child_element, "READONLY", needs.readonly)
1229
- self.setChildElementOptionalLiteral(child_element, "RELIABILITY", needs.reliability)
1230
- self.setChildElementOptionalBooleanValue(child_element, "RESISTANT-TO-CHANGED-SW", needs.resistant_to_changed_sw)
1231
- self.setChildElementOptionalBooleanValue(child_element, "RESTORE-AT-START", needs.restore_at_start)
1232
- self.setChildElementOptionalBooleanValue(child_element, "STORE-AT-SHUTDOWN", needs.store_at_shutdown)
1233
- self.setChildElementOptionalBooleanValue(child_element, "WRITE-ONLY-ONCE", needs.write_only_once)
1234
- self.setChildElementOptionalBooleanValue(child_element, "WRITE-VERIFICATION", needs.write_verification)
1235
- self.setChildElementOptionalLiteral(child_element, "WRITING-PRIORITY", needs.writing_priority)
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)
1376
+ self.setIdentifiable(child_element, needs)
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())
1236
1416
 
1237
1417
  def writeSwcServiceDependencyServiceNeeds(self, element: ET.Element, parent: SwcServiceDependency):
1238
1418
  needs = parent.getServiceNeeds()
@@ -1240,7 +1420,17 @@ class ARXMLWriter(AbstractARXMLWriter):
1240
1420
  child_element = ET.SubElement(element, "SERVICE-NEEDS")
1241
1421
  for need in needs:
1242
1422
  if isinstance(need, NvBlockNeeds):
1243
- 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)
1244
1434
  else:
1245
1435
  self._raiseError("Unsupported service needs <%s>" % type(need))
1246
1436
 
@@ -1283,7 +1473,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1283
1473
  self.setChildElementOptionalLiteral(child_element, "HANDLE-TERMINATION-AND-RESTART", behavior.handle_termination_and_restart)
1284
1474
  self.setIncludedDataTypeSets(child_element, behavior.getIncludedDataTypeSets())
1285
1475
  self.writePerInstanceMemories(child_element, behavior)
1286
- self.writeParameterDataPrototypes(child_element, behavior)
1476
+ self.writePerInstanceParameters(child_element, behavior)
1287
1477
  self.writePortAPIOptions(child_element, behavior)
1288
1478
  self.writeSwcInternalBehaviorRunnableEntities(child_element, behavior)
1289
1479
  self.writeSwcInternalBehaviorServiceDependencies(child_element, behavior)
@@ -1346,12 +1536,13 @@ class ARXMLWriter(AbstractARXMLWriter):
1346
1536
  for memory_section in memory_sections:
1347
1537
  child_element = ET.SubElement(sections_tag, "MEMORY-SECTION")
1348
1538
  self.setIdentifiable(child_element, memory_section)
1349
- 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())
1350
1541
  self.setMemorySectionOptions(child_element, memory_section.getOptions())
1351
- self.setChildElementOptionalNumericalValue(child_element, "SIZE", memory_section.size)
1352
- self.setChildElementOptionalRefType(child_element, "SW-ADDRMETHOD-REF", memory_section.swAddrMethodRef)
1353
- self.setChildElementOptionalLiteral(child_element, "SYMBOL", memory_section.symbol)
1354
- 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())
1355
1546
 
1356
1547
  def setResourceConsumption(self, element: ET.Element, consumption: ResourceConsumption):
1357
1548
  if consumption is not None:
@@ -1441,15 +1632,15 @@ class ARXMLWriter(AbstractARXMLWriter):
1441
1632
  self.setIdentifiable(child_element, protection_set)
1442
1633
  self.writeEndToEndProtections(child_element, protection_set)
1443
1634
 
1444
- def writeAutosarDataPrototype(self, element: ET.Element, prototype: AutosarDataPrototype):
1635
+ def setAutosarDataPrototype(self, element: ET.Element, prototype: AutosarDataPrototype):
1636
+ self.setDataPrototype(element, prototype)
1445
1637
  self.setChildElementOptionalRefType(element, "TYPE-TREF", prototype.typeTRef)
1446
1638
 
1447
1639
  def writeVariableDataPrototype(self, element: ET.Element, prototype: VariableDataPrototype):
1448
1640
  self.logger.debug("writeVariableDataPrototype %s" % prototype.short_name)
1449
1641
  child_element = ET.SubElement(element, "VARIABLE-DATA-PROTOTYPE")
1450
1642
  self.setIdentifiable(child_element, prototype)
1451
- self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", prototype.swDataDefProps)
1452
- self.writeAutosarDataPrototype(child_element, prototype)
1643
+ self.setAutosarDataPrototype(child_element, prototype)
1453
1644
  self.setInitValue(child_element, prototype.initValue)
1454
1645
 
1455
1646
  def writeSenderReceiverInterfaceDataElements(self, element: ET.Element, sr_interface: SenderReceiverInterface):
@@ -1477,6 +1668,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1477
1668
  self.setIdentifiable(child_element, sr_interface)
1478
1669
  self.setChildElementOptionalBooleanValue(child_element, "IS-SERVICE", sr_interface.getIsService())
1479
1670
  self.writeSenderReceiverInterfaceDataElements(child_element, sr_interface)
1671
+ self.writeSenderReceiverInterfaceInvalidationPolicies(child_element, sr_interface)
1480
1672
 
1481
1673
  def writerBswModuleDescriptionImplementedEntry(self, element: ET.Element, desc: BswModuleDescription):
1482
1674
  entries = desc.getImplementedEntries()
@@ -1557,7 +1749,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1557
1749
  self.logger.debug("setBswTimingEvent %s" % event.short_name)
1558
1750
  child_element = ET.SubElement(element, "BSW-TIMING-EVENT")
1559
1751
  self.setBswScheduleEvent(child_element, event)
1560
- self.setChildElementOptionalFloatValue(child_element, "PERIOD", event.period)
1752
+ self.setChildElementOptionalTimeValue(child_element, "PERIOD", event.getPeriod())
1561
1753
 
1562
1754
  def writeBswInternalBehaviorBswEvents(self, element: ET.Element, parent: BswInternalBehavior):
1563
1755
  events = parent.getBswEvents()
@@ -1708,13 +1900,16 @@ class ARXMLWriter(AbstractARXMLWriter):
1708
1900
  child_element = ET.SubElement(sub_elements_tag, "IMPLEMENTATION-DATA-TYPE-ELEMENT")
1709
1901
  self.setIdentifiable(child_element, type_element)
1710
1902
  self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE", type_element.getArraySize())
1903
+ self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE-HANDLING", type_element.getArraySizeHandling())
1711
1904
  self.setChildElementOptionalLiteral(child_element, "ARRAY-SIZE-SEMANTICS", type_element.getArraySizeSemantics())
1905
+ self.writeImplementationDataTypeElements(child_element, type_element)
1712
1906
  self.setSwDataDefProps(child_element, "SW-DATA-DEF-PROPS", type_element.getSwDataDefProps())
1713
1907
 
1714
1908
  def writeImplementationDataType(self, element: ET.Element, data_type: ImplementationDataType):
1715
1909
  self.logger.debug("writeImplementationDataType %s" % data_type.short_name)
1716
1910
  child_element = ET.SubElement(element, "IMPLEMENTATION-DATA-TYPE")
1717
- 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())
1718
1913
  self.writeImplementationDataTypeElements(child_element, data_type)
1719
1914
  self.setChildElementOptionalLiteral(child_element, "TYPE-EMITTER", data_type.getTypeEmitter())
1720
1915
 
@@ -1775,6 +1970,19 @@ class ARXMLWriter(AbstractARXMLWriter):
1775
1970
  self.setChildElementOptionalBooleanValue(element, "IS-SERVICE", port_interface.isService)
1776
1971
  self.setChildElementOptionalLiteral(element, "SERVICE-KIND", port_interface.serviceKind)
1777
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
+
1778
1986
  def writeClientServerInterface(self, element: ET.Element, cs_interface: ClientServerInterface):
1779
1987
  self.logger.debug("writeClientServerInterface %s" % cs_interface.short_name)
1780
1988
  child_element = ET.SubElement(element, "CLIENT-SERVER-INTERFACE")
@@ -1802,44 +2010,54 @@ class ARXMLWriter(AbstractARXMLWriter):
1802
2010
  def writeApplicationArrayDataType(self, element: ET.Element, data_type: ApplicationArrayDataType):
1803
2011
  self.logger.debug("writeApplicationArrayDataType %s" % data_type.short_name)
1804
2012
  child_element = ET.SubElement(element, "APPLICATION-ARRAY-DATA-TYPE")
1805
- self.writeApplicationCompositeDataType(child_element, data_type)
2013
+ self.setApplicationCompositeDataType(child_element, data_type)
1806
2014
  self.setApplicationArrayElement(child_element, data_type.element)
1807
2015
 
1808
2016
  def setSwRecordLayoutV(self, element: ET.Element, key: str, layout_v: SwRecordLayoutV):
1809
2017
  if layout_v is not None:
1810
2018
  child_element = ET.SubElement(element, key)
1811
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", layout_v.shortLabel)
1812
- self.setChildElementOptionalRefType(child_element, "BASE-TYPE-REF", layout_v.baseTypeRef)
1813
- self.setChildElementOptionalNumericalValue(child_element, "SW-RECORD-LAYOUT-V-AXIS", layout_v.swRecordLayoutVAxis)
1814
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-V-PROP", layout_v.swRecordLayoutVProp)
1815
- 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())
1816
2024
 
1817
2025
  def setSwRecordLayoutGroup(self, element: ET.Element, key: str, group: SwRecordLayoutGroup):
1818
2026
  if group is not None:
1819
2027
  child_element = ET.SubElement(element, key)
1820
- self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", group.shortLabel)
1821
- self.setChildElementOptionalLiteral(child_element, "CATEGORY", group.category)
1822
- self.setChildElementOptionalNumericalValue(child_element, "SW-RECORD-LAYOUT-GROUP-AXIS", group.swRecordLayoutGroupAxis)
1823
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-INDEX", group.swRecordLayoutGroupIndex)
1824
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-FROM", group.swRecordLayoutGroupFrom)
1825
- self.setChildElementOptionalLiteral(child_element, "SW-RECORD-LAYOUT-GROUP-TO", group.swRecordLayoutGroupTo)
1826
- self.setSwRecordLayoutV(child_element, "SW-RECORD-LAYOUT-V", group.swRecordLayoutGroupContentType.swRecordLayoutV)
1827
- 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)
1828
2037
  return group
1829
2038
 
1830
2039
  def writeSwRecordLayout(self, element: ET.Element, layout: SwRecordLayout):
1831
2040
  self.logger.debug("writeSwRecordLayout %s" % layout.short_name)
1832
2041
  child_element = ET.SubElement(element, "SW-RECORD-LAYOUT")
1833
2042
  self.setIdentifiable(child_element, layout)
1834
- self.setSwRecordLayoutGroup(child_element, "SW-RECORD-LAYOUT-GROUP", layout.swRecordLayoutGroup)
2043
+ self.setSwRecordLayoutGroup(child_element, "SW-RECORD-LAYOUT-GROUP", layout.getSwRecordLayoutGroup())
1835
2044
 
1836
2045
  def writeSwAddrMethod(self, element: ET.Element, method: SwAddrMethod):
1837
2046
  self.logger.debug("writeSwAddrMethod %s" % method.short_name)
1838
- 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())
1839
2057
 
1840
2058
  def writeTriggerInterface(self, element: ET.Element, trigger_if: TriggerInterface):
1841
2059
  self.logger.debug("writeTriggerInterface %s" % trigger_if.short_name)
1842
- child_element = ET.SubElement(element, "SW-RECORD-LAYOUT")
2060
+ child_element = ET.SubElement(element, "TRIGGER-INTERFACE")
1843
2061
 
1844
2062
  def writeServiceSwComponentType(self, element: ET.Element, sw_component: ServiceSwComponentType):
1845
2063
  self.logger.debug("writeServiceSwComponentType %s" % sw_component.short_name)
@@ -1853,8 +2071,8 @@ class ARXMLWriter(AbstractARXMLWriter):
1853
2071
  for map in maps:
1854
2072
  child_element = ET.SubElement(maps_tag, "DATA-TYPE-MAP")
1855
2073
  self.setARObjectAttributes(child_element, map)
1856
- self.setChildElementOptionalRefType(child_element, "APPLICATION-DATA-TYPE-REF", map.application_data_type_ref)
1857
- 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())
1858
2076
 
1859
2077
  def writeModeRequestTypeMaps(self, element: ET.Element, parent: DataTypeMappingSet):
1860
2078
  maps = parent.getModeRequestTypeMaps()
@@ -1863,8 +2081,8 @@ class ARXMLWriter(AbstractARXMLWriter):
1863
2081
  for map in maps:
1864
2082
  child_element = ET.SubElement(maps_tag, "MODE-REQUEST-TYPE-MAP")
1865
2083
  self.setARObjectAttributes(child_element, map)
1866
- self.setChildElementOptionalRefType(child_element, "IMPLEMENTATION-DATA-TYPE-REF", map.implementation_data_type_ref)
1867
- 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())
1868
2086
 
1869
2087
  def writeDataTypeMappingSet(self, element: ET.Element, mapping_set: DataTypeMappingSet):
1870
2088
  self.logger.debug("writeDataTypeMappingSet %s" % mapping_set.short_name)
@@ -1889,7 +2107,7 @@ class ARXMLWriter(AbstractARXMLWriter):
1889
2107
  self.logger.debug("writeModeDeclarationGroup %s" % group.short_name)
1890
2108
  child_element = ET.SubElement(element, "MODE-DECLARATION-GROUP")
1891
2109
  self.setIdentifiable(child_element, group)
1892
- self.setChildElementOptionalRefType(child_element, "INITIAL-MODE-REF", group._initial_mode_ref)
2110
+ self.setChildElementOptionalRefType(child_element, "INITIAL-MODE-REF", group.initialModeRef)
1893
2111
  self.writeModeDeclarationGroupModeDeclaration(child_element, group)
1894
2112
  self.setChildElementOptionalNumericalValue(child_element, "ON-TRANSITION-VALUE", group.getOnTransitionValue())
1895
2113
 
@@ -2193,7 +2411,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2193
2411
  elif isinstance(triggering, LinFrameTriggering):
2194
2412
  self.writeLinFrameTriggering(triggerings_tag, triggering)
2195
2413
  else:
2196
- raise NotImplementedError("Unsupported Frame Triggering <%s>" % type(triggering))
2414
+ self.notImplemented("Unsupported Frame Triggering <%s>" % type(triggering))
2197
2415
 
2198
2416
  triggerings = channel.getISignalTriggerings()
2199
2417
  if len(triggerings) > 0:
@@ -2202,7 +2420,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2202
2420
  if isinstance(triggering, ISignalTriggering):
2203
2421
  self.writeISignalTriggering(triggerings_tag, triggering)
2204
2422
  else:
2205
- raise NotImplementedError("Unsupported ISignalTriggering <%s>" % type(triggering))
2423
+ self.notImplemented("Unsupported ISignalTriggering <%s>" % type(triggering))
2206
2424
 
2207
2425
  triggerings = channel.getPduTriggerings()
2208
2426
  if len(triggerings) > 0:
@@ -2211,7 +2429,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2211
2429
  if isinstance(triggering, PduTriggering):
2212
2430
  self.writePduTriggering(triggerings_tag, triggering)
2213
2431
  else:
2214
- raise NotImplementedError("Unsupported PduTriggering <%s>" % type(triggering))
2432
+ self.notImplemented("Unsupported PduTriggering <%s>" % type(triggering))
2215
2433
 
2216
2434
  def writeCanPhysicalChannel(self, element: ET.Element, channel: CanPhysicalChannel):
2217
2435
  self.logger.debug("CanPhysicalChannel %s" % channel.short_name)
@@ -2235,7 +2453,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2235
2453
  elif isinstance(channel, LinPhysicalChannel):
2236
2454
  self.writeLinPhysicalChannel(child_element, channel)
2237
2455
  else:
2238
- raise NotImplementedError("Unsupported Physical Channel <%s>" % type(channel))
2456
+ self.notImplemented("Unsupported Physical Channel <%s>" % type(channel))
2239
2457
 
2240
2458
  def writeCommunicationCluster(self, element: ET.Element, cluster: CommunicationCluster):
2241
2459
  self.setChildElementOptionalNumericalValue(element, "BAUDRATE", cluster.getBaudrate())
@@ -2380,7 +2598,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2380
2598
  elif isinstance(data_mapping, SenderReceiverToSignalGroupMapping):
2381
2599
  self.setSenderReceiverToSignalGroupMapping(child_element, data_mapping)
2382
2600
  else:
2383
- raise NotImplementedError("Unsupported Data Mapping %s" % type(data_mapping))
2601
+ self.notImplemented("Unsupported Data Mapping %s" % type(data_mapping))
2384
2602
 
2385
2603
  def setSwcToEcuMapping(self, element: ET.Element, mapping: SwcToEcuMapping):
2386
2604
  child_element = ET.SubElement(element, "SWC-TO-ECU-MAPPING")
@@ -2400,7 +2618,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2400
2618
  if isinstance(sw_mapping, SwcToEcuMapping):
2401
2619
  self.setSwcToEcuMapping(child_element, sw_mapping)
2402
2620
  else:
2403
- raise NotImplementedError("Unsupported Sw Mapping %s" % type(sw_mapping))
2621
+ self.notImplemented("Unsupported Sw Mapping %s" % type(sw_mapping))
2404
2622
 
2405
2623
  def writeSystemMapping(self, element: ET.Element, mapping: SystemMapping):
2406
2624
  self.logger.debug("Write SystemMapping %s" % mapping.short_name)
@@ -2417,7 +2635,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2417
2635
  if isinstance(mapping, SystemMapping):
2418
2636
  self.writeSystemMapping(mappings_tag, mapping)
2419
2637
  else:
2420
- raise NotImplementedError("Unsupported Mapping %s" % type(mapping))
2638
+ self.notImplemented("Unsupported Mapping %s" % type(mapping))
2421
2639
 
2422
2640
  def writeRootSwCompositionPrototype(self, element: ET.Element, system: System):
2423
2641
  prototype = system.getRootSoftwareComposition()
@@ -2451,6 +2669,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2451
2669
  self.setARElement(child_element, dimension)
2452
2670
  self.setChildElementOptionalNumericalValue(child_element, "CURRENT-EXP", dimension.getCurrentExp())
2453
2671
  self.setChildElementOptionalNumericalValue(child_element, "LENGTH-EXP", dimension.getLengthExp())
2672
+ self.setChildElementOptionalNumericalValue(child_element, "TIME-EXP", dimension.getTimeExp())
2454
2673
 
2455
2674
  def setISignalMappings(self, element: ET.Element, mappings: List[ISignalMapping]):
2456
2675
  if len(mappings) > 0:
@@ -2500,7 +2719,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2500
2719
  if isinstance(sub_container, EcucContainerValue):
2501
2720
  self.writeEcucContainValue(sub_containers_tag, sub_container)
2502
2721
  else:
2503
- raise NotImplementedError("Unsupported Sub Container %s" % type(container))
2722
+ self.notImplemented("Unsupported Sub Container %s" % type(container))
2504
2723
 
2505
2724
  def writeEcucParameterValue(self, element: ET.Element, param_value: EcucParameterValue):
2506
2725
  self.setChildElementOptionalRefType(element, "DEFINITION-REF", param_value.getDefinitionRef())
@@ -2526,7 +2745,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2526
2745
  elif isinstance(param_value, EcucNumericalParamValue):
2527
2746
  self.setEcucNumericalParamValue(child_element, param_value)
2528
2747
  else:
2529
- raise NotImplementedError("Unsupported EcucParameterValue <%s>" % type(param_value))
2748
+ self.notImplemented("Unsupported EcucParameterValue <%s>" % type(param_value))
2530
2749
 
2531
2750
  def writeEcucAbstractReferenceValue(self, element: ET.Element, value: EcucAbstractReferenceValue):
2532
2751
  self.setChildElementOptionalRefType(element, "DEFINITION-REF", value.getDefinitionRef())
@@ -2562,7 +2781,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2562
2781
  elif isinstance(reference_value, EcucInstanceReferenceValue):
2563
2782
  self.setEcucInstanceReferenceValue(child_element, reference_value)
2564
2783
  else:
2565
- raise NotImplementedError("Unsupported EcucParameterValue <%s>" % type(reference_value))
2784
+ self.notImplemented("Unsupported EcucParameterValue <%s>" % type(reference_value))
2566
2785
 
2567
2786
  def writeEcucContainValue(self, element: ET.Element, container_value: EcucContainerValue):
2568
2787
  self.logger.debug("EcucContainerValue %s" % container_value.short_name)
@@ -2581,7 +2800,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2581
2800
  if isinstance(container, EcucContainerValue):
2582
2801
  self.writeEcucContainValue(containers_tag, container)
2583
2802
  else:
2584
- raise NotImplementedError("Unsupported Container %s" % type(container))
2803
+ self.notImplemented("Unsupported Container %s" % type(container))
2585
2804
 
2586
2805
  def writeEcucModuleConfigurationValues(self, element: ET.Element, values: EcucModuleConfigurationValues):
2587
2806
  self.logger.debug("EcucModuleConfigurationValues %s" % values.short_name)
@@ -2627,16 +2846,18 @@ class ARXMLWriter(AbstractARXMLWriter):
2627
2846
  self.setIdentifiable(child_element, signal)
2628
2847
  self.setChildElementOptionalBooleanValue(child_element, "DYNAMIC-LENGTH", signal.getDynamicLength())
2629
2848
 
2630
- def writeParameterInterface(self, element: ET.Element, signal: SystemSignal):
2631
- self.logger.debug("Write ParameterInterface %s" % signal.short_name)
2632
- child_element = ET.SubElement(element, "PARAMETER-INTERFACE")
2633
- self.setIdentifiable(child_element, signal)
2849
+
2634
2850
 
2635
- def writeGenericEthernetFrame(self, element: ET.Element, signal: SystemSignal):
2851
+ def writeGenericEthernetFrame(self, element: ET.Element, signal: GenericEthernetFrame):
2636
2852
  self.logger.debug("Write GenericEthernetFrame %s" % signal.short_name)
2637
2853
  child_element = ET.SubElement(element, "ETHERNET-FRAME")
2638
2854
  self.writeFrame(child_element, signal)
2639
2855
 
2856
+ def writeLifeCycleInfoSet(self, element: ET.Element, set: LifeCycleInfoSet):
2857
+ self.logger.debug("Write LifeCycleInfoSet %s" % set.short_name)
2858
+ child_element = ET.SubElement(element, "LIFE-CYCLE-INFO-SET")
2859
+ self.setIdentifiable(child_element, set)
2860
+
2640
2861
  def writeISignalToPduMappings(self, element: ET.Element, parent: ISignalIPdu):
2641
2862
  mappings = parent.getISignalToPduMappings()
2642
2863
  if len(mappings) > 0:
@@ -2797,8 +3018,24 @@ class ARXMLWriter(AbstractARXMLWriter):
2797
3018
  self.writeParameterInterface(element, ar_element)
2798
3019
  elif isinstance(ar_element, GenericEthernetFrame):
2799
3020
  self.writeGenericEthernetFrame(element, ar_element)
3021
+ elif isinstance(ar_element, LifeCycleInfoSet):
3022
+ self.writeLifeCycleInfoSet(element, ar_element)
3023
+ elif isinstance(ar_element, PhysicalDimension):
3024
+ self.writePhysicalDimension(element, ar_element)
2800
3025
  else:
2801
- raise NotImplementedError("Unsupported Elements of ARPackage <%s>" % type(ar_element))
3026
+ self.notImplemented("Unsupported Elements of ARPackage <%s>" % type(ar_element))
3027
+
3028
+ def writeReferenceBases(self, element: ET.Element, bases: List[ReferenceBase]):
3029
+ self.logger.debug("Write ReferenceBases")
3030
+ if len(bases) > 0:
3031
+ bases_tag = ET.SubElement(element, "REFERENCE-BASES")
3032
+ for base in bases:
3033
+ child_element = ET.SubElement(bases_tag, "REFERENCE-BASE")
3034
+ self.setChildElementOptionalLiteral(child_element, "SHORT-LABEL", base.getShortLabel())
3035
+ self.setChildElementOptionalBooleanValue(child_element, "IS-DEFAULT", base.getIsDefault())
3036
+ self.setChildElementOptionalBooleanValue(child_element, "IS-GLOBAL", base.getIsDefault())
3037
+ self.setChildElementOptionalBooleanValue(child_element, "BASE-IS-THIS-PACKAGE", base.getBaseIsThisPackage())
3038
+ self.setChildElementOptionalRefType(child_element, "PACKAGE-REF", base.getPackageRef())
2802
3039
 
2803
3040
  def writeARPackages(self, element: ET.Element, pkgs: List[ARPackage]):
2804
3041
  if len(pkgs) > 0:
@@ -2810,6 +3047,8 @@ class ARXMLWriter(AbstractARXMLWriter):
2810
3047
  self.setIdentifiable(pkg_tag, pkg)
2811
3048
  self.logger.debug("writeARPackage %s" % pkg.full_name)
2812
3049
 
3050
+ self.writeReferenceBases(pkg_tag, pkg.getReferenceBases())
3051
+
2813
3052
  if pkg.getTotalElement() > 0:
2814
3053
  elements_tag = ET.SubElement(pkg_tag, "ELEMENTS")
2815
3054
 
@@ -2818,6 +3057,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2818
3057
  self.writeARPackageElement(elements_tag, ar_element)
2819
3058
 
2820
3059
  self.writeARPackages(pkg_tag, pkg.getARPackages())
3060
+
2821
3061
 
2822
3062
  def save(self, filename, document: AUTOSAR):
2823
3063
  self.logger.info("Save %s ..." % filename)
@@ -2826,6 +3066,7 @@ class ARXMLWriter(AbstractARXMLWriter):
2826
3066
  root.attrib["xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance"
2827
3067
  root.attrib["xsi:schemaLocation"] = document.schema_location
2828
3068
 
3069
+ self.setAdminData(root, document.getAdminData())
2829
3070
  self.writeARPackages(root, document.getARPackages())
2830
3071
 
2831
3072
  self.saveToFile(filename, root)