armodel 1.6.4__py3-none-any.whl → 1.7.1__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 (43) hide show
  1. armodel/cli/arxml_format_cli.py +14 -11
  2. armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +50 -13
  3. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +1 -1
  4. armodel/models/M2/AUTOSARTemplates/CommonStructure/Filter.py +86 -0
  5. armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +3 -4
  6. armodel/models/M2/AUTOSARTemplates/ECUCDescriptionTemplate.py +1 -1
  7. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +95 -13
  8. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +14 -4
  9. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +103 -10
  10. armodel/models/M2/AUTOSARTemplates/GenericStructure/LifeCycles.py +5 -0
  11. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +21 -8
  12. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py +24 -0
  13. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +1 -1
  14. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanTopology.py +173 -0
  15. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Multiplatform.py +1 -1
  16. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +6 -6
  17. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +237 -28
  18. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +223 -0
  19. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/Timing.py +177 -0
  20. armodel/models/M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py +37 -0
  21. armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +88 -16
  22. armodel/models/M2/MSR/AsamHdo/AdminData.py +34 -8
  23. armodel/models/M2/MSR/Documentation/Annotation.py +1 -1
  24. armodel/models/M2/MSR/Documentation/TextModel/BlockElements/ListElements.py +54 -0
  25. armodel/models/M2/MSR/Documentation/TextModel/BlockElements/PaginationAndView.py +9 -0
  26. armodel/models/M2/MSR/Documentation/TextModel/BlockElements/__init__.py +25 -0
  27. armodel/models/M2/MSR/Documentation/TextModel/LanguageDataModel.py +33 -5
  28. armodel/models/M2/MSR/Documentation/TextModel/MultilanguageData.py +15 -2
  29. armodel/models/M2/MSR/Documentation/__init__.py +1 -1
  30. armodel/models/__init__.py +15 -2
  31. armodel/parser/abstract_arxml_parser.py +55 -18
  32. armodel/parser/arxml_parser.py +344 -101
  33. armodel/tests/test_armodel/models/test_ar_ref.py +7 -4
  34. armodel/tests/test_armodel/parser/test_sw_components.py +6 -19
  35. armodel/tests/test_armodel/parser/test_system.py +2 -2
  36. armodel/writer/abstract_arxml_writer.py +17 -8
  37. armodel/writer/arxml_writer.py +291 -78
  38. {armodel-1.6.4.dist-info → armodel-1.7.1.dist-info}/METADATA +23 -1
  39. {armodel-1.6.4.dist-info → armodel-1.7.1.dist-info}/RECORD +43 -35
  40. {armodel-1.6.4.dist-info → armodel-1.7.1.dist-info}/LICENSE +0 -0
  41. {armodel-1.6.4.dist-info → armodel-1.7.1.dist-info}/WHEEL +0 -0
  42. {armodel-1.6.4.dist-info → armodel-1.7.1.dist-info}/entry_points.txt +0 -0
  43. {armodel-1.6.4.dist-info → armodel-1.7.1.dist-info}/top_level.txt +0 -0
@@ -14,13 +14,16 @@ from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArOb
14
14
  class TestARRef:
15
15
  def test_RefType(self):
16
16
  ref_type = RefType()
17
- assert(ref_type.value == "")
18
- assert(ref_type.dest == "")
17
+ assert(ref_type.getBase() == None)
18
+ assert(ref_type.getValue() == None)
19
+ assert(ref_type.getDest() == None)
19
20
 
20
21
  def test_TRefType(self):
21
22
  ref_type = TRefType()
22
- assert(ref_type.value == "")
23
- assert(ref_type.dest == "")
23
+ assert(ref_type.getBase() == None)
24
+ assert(ref_type.getValue() == None)
25
+ assert(ref_type.getDest() == None)
26
+
24
27
 
25
28
  def test_AutosarVariableRef(self):
26
29
  ref_type = AutosarVariableRef()
@@ -53,40 +53,27 @@ class TestSWComponents:
53
53
  assert(len(sw_component.getAssemblySwConnectors()) == 0)
54
54
  assert(len(sw_component.getDelegationSwConnectors()) == 0)
55
55
 
56
- def test_software_components_arxml_loading_and_saving(self):
57
- document = AUTOSAR.getInstance()
58
- document.clear()
59
- parser = ARXMLParser()
60
- parser.load("src/armodel/tests/test_files/SoftwareComponents.arxml", document)
61
-
62
- writer = ARXMLWriter()
63
- writer.save("data/generated.arxml", document)
64
-
65
- assert(filecmp.cmp("src/armodel/tests/test_files/SoftwareComponents.arxml", "data/generated.arxml", shallow = False) == True)
66
-
67
- def test_software_components_arxml_loading_and_saving(self):
56
+ def test_bswm_mode_arxml_loading_and_saving(self):
68
57
  document = AUTOSAR.getInstance()
69
58
  document.clear()
70
59
  parser = ARXMLParser()
71
- parser.load("src/armodel/tests/test_files/AUTOSAR_Datatypes.arxml", document)
60
+ parser.load("src/armodel/tests/test_files/BswMMode.arxml", document)
72
61
 
73
62
  writer = ARXMLWriter()
