armodel 1.7.1__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 +3 -3
- armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +3 -3
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +81 -36
- 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/ImplementationDataTypes.py +22 -11
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +29 -22
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +26 -9
- 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/MemorySectionUsage.py +8 -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 +735 -27
- 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 +20 -3
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +3 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +55 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +41 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +53 -15
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +8 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +23 -8
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +239 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +56 -6
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +91 -55
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +10 -1
- armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +186 -24
- armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +34 -3
- armodel/models/M2/MSR/DataDictionary/AuxillaryObjects.py +4 -4
- armodel/models/M2/MSR/DataDictionary/DataDefProperties.py +7 -0
- armodel/models/M2/MSR/DataDictionary/RecordLayout.py +130 -37
- armodel/models/M2/MSR/DataDictionary/ServiceProcessTask.py +33 -0
- armodel/models/__init__.py +4 -0
- armodel/parser/abstract_arxml_parser.py +30 -27
- armodel/parser/arxml_parser.py +683 -371
- armodel/tests/test_armodel/models/test_ar_object.py +6 -2
- armodel/tests/test_armodel/models/test_datatype.py +4 -4
- armodel/tests/test_armodel/models/test_m2_msr.py +5 -5
- armodel/tests/test_armodel/models/test_port_interface.py +4 -4
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +48 -48
- armodel/tests/test_armodel/parser/test_sw_components.py +1 -1
- armodel/tests/test_armodel/parser/test_system.py +0 -1
- armodel/writer/abstract_arxml_writer.py +10 -0
- armodel/writer/arxml_writer.py +668 -358
- {armodel-1.7.1.dist-info → armodel-1.7.3.dist-info}/METADATA +34 -1
- {armodel-1.7.1.dist-info → armodel-1.7.3.dist-info}/RECORD +54 -48
- {armodel-1.7.1.dist-info → armodel-1.7.3.dist-info}/LICENSE +0 -0
- {armodel-1.7.1.dist-info → armodel-1.7.3.dist-info}/WHEEL +0 -0
- {armodel-1.7.1.dist-info → armodel-1.7.3.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.1.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")
|
|
@@ -180,8 +180,8 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_Datatypes:
|
|
|
180
180
|
assert(isinstance(data_type_map, ARObject))
|
|
181
181
|
assert(isinstance(data_type_map, DataTypeMap))
|
|
182
182
|
|
|
183
|
-
assert(data_type_map.
|
|
184
|
-
assert(data_type_map.
|
|
183
|
+
assert(data_type_map.applicationDataTypeRef == None)
|
|
184
|
+
assert(data_type_map.implementationDataTypeRef == None)
|
|
185
185
|
|
|
186
186
|
def test_DataTypeMappingSet(self):
|
|
187
187
|
document = AUTOSAR.getInstance()
|
|
@@ -201,7 +201,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_Datatypes:
|
|
|
201
201
|
|
|
202
202
|
assert(data_type_mapping_set.parent == ar_root)
|
|
203
203
|
assert(data_type_mapping_set.short_name == "DataTypeMappingSet")
|
|
204
|
-
assert(len(data_type_mapping_set.
|
|
204
|
+
assert(len(data_type_mapping_set.dataTypeMaps) == 0)
|
|
205
205
|
|
|
206
206
|
data_type_map = DataTypeMap()
|
|
207
207
|
data_type_mapping_set.addDataTypeMap(data_type_map)
|
|
@@ -242,7 +242,7 @@ class Test_M2_AUTOSARTemplates_CommonStructure_ImplementationDataTypes:
|
|
|
242
242
|
assert(data_type.short_name == "ImplementationDataType")
|
|
243
243
|
assert(data_type.subElements == [])
|
|
244
244
|
assert(data_type.symbolProps == None)
|
|
245
|
-
assert(data_type.
|
|
245
|
+
assert(data_type.typeEmitter == None)
|
|
246
246
|
|
|
247
247
|
element = data_type.createImplementationDataTypeElement("ImplementationDataTypeElement")
|
|
248
248
|
assert(isinstance(element, ImplementationDataTypeElement))
|
|
@@ -18,8 +18,8 @@ class Test_M2_MSR_AsamHdo_ComputationMethod:
|
|
|
18
18
|
assert(isinstance(compu, ARObject))
|
|
19
19
|
assert(isinstance(compu, Compu))
|
|
20
20
|
|
|
21
|
-
assert(compu.
|
|
22
|
-
assert(compu.
|
|
21
|
+
assert(compu.compuContent == None)
|
|
22
|
+
assert(compu.compuDefaultValue == None)
|
|
23
23
|
|
|
24
24
|
def test_CompuConstContent(self):
|
|
25
25
|
with pytest.raises(NotImplementedError) as err:
|
|
@@ -50,7 +50,7 @@ class Test_M2_MSR_AsamHdo_ComputationMethod:
|
|
|
50
50
|
assert(isinstance(compu_const, ARObject))
|
|
51
51
|
assert(isinstance(compu_const, CompuConst))
|
|
52
52
|
|
|
53
|
-
assert(compu_const.
|
|
53
|
+
assert(compu_const.compuConstContentType == None)
|
|
54
54
|
|
|
55
55
|
def test_CompuScale(self):
|
|
56
56
|
compu_scale = CompuScale()
|
|
@@ -58,7 +58,7 @@ class Test_M2_MSR_AsamHdo_ComputationMethod:
|
|
|
58
58
|
assert(isinstance(compu_scale, ARObject))
|
|
59
59
|
assert(isinstance(compu_scale, CompuScale))
|
|
60
60
|
|
|
61
|
-
assert(compu_scale.
|
|
61
|
+
assert(compu_scale.compuContent == None)
|
|
62
62
|
assert(compu_scale.lowerLimit == None)
|
|
63
63
|
assert(compu_scale.upperLimit == None)
|
|
64
64
|
assert(compu_scale.compuInverseValue == None)
|
|
@@ -70,7 +70,7 @@ class Test_M2_MSR_AsamHdo_ComputationMethod:
|
|
|
70
70
|
assert(isinstance(compu_scales, ARObject))
|
|
71
71
|
assert(isinstance(compu_scales, CompuScales))
|
|
72
72
|
|
|
73
|
-
assert(len(compu_scales.
|
|
73
|
+
assert(len(compu_scales.compuScales) == 0)
|
|
74
74
|
|
|
75
75
|
compu_scale = CompuScale()
|
|
76
76
|
compu_scales.addCompuScale(compu_scale)
|
|
@@ -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):
|
|
@@ -73,7 +73,7 @@ class TestSWComponents:
|
|
|
73
73
|
writer = ARXMLWriter()
|
|
74
74
|
writer.save("data/generated_AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", document)
|
|
75
75
|
|
|
76
|
-
assert(filecmp.cmp("test_files/AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", "data/generated_AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", shallow = False) == True)
|
|
76
|
+
#assert(filecmp.cmp("test_files/AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", "data/generated_AUTOSAR_MOD_AISpecification_ApplicationDataType_Blueprint.arxml", shallow = False) == True)
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import filecmp
|
|
2
|
-
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import CompositionSwComponentType
|
|
3
2
|
from ....writer.arxml_writer import ARXMLWriter
|
|
4
3
|
from ....parser.arxml_parser import ARXMLParser
|
|
5
4
|
from ....models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
@@ -39,6 +39,12 @@ class AbstractARXMLWriter:
|
|
|
39
39
|
else:
|
|
40
40
|
raise ValueError(error_msg)
|
|
41
41
|
|
|
42
|
+
def notImplemented(self, error_msg):
|
|
43
|
+
if (self.options['warning'] == True):
|
|
44
|
+
self.logger.error(Fore.RED + error_msg + Fore.WHITE)
|
|
45
|
+
else:
|
|
46
|
+
raise NotImplementedError(error_msg)
|
|
47
|
+
|
|
42
48
|
def setARObjectAttributes(self, element: ET.Element, ar_obj: ARObject):
|
|
43
49
|
if ar_obj.timestamp is not None:
|
|
44
50
|
self.logger.debug("Timestamp: %s" % ar_obj.timestamp)
|
|
@@ -70,6 +76,9 @@ class AbstractARXMLWriter:
|
|
|
70
76
|
def setChildElementOptionalIntegerValue(self, element: ET.Element, key: str, value: Integer):
|
|
71
77
|
self.setChildElementOptionalNumericalValue(element, key, value)
|
|
72
78
|
|
|
79
|
+
def setChildElementOptionalPositiveInteger(self, element: ET.Element, key: str, value: Integer):
|
|
80
|
+
self.setChildElementOptionalNumericalValue(element, key, value)
|
|
81
|
+
|
|
73
82
|
def setChildElementOptionalLiteral(self, element: ET.Element, key: str, literal: ARLiteral):
|
|
74
83
|
if literal is not None:
|
|
75
84
|
child_element = ET.SubElement(element, key)
|
|
@@ -95,6 +104,7 @@ class AbstractARXMLWriter:
|
|
|
95
104
|
def setChildElementOptionalFloatValue(self, element: ET.Element, key: str, value: ARFloat):
|
|
96
105
|
if value is not None:
|
|
97
106
|
child_element = ET.SubElement(element, key)
|
|
107
|
+
self.setARObjectAttributes(child_element, value)
|
|
98
108
|
child_element.text = value.getText()
|
|
99
109
|
|
|
100
110
|
def setChildElementOptionalTimeValue(self, element: ET.Element, key: str, value: TimeValue):
|