armodel 1.6.2__py3-none-any.whl → 1.6.3__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 (157) hide show
  1. armodel/cli/arxml_dump_cli.py +10 -7
  2. armodel/cli/arxml_format_cli.py +1 -1
  3. armodel/cli/connector_update_cli.py +1 -1
  4. armodel/lib/sw_component.py +1 -1
  5. armodel/lib/system_signal.py +2 -2
  6. armodel/models/{m2/autosar_templates/autosar_top_level_structure.py → M2/AUTOSARTemplates/AutosarTopLevelStructure.py} +7 -4
  7. armodel/models/{bsw_module_template.py → M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py} +115 -140
  8. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswImplementation.py +21 -0
  9. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +52 -0
  10. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +78 -0
  11. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/__init__.py +1 -0
  12. armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +81 -0
  13. armodel/models/{m2/autosar_templates/common_structure/implementation_data_types.py → M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py} +9 -5
  14. armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +108 -0
  15. armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +96 -0
  16. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +72 -0
  17. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +22 -0
  18. armodel/models/{service_needs.py → M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py} +7 -7
  19. armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +36 -0
  20. armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/ModeDeclarationGroup.py +27 -0
  21. armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/__init__.py +1 -0
  22. armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +9 -0
  23. armodel/models/{m2/autosar_templates/common_structure → M2/AUTOSARTemplates/CommonStructure}/__init__.py +5 -2
  24. armodel/models/{m2/autosar_templates/generic_structure/abstract_structure.py → M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py} +25 -2
  25. armodel/models/{m2/autosar_templates/generic_structure/ar_package.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py} +29 -21
  26. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ArObject.py +16 -0
  27. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ElementCollection.py +1 -0
  28. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/EngineeringObject.py +55 -0
  29. armodel/models/{general_structure.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py} +37 -149
  30. armodel/models/{ar_object.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py} +163 -70
  31. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/__init__.py +1 -0
  32. armodel/models/M2/AUTOSARTemplates/GenericStructure/__init__.py +1 -0
  33. armodel/models/{m2/autosar_templates/sw_component_template/communication.py → M2/AUTOSARTemplates/SWComponentTemplate/Communication.py} +22 -5
  34. armodel/models/{m2/autosar_templates/sw_component_template/components/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Components/InstanceRefs.py} +2 -2
  35. armodel/models/{m2/autosar_templates/sw_component_template/components → M2/AUTOSARTemplates/SWComponentTemplate/Components}/__init__.py +10 -8
  36. armodel/models/{m2/autosar_templates/sw_component_template/composition/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Composition/InstanceRefs.py} +2 -2
  37. armodel/models/{m2/autosar_templates/sw_component_template/composition → M2/AUTOSARTemplates/SWComponentTemplate/Composition}/__init__.py +5 -5
  38. armodel/models/{m2/autosar_templates/sw_component_template/data_type/data_prototypes.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py} +25 -7
  39. armodel/models/{datatype.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py} +16 -73
  40. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/__init__.py +1 -0
  41. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +177 -0
  42. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcImplementation.py +11 -0
  43. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AccessCount.py} +2 -2
  44. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py} +7 -5
  45. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/IncludedDataTypes.py +24 -0
  46. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py} +3 -3
  47. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py} +3 -3
  48. armodel/models/{per_instance_memory.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/PerInstanceMemory.py} +5 -6
  49. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServerCall.py} +3 -3
  50. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +23 -0
  51. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/trigger.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/Trigger.py} +2 -2
  52. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior}/__init__.py +9 -10
  53. armodel/models/{m2/autosar_templates/sw_component_template → M2/AUTOSARTemplates/SWComponentTemplate}/port_interface/__init__.py +10 -6
  54. armodel/models/{m2/autosar_templates/sw_component_template → M2/AUTOSARTemplates/SWComponentTemplate}/port_interface/instance_refs.py +2 -2
  55. armodel/models/{m2/autosar_templates/system_template/instance_refs.py → M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py} +2 -2
  56. armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/__init__.py +4 -2
  57. armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/data_mapping.py +2 -2
  58. armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/network_management.py +7 -3
  59. armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/transport_protocols.py +1 -1
  60. armodel/models/{m2/autosar_templates → M2/AUTOSARTemplates}/ecuc_description_template.py +10 -6
  61. armodel/models/M2/MSR/AsamHdo/AdminData.py +21 -0
  62. armodel/models/M2/MSR/AsamHdo/BaseTypes.py +77 -0
  63. armodel/models/{m2_msr.py → M2/MSR/AsamHdo/ComputationMethod.py} +44 -28
  64. armodel/models/{global_constraints.py → M2/MSR/AsamHdo/Constraints/GlobalConstraints.py} +7 -4
  65. armodel/models/M2/MSR/AsamHdo/Constraints/__init__.py +1 -0
  66. armodel/models/M2/MSR/AsamHdo/SpecialData.py +63 -0
  67. armodel/models/{m2/msr/asam_hdo/units.py → M2/MSR/AsamHdo/Units.py} +6 -3
  68. armodel/models/M2/MSR/AsamHdo/__init__.py +1 -0
  69. armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +30 -0
  70. armodel/models/M2/MSR/CalibrationData/__init__.py +1 -0
  71. armodel/models/{m2/msr/data_dictionary/auxillary_objects.py → M2/MSR/DataDictionary/AuxillaryObjects.py} +4 -2
  72. armodel/models/M2/MSR/DataDictionary/Axis.py +145 -0
  73. armodel/models/M2/MSR/DataDictionary/CalibrationParameter.py +37 -0
  74. armodel/models/{m2/msr/data_dictionary/data_def_properties.py → M2/MSR/DataDictionary/DataDefProperties.py} +19 -9
  75. armodel/models/{record_layout.py → M2/MSR/DataDictionary/RecordLayout.py} +26 -25
  76. armodel/models/M2/MSR/DataDictionary/__init__.py +1 -0
  77. armodel/models/{annotation.py → M2/MSR/Documentation/Annotation.py} +8 -8
  78. armodel/models/{m2/msr/documentation/block_elements.py → M2/MSR/Documentation/BlockElements.py} +2 -2
  79. armodel/models/M2/MSR/Documentation/TextModel/LanguageDataModel.py +17 -0
  80. armodel/models/{multilanguage_data.py → M2/MSR/Documentation/TextModel/MultilanguageData.py} +21 -30
  81. armodel/models/M2/MSR/Documentation/TextModel/__init__.py +2 -0
  82. armodel/models/M2/MSR/Documentation/__init__.py +3 -0
  83. armodel/models/M2/MSR/__init__.py +1 -0
  84. armodel/models/M2/__init__.py +1 -0
  85. armodel/models/__init__.py +6 -23
  86. armodel/models/fibex/can_communication.py +3 -2
  87. armodel/models/fibex/fibex_4_multiplatform.py +5 -3
  88. armodel/models/fibex/fibex_core/core_communication.py +9 -3
  89. armodel/models/fibex/fibex_core/core_topology.py +7 -3
  90. armodel/models/fibex/lin_communication.py +5 -1
  91. armodel/models/rpt_scenario.py +2 -2
  92. armodel/models/sw_component.py +19 -14
  93. armodel/models/timing.py +3 -3
  94. armodel/parser/abstract_arxml_parser.py +8 -4
  95. armodel/parser/arxml_parser.py +85 -62
  96. armodel/parser/connector_xlsx_parser.py +5 -3
  97. armodel/report/connector_xls_report.py +1 -1
  98. armodel/tests/test_armodel/models/test_ar_object.py +2 -1
  99. armodel/tests/test_armodel/models/test_ar_package.py +20 -8
  100. armodel/tests/test_armodel/models/test_ar_ref.py +7 -5
  101. armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -1
  102. armodel/tests/test_armodel/models/test_common_structure.py +11 -5
  103. armodel/tests/test_armodel/models/test_data_dictionary.py +2 -2
  104. armodel/tests/test_armodel/models/test_data_prototype.py +7 -3
  105. armodel/tests/test_armodel/models/test_datatype.py +21 -7
  106. armodel/tests/test_armodel/models/test_general_structure.py +12 -2
  107. armodel/tests/test_armodel/models/test_implementation.py +3 -2
  108. armodel/tests/test_armodel/models/test_m2_msr.py +4 -2
  109. armodel/tests/test_armodel/models/test_port_interface.py +16 -6
  110. armodel/tests/test_armodel/models/test_port_prototype.py +1 -1
  111. armodel/tests/test_armodel/parser/test_parse_bswmd.py +1 -1
  112. armodel/tests/test_armodel/parser/test_sw_components.py +2 -2
  113. armodel/tests/test_armodel/parser/test_system.py +30 -0
  114. armodel/writer/abstract_arxml_writer.py +5 -2
  115. armodel/writer/arxml_writer.py +100 -67
  116. {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/METADATA +366 -356
  117. armodel-1.6.3.dist-info/RECORD +148 -0
  118. {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/WHEEL +1 -1
  119. armodel/lib/data_analyzer.py +0 -34
  120. armodel/models/ar_package.py +0 -641
  121. armodel/models/ar_ref.py +0 -25
  122. armodel/models/calibration.py +0 -119
  123. armodel/models/common_structure.py +0 -272
  124. armodel/models/communication.py +0 -17
  125. armodel/models/data_def_properties.py +0 -16
  126. armodel/models/data_dictionary.py +0 -59
  127. armodel/models/data_prototype.py +0 -103
  128. armodel/models/ecuc_parameter_def_template.py +0 -0
  129. armodel/models/end_to_end_protection.py +0 -67
  130. armodel/models/fibex/fibex_core.py +0 -341
  131. armodel/models/fibex/lin_topology.py +0 -7
  132. armodel/models/implementation.py +0 -135
  133. armodel/models/internal_behavior.py +0 -63
  134. armodel/models/m2/autosar_templates/common_structure/constants.py +0 -0
  135. armodel/models/m2/autosar_templates/common_structure/implementation.py +0 -21
  136. armodel/models/m2/autosar_templates/generic_structure/__init__.py +0 -0
  137. armodel/models/m2/autosar_templates/sw_component_template/__init__.py +0 -0
  138. armodel/models/m2/autosar_templates/sw_component_template/data_type/__init__.py +0 -0
  139. armodel/models/m2/autosar_templates/sw_component_template/port_interface.py +0 -236
  140. armodel/models/m2/msr/__init__.py +0 -0
  141. armodel/models/m2/msr/asam_hdo/__init__.py +0 -0
  142. armodel/models/m2/msr/data_dictionary/__init__.py +0 -0
  143. armodel/models/m2/msr/documentation/__init__.py +0 -0
  144. armodel/models/mode_declaration.py +0 -8
  145. armodel/models/port_interface.py +0 -165
  146. armodel/models/port_prototype.py +0 -6
  147. armodel/models/service_mapping.py +0 -11
  148. armodel/models/system_template/__init__.py +0 -0
  149. armodel/models/system_template/network_management.py +0 -7
  150. armodel/models/system_template/transport_protocols.py +0 -7
  151. armodel/models/unit.py +0 -14
  152. armodel-1.6.2.dist-info/RECORD +0 -142
  153. /armodel/models/{m2 → M2/AUTOSARTemplates/SWComponentTemplate}/__init__.py +0 -0
  154. /armodel/models/{m2/autosar_templates → M2/AUTOSARTemplates}/__init__.py +0 -0
  155. {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/LICENSE +0 -0
  156. {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/entry_points.txt +0 -0
  157. {armodel-1.6.2.dist-info → armodel-1.6.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,81 @@
1
+ from abc import ABCMeta
2
+ from typing import List
3
+ from .ResourceConsumption import ResourceConsumption
4
+ from ..GenericStructure.GeneralTemplateClasses.EngineeringObject import AutosarEngineeringObject
5
+ from ..GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable, PackageableElement, Referrable
6
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARNumerical, RefType, ARLiteral
7
+ from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
8
+
9
+
10
+ class ImplementationProps(Referrable, metaclass = ABCMeta):
11
+ def __init__(self, parent: ARObject, short_name: str):
12
+ if type(self) == ImplementationProps:
13
+ raise NotImplementedError("ImplementationProps is an abstract class.")
14
+
15
+ super().__init__(parent, short_name)
16
+
17
+ self.symbol = None # type: ARLiteral
18
+
19
+ def getSymbol(self):
20
+ return self.symbol
21
+
22
+ def setSymbol(self, value):
23
+ self.symbol = value
24
+ return self
25
+
26
+
27
+ class Code(Identifiable):
28
+ def __init__(self, parent: ARObject, short_name: str):
29
+ super().__init__(parent, short_name)
30
+
31
+ self._artifactDescriptors = [] # type: List[AutosarEngineeringObject]
32
+ self.callbackHeaderRefs = [] # type: List[RefType]
33
+
34
+ def addArtifactDescriptor(self, desc: AutosarEngineeringObject):
35
+ self._artifactDescriptors.append(desc)
36
+
37
+ def getArtifactDescriptors(self, category:str = "") -> List[AutosarEngineeringObject]:
38
+ if (category == ""):
39
+ return self._artifactDescriptors
40
+ else:
41
+ return list(filter(lambda a: a.getCategory().getText() == category, self._artifactDescriptors))
42
+
43
+
44
+ class Implementation(PackageableElement, metaclass=ABCMeta):
45
+ def __init__(self, parent: ARObject, short_name: str) -> None:
46
+ if type(self) == Implementation:
47
+ raise NotImplementedError("Implementation is an abstract class.")
48
+
49
+ super().__init__(parent, short_name)
50
+
51
+ self.build_action_manifest_ref = None # type: RefType
52
+ self.compilers = None
53
+ self.generated_artifacts = None
54
+ self.hw_element_refs = [] # type: List[RefType]
55
+ self.linker = []
56
+ self.mc_support = None
57
+ self.programming_language = None # type: ARLiteral
58
+ self.required_artifacts = []
59
+ self.required_generator_tools = []
60
+ self.resource_consumption = None # type: ResourceConsumption
61
+ self.sw_version = "" # type: ARLiteral
62
+ self.swc_bsw_mapping_ref = None # type: RefType
63
+ self.used_code_generator = None # type: ARLiteral
64
+ self.vendor_id = 0 # type: ARNumerical
65
+
66
+ def createCodeDescriptor(self, short_name: str) -> Code:
67
+ if (short_name not in self.elements):
68
+ sw_component = Code(self, short_name)
69
+ self.elements[short_name] = sw_component
70
+ return self.elements[short_name]
71
+
72
+ def getCodeDescriptors(self)-> List[Code]:
73
+ return list(filter(lambda a : isinstance(a, Code), self.elements.values()))
74
+
75
+ def setResourceConsumption(self, consumption: ResourceConsumption):
76
+ self.elements[consumption.short_name] = consumption
77
+ self.resource_consumption = consumption
78
+ return self
79
+
80
+ def getResourceConsumption(self) -> ResourceConsumption:
81
+ return self.resource_consumption
@@ -1,11 +1,15 @@
1
1
  from abc import ABCMeta
2
2
  from typing import List
3
3
 
4
- from ...msr.data_dictionary.data_def_properties import SwDataDefProps
5
- from ....general_structure import Identifiable
6
- from ....ar_object import ARBoolean, ARLiteral, ARNumerical, ARObject
7
- from ....datatype import AutosarDataType
8
- from ..sw_component_template.components import SymbolProps
4
+ from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
5
+
6
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical
7
+
8
+ from ...MSR.DataDictionary.DataDefProperties import SwDataDefProps
9
+ from ..GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
10
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
11
+ from ..SWComponentTemplate.Datatype.Datatypes import AutosarDataType
12
+ from ..SWComponentTemplate.Components import SymbolProps
9
13
 
10
14
  class AbstractImplementationDataTypeElement(Identifiable):
11
15
  def __init__(self, parent, short_name: str):
@@ -0,0 +1,108 @@
1
+ from abc import ABCMeta
2
+ from enum import Enum
3
+ from typing import List
4
+
5
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
6
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
7
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, RefType
8
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ParameterDataPrototype
9
+
10
+ class ReentrancyLevelEnum(Enum):
11
+
12
+ multicoreReentrant = "multicoreReentrant"
13
+ nonReentrant = "nonReentrant"
14
+ singleCoreReentrant = "singleCoreReentrant"
15
+
16
+
17
+ class ExclusiveArea(Identifiable):
18
+ def __init__(self, parent: ARObject, short_name: str):
19
+ super().__init__(parent, short_name)
20
+
21
+
22
+ class ExecutableEntity(Identifiable, metaclass=ABCMeta):
23
+ def __init__(self, parent: ARObject, short_name: str):
24
+ if type(self) == ExecutableEntity:
25
+ raise NotImplementedError("ExecutableEntity is an abstract class.")
26
+
27
+ super().__init__(parent, short_name)
28
+
29
+ self.activationReason = None # *
30
+ self.minimumStartInterval = None # type: ARFloat
31
+ self.reentrancyLevel = None #
32
+ self.canEnterExclusiveAreaRefs = [] # type: List[RefType]
33
+ self.swAddrMethodRef = None # type: RefType
34
+
35
+ def getActivationReason(self):
36
+ return self.activationReason
37
+
38
+ def setActivationReason(self, value):
39
+ self.activationReason = value
40
+ return self
41
+
42
+ def getMinimumStartInterval(self):
43
+ return self.minimumStartInterval
44
+
45
+ def setMinimumStartInterval(self, value):
46
+ self.minimumStartInterval = value
47
+ return self
48
+
49
+ def getReentrancyLevel(self):
50
+ return self.reentrancyLevel
51
+
52
+ def setReentrancyLevel(self, value):
53
+ self.reentrancyLevel = value
54
+ return self
55
+
56
+ def getSwAddrMethodRef(self):
57
+ return self.swAddrMethodRef
58
+
59
+ def setSwAddrMethodRef(self, value):
60
+ self.swAddrMethodRef = value
61
+ return self
62
+
63
+ @property
64
+ def minimumStartIntervalMs(self) -> int:
65
+ if self.minimumStartInterval is not None:
66
+ return int(self.minimumStartInterval.getValue() * 1000)
67
+ return None
68
+
69
+ def addCanEnterExclusiveAreaRef(self, ref: RefType):
70
+ self.canEnterExclusiveAreaRefs.append(ref)
71
+
72
+ def getCanEnterExclusiveAreaRefs(self):
73
+ return self.canEnterExclusiveAreaRefs
74
+
75
+
76
+ class InternalBehavior(Identifiable, metaclass=ABCMeta):
77
+ def __init__(self, parent: ARObject, short_name: str):
78
+ if type(self) == InternalBehavior:
79
+ raise NotImplementedError("InternalBehavior is an abstract class.")
80
+ super().__init__(parent, short_name)
81
+
82
+ self.data_type_mapping_refs = [] # type: List[RefType]
83
+ self.constant_memories = [] # type: List[ParameterDataPrototype]
84
+
85
+ def addDataTypeMappingRef(self, ref: RefType):
86
+ self.data_type_mapping_refs.append(ref)
87
+
88
+ def getDataTypeMappingRefs(self) -> List[RefType]:
89
+ return self.data_type_mapping_refs
90
+
91
+ def createExclusiveArea(self, short_name: str) -> ExclusiveArea:
92
+ if (short_name not in self.elements):
93
+ event = ExclusiveArea(self, short_name)
94
+ self.elements[short_name] = event
95
+ return self.elements[short_name]
96
+
97
+ def getExclusiveAreas(self) -> List[ExclusiveArea]:
98
+ return list(filter(lambda c: isinstance(c, ExclusiveArea), self.elements.values()))
99
+
100
+ def createConstantMemory(self, short_name: str) -> ParameterDataPrototype:
101
+ if (short_name not in self.elements):
102
+ prototype = ParameterDataPrototype(self, short_name)
103
+ self.elements[short_name] = prototype
104
+ self.constant_memories.append(prototype)
105
+ return self.elements[short_name]
106
+
107
+ def getConstantMemorys(self) -> List[ParameterDataPrototype]:
108
+ return self.constant_memories
@@ -0,0 +1,96 @@
1
+ from typing import List
2
+ from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
3
+ from ..GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
4
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARNumerical, RefType, TRefType
5
+
6
+ class ModeDeclaration(Identifiable):
7
+ def __init__(self, parent: ARObject, short_name: str):
8
+ super().__init__(parent, short_name)
9
+
10
+ self.value = None # type: ARNumerical
11
+
12
+ def setValue(self, value):
13
+ self.value = value
14
+ return self
15
+
16
+ def getValue(self) -> ARNumerical:
17
+ return self.value
18
+
19
+
20
+ class ModeRequestTypeMap(ARObject):
21
+ def __init__(self):
22
+ super().__init__()
23
+
24
+ self.implementation_data_type_ref = None # type: RefType
25
+ self.mode_group_ref = None # type: RefType
26
+
27
+
28
+ class ModeDeclarationGroup(Identifiable):
29
+ def __init__(self, parent: ARObject, short_name: str):
30
+ super().__init__(parent, short_name)
31
+
32
+ self._initial_mode_ref = None # type: RefType
33
+ self._on_transition_value = None # type: ARNumerical
34
+
35
+ def createModeDeclaration(self, short_name: str) -> ModeDeclaration:
36
+ if (short_name not in self.elements):
37
+ spec = ModeDeclaration(self, short_name)
38
+ self.elements[short_name] = spec
39
+ return self.elements[short_name]
40
+
41
+ def getModeDeclarations(self) -> List[ModeDeclaration]:
42
+ return list(sorted(filter(lambda a: isinstance(a, ModeDeclaration), self.elements.values()), key= lambda o:o.short_name))
43
+
44
+ def setInitialModeRef(self, ref: RefType):
45
+ self._initial_mode_ref = ref
46
+ return self
47
+
48
+ def getInitialModeRef(self) -> RefType:
49
+ return self._initial_mode_ref
50
+
51
+ def setOnTransitionValue(self, value):
52
+ if isinstance(value, int):
53
+ value = ARNumerical()
54
+ value.setValue(value)
55
+ self._on_transition_value = value
56
+ return self
57
+
58
+ def getOnTransitionValue(self) -> ARNumerical:
59
+ return self._on_transition_value
60
+
61
+
62
+ class ModeDeclarationGroupPrototype(Identifiable):
63
+
64
+ """
65
+ The ModeDeclarationGroupPrototype specifies a set of Modes (ModeDeclarationGroup) which is provided or required in the given context.
66
+ """
67
+
68
+ def __init__(self, parent: ARObject, short_name: str):
69
+ super().__init__(parent, short_name)
70
+
71
+ self._swCalibrationAccess = None # type: str
72
+ self.typeTRef = None # type: TRefType
73
+
74
+ @property
75
+ def sw_calibration_access(self):
76
+ return self._swCalibrationAccess
77
+
78
+ @sw_calibration_access.setter
79
+ def sw_calibration_access(self, value):
80
+ if (value not in ("notAccessible", "readOnly", "readWrite")):
81
+ raise ValueError("Invalid SwCalibrationAccess <%s> of ModeDeclarationGroupPrototype <%s>" % (value, self.short_name))
82
+ self._swCalibrationAccess = value
83
+
84
+ def getSwCalibrationAccess(self):
85
+ return self.swCalibrationAccess
86
+
87
+ def setSwCalibrationAccess(self, value):
88
+ self.swCalibrationAccess = value
89
+ return self
90
+
91
+ def getTypeTRef(self):
92
+ return self.typeTRef
93
+
94
+ def setTypeTRef(self, value):
95
+ self.typeTRef = value
96
+ return self
@@ -0,0 +1,72 @@
1
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
2
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
3
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, RefType
4
+
5
+
6
+ import re
7
+ from typing import List
8
+
9
+
10
+ class MemorySection(Identifiable):
11
+ def __init__(self, parent: ARObject, short_name: str):
12
+ super().__init__(parent, short_name)
13
+
14
+ self._alignment = None # type: ARLiteral
15
+ self.size = None
16
+ self.options = [] # type: List[ARLiteral]
17
+ self.swAddrMethodRef = None # type: RefType
18
+ self.symbol = None # type: ARLiteral
19
+
20
+ def getAlignment(self):
21
+ return self.alignment
22
+
23
+ def setAlignment(self, value):
24
+ self.alignment = value
25
+ return self
26
+
27
+ def getSize(self):
28
+ return self.size
29
+
30
+ def setSize(self, value):
31
+ self.size = value
32
+ return self
33
+
34
+ def getSwAddrMethodRef(self):
35
+ return self.swAddrMethodRef
36
+
37
+ def setSwAddrMethodRef(self, value):
38
+ self.swAddrMethodRef = value
39
+ return self
40
+
41
+ def getSymbol(self):
42
+ return self.symbol
43
+
44
+ def setSymbol(self, value):
45
+ self.symbol = value
46
+ return self
47
+
48
+ @property
49
+ def alignment(self) -> ARLiteral:
50
+ return self._alignment
51
+
52
+ @alignment.setter
53
+ def alignment(self, value: ARLiteral):
54
+ if value is not None and value.getValue() != "":
55
+ match = False
56
+ if value.getValue() in ("UNKNOWN", "UNSPECIFIED", "BOOLEAN", "PTR"):
57
+ self._alignment = value
58
+ match = True
59
+ else:
60
+ m = re.match(r'^\d+', value.value)
61
+ if m:
62
+ self._alignment = value
63
+ match = True
64
+
65
+ if not match:
66
+ raise ValueError("Invalid alignment <%s> of memory section <%s>" % (value, self.getShortName()))
67
+
68
+ def addOption(self, option: ARLiteral):
69
+ self.options.append(option)
70
+
71
+ def getOptions(self) -> List[ARLiteral]:
72
+ return self.options
@@ -0,0 +1,22 @@
1
+ from . import *
2
+
3
+ from .MemorySectionUsage import MemorySection
4
+ from ...GenericStructure.GeneralTemplateClasses.ArObject import ARObject
5
+ from ...GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
6
+ from typing import List
7
+
8
+ class ResourceConsumption(Identifiable):
9
+ def __init__(self, parent: ARObject, short_name: str):
10
+ super().__init__(parent, short_name)
11
+
12
+ def createMemorySection(self, short_name: str) -> MemorySection:
13
+ if (short_name not in self.elements):
14
+ entry = MemorySection(self, short_name)
15
+ self.elements[short_name] = entry
16
+ return self.elements[short_name]
17
+
18
+ def getMemorySections(self) -> List[MemorySection]:
19
+ return list(filter(lambda a : isinstance(a, MemorySection), self.elements.values()))
20
+
21
+ def getMemorySection(self, short_name: str) -> MemorySection:
22
+ return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements.values()), None)
@@ -1,10 +1,8 @@
1
-
2
1
  from abc import ABCMeta
3
-
4
- from .m2.autosar_templates.sw_component_template.swc_internal_behavior.instance_refs_usage import AutosarParameterRef, AutosarVariableRef
5
- from .general_structure import Identifiable
6
- from .ar_ref import RefType
7
- from .ar_object import ARBoolean, ARLiteral, ARObject
2
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
3
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
4
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean, ARLiteral, RefType
5
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.SwcInternalBehavior.InstanceRefsUsage import AutosarParameterRef, AutosarVariableRef
8
6
 
9
7
 
10
8
  class RoleBasedDataAssignment(ARObject):
@@ -16,13 +14,15 @@ class RoleBasedDataAssignment(ARObject):
16
14
  self.used_parameter_element = None # type: AutosarParameterRef
17
15
  self.used_pim_ref = None # type: RefType
18
16
 
17
+
19
18
  class ServiceNeeds(Identifiable, metaclass = ABCMeta):
20
19
  def __init__(self, parent: ARObject, short_name: str):
21
20
  if type(self) == ServiceNeeds:
22
21
  raise NotImplementedError("ServiceNeeds is an abstract class.")
23
-
22
+
24
23
  super().__init__(parent, short_name)
25
24
 
25
+
26
26
  class NvBlockNeeds(ServiceNeeds):
27
27
  def __init__(self, parent: ARObject, short_name: str):
28
28
  super().__init__(parent, short_name)
@@ -0,0 +1,36 @@
1
+ from typing import List
2
+ from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
3
+ from ..GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
4
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
5
+
6
+
7
+ class SwcBswRunnableMapping(ARObject):
8
+ def __init__(self):
9
+ '''
10
+ Maps a BswModuleEntity to a RunnableEntity if it is implemented as part of a BSW
11
+ module (in the case of an AUTOSAR Service, a Complex Driver or an ECU
12
+ Abstraction). The mapping can be used by a tool to find relevant information on the
13
+ behavior, e.g. whether the bswEntity shall be running in interrupt context.
14
+
15
+ '''
16
+ super().__init__()
17
+
18
+ self.bswEntityRef = None # type: RefType
19
+ self.swcRunnableRef = None # type: RefType
20
+
21
+
22
+ class SwcBswMapping(Identifiable):
23
+ def __init__(self, parent: ARObject, short_name: str):
24
+ super().__init__(parent, short_name)
25
+
26
+ self.bswBehaviorRef = None # type: RefType
27
+ self._runnableMappings = []
28
+ self.swcBehaviorRef = None # type: RefType
29
+ self.synchronizedModeGroups = []
30
+ self.synchronizedTriggers = []
31
+
32
+ def addRunnableMapping(self, mapping: SwcBswRunnableMapping):
33
+ self._runnableMappings.append(mapping)
34
+
35
+ def getRunnableMappings(self) -> List[SwcBswRunnableMapping]:
36
+ return self._runnableMappings
@@ -0,0 +1,27 @@
1
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
2
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, RefType
3
+
4
+
5
+ from typing import List
6
+
7
+
8
+ class IncludedModeDeclarationGroupSet(ARObject):
9
+ def __init__(self):
10
+ super().__init__()
11
+
12
+ self.mode_declaration_group_refs = [] # type: List[RefType]
13
+ self.prefix = None # type: ARLiteral
14
+
15
+ def addModeDeclarationGroupRef(self, ref: RefType):
16
+ self.mode_declaration_group_refs.append(ref)
17
+ return self
18
+
19
+ def getModeDeclarationGroupRefs(self) -> List[RefType]:
20
+ return self.mode_declaration_group_refs
21
+
22
+ def setPrefix(self, prefix: str):
23
+ self.prefix = prefix
24
+ return self
25
+
26
+ def getPrefix(self) -> ARLiteral:
27
+ return self.prefix
@@ -0,0 +1,9 @@
1
+ from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
2
+ from ..GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
3
+
4
+ class Trigger(Identifiable):
5
+ def __init__(self, parent: ARObject, short_name: str):
6
+ super().__init__(parent, short_name)
7
+
8
+ self.swImplPolicy = None # type: str
9
+ self.triggerPeriod = None # type: float
@@ -1,8 +1,11 @@
1
1
  from abc import ABCMeta
2
2
  from typing import List
3
3
 
4
- from armodel.models.general_structure import ARElement
5
- from ....ar_object import ARLiteral, ARNumerical, ARObject
4
+ from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
5
+
6
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARNumerical
7
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
8
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral
6
9
 
7
10
  class ValueSpecification(ARObject, metaclass = ABCMeta):
8
11
  '''
@@ -2,9 +2,10 @@
2
2
  from abc import ABCMeta
3
3
  from typing import List
4
4
 
5
- from ....ar_ref import RefType
6
- from ....ar_object import ARObject
5
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Identifiable
7
6
 
7
+ from .GeneralTemplateClasses.PrimitiveTypes import RefType
8
+ from .GeneralTemplateClasses.ArObject import ARObject
8
9
 
9
10
  class AtpInstanceRef(ARObject, metaclass = ABCMeta):
10
11
  def __init__(self):
@@ -67,3 +68,25 @@ class AnyInstanceRef(ARObject):
67
68
  def setTargetRef(self, value:RefType):
68
69
  self.targetRef = value
69
70
  return self
71
+
72
+
73
+ class AtpFeature(Identifiable, metaclass = ABCMeta):
74
+ def __init__(self, parent: ARObject, short_name: str):
75
+ if type(self) == AtpFeature:
76
+ raise NotImplementedError("AtpFeature is an abstract class.")
77
+ super().__init__(parent, short_name)
78
+
79
+
80
+ class AtpStructureElement(AtpFeature, metaclass=ABCMeta):
81
+ def __init__(self, parent: ARObject, short_name: str):
82
+ if type(self) == AtpFeature:
83
+ raise NotImplementedError("AtpStructureElement is an abstract class.")
84
+ super().__init__(parent, short_name)
85
+
86
+
87
+ class AtpType(ARElement, metaclass=ABCMeta):
88
+ def __init__(self, parent: ARObject, short_name: str):
89
+ if type(self) == AtpType:
90
+ raise NotImplementedError("AtpType is an abstract class.")
91
+
92
+ super().__init__(parent, short_name)
@@ -1,28 +1,36 @@
1
- from armodel.models.bsw_module_template import BswModuleDescription, BswModuleEntry
2
- from armodel.models.common_structure import ModeDeclarationGroup
3
- from armodel.models.datatype import ApplicationArrayDataType, ApplicationDataType, ApplicationPrimitiveDataType, ApplicationRecordDataType, DataTypeMappingSet, SwBaseType
4
- from armodel.models.end_to_end_protection import EndToEndProtectionSet
1
+ from armodel.models.M2.AUTOSARTemplates.BswModuleTemplate.BswOverview import BswModuleDescription
2
+ from armodel.models.M2.AUTOSARTemplates.CommonStructure.Implementation import Implementation
3
+ from armodel.models.M2.AUTOSARTemplates.BswModuleTemplate.BswImplementation import BswImplementation
4
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
5
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import CollectableElement
6
+ from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable, Referrable
7
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationArrayDataType, ApplicationDataType, ApplicationPrimitiveDataType, ApplicationRecordDataType
8
+ from armodel.models.M2.MSR.AsamHdo.BaseTypes import SwBaseType
9
+ from armodel.models.M2.AUTOSARTemplates.BswModuleTemplate.BswInterfaces import BswModuleEntry
10
+ from armodel.models.M2.AUTOSARTemplates.CommonStructure.ModeDeclaration import ModeDeclarationGroup
11
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import DataTypeMappingSet
12
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.EndToEndProtection import EndToEndProtectionSet
5
13
  from armodel.models.fibex.can_communication import CanFrame
6
14
  from armodel.models.fibex.fibex_4_multiplatform import Gateway
7
15
  from armodel.models.fibex.fibex_core.core_communication import DcmIPdu, ISignal, ISignalGroup, ISignalIPdu, ISignalIPduGroup, NPdu, NmPdu, SecuredIPdu, SystemSignal, SystemSignalGroup
8
16
  from armodel.models.fibex.fibex_core.core_topology import CanCluster, EcuInstance, LinCluster
9
17
  from armodel.models.fibex.lin_communication import LinUnconditionalFrame
10
- from armodel.models.general_structure import ARObject, CollectableElement, Identifiable, Referrable, SwcBswMapping
11
- from armodel.models.global_constraints import DataConstr
12
- from armodel.models.implementation import BswImplementation, Implementation, SwcImplementation
13
- from armodel.models.m2.autosar_templates.common_structure import ConstantSpecification
14
- from armodel.models.m2.autosar_templates.common_structure.implementation_data_types import ImplementationDataType
15
- from armodel.models.m2.autosar_templates.ecuc_description_template import EcucModuleConfigurationValues, EcucValueCollection
16
- from armodel.models.m2.autosar_templates.sw_component_template.components import SwComponentType
17
- from armodel.models.m2.autosar_templates.sw_component_template.composition import CompositionSwComponentType
18
- from armodel.models.m2.autosar_templates.sw_component_template.port_interface import ClientServerInterface, ModeSwitchInterface, ParameterInterface, SenderReceiverInterface, TriggerInterface
19
- from armodel.models.m2.autosar_templates.system_template import System
20
- from armodel.models.m2.autosar_templates.system_template.network_management import NmConfig
21
- from armodel.models.m2.autosar_templates.system_template.transport_protocols import CanTpConfig
22
- from armodel.models.m2.msr.asam_hdo.units import PhysicalDimension, Unit
23
- from armodel.models.m2.msr.data_dictionary.auxillary_objects import SwAddrMethod
24
- from armodel.models.m2_msr import CompuMethod
25
- from armodel.models.record_layout import SwRecordLayout
18
+ from armodel.models.M2.AUTOSARTemplates.CommonStructure.SwcBswMapping import SwcBswMapping
19
+ from armodel.models.M2.MSR.AsamHdo.Constraints.GlobalConstraints import DataConstr
20
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.SwcImplementation import SwcImplementation
21
+ from armodel.models.M2.AUTOSARTemplates.CommonStructure import ConstantSpecification
22
+ from armodel.models.M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
23
+ from armodel.models.M2.AUTOSARTemplates.ecuc_description_template import EcucModuleConfigurationValues, EcucValueCollection
24
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.Components import SwComponentType
25
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.Composition import CompositionSwComponentType
26
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.port_interface import ClientServerInterface, ModeSwitchInterface, ParameterInterface, SenderReceiverInterface, TriggerInterface
27
+ from armodel.models.M2.AUTOSARTemplates.SystemTemplate import System
28
+ from armodel.models.M2.AUTOSARTemplates.SystemTemplate.network_management import NmConfig
29
+ from armodel.models.M2.AUTOSARTemplates.SystemTemplate.transport_protocols import CanTpConfig
30
+ from armodel.models.M2.MSR.AsamHdo.Units import PhysicalDimension, Unit
31
+ from armodel.models.M2.MSR.DataDictionary.AuxillaryObjects import SwAddrMethod
32
+ from armodel.models.M2.MSR.AsamHdo.ComputationMethod import CompuMethod
33
+ from armodel.models.M2.MSR.DataDictionary.RecordLayout import SwRecordLayout
26
34
  from armodel.models.sw_component import ApplicationSwComponentType, AtomicSwComponentType, ComplexDeviceDriverSwComponentType, EcuAbstractionSwComponentType, SensorActuatorSwComponentType, ServiceSwComponentType
27
35
  from armodel.models.timing import SwcTiming
28
36
 
@@ -525,4 +533,4 @@ class ARPackage(Identifiable, CollectableElement):
525
533
  return list(sorted(filter(lambda a : isinstance(a, ISignalIPdu), self.elements.values()), key = lambda a: a.short_name))
526
534
 
527
535
  def getSystems(self) -> List[System]:
528
- return list(sorted(filter(lambda a : isinstance(a, System), self.elements.values()), key = lambda a: a.short_name))
536
+ return list(sorted(filter(lambda a : isinstance(a, System), self.elements.values()), key = lambda a: a.short_name))
@@ -0,0 +1,16 @@
1
+ from abc import ABCMeta
2
+ from typing import Dict
3
+
4
+ class ARObject(metaclass = ABCMeta):
5
+ def __init__(self):
6
+ if type(self) == ARObject:
7
+ raise NotImplementedError("ARObject is an abstract class.")
8
+
9
+ self.parent = None # type: ARObject
10
+ self.checksum = None # type: str
11
+
12
+ self.timestamp = None # type: str
13
+ self.uuid = None # type: str
14
+
15
+ def getTagName(self, tag: str, nsmap: Dict) -> str:
16
+ return tag.replace("{%s}" % nsmap["xmlns"], "")