armodel 1.7.2__py3-none-any.whl → 1.7.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 +1 -1
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +42 -19
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +104 -30
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +12 -16
- armodel/models/M2/AUTOSARTemplates/CommonStructure/FlatMap.py +70 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +12 -9
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +29 -22
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/HardwareConfiguration.py +33 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/HeapUsage.py +10 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/SoftwareContext.py +23 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/StackUsage.py +93 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +39 -5
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +26 -2
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +48 -6
- armodel/models/M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py +5 -5
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +21 -1
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +12 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +8 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +196 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +11 -2
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +36 -21
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +10 -1
- armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +16 -1
- armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +34 -3
- armodel/models/M2/MSR/DataDictionary/DataDefProperties.py +7 -0
- armodel/models/M2/MSR/DataDictionary/ServiceProcessTask.py +33 -0
- armodel/models/__init__.py +3 -0
- armodel/parser/abstract_arxml_parser.py +4 -14
- armodel/parser/arxml_parser.py +347 -180
- armodel/tests/test_armodel/models/test_ar_object.py +6 -2
- armodel/tests/test_armodel/models/test_port_interface.py +4 -4
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +48 -48
- armodel/writer/abstract_arxml_writer.py +1 -0
- armodel/writer/arxml_writer.py +351 -226
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/METADATA +15 -2
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/RECORD +40 -34
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/LICENSE +0 -0
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/WHEEL +0 -0
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, ARLiteral, ARNumerical
|
|
1
|
+
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, ARLiteral, ARNumerical, TimeValue
|
|
2
2
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
|
|
3
3
|
|
|
4
4
|
class TestARObject:
|
|
@@ -148,4 +148,8 @@ class TestARObject:
|
|
|
148
148
|
assert(flag.getText() == "100")
|
|
149
149
|
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
def test_TimeValue(self):
|
|
152
|
+
value = TimeValue()
|
|
153
|
+
value.setValue("0.01")
|
|
154
|
+
assert(value.getValue() == 0.01)
|
|
155
|
+
assert(value.getText() == "0.01")
|
|
@@ -127,10 +127,10 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
|
|
|
127
127
|
assert(isinstance(prototype, Referrable))
|
|
128
128
|
assert(isinstance(prototype, ArgumentDataPrototype))
|
|
129
129
|
|
|
130
|
-
assert(prototype.
|
|
131
|
-
assert(prototype.
|
|
132
|
-
assert(prototype.
|
|
133
|
-
assert(prototype.
|
|
130
|
+
assert(prototype.getParent() == ar_root)
|
|
131
|
+
assert(prototype.getShortName() == "ArgumentDataPrototype")
|
|
132
|
+
assert(prototype.getDirection() == None)
|
|
133
|
+
assert(prototype.getServerArgumentImplPolicy() == None)
|
|
134
134
|
|
|
135
135
|
def test_ApplicationError(self):
|
|
136
136
|
document = AUTOSAR.getInstance()
|
|
@@ -28,14 +28,14 @@ class TestBswMD:
|
|
|
28
28
|
document = AUTOSAR.getInstance()
|
|
29
29
|
root_pkgs = sorted(document.getARPackages(), key = lambda pkg: pkg.short_name)
|
|
30
30
|
assert(len(root_pkgs) == 2)
|
|
31
|
-
assert(root_pkgs[0].
|
|
32
|
-
assert(root_pkgs[1].
|
|
31
|
+
assert(root_pkgs[0].getShortName() == "AUTOSAR_BswM")
|
|
32
|
+
assert(root_pkgs[1].getShortName() == "EB_BswM_TxDxM1I14R0")
|
|
33
33
|
|
|
34
34
|
root_pkg_0_pkgs = sorted(root_pkgs[0].getARPackages(), key = lambda pkg: pkg.short_name)
|
|
35
35
|
assert(len(root_pkg_0_pkgs) == 3)
|
|
36
36
|
|
|
37
37
|
bsw_module_desc_pkg = root_pkg_0_pkgs[0] # type:ARPackage
|
|
38
|
-
assert(bsw_module_desc_pkg.
|
|
38
|
+
assert(bsw_module_desc_pkg.getShortName() == "BswModuleDescriptions")
|
|
39
39
|
|
|
40
40
|
root_pkg_1_pkgs = root_pkgs[1].getARPackages()
|
|
41
41
|
assert(len(root_pkg_1_pkgs) == 1)
|
|
@@ -48,16 +48,16 @@ class TestBswMD:
|
|
|
48
48
|
assert(len(bsw_module_descs) == 1)
|
|
49
49
|
|
|
50
50
|
bsw_module_desc = bsw_module_descs[0]
|
|
51
|
-
assert(bsw_module_desc.
|
|
52
|
-
assert(bsw_module_desc.
|
|
53
|
-
assert(bsw_module_desc.
|
|
51
|
+
assert(bsw_module_desc.getShortName() == "BswM")
|
|
52
|
+
assert(bsw_module_desc.moduleId.getText() == "34")
|
|
53
|
+
assert(bsw_module_desc.moduleId.getValue() == 34)
|
|
54
54
|
|
|
55
55
|
# verify the provided entries
|
|
56
|
-
assert(len(bsw_module_desc.
|
|
57
|
-
assert(bsw_module_desc.
|
|
58
|
-
assert(bsw_module_desc.
|
|
59
|
-
assert(bsw_module_desc.
|
|
60
|
-
assert(bsw_module_desc.
|
|
56
|
+
assert(len(bsw_module_desc.implementedEntryRefs) == 2)
|
|
57
|
+
assert(bsw_module_desc.implementedEntryRefs[0].getDest() == "BSW-MODULE-ENTRY")
|
|
58
|
+
assert(bsw_module_desc.implementedEntryRefs[0].getValue() == "/AUTOSAR_BswM/BswModuleEntrys/BswM_Init")
|
|
59
|
+
assert(bsw_module_desc.implementedEntryRefs[1].getDest() == "BSW-MODULE-ENTRY")
|
|
60
|
+
assert(bsw_module_desc.implementedEntryRefs[1].getValue() == "/AUTOSAR_BswM/BswModuleEntrys/BswM_MainFunction")
|
|
61
61
|
|
|
62
62
|
assert(len(bsw_module_desc.getBswInternalBehaviors()) == 1)
|
|
63
63
|
behavior = bsw_module_desc.getBswInternalBehaviors()[0]
|
|
@@ -65,8 +65,8 @@ class TestBswMD:
|
|
|
65
65
|
|
|
66
66
|
assert(len(behavior.getDataTypeMappingRefs()) == 1)
|
|
67
67
|
data_type_mapping_ref = behavior.getDataTypeMappingRefs()[0]
|
|
68
|
-
assert(data_type_mapping_ref.
|
|
69
|
-
assert(data_type_mapping_ref.
|
|
68
|
+
assert(data_type_mapping_ref.getDest() == "DATA-TYPE-MAPPING-SET")
|
|
69
|
+
assert(data_type_mapping_ref.getValue() == "/BswMMode/DataTypeMappingSets/BswMModeMapping")
|
|
70
70
|
|
|
71
71
|
assert(len(behavior.getExclusiveAreas()) == 1)
|
|
72
72
|
assert(behavior.getExclusiveAreas()[0].short_name == "SCHM_BSWM_EXCLUSIVE_AREA")
|
|
@@ -77,16 +77,16 @@ class TestBswMD:
|
|
|
77
77
|
assert(entity.minimumStartInterval is not None)
|
|
78
78
|
assert(entity.minimumStartIntervalMs is not None)
|
|
79
79
|
assert(len(entity.getCanEnterExclusiveAreaRefs()) == 1)
|
|
80
|
-
assert(entity.getCanEnterExclusiveAreaRefs()[0].
|
|
81
|
-
assert(entity.getCanEnterExclusiveAreaRefs()[0].
|
|
82
|
-
assert(entity.implementedEntryRef.
|
|
83
|
-
assert(entity.implementedEntryRef.
|
|
80
|
+
assert(entity.getCanEnterExclusiveAreaRefs()[0].getDest() == "EXCLUSIVE-AREA")
|
|
81
|
+
assert(entity.getCanEnterExclusiveAreaRefs()[0].getValue() == "/AUTOSAR_BswM/BswModuleDescriptions/BswM/InternalBehavior_0/SCHM_BSWM_EXCLUSIVE_AREA")
|
|
82
|
+
assert(entity.implementedEntryRef.getDest() == "BSW-MODULE-ENTRY")
|
|
83
|
+
assert(entity.implementedEntryRef.getValue() == "/AUTOSAR_BswM/BswModuleEntrys/BswM_MainFunction")
|
|
84
84
|
|
|
85
85
|
assert(len(behavior.getBswTimingEvents()) == 1)
|
|
86
86
|
event = behavior.getBswTimingEvents()[0]
|
|
87
87
|
assert(event.short_name == "TimingEvent_MainFunction")
|
|
88
|
-
assert(event.startsOnEventRef.
|
|
89
|
-
assert(event.startsOnEventRef.
|
|
88
|
+
assert(event.startsOnEventRef.getDest() == "BSW-SCHEDULABLE-ENTITY")
|
|
89
|
+
assert(event.startsOnEventRef.getValue() == "/AUTOSAR_BswM/BswModuleDescriptions/BswM/InternalBehavior_0/BswM_MainFunction")
|
|
90
90
|
assert(event.period.getValue() == 0.02)
|
|
91
91
|
assert(event.period.getText() == "0.02")
|
|
92
92
|
assert(event.periodMs == 20)
|
|
@@ -98,21 +98,21 @@ class TestBswMD:
|
|
|
98
98
|
entries = sorted(pkg.getBswModuleEntries(), key= lambda entry: entry.short_name)
|
|
99
99
|
assert(len(entries) == 2)
|
|
100
100
|
|
|
101
|
-
assert(entries[0].
|
|
102
|
-
assert(entries[0].
|
|
103
|
-
assert(entries[0].
|
|
104
|
-
assert(entries[0].
|
|
105
|
-
assert(entries[0].
|
|
106
|
-
assert(entries[0].
|
|
107
|
-
assert(entries[0].
|
|
108
|
-
|
|
109
|
-
assert(entries[1].
|
|
110
|
-
assert(entries[1].
|
|
111
|
-
assert(entries[1].
|
|
112
|
-
assert(entries[1].
|
|
113
|
-
assert(entries[1].
|
|
114
|
-
assert(entries[1].
|
|
115
|
-
assert(entries[1].
|
|
101
|
+
assert(entries[0].getShortName() == "BswM_Init")
|
|
102
|
+
assert(entries[0].getServiceId().getValue() == 0)
|
|
103
|
+
assert(entries[0].getIsReentrant().getValue() == False)
|
|
104
|
+
assert(entries[0].getIsSynchronous().getValue() == True)
|
|
105
|
+
assert(entries[0].getCallType().getText() == "REGULAR")
|
|
106
|
+
assert(entries[0].getExecutionContext().getText() == "UNSPECIFIED")
|
|
107
|
+
assert(entries[0].getSwServiceImplPolicy().getText() == "STANDARD")
|
|
108
|
+
|
|
109
|
+
assert(entries[1].getShortName() == "BswM_MainFunction")
|
|
110
|
+
assert(entries[1].getServiceId().getValue() == 3)
|
|
111
|
+
assert(entries[1].getIsReentrant().getValue() == False)
|
|
112
|
+
assert(entries[1].getIsSynchronous().getValue() == True)
|
|
113
|
+
assert(entries[1].getCallType().getText() == "SCHEDULED")
|
|
114
|
+
assert(entries[1].getExecutionContext().getText() == "TASK")
|
|
115
|
+
assert(entries[1].getSwServiceImplPolicy().getText() == "STANDARD")
|
|
116
116
|
|
|
117
117
|
def test_bsw_module_swc_bsw_mapping(self):
|
|
118
118
|
document = AUTOSAR.getInstance()
|
|
@@ -121,15 +121,15 @@ class TestBswMD:
|
|
|
121
121
|
mappings = pkg.getSwcBswMappings()
|
|
122
122
|
assert(len(mappings) == 1)
|
|
123
123
|
|
|
124
|
-
assert(mappings[0].bswBehaviorRef.
|
|
125
|
-
assert(mappings[0].bswBehaviorRef.
|
|
124
|
+
assert(mappings[0].bswBehaviorRef.getDest() == "BSW-INTERNAL-BEHAVIOR")
|
|
125
|
+
assert(mappings[0].bswBehaviorRef.getValue() == "/AUTOSAR_BswM/BswModuleDescriptions/BswM/InternalBehavior_0")
|
|
126
126
|
|
|
127
127
|
assert(len(mappings[0].getRunnableMappings()) == 1)
|
|
128
128
|
runnable_mapping = mappings[0].getRunnableMappings()[0]
|
|
129
|
-
assert(runnable_mapping.
|
|
130
|
-
assert(runnable_mapping.
|
|
131
|
-
assert(runnable_mapping.
|
|
132
|
-
assert(runnable_mapping.
|
|
129
|
+
assert(runnable_mapping.getBswEntityRef().getDest() == "BSW-SCHEDULABLE-ENTITY")
|
|
130
|
+
assert(runnable_mapping.getBswEntityRef().getValue() == "/AUTOSAR_BswM/BswModuleDescriptions/BswM/InternalBehavior_0/BswM_MainFunction")
|
|
131
|
+
assert(runnable_mapping.getSwcRunnableRef().getDest() == "RUNNABLE-ENTITY")
|
|
132
|
+
assert(runnable_mapping.getSwcRunnableRef().getValue() == "/AUTOSAR_BswM/SwComponentTypes/BswM/BswMInternalBehavior/RES_MainFunction")
|
|
133
133
|
|
|
134
134
|
def test_bsw_module_implementation(self):
|
|
135
135
|
document = AUTOSAR.getInstance()
|
|
@@ -161,22 +161,22 @@ class TestBswMD:
|
|
|
161
161
|
section = impl.resourceConsumption.getMemorySection("CODE")
|
|
162
162
|
assert(section.short_name == "CODE")
|
|
163
163
|
assert(section.alignment == None)
|
|
164
|
-
assert(section.swAddrMethodRef.
|
|
165
|
-
assert(section.swAddrMethodRef.
|
|
164
|
+
assert(section.swAddrMethodRef.getDest() == "SW-ADDR-METHOD")
|
|
165
|
+
assert(section.swAddrMethodRef.getValue() == "/AUTOSAR_MemMap/SwAddrMethods/CODE")
|
|
166
166
|
|
|
167
167
|
section = impl.resourceConsumption.getMemorySection("VAR_NO_INIT_UNSPECIFIED")
|
|
168
168
|
assert(section.short_name == "VAR_NO_INIT_UNSPECIFIED")
|
|
169
169
|
assert(section.alignment.getText() == "UNSPECIFIED")
|
|
170
|
-
assert(section.swAddrMethodRef.
|
|
171
|
-
assert(section.swAddrMethodRef.
|
|
170
|
+
assert(section.swAddrMethodRef.getDest() == "SW-ADDR-METHOD")
|
|
171
|
+
assert(section.swAddrMethodRef.getValue() == "/AUTOSAR_MemMap/SwAddrMethods/VAR_NOINIT")
|
|
172
172
|
|
|
173
173
|
assert(impl.vendorId.getValue() == 1)
|
|
174
174
|
assert(impl.swVersion.getValue() == "1.14.1")
|
|
175
|
-
assert(impl.swcBswMappingRef.
|
|
176
|
-
assert(impl.swcBswMappingRef.
|
|
175
|
+
assert(impl.swcBswMappingRef.getDest() == "SWC-BSW-MAPPING")
|
|
176
|
+
assert(impl.swcBswMappingRef.getValue() == "/AUTOSAR_BswM/SwcBswMappings/SwcBswMapping_0")
|
|
177
177
|
assert(impl.arReleaseVersion.getValue() == "4.0.3")
|
|
178
|
-
assert(impl.behaviorRef.
|
|
179
|
-
assert(impl.behaviorRef.
|
|
178
|
+
assert(impl.behaviorRef.getDest() == "BSW-INTERNAL-BEHAVIOR")
|
|
179
|
+
assert(impl.behaviorRef.getValue() == "/AUTOSAR_BswM/BswModuleDescriptions/BswM/InternalBehavior_0")
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
def test_load_save(self):
|
|
@@ -104,6 +104,7 @@ class AbstractARXMLWriter:
|
|
|
104
104
|
def setChildElementOptionalFloatValue(self, element: ET.Element, key: str, value: ARFloat):
|
|
105
105
|
if value is not None:
|
|
106
106
|
child_element = ET.SubElement(element, key)
|
|
107
|
+
self.setARObjectAttributes(child_element, value)
|
|
107
108
|
child_element.text = value.getText()
|
|
108
109
|
|
|
109
110
|
def setChildElementOptionalTimeValue(self, element: ET.Element, key: str, value: TimeValue):
|