armodel 1.6.1__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.
- armodel/cli/arxml_dump_cli.py +31 -25
- armodel/cli/arxml_format_cli.py +1 -4
- armodel/cli/connector_update_cli.py +1 -1
- armodel/cli/swc_list_cli.py +1 -1
- armodel/lib/sw_component.py +3 -1
- armodel/lib/system_signal.py +3 -1
- armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +123 -0
- armodel/models/{bsw_module_template.py → M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py} +115 -140
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswImplementation.py +21 -0
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +52 -0
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +78 -0
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +81 -0
- armodel/models/{m2/autosar_templates/common_structure/implementation_data_types.py → M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py} +20 -10
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +108 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +96 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +72 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +22 -0
- armodel/models/{service_needs.py → M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py} +7 -7
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +36 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/ModeDeclarationGroup.py +27 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +9 -0
- armodel/models/{m2/autosar_templates/common_structure → M2/AUTOSARTemplates/CommonStructure}/__init__.py +5 -2
- armodel/models/{m2/autosar_templates/generic_structure/abstract_structure.py → M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py} +25 -2
- armodel/models/{ar_package.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py} +113 -218
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ArObject.py +16 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ElementCollection.py +1 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/EngineeringObject.py +55 -0
- armodel/models/{general_structure.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py} +37 -149
- armodel/models/{ar_object.py → M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py} +163 -70
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/__init__.py +1 -0
- armodel/models/{m2/autosar_templates/sw_component_template/communication.py → M2/AUTOSARTemplates/SWComponentTemplate/Communication.py} +22 -5
- armodel/models/{m2/autosar_templates/sw_component_template/components/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Components/InstanceRefs.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/components → M2/AUTOSARTemplates/SWComponentTemplate/Components}/__init__.py +10 -8
- armodel/models/{m2/autosar_templates/sw_component_template/composition/instance_refs.py → M2/AUTOSARTemplates/SWComponentTemplate/Composition/InstanceRefs.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/composition → M2/AUTOSARTemplates/SWComponentTemplate/Composition}/__init__.py +5 -5
- armodel/models/{m2/autosar_templates/sw_component_template/data_type/data_prototypes.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py} +25 -7
- armodel/models/{datatype.py → M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py} +16 -74
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/__init__.py +1 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +177 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcImplementation.py +11 -0
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/access_count.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AccessCount.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py} +7 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/IncludedDataTypes.py +24 -0
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py} +3 -3
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py} +3 -3
- armodel/models/{per_instance_memory.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/PerInstanceMemory.py} +5 -6
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServerCall.py} +3 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +23 -0
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior/trigger.py → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/Trigger.py} +2 -2
- armodel/models/{m2/autosar_templates/sw_component_template/swc_internal_behavior → M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior}/__init__.py +9 -10
- armodel/models/{m2/autosar_templates/sw_component_template → M2/AUTOSARTemplates/SWComponentTemplate}/port_interface/__init__.py +12 -8
- armodel/models/{m2/autosar_templates/sw_component_template → M2/AUTOSARTemplates/SWComponentTemplate}/port_interface/instance_refs.py +2 -2
- armodel/models/{m2/autosar_templates/system_template/instance_refs.py → M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py} +2 -2
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/__init__.py +4 -2
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/data_mapping.py +2 -2
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/network_management.py +7 -3
- armodel/models/{m2/autosar_templates/system_template → M2/AUTOSARTemplates/SystemTemplate}/transport_protocols.py +1 -1
- armodel/models/{m2/autosar_templates → M2/AUTOSARTemplates}/ecuc_description_template.py +10 -6
- armodel/models/M2/MSR/AsamHdo/AdminData.py +21 -0
- armodel/models/M2/MSR/AsamHdo/BaseTypes.py +77 -0
- armodel/models/{m2_msr.py → M2/MSR/AsamHdo/ComputationMethod.py} +44 -28
- armodel/models/{global_constraints.py → M2/MSR/AsamHdo/Constraints/GlobalConstraints.py} +7 -4
- armodel/models/M2/MSR/AsamHdo/Constraints/__init__.py +1 -0
- armodel/models/M2/MSR/AsamHdo/SpecialData.py +63 -0
- armodel/models/{m2/msr/asam_hdo/units.py → M2/MSR/AsamHdo/Units.py} +6 -3
- armodel/models/M2/MSR/AsamHdo/__init__.py +1 -0
- armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +30 -0
- armodel/models/M2/MSR/CalibrationData/__init__.py +1 -0
- armodel/models/{m2/msr/data_dictionary/auxillary_objects.py → M2/MSR/DataDictionary/AuxillaryObjects.py} +4 -2
- armodel/models/M2/MSR/DataDictionary/Axis.py +145 -0
- armodel/models/M2/MSR/DataDictionary/CalibrationParameter.py +37 -0
- armodel/models/{m2/msr/data_dictionary/data_def_properties.py → M2/MSR/DataDictionary/DataDefProperties.py} +19 -9
- armodel/models/{record_layout.py → M2/MSR/DataDictionary/RecordLayout.py} +26 -25
- armodel/models/M2/MSR/DataDictionary/__init__.py +1 -0
- armodel/models/{annotation.py → M2/MSR/Documentation/Annotation.py} +8 -8
- armodel/models/{m2/msr/documentation/block_elements.py → M2/MSR/Documentation/BlockElements.py} +2 -2
- armodel/models/M2/MSR/Documentation/TextModel/LanguageDataModel.py +17 -0
- armodel/models/{multilanguage_data.py → M2/MSR/Documentation/TextModel/MultilanguageData.py} +21 -30
- armodel/models/M2/MSR/Documentation/TextModel/__init__.py +2 -0
- armodel/models/M2/MSR/Documentation/__init__.py +3 -0
- armodel/models/M2/MSR/__init__.py +1 -0
- armodel/models/M2/__init__.py +1 -0
- armodel/models/__init__.py +6 -23
- armodel/models/fibex/can_communication.py +3 -2
- armodel/models/fibex/fibex_4_multiplatform.py +5 -3
- armodel/models/fibex/fibex_core/core_communication.py +9 -3
- armodel/models/fibex/fibex_core/core_topology.py +7 -3
- armodel/models/fibex/lin_communication.py +5 -1
- armodel/models/rpt_scenario.py +2 -2
- armodel/models/sw_component.py +19 -14
- armodel/models/timing.py +3 -3
- armodel/parser/abstract_arxml_parser.py +8 -4
- armodel/parser/arxml_parser.py +120 -86
- armodel/parser/connector_xlsx_parser.py +6 -2
- armodel/report/connector_xls_report.py +2 -1
- armodel/tests/test_armodel/models/test_ar_object.py +2 -1
- armodel/tests/test_armodel/models/test_ar_package.py +20 -8
- armodel/tests/test_armodel/models/test_ar_ref.py +7 -5
- armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -1
- armodel/tests/test_armodel/models/test_common_structure.py +11 -5
- armodel/tests/test_armodel/models/test_data_dictionary.py +2 -2
- armodel/tests/test_armodel/models/test_data_prototype.py +7 -3
- armodel/tests/test_armodel/models/test_datatype.py +22 -8
- armodel/tests/test_armodel/models/test_general_structure.py +12 -2
- armodel/tests/test_armodel/models/test_implementation.py +3 -2
- armodel/tests/test_armodel/models/test_m2_msr.py +4 -2
- armodel/tests/test_armodel/models/test_port_interface.py +16 -6
- armodel/tests/test_armodel/models/test_port_prototype.py +1 -1
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +3 -1
- armodel/tests/test_armodel/parser/test_sw_components.py +2 -2
- armodel/tests/test_armodel/parser/test_system.py +30 -0
- armodel/writer/abstract_arxml_writer.py +5 -2
- armodel/writer/arxml_writer.py +100 -67
- {armodel-1.6.1.dist-info → armodel-1.6.3.dist-info}/METADATA +366 -356
- armodel-1.6.3.dist-info/RECORD +148 -0
- {armodel-1.6.1.dist-info → armodel-1.6.3.dist-info}/WHEEL +1 -1
- armodel/lib/data_analyzer.py +0 -34
- armodel/models/ar_ref.py +0 -25
- armodel/models/calibration.py +0 -119
- armodel/models/common_structure.py +0 -272
- armodel/models/communication.py +0 -17
- armodel/models/data_def_properties.py +0 -16
- armodel/models/data_dictionary.py +0 -59
- armodel/models/data_prototype.py +0 -103
- armodel/models/ecuc_parameter_def_template.py +0 -0
- armodel/models/end_to_end_protection.py +0 -67
- armodel/models/fibex/fibex_core.py +0 -341
- armodel/models/fibex/lin_topology.py +0 -7
- armodel/models/implementation.py +0 -135
- armodel/models/internal_behavior.py +0 -63
- armodel/models/m2/autosar_templates/common_structure/constants.py +0 -0
- armodel/models/m2/autosar_templates/common_structure/implementation.py +0 -21
- armodel/models/m2/autosar_templates/generic_structure/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/data_type/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface.py +0 -236
- armodel/models/m2/msr/__init__.py +0 -0
- armodel/models/m2/msr/asam_hdo/__init__.py +0 -0
- armodel/models/m2/msr/data_dictionary/__init__.py +0 -0
- armodel/models/m2/msr/documentation/__init__.py +0 -0
- armodel/models/mode_declaration.py +0 -8
- armodel/models/port_interface.py +0 -165
- armodel/models/port_prototype.py +0 -6
- armodel/models/service_mapping.py +0 -11
- armodel/models/system_template/__init__.py +0 -0
- armodel/models/system_template/network_management.py +0 -7
- armodel/models/system_template/transport_protocols.py +0 -7
- armodel/models/unit.py +0 -14
- armodel-1.6.1.dist-info/RECORD +0 -140
- /armodel/models/{m2 → M2/AUTOSARTemplates/SWComponentTemplate}/__init__.py +0 -0
- /armodel/models/{m2/autosar_templates → M2/AUTOSARTemplates}/__init__.py +0 -0
- {armodel-1.6.1.dist-info → armodel-1.6.3.dist-info}/LICENSE +0 -0
- {armodel-1.6.1.dist-info → armodel-1.6.3.dist-info}/entry_points.txt +0 -0
- {armodel-1.6.1.dist-info → armodel-1.6.3.dist-info}/top_level.txt +0 -0
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
|
-
from
|
|
5
|
-
|
|
6
|
-
from
|
|
7
|
-
|
|
8
|
-
from
|
|
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):
|
|
@@ -85,6 +89,7 @@ class AbstractImplementationDataType(AutosarDataType, metaclass = ABCMeta):
|
|
|
85
89
|
super().__init__(parent, short_name)
|
|
86
90
|
|
|
87
91
|
class ImplementationDataType(AbstractImplementationDataType):
|
|
92
|
+
|
|
88
93
|
CATEGORY_TYPE_REFERENCE = "TYPE_REFERENCE"
|
|
89
94
|
CATEGORY_TYPE_VALUE = "VALUE"
|
|
90
95
|
CATEGORY_TYPE_STRUCTURE = "STRUCTURE"
|
|
@@ -93,17 +98,22 @@ class ImplementationDataType(AbstractImplementationDataType):
|
|
|
93
98
|
|
|
94
99
|
def __init__(self, parent: ARObject, short_name: str):
|
|
95
100
|
super().__init__(parent, short_name)
|
|
101
|
+
|
|
102
|
+
self.arrayImplPolicy = None
|
|
103
|
+
self.arraySize = None
|
|
104
|
+
self.arraySizeHandling = None # type: ARLiteral
|
|
105
|
+
self.arraySizeSemantics = None # type: ARLiteral
|
|
96
106
|
|
|
97
|
-
self.
|
|
98
|
-
self.symbolProps = None
|
|
99
|
-
self._type_emitter = None
|
|
107
|
+
self.subElements = [] # type: List[str]
|
|
108
|
+
self.symbolProps = None # type: SymbolProps
|
|
109
|
+
self._type_emitter = None # type: ARLiteral
|
|
100
110
|
|
|
101
111
|
self._array_type = None # ImplementationDataType
|
|
102
112
|
self._struct_type = None # ImplementationDataType
|
|
103
113
|
|
|
104
114
|
|
|
105
115
|
def createImplementationDataTypeElement(self, short_name: str) -> ImplementationDataTypeElement:
|
|
106
|
-
self.
|
|
116
|
+
self.subElements.append(short_name)
|
|
107
117
|
if (short_name not in self.elements):
|
|
108
118
|
event = ImplementationDataTypeElement(self, short_name)
|
|
109
119
|
self.elements[short_name] = event
|
|
@@ -111,7 +121,7 @@ class ImplementationDataType(AbstractImplementationDataType):
|
|
|
111
121
|
|
|
112
122
|
def getImplementationDataTypeElements(self) -> List[ImplementationDataTypeElement]:
|
|
113
123
|
elements = []
|
|
114
|
-
for sub_element in self.
|
|
124
|
+
for sub_element in self.subElements:
|
|
115
125
|
elements.append(self.elements[sub_element])
|
|
116
126
|
return elements
|
|
117
127
|
# return filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements.values())
|
|
@@ -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 .
|
|
5
|
-
from .
|
|
6
|
-
from .
|
|
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
|
armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/ModeDeclarationGroup.py
ADDED
|
@@ -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 @@
|
|
|
1
|
+
from . import *
|
|
@@ -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
|
|
5
|
-
|
|
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
|
|
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)
|