74
63
  writer.save("data/generated_AUTOSAR_Datatypes.arxml", document)
75
64
 
76
- assert(filecmp.cmp("src/armodel/tests/test_files/AUTOSAR_Datatypes.arxml", "data/generated_AUTOSAR_Datatypes.arxml", shallow = False) == True)
65
+ assert(filecmp.cmp("src/armodel/tests/test_files/BswMMode.arxml", "data/generated_AUTOSAR_Datatypes.arxml", shallow = False) == True)
77
66
 
78
67
  def test_bswm_mode_arxml_loading_and_saving(self):
79
68
  document = AUTOSAR.getInstance()
80
69
  document.clear()
81
70
  parser = ARXMLParser()
82
- parser.load("src/armodel/tests/test_files/BswMMode.arxml", document)
71
+ parser.load("test_files/AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", document)
83
72
 
84
73
  writer = ARXMLWriter()
85
- writer.save("data/generated_AUTOSAR_Datatypes.arxml", document)
86
-
87
- assert(filecmp.cmp("src/armodel/tests/test_files/BswMMode.arxml", "data/generated_AUTOSAR_Datatypes.arxml", shallow = False) == True)
74
+ writer.save("data/generated_AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", document)
88
75
 
89
-
76
+ assert(filecmp.cmp("test_files/AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", "data/generated_AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", shallow = False) == True)
90
77
 
91
78
 
92
79
 
@@ -12,7 +12,7 @@ class TestSystemTemplate:
12
12
  parser.load("src/armodel/tests/test_files/CanSystem.arxml", document)
13
13
 
14
14
 
15
- def test_bswm_mode_arxml_loading_and_saving(self):
15
+ def test_can_system_arxml_loading_and_saving(self):
16
16
  document = AUTOSAR.getInstance()
17
17
  document.clear()
18
18
  parser = ARXMLParser()
@@ -21,7 +21,7 @@ class TestSystemTemplate:
21
21
  writer = ARXMLWriter()
22
22
  writer.save("data/generated_CanSystem.arxml", document)
23
23
 
24
- #assert(filecmp.cmp("src/armodel/tests/test_files/CanSystem.arxml", "data/generated_CanSystem.arxml", shallow = False) == True)
24
+ assert(filecmp.cmp("src/armodel/tests/test_files/CanSystem.arxml", "data/generated_CanSystem.arxml", shallow = False) == True)
25
25
 
26
26
 
27
27
 
@@ -8,11 +8,7 @@ import logging
8
8
  import xml.etree.cElementTree as ET
9
9
 
10
10
  from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
11
-
12
- from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, ARLiteral, ARNumerical
13
- from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import TRefType
14
-
15
- from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
11
+ from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, ARLiteral, ARNumerical, Integer, TimeValue, RefType, ARBoolean
16
12
 
17
13
  class AbstractARXMLWriter:
18
14
  __metaclass__ = ABCMeta
@@ -71,6 +67,9 @@ class AbstractARXMLWriter:
71
67
  self.setARObjectAttributes(child_element, numerical)
72
68
  child_element.text = numerical._text
73
69
 
70
+ def setChildElementOptionalIntegerValue(self, element: ET.Element, key: str, value: Integer):
71
+ self.setChildElementOptionalNumericalValue(element, key, value)
72
+
74
73
  def setChildElementOptionalLiteral(self, element: ET.Element, key: str, literal: ARLiteral):
75
74
  if literal is not None:
76
75
  child_element = ET.SubElement(element, key)
@@ -78,11 +77,18 @@ class AbstractARXMLWriter:
78
77
  if literal._value is not None:
79
78
  child_element.text = str(literal._value)
80
79
 
81
- def setChildElementOptionalRefType(self, parent: ET.Element, child_tag_name: str, ref: TRefType):
80
+ def setChildElementOptionalRevisionLabelString(self, element: ET.Element, key: str, literal: ARLiteral):
81
+ self.setChildElementOptionalLiteral(element, key, literal)
82
+
83
+ def setChildElementOptionalRefType(self, parent: ET.Element, child_tag_name: str, ref: RefType):
82
84
  if ref is not None:
83
85
  child_tag = ET.SubElement(parent, child_tag_name)
84
- if ref.dest is not None:
85
- child_tag.attrib['DEST'] = ref.dest
86
+ base = ref.getBase()
87
+ if base is not None:
88
+ child_tag.attrib['BASE'] = base
89
+ dest = ref.getDest()
90
+ if dest is not None:
91
+ child_tag.attrib['DEST'] = dest
86
92
  if ref.value is not None:
87
93
  child_tag.text = ref.value
88
94
 
@@ -91,6 +97,9 @@ class AbstractARXMLWriter:
91
97
  child_element = ET.SubElement(element, key)
92
98
  child_element.text = value.getText()
93
99
 
100
+ def setChildElementOptionalTimeValue(self, element: ET.Element, key: str, value: TimeValue):
101
+ self.setChildElementOptionalFloatValue(element, key, value)
102
+
94
103
  def setChildElementOptionalBooleanValue(self, element: ET.Element, key: str, value: ARBoolean) -> ET.Element:
95
104
  child_element = None
96
105
  if value is not None: