armodel 1.6.3__py3-none-any.whl → 1.7.0__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 +7 -7
- armodel/cli/arxml_format_cli.py +14 -12
- armodel/cli/connector2xlsx_cli.py +2 -3
- armodel/cli/connector_update_cli.py +1 -4
- armodel/cli/memory_section_cli.py +2 -2
- armodel/cli/swc_list_cli.py +2 -3
- armodel/cli/system_signal_cli.py +2 -2
- armodel/lib/sw_component.py +2 -2
- armodel/lib/system_signal.py +1 -3
- armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +5 -10
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +9 -11
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswImplementation.py +51 -12
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +3 -3
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +5 -6
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/__init__.py +4 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Filter.py +86 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +186 -29
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +7 -10
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +21 -11
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ModeDeclaration.py +3 -3
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/MemorySectionUsage.py +3 -6
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +3 -5
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +10 -6
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +3 -4
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/ModeDeclarationGroup.py +2 -5
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcInternalBehavior/__init__.py +0 -1
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/ExecutionOrderConstraint.py +45 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/TimingConstraint.py +24 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint/TimingExtensions.py +33 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +2 -2
- armodel/models/M2/AUTOSARTemplates/CommonStructure/__init__.py +4 -6
- armodel/models/M2/AUTOSARTemplates/{ecuc_description_template.py → ECUCDescriptionTemplate.py} +6 -11
- armodel/models/M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py +3 -6
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +42 -36
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/EngineeringObject.py +2 -5
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +11 -16
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +87 -4
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/__init__.py +0 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +21 -8
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/InstanceRefs.py +2 -4
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +114 -12
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/InstanceRefs.py +2 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +4 -62
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py +6 -8
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +7 -7
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/__init__.py +0 -1
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/{port_interface/instance_refs.py → PortInterface/InstanceRefs.py} +2 -2
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/{port_interface → PortInterface}/__init__.py +10 -10
- armodel/models/{rpt_scenario.py → M2/AUTOSARTemplates/SWComponentTemplate/RPTScenario.py} +4 -6
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcImplementation.py +29 -6
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/DataElements.py +6 -6
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/IncludedDataTypes.py +2 -2
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/InstanceRefsUsage.py +3 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py +28 -4
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/PerInstanceMemory.py +3 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/PortAPIOptions.py +86 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/RTEEvents.py +174 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServerCall.py +3 -4
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +37 -3
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/Trigger.py +2 -4
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +166 -10
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/{data_mapping.py → DataMapping.py} +2 -3
- armodel/models/{fibex/can_communication.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanCommunication.py} +3 -4
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanTopology.py +173 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetFrame.py +14 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/ServiceInstances.py +116 -0
- armodel/models/{fibex/lin_communication.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Lin/LinCommunication.py} +4 -5
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Lin/__init__.py +0 -0
- armodel/models/{fibex/fibex_4_multiplatform.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Multiplatform.py} +5 -6
- armodel/models/{fibex/fibex_core/core_communication.py → M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py} +6 -14
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +388 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +223 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/Timing.py +177 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/__init__.py +0 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/__init__.py +0 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py +39 -2
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/{network_management.py → NetworkManagement.py} +5 -10
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/TransportProtocols.py +6 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +86 -17
- armodel/models/M2/MSR/AsamHdo/AdminData.py +2 -5
- armodel/models/M2/MSR/AsamHdo/BaseTypes.py +3 -3
- armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +5 -6
- armodel/models/M2/MSR/AsamHdo/Constraints/GlobalConstraints.py +3 -4
- armodel/models/M2/MSR/AsamHdo/Constraints/__init__.py +0 -1
- armodel/models/M2/MSR/AsamHdo/SpecialData.py +1 -4
- armodel/models/M2/MSR/AsamHdo/Units.py +3 -6
- armodel/models/M2/MSR/AsamHdo/__init__.py +0 -1
- armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +3 -7
- armodel/models/M2/MSR/CalibrationData/__init__.py +0 -1
- armodel/models/M2/MSR/DataDictionary/AuxillaryObjects.py +3 -6
- armodel/models/M2/MSR/DataDictionary/Axis.py +3 -3
- armodel/models/M2/MSR/DataDictionary/CalibrationParameter.py +3 -3
- armodel/models/M2/MSR/DataDictionary/DataDefProperties.py +5 -6
- armodel/models/M2/MSR/DataDictionary/RecordLayout.py +4 -4
- armodel/models/M2/MSR/DataDictionary/__init__.py +0 -1
- armodel/models/M2/MSR/Documentation/Annotation.py +4 -6
- armodel/models/M2/MSR/Documentation/BlockElements.py +2 -2
- armodel/models/M2/MSR/Documentation/TextModel/LanguageDataModel.py +1 -2
- armodel/models/M2/MSR/Documentation/TextModel/MultilanguageData.py +3 -6
- armodel/models/M2/MSR/Documentation/TextModel/__init__.py +0 -2
- armodel/models/M2/MSR/Documentation/__init__.py +1 -1
- armodel/models/M2/MSR/__init__.py +1 -1
- armodel/models/M2/__init__.py +0 -1
- armodel/models/__init__.py +57 -3
- armodel/parser/abstract_arxml_parser.py +50 -16
- armodel/parser/arxml_parser.py +285 -112
- armodel/parser/file_parser.py +2 -1
- armodel/report/connector_xls_report.py +2 -1
- armodel/tests/test_armodel/models/test_ar_object.py +0 -2
- armodel/tests/test_armodel/models/test_ar_package.py +4 -4
- armodel/tests/test_armodel/models/test_data_prototype.py +1 -1
- armodel/tests/test_armodel/models/test_datatype.py +7 -7
- armodel/tests/test_armodel/models/test_port_interface.py +6 -6
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +12 -12
- armodel/tests/test_armodel/parser/test_sw_components.py +1 -23
- armodel/tests/test_armodel/parser/test_system.py +3 -3
- armodel/writer/abstract_arxml_writer.py +10 -1
- armodel/writer/arxml_writer.py +249 -80
- {armodel-1.6.3.dist-info → armodel-1.7.0.dist-info}/METADATA +385 -366
- armodel-1.7.0.dist-info/RECORD +160 -0
- {armodel-1.6.3.dist-info → armodel-1.7.0.dist-info}/WHEEL +1 -1
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/transport_protocols.py +0 -7
- armodel/models/fibex/fibex_core/core_topology.py +0 -184
- armodel/models/sw_component.py +0 -390
- armodel/models/timing.py +0 -91
- armodel-1.6.3.dist-info/RECORD +0 -148
- /armodel/models/{fibex → M2/AUTOSARTemplates/CommonStructure/Timing/TimingConstraint}/__init__.py +0 -0
- /armodel/models/{fibex/fibex_4_can → M2/AUTOSARTemplates/CommonStructure/Timing}/__init__.py +0 -0
- /armodel/models/{fibex/fibex_4_lin → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can}/__init__.py +0 -0
- /armodel/models/{fibex/fibex_core → M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet}/__init__.py +0 -0
- {armodel-1.6.3.dist-info → armodel-1.7.0.dist-info}/LICENSE +0 -0
- {armodel-1.6.3.dist-info → armodel-1.7.0.dist-info}/entry_points.txt +0 -0
- {armodel-1.6.3.dist-info → armodel-1.7.0.dist-info}/top_level.txt +0 -0
|
@@ -46,7 +46,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_DataPrototypes:
|
|
|
46
46
|
assert(isinstance(prototype, MultilanguageReferrable))
|
|
47
47
|
assert(isinstance(prototype, Referrable))
|
|
48
48
|
|
|
49
|
-
assert(prototype.
|
|
49
|
+
assert(prototype.parent == ar_root)
|
|
50
50
|
assert(prototype.short_name == "prototype")
|
|
51
51
|
assert(prototype.typeTRef is None)
|
|
52
52
|
|
|
@@ -40,7 +40,7 @@ class Test_M2_AUTOSARTemplates_CommonStructure_Implementation:
|
|
|
40
40
|
assert(isinstance(prototype, Referrable))
|
|
41
41
|
assert(isinstance(prototype, SymbolProps))
|
|
42
42
|
|
|
43
|
-
assert(prototype.
|
|
43
|
+
assert(prototype.parent == ar_root)
|
|
44
44
|
assert(prototype.short_name == "SymbolProps")
|
|
45
45
|
assert(prototype.symbol == None)
|
|
46
46
|
|
|
@@ -66,7 +66,7 @@ class Test_M2_MSR_AsamHdo_BaseTypes:
|
|
|
66
66
|
assert(isinstance(base_type, Referrable))
|
|
67
67
|
assert(isinstance(base_type, SwBaseType))
|
|
68
68
|
|
|
69
|
-
assert(base_type.
|
|
69
|
+
assert(base_type.parent == ar_root)
|
|
70
70
|
assert(base_type.short_name == "SwBaseType")
|
|
71
71
|
assert(isinstance(base_type.baseTypeDefinition, BaseTypeDirectDefinition))
|
|
72
72
|
|
|
@@ -111,7 +111,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_Datatypes:
|
|
|
111
111
|
assert(isinstance(data_type, Referrable))
|
|
112
112
|
assert(isinstance(data_type, ApplicationPrimitiveDataType))
|
|
113
113
|
|
|
114
|
-
assert(data_type.
|
|
114
|
+
assert(data_type.parent == ar_root)
|
|
115
115
|
assert(data_type.short_name == "ApplicationPrimitiveDataType")
|
|
116
116
|
assert(data_type.swDataDefProps == None)
|
|
117
117
|
|
|
@@ -142,7 +142,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_Datatypes:
|
|
|
142
142
|
assert(isinstance(data_type, Referrable))
|
|
143
143
|
assert(isinstance(data_type, ApplicationArrayDataType))
|
|
144
144
|
|
|
145
|
-
assert(data_type.
|
|
145
|
+
assert(data_type.parent == ar_root)
|
|
146
146
|
assert(data_type.short_name == "ApplicationArrayDataType")
|
|
147
147
|
assert(data_type.dynamic_array_size_profile == None)
|
|
148
148
|
assert(data_type.element == None)
|
|
@@ -167,7 +167,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_Datatypes:
|
|
|
167
167
|
assert(isinstance(data_type, Referrable))
|
|
168
168
|
assert(isinstance(data_type, ApplicationRecordDataType))
|
|
169
169
|
|
|
170
|
-
assert(data_type.
|
|
170
|
+
assert(data_type.parent == ar_root)
|
|
171
171
|
assert(data_type.short_name == "ApplicationRecordDataType")
|
|
172
172
|
|
|
173
173
|
element = data_type.createApplicationRecordElement("element")
|
|
@@ -199,7 +199,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_Datatype_Datatypes:
|
|
|
199
199
|
assert(isinstance(data_type_mapping_set, Referrable))
|
|
200
200
|
assert(isinstance(data_type_mapping_set, DataTypeMappingSet))
|
|
201
201
|
|
|
202
|
-
assert(data_type_mapping_set.
|
|
202
|
+
assert(data_type_mapping_set.parent == ar_root)
|
|
203
203
|
assert(data_type_mapping_set.short_name == "DataTypeMappingSet")
|
|
204
204
|
assert(len(data_type_mapping_set._dataTypeMaps) == 0)
|
|
205
205
|
|
|
@@ -238,7 +238,7 @@ class Test_M2_AUTOSARTemplates_CommonStructure_ImplementationDataTypes:
|
|
|
238
238
|
assert(isinstance(data_type, Referrable))
|
|
239
239
|
assert(isinstance(data_type, ImplementationDataType))
|
|
240
240
|
|
|
241
|
-
assert(data_type.
|
|
241
|
+
assert(data_type.parent == ar_root)
|
|
242
242
|
assert(data_type.short_name == "ImplementationDataType")
|
|
243
243
|
assert(data_type.subElements == [])
|
|
244
244
|
assert(data_type.symbolProps == None)
|
|
@@ -15,7 +15,7 @@ from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Prim
|
|
|
15
15
|
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import AtpPrototype, AutosarDataPrototype, DataPrototype, VariableDataPrototype
|
|
16
16
|
from ....models.M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AtpType
|
|
17
17
|
from ....models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement
|
|
18
|
-
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.
|
|
18
|
+
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ApplicationError, ArgumentDataPrototype, ClientServerInterface, ClientServerOperation, DataInterface, NvDataInterface, ParameterInterface, PortInterface, SenderReceiverInterface
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
|
|
@@ -50,7 +50,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
|
|
|
50
50
|
assert(isinstance(data_if, Referrable))
|
|
51
51
|
assert(isinstance(data_if, NvDataInterface))
|
|
52
52
|
|
|
53
|
-
assert(data_if.
|
|
53
|
+
assert(data_if.parent == ar_root)
|
|
54
54
|
assert(data_if.short_name == "NvDataInterface")
|
|
55
55
|
|
|
56
56
|
def test_ParameterInterface(self):
|
|
@@ -73,7 +73,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
|
|
|
73
73
|
assert(isinstance(data_if, Referrable))
|
|
74
74
|
assert(isinstance(data_if, ParameterInterface))
|
|
75
75
|
|
|
76
|
-
assert(data_if.
|
|
76
|
+
assert(data_if.parent == ar_root)
|
|
77
77
|
assert(data_if.short_name == "ParameterInterface")
|
|
78
78
|
|
|
79
79
|
def test_SenderReceiverInterface(self):
|
|
@@ -97,7 +97,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
|
|
|
97
97
|
assert(isinstance(sr_if, SenderReceiverInterface))
|
|
98
98
|
|
|
99
99
|
assert(sr_if.short_name == "sr_if")
|
|
100
|
-
assert(sr_if.
|
|
100
|
+
assert(sr_if.parent == ar_root)
|
|
101
101
|
assert(len(sr_if.getDataElements()) == 0)
|
|
102
102
|
|
|
103
103
|
element = sr_if.createDataElement("element")
|
|
@@ -127,7 +127,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
|
|
|
127
127
|
assert(isinstance(prototype, Referrable))
|
|
128
128
|
assert(isinstance(prototype, ArgumentDataPrototype))
|
|
129
129
|
|
|
130
|
-
assert(prototype.
|
|
130
|
+
assert(prototype.parent == ar_root)
|
|
131
131
|
assert(prototype.short_name == "ArgumentDataPrototype")
|
|
132
132
|
assert(prototype.direction == "")
|
|
133
133
|
assert(prototype.server_argument_impl_policy == "")
|
|
@@ -143,7 +143,7 @@ class Test_M2_AUTOSARTemplates_SWComponentTemplate_PortInterface:
|
|
|
143
143
|
assert(isinstance(app_error, Referrable))
|
|
144
144
|
assert(isinstance(app_error, ApplicationError))
|
|
145
145
|
|
|
146
|
-
assert(app_error.
|
|
146
|
+
assert(app_error.parent == ar_root)
|
|
147
147
|
assert(app_error.short_name == "ApplicationError")
|
|
148
148
|
|
|
149
149
|
def test_ClientServerOperation(self):
|
|
@@ -153,30 +153,30 @@ class TestBswMD:
|
|
|
153
153
|
assert(artifact_descs[1].getShortLabel().getValue() == "make::BswM_rules.mak")
|
|
154
154
|
assert(artifact_descs[1].getCategory().getValue() == "SWMAKE")
|
|
155
155
|
|
|
156
|
-
assert(impl.
|
|
156
|
+
assert(impl.programmingLanguage.getValue() == "C")
|
|
157
157
|
|
|
158
|
-
assert(impl.
|
|
159
|
-
assert(len(impl.
|
|
158
|
+
assert(impl.resourceConsumption.short_name == "ResourceConsumption")
|
|
159
|
+
assert(len(impl.resourceConsumption.getMemorySections()) == 8)
|
|
160
160
|
|
|
161
|
-
section = impl.
|
|
161
|
+
section = impl.resourceConsumption.getMemorySection("CODE")
|
|
162
162
|
assert(section.short_name == "CODE")
|
|
163
163
|
assert(section.alignment == None)
|
|
164
164
|
assert(section.swAddrMethodRef.dest == "SW-ADDR-METHOD")
|
|
165
165
|
assert(section.swAddrMethodRef.value == "/AUTOSAR_MemMap/SwAddrMethods/CODE")
|
|
166
166
|
|
|
167
|
-
section = impl.
|
|
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
170
|
assert(section.swAddrMethodRef.dest == "SW-ADDR-METHOD")
|
|
171
171
|
assert(section.swAddrMethodRef.value == "/AUTOSAR_MemMap/SwAddrMethods/VAR_NOINIT")
|
|
172
172
|
|
|
173
|
-
assert(impl.
|
|
174
|
-
assert(impl.
|
|
175
|
-
assert(impl.
|
|
176
|
-
assert(impl.
|
|
177
|
-
assert(impl.
|
|
178
|
-
assert(impl.
|
|
179
|
-
assert(impl.
|
|
173
|
+
assert(impl.vendorId.getValue() == 1)
|
|
174
|
+
assert(impl.swVersion.getValue() == "1.14.1")
|
|
175
|
+
assert(impl.swcBswMappingRef.dest == "SWC-BSW-MAPPING")
|
|
176
|
+
assert(impl.swcBswMappingRef.value == "/AUTOSAR_BswM/SwcBswMappings/SwcBswMapping_0")
|
|
177
|
+
assert(impl.arReleaseVersion.getValue() == "4.0.3")
|
|
178
|
+
assert(impl.behaviorRef.dest == "BSW-INTERNAL-BEHAVIOR")
|
|
179
|
+
assert(impl.behaviorRef.value == "/AUTOSAR_BswM/BswModuleDescriptions/BswM/InternalBehavior_0")
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
def test_load_save(self):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import filecmp
|
|
2
|
-
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.
|
|
2
|
+
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import CompositionSwComponentType
|
|
3
3
|
from ....writer.arxml_writer import ARXMLWriter
|
|
4
4
|
from ....parser.arxml_parser import ARXMLParser
|
|
5
5
|
from ....models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
@@ -53,28 +53,6 @@ class TestSWComponents:
|
|
|
53
53
|
assert(len(sw_component.getAssemblySwConnectors()) == 0)
|
|
54
54
|
assert(len(sw_component.getDelegationSwConnectors()) == 0)
|
|
55
55
|
|
|
56
|
-
def test_software_components_arxml_loading_and_saving(self):
|
|
57
|
-
document = AUTOSAR.getInstance()
|
|
58
|
-
document.clear()
|
|
59
|
-
parser = ARXMLParser()
|
|
60
|
-
parser.load("src/armodel/tests/test_files/SoftwareComponents.arxml", document)
|
|
61
|
-
|
|
62
|
-
writer = ARXMLWriter()
|
|
63
|
-
writer.save("data/generated.arxml", document)
|
|
64
|
-
|
|
65
|
-
assert(filecmp.cmp("src/armodel/tests/test_files/SoftwareComponents.arxml", "data/generated.arxml", shallow = False) == True)
|
|
66
|
-
|
|
67
|
-
def test_software_components_arxml_loading_and_saving(self):
|
|
68
|
-
document = AUTOSAR.getInstance()
|
|
69
|
-
document.clear()
|
|
70
|
-
parser = ARXMLParser()
|
|
71
|
-
parser.load("src/armodel/tests/test_files/AUTOSAR_Datatypes.arxml", document)
|
|
72
|
-
|
|
73
|
-
writer = ARXMLWriter()
|
|
74
|
-
writer.save("data/generated_AUTOSAR_Datatypes.arxml", document)
|
|
75
|
-
|
|
76
|
-
assert(filecmp.cmp("src/armodel/tests/test_files/AUTOSAR_Datatypes.arxml", "data/generated_AUTOSAR_Datatypes.arxml", shallow = False) == True)
|
|
77
|
-
|
|
78
56
|
def test_bswm_mode_arxml_loading_and_saving(self):
|
|
79
57
|
document = AUTOSAR.getInstance()
|
|
80
58
|
document.clear()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import filecmp
|
|
2
|
-
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.
|
|
2
|
+
from ....models.M2.AUTOSARTemplates.SWComponentTemplate.Components import CompositionSwComponentType
|
|
3
3
|
from ....writer.arxml_writer import ARXMLWriter
|
|
4
4
|
from ....parser.arxml_parser import ARXMLParser
|
|
5
5
|
from ....models.M2.AUTOSARTemplates.AutosarTopLevelStructure import AUTOSAR
|
|
@@ -12,7 +12,7 @@ class TestSystemTemplate:
|
|
|
12
12
|
parser.load("src/armodel/tests/test_files/CanSystem.arxml", document)
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
def
|
|
15
|
+
def test_can_system_arxml_loading_and_saving(self):
|
|
16
16
|
document = AUTOSAR.getInstance()
|
|
17
17
|
document.clear()
|
|
18
18
|
parser = ARXMLParser()
|
|
@@ -21,7 +21,7 @@ class TestSystemTemplate:
|
|
|
21
21
|
writer = ARXMLWriter()
|
|
22
22
|
writer.save("data/generated_CanSystem.arxml", document)
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
assert(filecmp.cmp("src/armodel/tests/test_files/CanSystem.arxml", "data/generated_CanSystem.arxml", shallow = False) == True)
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -9,7 +9,7 @@ import xml.etree.cElementTree as ET
|
|
|
9
9
|
|
|
10
10
|
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
11
11
|
|
|
12
|
-
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, ARLiteral, ARNumerical
|
|
12
|
+
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, ARLiteral, ARNumerical, Integer, TimeValue
|
|
13
13
|
from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import TRefType
|
|
14
14
|
|
|
15
15
|
from ..models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
|
|
@@ -71,6 +71,9 @@ class AbstractARXMLWriter:
|
|
|
71
71
|
self.setARObjectAttributes(child_element, numerical)
|
|
72
72
|
child_element.text = numerical._text
|
|
73
73
|
|
|
74
|
+
def setChildElementOptionalIntegerValue(self, element: ET.Element, key: str, value: Integer):
|
|
75
|
+
self.setChildElementOptionalNumericalValue(element, key, value)
|
|
76
|
+
|
|
74
77
|
def setChildElementOptionalLiteral(self, element: ET.Element, key: str, literal: ARLiteral):
|
|
75
78
|
if literal is not None:
|
|
76
79
|
child_element = ET.SubElement(element, key)
|
|
@@ -78,6 +81,9 @@ class AbstractARXMLWriter:
|
|
|
78
81
|
if literal._value is not None:
|
|
79
82
|
child_element.text = str(literal._value)
|
|
80
83
|
|
|
84
|
+
def setChildElementOptionalRevisionLabelString(self, element: ET.Element, key: str, literal: ARLiteral):
|
|
85
|
+
self.setChildElementOptionalLiteral(element, key, literal)
|
|
86
|
+
|
|
81
87
|
def setChildElementOptionalRefType(self, parent: ET.Element, child_tag_name: str, ref: TRefType):
|
|
82
88
|
if ref is not None:
|
|
83
89
|
child_tag = ET.SubElement(parent, child_tag_name)
|
|
@@ -91,6 +97,9 @@ class AbstractARXMLWriter:
|
|
|
91
97
|
child_element = ET.SubElement(element, key)
|
|
92
98
|
child_element.text = value.getText()
|
|
93
99
|
|
|
100
|
+
def setChildElementOptionalTimeValue(self, element: ET.Element, key: str, value: TimeValue):
|
|
101
|
+
self.setChildElementOptionalFloatValue(element, key, value)
|
|
102
|
+
|
|
94
103
|
def setChildElementOptionalBooleanValue(self, element: ET.Element, key: str, value: ARBoolean) -> ET.Element:
|
|
95
104
|
child_element = None
|
|
96
105
|
if value is not None:
|