armodel 1.6.2__py3-none-any.whl → 1.6.4__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 (170) hide show
  1. armodel/cli/arxml_dump_cli.py +13 -10
  2. armodel/cli/arxml_format_cli.py +1 -2
  3. armodel/cli/connector2xlsx_cli.py +2 -3
  4. armodel/cli/connector_update_cli.py +2 -5
  5. armodel/cli/memory_section_cli.py +2 -2
  6. armodel/cli/swc_list_cli.py +2 -3
  7. armodel/cli/system_signal_cli.py +2 -2
  8. armodel/lib/sw_component.py +3 -3
  9. armodel/lib/system_signal.py +3 -5
  10. armodel/models/{m2/autosar_templates/autosar_top_level_structure.py → M2/AUTOSARTemplates/AutosarTopLevelStructure.py} +5 -7
  11. armodel/models/{bsw_module_template.py → M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py} +113 -140
  12. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswImplementation.py +60 -0
  13. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +52 -0
  14. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +77 -0
  15. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/__init__.py +4 -0
  16. armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +238 -0
  17. armodel/models/{m2/autosar_templates/common_structure/implementation_data_types.py → M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py} +7 -6
  18. armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +119 -0
  19. armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +96 -0
  20. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +69 -0
  21. armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +20 -0
  22. armodel/models/{service_needs.py → M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py} +13 -9
  23. armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +35 -0
  24. armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/ModeDeclarationGroup.py +24 -0
  25. armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/ExecutionOrderConstraint.py +45 -0
  26. armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/TimingConstraint.py +24 -0
  27. armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/TimingExtensions.py +33 -0
  28. armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +9 -0
  29. armodel/models/{m2/autosar_templates/common_structure → M2/AUTOSARTemplates/CommonStructure}/__init__.py +4 -3
  30. armodel/models/{m2/autosar_templates/ecuc_description_template.py → M2/AUTOSARTemplates/ECUCDescriptionTemplate.py} +6 -7
  31. armodel/models/{m2/autosar_templates/generic_structure/abstract_structure.py → M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py} +25 -5
  32. armodel/models/{m2/autosar_templates/generic_structure/ar_package.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py} +41 -29
  33. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ArObject.py +16 -0
  34. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ElementCollection.py +1 -0
  35. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/EngineeringObject.py +52 -0
  36. armodel/models/{general_structure.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py} +42 -159
  37. armodel/models/{ar_object.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py} +179 -71
  38. armodel/models/M2/AUTOSARTemplates/GenericStructure/__init__.py +1 -0
  39. armodel/models/{m2/autosar_templates/sw_component_template/communication.py → M2/AUTOSARTemplates/SWComponentTemplate/Communication.py} +22 -5
  40. armodel/models/{m2/autosar_templates/sw_component_template/components/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Components/InstanceRefs.py} +2 -4
  41. armodel/models/{m2/autosar_templates/sw_component_template/components → M2/AUTOSARTemplates/SWComponentTemplate/Components}/__init__.py +114 -10
  42. armodel/models/{m2/autosar_templates/sw_component_template/composition/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Composition/InstanceRefs.py} +2 -5
  43. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +96 -0
  44. armodel/models/{m2/autosar_templates/sw_component_template/data_type/data_prototypes.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py} +24 -8
  45. armodel/models/{datatype.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py} +16 -73
  46. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +177 -0
  47. armodel/models/{m2/autosar_templates/sw_component_template/port_interface/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/InstanceRefs.py} +2 -2
  48. armodel/models/{m2/autosar_templates/sw_component_template/port_interface → M2/AUTOSARTemplates/SWComponentTemplate/PortInterface}/__init__.py +10 -6
  49. armodel/models/{rpt_scenario.py → M2/AUTOSARTemplates/SWComponentTemplate/RPTScenario.py} +4 -6
  50. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcImplementation.py +34 -0
  51. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AccessCount.py} +2 -2
  52. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py} +7 -5
  53. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/IncludedDataTypes.py +24 -0
  54. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py} +3 -3
  55. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py} +4 -4
  56. armodel/models/{per_instance_memory.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/PerInstanceMemory.py} +5 -6
  57. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/PortAPIOptions.py +86 -0
  58. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/RTEEvents.py +174 -0
  59. armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServerCall.py} +3 -4
  60. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +57 -0
  61. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/Trigger.py +8 -0
  62. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +358 -0
  63. armodel/models/{m2/autosar_templates/system_template/data_mapping.py → M2/AUTOSARTemplates/SystemTemplate/DataMapping.py} +2 -3
  64. armodel/models/{fibex/can_communication.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanCommunication.py} +3 -3
  65. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetFrame.py +14 -0
  66. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/ServiceInstances.py +116 -0
  67. armodel/models/{fibex/lin_communication.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Lin/LinCommunication.py} +5 -2
  68. armodel/models/{fibex/fibex_4_multiplatform.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Multiplatform.py} +5 -4
  69. armodel/models/{fibex/fibex_core/core_communication.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py} +4 -6
  70. armodel/models/{fibex/fibex_core/core_topology.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py} +6 -7
  71. armodel/models/{m2/autosar_templates/system_template/instance_refs.py → M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py} +2 -2
  72. armodel/models/{m2/autosar_templates/system_template/network_management.py → M2/AUTOSARTemplates/SystemTemplate/NetworkManagement.py} +5 -6
  73. armodel/models/M2/AUTOSARTemplates/SystemTemplate/TransportProtocols.py +6 -0
  74. armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/__init__.py +3 -4
  75. armodel/models/M2/MSR/AsamHdo/AdminData.py +18 -0
  76. armodel/models/M2/MSR/AsamHdo/BaseTypes.py +77 -0
  77. armodel/models/{m2_msr.py → M2/MSR/AsamHdo/ComputationMethod.py} +43 -28
  78. armodel/models/{global_constraints.py → M2/MSR/AsamHdo/Constraints/GlobalConstraints.py} +6 -4
  79. armodel/models/M2/MSR/AsamHdo/SpecialData.py +60 -0
  80. armodel/models/{m2/msr/asam_hdo/units.py → M2/MSR/AsamHdo/Units.py} +3 -3
  81. armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +26 -0
  82. armodel/models/{m2/msr/data_dictionary/auxillary_objects.py → M2/MSR/DataDictionary/AuxillaryObjects.py} +3 -4
  83. armodel/models/M2/MSR/DataDictionary/Axis.py +145 -0
  84. armodel/models/M2/MSR/DataDictionary/CalibrationParameter.py +37 -0
  85. armodel/models/{m2/msr/data_dictionary/data_def_properties.py → M2/MSR/DataDictionary/DataDefProperties.py} +19 -10
  86. armodel/models/{record_layout.py → M2/MSR/DataDictionary/RecordLayout.py} +26 -25
  87. armodel/models/{annotation.py → M2/MSR/Documentation/Annotation.py} +8 -10
  88. armodel/models/{m2/msr/documentation/block_elements.py → M2/MSR/Documentation/BlockElements.py} +2 -2
  89. armodel/models/M2/MSR/Documentation/TextModel/LanguageDataModel.py +16 -0
  90. armodel/models/{multilanguage_data.py → M2/MSR/Documentation/TextModel/MultilanguageData.py} +20 -32
  91. armodel/models/M2/MSR/Documentation/TextModel/__init__.py +0 -0
  92. armodel/models/M2/MSR/Documentation/__init__.py +3 -0
  93. armodel/models/M2/MSR/__init__.py +1 -0
  94. armodel/models/M2/__init__.py +0 -0
  95. armodel/models/__init__.py +50 -24
  96. armodel/parser/abstract_arxml_parser.py +8 -4
  97. armodel/parser/arxml_parser.py +117 -90
  98. armodel/parser/connector_xlsx_parser.py +5 -3
  99. armodel/parser/file_parser.py +2 -1
  100. armodel/report/connector_xls_report.py +3 -2
  101. armodel/tests/test_armodel/models/test_ar_object.py +2 -3
  102. armodel/tests/test_armodel/models/test_ar_package.py +21 -9
  103. armodel/tests/test_armodel/models/test_ar_ref.py +7 -5
  104. armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -1
  105. armodel/tests/test_armodel/models/test_common_structure.py +11 -5
  106. armodel/tests/test_armodel/models/test_data_dictionary.py +2 -2
  107. armodel/tests/test_armodel/models/test_data_prototype.py +8 -4
  108. armodel/tests/test_armodel/models/test_datatype.py +28 -14
  109. armodel/tests/test_armodel/models/test_general_structure.py +12 -2
  110. armodel/tests/test_armodel/models/test_implementation.py +3 -2
  111. armodel/tests/test_armodel/models/test_m2_msr.py +4 -2
  112. armodel/tests/test_armodel/models/test_port_interface.py +21 -11
  113. armodel/tests/test_armodel/models/test_port_prototype.py +1 -1
  114. armodel/tests/test_armodel/parser/test_parse_bswmd.py +13 -13
  115. armodel/tests/test_armodel/parser/test_sw_components.py +2 -2
  116. armodel/tests/test_armodel/parser/test_system.py +30 -0
  117. armodel/writer/abstract_arxml_writer.py +5 -2
  118. armodel/writer/arxml_writer.py +136 -91
  119. {armodel-1.6.2.dist-info → armodel-1.6.4.dist-info}/METADATA +16 -1
  120. armodel-1.6.4.dist-info/RECORD +156 -0
  121. armodel/lib/data_analyzer.py +0 -34
  122. armodel/models/ar_package.py +0 -641
  123. armodel/models/ar_ref.py +0 -25
  124. armodel/models/calibration.py +0 -119
  125. armodel/models/common_structure.py +0 -272
  126. armodel/models/communication.py +0 -17
  127. armodel/models/data_def_properties.py +0 -16
  128. armodel/models/data_dictionary.py +0 -59
  129. armodel/models/data_prototype.py +0 -103
  130. armodel/models/end_to_end_protection.py +0 -67
  131. armodel/models/fibex/fibex_core.py +0 -341
  132. armodel/models/fibex/lin_topology.py +0 -7
  133. armodel/models/implementation.py +0 -135
  134. armodel/models/internal_behavior.py +0 -63
  135. armodel/models/m2/autosar_templates/common_structure/implementation.py +0 -21
  136. armodel/models/m2/autosar_templates/sw_component_template/composition/__init__.py +0 -154
  137. armodel/models/m2/autosar_templates/sw_component_template/port_interface.py +0 -236
  138. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/__init__.py +0 -203
  139. armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/trigger.py +0 -10
  140. armodel/models/m2/autosar_templates/system_template/transport_protocols.py +0 -7
  141. armodel/models/mode_declaration.py +0 -8
  142. armodel/models/port_interface.py +0 -165
  143. armodel/models/port_prototype.py +0 -6
  144. armodel/models/service_mapping.py +0 -11
  145. armodel/models/sw_component.py +0 -385
  146. armodel/models/system_template/network_management.py +0 -7
  147. armodel/models/system_template/transport_protocols.py +0 -7
  148. armodel/models/timing.py +0 -91
  149. armodel/models/unit.py +0 -14
  150. armodel-1.6.2.dist-info/RECORD +0 -142
  151. /armodel/models/{fibex → M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior}/__init__.py +0 -0
  152. /armodel/models/{fibex/fibex_4_can → M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint}/__init__.py +0 -0
  153. /armodel/models/{fibex/fibex_4_lin → M2/AUTOSARTemplates/CommonStructure/Timing}/__init__.py +0 -0
  154. /armodel/models/{fibex/fibex_core → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses}/__init__.py +0 -0
  155. /armodel/models/{m2 → M2/AUTOSARTemplates/SWComponentTemplate/Datatype}/__init__.py +0 -0
  156. /armodel/models/{m2/autosar_templates → M2/AUTOSARTemplates/SWComponentTemplate}/__init__.py +0 -0
  157. /armodel/models/{m2/autosar_templates/generic_structure → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can}/__init__.py +0 -0
  158. /armodel/models/{m2/autosar_templates/sw_component_template → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet}/__init__.py +0 -0
  159. /armodel/models/{m2/autosar_templates/sw_component_template/data_type → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Lin}/__init__.py +0 -0
  160. /armodel/models/{m2/msr → M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore}/__init__.py +0 -0
  161. /armodel/models/{m2/msr/asam_hdo → M2/AUTOSARTemplates/SystemTemplate/Fibex}/__init__.py +0 -0
  162. /armodel/models/{m2/msr/data_dictionary → M2/AUTOSARTemplates}/__init__.py +0 -0
  163. /armodel/models/{m2/msr/documentation → M2/MSR/AsamHdo/Constraints}/__init__.py +0 -0
  164. /armodel/models/{system_template → M2/MSR/AsamHdo}/__init__.py +0 -0
  165. /armodel/models/{ecuc_parameter_def_template.py → M2/MSR/CalibrationData/__init__.py} +0 -0
  166. /armodel/models/{m2/autosar_templates/common_structure/constants.py → M2/MSR/DataDictionary/__init__.py} +0 -0
  167. {armodel-1.6.2.dist-info → armodel-1.6.4.dist-info}/LICENSE +0 -0
  168. {armodel-1.6.2.dist-info → armodel-1.6.4.dist-info}/WHEEL +0 -0
  169. {armodel-1.6.2.dist-info → armodel-1.6.4.dist-info}/entry_points.txt +0 -0
  170. {armodel-1.6.2.dist-info → armodel-1.6.4.dist-info}/top_level.txt +0 -0
@@ -1,99 +1,22 @@
1
+ from .....M2.MSR.AsamHdo.AdminData import AdminData
2
+ from .....M2.MSR.Documentation.TextModel.MultilanguageData import MultilanguageLongName
3
+ from .....M2.MSR.Documentation.Annotation import Annotation
4
+ from .....M2.MSR.Documentation.TextModel.MultilanguageData import MultiLanguageOverviewParagraph
5
+ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
6
+ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral
1
7
  from abc import ABCMeta
2
8
  from typing import List
3
9
 
4
- from .annotation import Annotation
5
- from .ar_ref import RefType
6
- from .multilanguage_data import MultiLanguageOverviewParagraph, MultilanguageLongName
7
- from .ar_object import ARObject, ARLiteral
8
-
9
- class Sd(ARObject):
10
- def __init__(self):
11
- super().__init__()
12
-
13
- self.gid = ""
14
- self.value = ""
15
-
16
- def getGID(self):
17
- return self.gid
18
-
19
- def setGID(self, value):
20
- self.gid = value
21
- return self
22
-
23
- def getValue(self):
24
- return self.value
25
-
26
- def setValue(self, value):
27
- self.value = value
28
- return self
29
- class Sdg(ARObject):
30
- def __init__(self):
31
- super().__init__()
32
-
33
- self.gid = ""
34
- self.sd = [] # type: List[Sd]
35
- self.sdgCaption = None
36
- self.sdgContentsTypes = [] # type: List[Sdg]
37
-
38
- def getGID(self):
39
- return self.gid
40
-
41
- def setGID(self, value):
42
- self.gid = value
43
- return self
44
-
45
- def addSd(self, sd: Sd):
46
- self.sd.append(sd)
47
- return self
48
-
49
- def getSds(self) -> List[Sd]:
50
- return self.sd
51
-
52
- def getSdgCaption(self):
53
- return self.sdgCaption
54
-
55
- def setSdgCaption(self, value):
56
- self.sdgCaption = value
57
- return self
58
-
59
- def addSdgContentsType(self, sdg):
60
- self.sdgContentsTypes.append(sdg)
61
-
62
- def getSdgContentsTypes(self):
63
- return self.sdgContentsTypes
64
-
65
- class AdminData(ARObject):
66
- def __init__(self):
67
- super().__init__()
68
-
69
- self.doc_revision = []
70
- self.language = None
71
- self.sdg = []
72
- self.used_languages = None
73
-
74
- def addSdg(self, sdg: Sdg):
75
- self.sdg.append(sdg)
76
-
77
- def getSdgs(self) -> List[Sdg]:
78
- return self.sdg
79
-
80
- class Referrable(ARObject, metaclass=ABCMeta):
10
+ class Referrable(ARObject, metaclass = ABCMeta):
81
11
  def __init__(self, parent: ARObject, short_name: str):
12
+
82
13
  if type(self) == Referrable:
83
14
  raise NotImplementedError("Referrable is an abstract class.")
84
15
  ARObject.__init__(self)
85
16
 
86
- self._parent = parent
17
+ self.parent = parent
87
18
  self.short_name = short_name
88
19
 
89
- @property
90
- def parent(self):
91
- return self._parent
92
-
93
- @parent.setter
94
- def parent(self, value):
95
- self._parent = value
96
-
97
20
  @property
98
21
  def shortName(self):
99
22
  return self.short_name
@@ -104,19 +27,22 @@ class Referrable(ARObject, metaclass=ABCMeta):
104
27
 
105
28
  def getShortName(self) -> str:
106
29
  return self.short_name
30
+
31
+ def getParent(self):
32
+ return self.parent
107
33
 
108
34
  @property
109
35
  def full_name(self) -> str:
110
- return self._parent.full_name + "/" + self.short_name
111
-
36
+ return self.parent.full_name + "/" + self.short_name
37
+
112
38
  def getFullName(self) -> str:
113
39
  return self.full_name
114
-
40
+
115
41
  class MultilanguageReferrable(Referrable, metaclass = ABCMeta):
116
42
  def __init__(self, parent: ARObject, short_name: str):
117
43
  if type(self) == MultilanguageReferrable:
118
44
  raise NotImplementedError("MultilanguageReferrable is an abstract class.")
119
-
45
+
120
46
  super().__init__(parent, short_name)
121
47
 
122
48
  #self._parent = parent
@@ -128,16 +54,18 @@ class MultilanguageReferrable(Referrable, metaclass = ABCMeta):
128
54
  def setLongName(self, value: MultilanguageLongName):
129
55
  self.longName = value
130
56
  return self
57
+
58
+
131
59
  class CollectableElement(ARObject, metaclass = ABCMeta):
132
60
  def __init__(self):
133
61
  if type(self) == CollectableElement:
134
62
  raise NotImplementedError("CollectableElement is an abstract class.")
135
- self.elements = {} # type: dict[str, PackageableElement]
63
+ self.elements = {} # type: dict[str, Referrable]
136
64
 
137
65
  def getTotalElement(self) -> int:
138
66
  #return len(list(filter(lambda a: not isinstance(a, ARPackage) , self.elements.values())))
139
67
  return len(self.elements.values())
140
-
68
+
141
69
  def removeElement(self, key):
142
70
  if key not in self.elements:
143
71
  raise KeyError("Invalid key <%s> for removing element" % key)
@@ -145,7 +73,7 @@ class CollectableElement(ARObject, metaclass = ABCMeta):
145
73
 
146
74
  def getElements(self):
147
75
  return self.elements.values()
148
-
76
+
149
77
  def addElement(self, element: Referrable):
150
78
  self.elements[element.getShortName()] = element
151
79
 
@@ -154,7 +82,7 @@ class CollectableElement(ARObject, metaclass = ABCMeta):
154
82
  return None
155
83
  return self.elements[short_name]
156
84
 
157
- class Identifiable(MultilanguageReferrable, CollectableElement, metaclass=ABCMeta):
85
+ class Identifiable(MultilanguageReferrable, CollectableElement, metaclass = ABCMeta):
158
86
  def __init__(self, parent: ARObject, short_name: str):
159
87
  if type(self) == Identifiable:
160
88
  raise NotImplementedError("Identifiable is an abstract class.")
@@ -172,7 +100,7 @@ class Identifiable(MultilanguageReferrable, CollectableElement, metaclass=ABCMet
172
100
  def setAdminData(self, value):
173
101
  self.adminData = value
174
102
  return self
175
-
103
+
176
104
  def getDesc(self):
177
105
  return self.desc
178
106
 
@@ -186,19 +114,34 @@ class Identifiable(MultilanguageReferrable, CollectableElement, metaclass=ABCMet
186
114
  def setCategory(self, value):
187
115
  self.category = value
188
116
  return self
189
-
117
+
190
118
  def addAnnotation(self, annotation: Annotation):
191
119
  self.annotations.append(annotation)
192
120
  return self
193
-
121
+
194
122
  def getAnnotations(self) -> List[Annotation]:
195
123
  return self.annotations
196
-
124
+
125
+
126
+ class PackageableElement(Identifiable, metaclass=ABCMeta):
127
+ def __init__(self, parent: ARObject, short_name: str):
128
+ if type(self) == PackageableElement:
129
+ raise NotImplementedError("PackageableElement is an abstract class.")
130
+ super().__init__(parent, short_name)
131
+
132
+
133
+ class ARElement(PackageableElement, metaclass=ABCMeta):
134
+ def __init__(self, parent: ARObject, short_name: str):
135
+ if type(self) == ARElement:
136
+ raise NotImplementedError("ARElement is an abstract class.")
137
+ super().__init__(parent, short_name)
138
+
139
+
197
140
  class Describable(ARObject, metaclass=ABCMeta):
198
141
  def __init__(self):
199
142
  if type(self) == Describable:
200
143
  raise NotImplementedError("Describable is an abstract class.")
201
-
144
+
202
145
  super().__init__()
203
146
 
204
147
  self._desc = None
@@ -222,64 +165,4 @@ class Describable(ARObject, metaclass=ABCMeta):
222
165
  def category(self, value: ARLiteral):
223
166
  self._category = value
224
167
 
225
- class AtpFeature(Identifiable, metaclass=ABCMeta):
226
- def __init__(self, parent: ARObject, short_name: str):
227
- if type(self) == AtpFeature:
228
- raise NotImplementedError("AtpFeature is an abstract class.")
229
- super().__init__(parent, short_name)
230
-
231
- class PackageableElement(Identifiable, metaclass=ABCMeta):
232
- def __init__(self, parent: ARObject, short_name: str):
233
- if type(self) == PackageableElement:
234
- raise NotImplementedError("PackageableElement is an abstract class.")
235
- super().__init__(parent, short_name)
236
-
237
- class SwcBswRunnableMapping(ARObject):
238
- def __init__(self):
239
- '''
240
- Maps a BswModuleEntity to a RunnableEntity if it is implemented as part of a BSW
241
- module (in the case of an AUTOSAR Service, a Complex Driver or an ECU
242
- Abstraction). The mapping can be used by a tool to find relevant information on the
243
- behavior, e.g. whether the bswEntity shall be running in interrupt context.
244
-
245
- '''
246
- super().__init__()
247
-
248
- self.bswEntityRef = None # type: RefType
249
- self.swcRunnableRef = None # type: RefType
250
-
251
- class SwcBswMapping(Identifiable):
252
- def __init__(self, parent: ARObject, short_name: str):
253
- super().__init__(parent, short_name)
254
-
255
- self.bswBehaviorRef = None # type: RefType
256
- self._runnableMappings = []
257
- self.swcBehaviorRef = None # type: RefType
258
- self.synchronizedModeGroups = []
259
- self.synchronizedTriggers = []
260
-
261
- def addRunnableMapping(self, mapping: SwcBswRunnableMapping):
262
- self._runnableMappings.append(mapping)
263
-
264
- def getRunnableMappings(self) -> List[SwcBswRunnableMapping]:
265
- return self._runnableMappings
266
-
267
- class ARElement(PackageableElement, metaclass=ABCMeta):
268
- def __init__(self, parent: ARObject, short_name: str):
269
- if type(self) == ARElement:
270
- raise NotImplementedError("ARElement is an abstract class.")
271
- super().__init__(parent, short_name)
272
-
273
-
274
- class AtpStructureElement(AtpFeature, metaclass=ABCMeta):
275
- def __init__(self, parent: ARObject, short_name: str):
276
- if type(self) == AtpFeature:
277
- raise NotImplementedError("AtpStructureElement is an abstract class.")
278
- super().__init__(parent, short_name)
279
-
280
- class Limit(ARObject):
281
- def __init__(self):
282
- super().__init__()
283
168
 
284
- self.intervalType = None # type: str
285
- self.value = None # type: str
@@ -1,71 +1,30 @@
1
1
  from abc import ABCMeta
2
2
  import re
3
- from typing import Dict, List
3
+ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
4
4
 
5
- import xml.etree.cElementTree as ET
6
-
7
-
8
- class ARObject(metaclass=ABCMeta):
9
- def __init__(self):
10
- if type(self) == ARObject:
11
- raise NotImplementedError("ARObject is an abstract class.")
12
-
13
- self.parent = None # type: ARObject
14
- self.checksum = None # type: str
15
-
16
- self.timestamp = None # type: str
17
- self.uuid = None # type: str
18
-
19
- def getTagName(self, tag: str, nsmap: Dict) -> str:
20
- return tag.replace("{%s}" % nsmap["xmlns"], "")
21
-
22
- class ARType(metaclass=ABCMeta):
5
+ class ARType(metaclass = ABCMeta):
23
6
  def __init__(self) -> None:
24
7
  self.timestamp = None # type: str
25
8
  self.uuid = None # type: str
26
- self._value = None
9
+ self._value = None
27
10
 
28
11
  @property
29
12
  def value(self):
30
13
  return self._value
31
-
14
+
32
15
  @value.setter
33
16
  def value(self, val):
34
17
  self._value = val
35
18
 
36
19
  def getValue(self):
37
20
  return self.value
38
-
21
+
39
22
  def setValue(self, val):
40
23
  self.value = val
41
24
 
42
25
  def getText(self) -> str:
43
26
  return str(self)
44
27
 
45
-
46
- class ARLiteral(ARType):
47
- def __init__(self) -> None:
48
- super().__init__()
49
-
50
- @property
51
- def value(self) -> str:
52
- if self._value is None:
53
- return ""
54
- return self._value
55
-
56
- @value.setter
57
- def value(self, val: any):
58
- if isinstance(val, str):
59
- self._value = val
60
- else:
61
- self._value = str(val)
62
-
63
- def __str__(self) -> str:
64
- return self.value
65
-
66
- def upper(self) -> str:
67
- return self.value.upper()
68
-
69
28
  class ARNumerical(ARType):
70
29
  def __init__(self) -> None:
71
30
  super().__init__()
@@ -82,17 +41,20 @@ class ARNumerical(ARType):
82
41
  m = re.match(r"0x([0-9a-f]+)", value, re.I)
83
42
  if m:
84
43
  return int(m.group(1), 16)
44
+ m = re.match(r'0b([\d]+)', value, re.I)
45
+ if m:
46
+ return int(m.group(1), 2)
85
47
  m = re.match(r"-?\d+\.\d+", value)
86
48
  if m:
87
49
  return float(value)
88
50
  return int(value)
89
51
  except:
90
52
  raise ValueError("Invalid Numerical Type <%s>" % value)
91
-
53
+
92
54
  @property
93
55
  def value(self) -> int:
94
56
  return self._value
95
-
57
+
96
58
  @value.setter
97
59
  def value(self, val: any):
98
60
  if isinstance(val, int):
@@ -108,26 +70,7 @@ class ARNumerical(ARType):
108
70
  return self._text
109
71
  else:
110
72
  return str(self._value)
111
-
112
- class ARPositiveInteger(ARNumerical):
113
- def __init__(self) -> None:
114
- super().__init__()
115
73
 
116
- @property
117
- def value(self) -> int:
118
- return self._value
119
-
120
- @value.setter
121
- def value(self, val: any):
122
- if isinstance(val, int):
123
- if val < 0:
124
- raise ValueError("Invalid Positive Integer <%s>" % val)
125
- self._value = val
126
- elif isinstance(val, str):
127
- self._text = val
128
- self._value = self._convertStringToNumberValue(val)
129
- else:
130
- raise ValueError("Unsupported Type <%s>", type(val))
131
74
 
132
75
  class ARFloat(ARNumerical):
133
76
  def __init__(self) -> None:
@@ -138,7 +81,7 @@ class ARFloat(ARNumerical):
138
81
  @property
139
82
  def value(self) -> float:
140
83
  return self._value
141
-
84
+
142
85
  @value.setter
143
86
  def value(self, val: any):
144
87
  if isinstance(val, float):
@@ -158,11 +101,74 @@ class ARFloat(ARNumerical):
158
101
  else:
159
102
  return str(self._value)
160
103
 
104
+ class TimeValue(ARFloat):
105
+ '''
106
+ This primitive type is taken for expressing time values. The numerical value is supposed to be interpreted
107
+ in the physical unit second.
108
+ Tags:
109
+ * xml.xsd.customType=TIME-VALUE
110
+ * xml.xsd.type=double
111
+ '''
112
+
113
+ def __init__(self):
114
+ super().__init__()
115
+
116
+
117
+ class ARLiteral(ARType):
118
+ def __init__(self) -> None:
119
+ super().__init__()
120
+
121
+ @property
122
+ def value(self) -> str:
123
+ if self._value is None:
124
+ return ""
125
+ return self._value
126
+
127
+ @value.setter
128
+ def value(self, val: any):
129
+ if isinstance(val, str):
130
+ self._value = val
131
+ else:
132
+ self._value = str(val)
133
+
134
+ def __str__(self) -> str:
135
+ return self.value
136
+
137
+ def upper(self) -> str:
138
+ return self.value.upper()
139
+
140
+
141
+ class String(ARLiteral):
142
+
143
+ pass
144
+
145
+
146
+ class ARPositiveInteger(ARNumerical):
147
+ def __init__(self) -> None:
148
+ super().__init__()
149
+
150
+ @property
151
+ def value(self) -> int:
152
+ return self._value
153
+
154
+ @value.setter
155
+ def value(self, val: any):
156
+ if isinstance(val, int):
157
+ if val < 0:
158
+ raise ValueError("Invalid Positive Integer <%s>" % val)
159
+ self._value = val
160
+ elif isinstance(val, str):
161
+ self._text = val
162
+ self._value = self._convertStringToNumberValue(val)
163
+ else:
164
+ raise ValueError("Unsupported Type <%s>", type(val))
165
+
166
+
161
167
  class ARBoolean(ARType):
162
168
  def __init__(self) -> None:
163
169
  super().__init__()
164
170
 
165
- self._text = None
171
+ self._text = None
166
172
 
167
173
  def _convertNumberToBoolean(self, value: int) -> bool:
168
174
  if value == 0:
@@ -181,7 +187,7 @@ class ARBoolean(ARType):
181
187
  @property
182
188
  def value(self) -> int:
183
189
  return self._value
184
-
190
+
185
191
  @value.setter
186
192
  def value(self, val: any):
187
193
  if isinstance(val, bool):
@@ -203,4 +209,106 @@ class ARBoolean(ARType):
203
209
  return "true"
204
210
  else:
205
211
  return "false"
206
-
212
+
213
+ class NameToken(ARLiteral):
214
+ '''
215
+ This is an identifier as used in xml, e.g. xml-names. Typical usages are, for example, the names of type
216
+ emitters, protocols, or profiles. For details see NMTOKEN definition on the W3C website
217
+ (https://www.w3.org/TR/xml/#NT-Nmtoken).
218
+
219
+ Note: Although NameToken supports a wide range of characters, the actually allowed patterns for a
220
+ certain attribute typed by NameToken may be further restricted by the specification of that attribute.
221
+
222
+ Tags:
223
+ * xml.xsd.customType=NMTOKEN-STRING
224
+ * xml.xsd.type=NMTOKEN
225
+ '''
226
+ def __init__(self):
227
+ super().__init__()
228
+
229
+ class PositiveInteger(ARPositiveInteger):
230
+ '''
231
+ This is a positive integer which can be denoted in decimal, binary, octal and hexadecimal. The value is
232
+ between 0 and 4294967295.
233
+
234
+ Tags:
235
+ * xml.xsd.customType=POSITIVE-INTEGER
236
+ * xml.xsd.pattern=0|[\+]?[1-9][0-9]*|0[xX][0-9a-fA-F]+|0[bB][0-1]+|0[0-7]+
237
+ * xml.xsd.type=string
238
+ '''
239
+ def __init__(self):
240
+ super().__init__()
241
+
242
+ class Integer(ARNumerical):
243
+ '''
244
+ An instance of Integer is an element in the set of integer numbers ( ..., -2, -1, 0, 1, 2, ...).
245
+ The value can be expressed in decimal, octal, hexadecimal and binary representation. Negative numbers
246
+ can only be expressed in decimal notation
247
+ Range is from -2147483648 and 2147483647.
248
+
249
+ Tags:
250
+ * xml.xsd.customType=INTEGER
251
+ * xml.xsd.pattern=0|[\+\-]?[1-9][0-9]*|0[xX][0-9a-fA-F]+|0[bB][0-1]+|0[0-7]+
252
+ * xml.xsd.type=string
253
+ '''
254
+ def __init__(self):
255
+ super().__init__()
256
+
257
+ class Boolean(ARBoolean):
258
+ '''
259
+ A Boolean value denotes a logical condition that is either 'true' or 'false'. It can be one of "0", "1", "true",
260
+ "false"
261
+
262
+ Tags:
263
+ * xml.xsd.customType=BOOLEAN
264
+ * xml.xsd.pattern=0|1|true|false
265
+ * xml.xsd.type=string
266
+ '''
267
+ def __init__(self):
268
+ super().__init__()
269
+
270
+ class Identifier(ARLiteral):
271
+ '''
272
+ An Identifier is a string with a number of constraints on its appearance, satisfying the requirements typical
273
+ programming languages define for their Identifiers.
274
+ This datatype represents a string, that can be used as a c-Identifier.
275
+ It shall start with a letter, may consist of letters, digits and underscores.
276
+
277
+ Tags:
278
+ * xml.xsd.customType=IDENTIFIER
279
+ * xml.xsd.maxLength=128
280
+ * xml.xsd.pattern=[a-zA-Z][a-zA-Z0-9_]*
281
+ * xml.xsd.type=string
282
+ '''
283
+ def __init__(self):
284
+ super().__init__()
285
+ class Limit(ARObject):
286
+ def __init__(self):
287
+ super().__init__()
288
+
289
+ self.intervalType = None # type: str
290
+ self.value = None # type: str
291
+
292
+
293
+ class RefType(ARObject):
294
+ def __init__(self):
295
+ self.dest = ""
296
+ self.value = ""
297
+
298
+ def getDest(self):
299
+ return self.dest
300
+
301
+ def setDest(self, value):
302
+ self.dest = value
303
+ return self
304
+
305
+ def getValue(self):
306
+ return self.value
307
+
308
+ def setValue(self, value):
309
+ self.value = value
310
+ return self
311
+
312
+ class TRefType(RefType):
313
+ def __init__(self):
314
+ super().__init__()
@@ -0,0 +1 @@
1
+ from . import *
@@ -1,12 +1,14 @@
1
1
  from abc import ABCMeta
2
2
  from typing import List
3
3
 
4
+ from armodel.models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface.InstanceRefs import ApplicationCompositeElementInPortInterfaceInstanceRef
4
5
 
5
- from .....models.ar_object import ARNumerical, ARObject, ARLiteral, ARBoolean, ARPositiveInteger
6
- from .....models.ar_ref import RefType
7
- from .....models.communication import CompositeNetworkRepresentation, TransmissionAcknowledgementRequest
8
- from ...msr.data_dictionary.data_def_properties import SwDataDefProps
9
- from ..common_structure import ValueSpecification
6
+ from ..GenericStructure.GeneralTemplateClasses.ArObject import ARObject
7
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical, ARPositiveInteger
8
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
9
+ from ..GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
10
+ from ...MSR.DataDictionary.DataDefProperties import SwDataDefProps
11
+ from ..CommonStructure import ValueSpecification
10
12
 
11
13
  class PPortComSpec(ARObject, metaclass = ABCMeta):
12
14
  """
@@ -43,6 +45,21 @@ class RPortComSpec(ARObject, metaclass = ABCMeta):
43
45
  super().__init__()
44
46
 
45
47
 
48
+ class CompositeNetworkRepresentation(ARObject):
49
+ def __init__(self):
50
+ super().__init__()
51
+
52
+ self.leaf_element_iref = None # type: ApplicationCompositeElementInPortInterfaceInstanceRef
53
+ self.network_representation = None # type: SwDataDefProps
54
+
55
+
56
+ class TransmissionAcknowledgementRequest(ARObject):
57
+ def __init__(self):
58
+ super().__init__()
59
+
60
+ self.timeout = None # type: float
61
+
62
+
46
63
  class SenderComSpec(PPortComSpec, metaclass = ABCMeta):
47
64
  def __init__(self):
48
65
  if type(self) == SenderComSpec:
@@ -1,8 +1,6 @@
1
1
  from abc import ABCMeta
2
-
3
- from ...generic_structure.abstract_structure import AtpInstanceRef
4
- from .....ar_ref import RefType
5
-
2
+ from .....M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AtpInstanceRef
3
+ from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
6
4
 
7
5
  class ModeGroupInAtomicSwcInstanceRef(AtpInstanceRef, metaclass = ABCMeta):
8
6
  def __init__(self):