armodel 1.6.0__py3-none-any.whl → 1.6.2__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 +25 -22
- 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/data_models/sw_connector.py +3 -3
- armodel/lib/sw_component.py +3 -1
- armodel/lib/system_signal.py +3 -1
- armodel/models/__init__.py +5 -3
- armodel/models/ar_object.py +1 -1
- armodel/models/ar_package.py +185 -151
- armodel/models/ar_ref.py +0 -202
- armodel/models/common_structure.py +3 -71
- armodel/models/communication.py +1 -1
- armodel/models/datatype.py +7 -72
- armodel/models/end_to_end_protection.py +1 -1
- armodel/models/general_structure.py +10 -4
- armodel/models/internal_behavior.py +1 -1
- armodel/models/m2/autosar_templates/autosar_top_level_structure.py +120 -0
- armodel/models/m2/autosar_templates/common_structure/implementation.py +21 -0
- armodel/models/m2/autosar_templates/common_structure/implementation_data_types.py +154 -0
- armodel/models/m2/autosar_templates/ecuc_description_template.py +2 -1
- armodel/models/m2/autosar_templates/generic_structure/__init__.py +0 -0
- armodel/models/m2/autosar_templates/generic_structure/abstract_structure.py +69 -0
- armodel/models/m2/autosar_templates/generic_structure/ar_package.py +528 -0
- armodel/models/m2/autosar_templates/sw_component_template/communication.py +44 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/__init__.py +246 -0
- armodel/models/m2/autosar_templates/sw_component_template/components/instance_refs.py +33 -1
- armodel/models/m2/autosar_templates/sw_component_template/composition/__init__.py +154 -0
- armodel/models/m2/autosar_templates/sw_component_template/composition/instance_refs.py +157 -0
- armodel/models/m2/autosar_templates/sw_component_template/data_type/__init__.py +0 -0
- armodel/models/m2/autosar_templates/sw_component_template/data_type/data_prototypes.py +104 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface/__init__.py +243 -0
- armodel/models/m2/autosar_templates/sw_component_template/port_interface/instance_refs.py +39 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py +3 -11
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/instance_refs_usage.py +169 -0
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/mode_declaration_group.py +1 -2
- armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/server_call.py +5 -4
- armodel/models/m2/autosar_templates/system_template/instance_refs.py +48 -0
- armodel/models/m2_msr.py +1 -0
- armodel/models/port_prototype.py +1 -90
- armodel/models/service_needs.py +3 -1
- armodel/models/sw_component.py +6 -143
- armodel/parser/__init__.py +2 -1
- armodel/parser/abstract_arxml_parser.py +1 -1
- armodel/parser/arxml_parser.py +157 -80
- armodel/parser/connector_xlsx_parser.py +3 -1
- armodel/parser/file_parser.py +43 -0
- armodel/report/connector_xls_report.py +2 -1
- armodel/tests/test_armodel/models/test_ar_package.py +6 -3
- armodel/tests/test_armodel/models/test_ar_ref.py +15 -13
- armodel/tests/test_armodel/models/test_common_structure.py +6 -5
- armodel/tests/test_armodel/models/test_data_prototype.py +1 -1
- armodel/tests/test_armodel/models/test_datatype.py +9 -9
- armodel/tests/test_armodel/models/test_general_structure.py +1 -1
- armodel/tests/test_armodel/models/test_implementation.py +1 -1
- armodel/tests/test_armodel/models/test_port_interface.py +2 -2
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +3 -1
- armodel/tests/test_armodel/parser/test_sw_components.py +2 -2
- armodel/writer/abstract_arxml_writer.py +5 -1
- armodel/writer/arxml_writer.py +70 -60
- {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/METADATA +5 -1
- {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/RECORD +66 -51
- {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/LICENSE +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/WHEEL +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/entry_points.txt +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.2.dist-info}/top_level.txt +0 -0
armodel/parser/arxml_parser.py
CHANGED
|
@@ -2,15 +2,28 @@ from typing import List
|
|
|
2
2
|
import xml.etree.ElementTree as ET
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
+
from ..models.m2.autosar_templates.generic_structure.ar_package import ARPackage
|
|
6
|
+
|
|
7
|
+
from ..models.ar_ref import RefType
|
|
8
|
+
from ..models.m2.autosar_templates.common_structure.implementation import ImplementationProps
|
|
5
9
|
from ..models.m2.autosar_templates.common_structure import ApplicationValueSpecification, ArrayValueSpecification, ConstantReference, NumericalValueSpecification, RecordValueSpecification, TextValueSpecification, ValueSpecification
|
|
6
|
-
from ..models.m2.autosar_templates.
|
|
10
|
+
from ..models.m2.autosar_templates.generic_structure.abstract_structure import AnyInstanceRef
|
|
11
|
+
from ..models.m2.autosar_templates.common_structure.implementation_data_types import ImplementationDataTypeElement
|
|
12
|
+
from ..models.m2.autosar_templates.sw_component_template.composition.instance_refs import POperationInAtomicSwcInstanceRef, PPortInCompositionInstanceRef, ROperationInAtomicSwcInstanceRef, RPortInCompositionInstanceRef
|
|
13
|
+
from ..models.m2.autosar_templates.sw_component_template.port_interface.instance_refs import ApplicationCompositeElementInPortInterfaceInstanceRef
|
|
14
|
+
from ..models.m2.autosar_templates.sw_component_template.swc_internal_behavior.instance_refs_usage import AutosarParameterRef, AutosarVariableRef, VariableInAtomicSWCTypeInstanceRef
|
|
15
|
+
from ..models.m2.autosar_templates.system_template.instance_refs import VariableDataPrototypeInSystemInstanceRef
|
|
16
|
+
from ..models.m2.autosar_templates.sw_component_template.components.instance_refs import InnerPortGroupInCompositionInstanceRef, PModeGroupInAtomicSwcInstanceRef, RModeGroupInAtomicSWCInstanceRef
|
|
7
17
|
from ..models.m2.autosar_templates.sw_component_template.swc_internal_behavior import RunnableEntityArgument
|
|
8
|
-
from ..models.m2.
|
|
9
|
-
from ..models.m2.autosar_templates.sw_component_template.
|
|
18
|
+
from ..models.m2.autosar_templates.sw_component_template.components import PortGroup, SwComponentType, SymbolProps, PPortPrototype, RPortPrototype
|
|
19
|
+
from ..models.m2.autosar_templates.sw_component_template.composition import AssemblySwConnector, CompositionSwComponentType, DelegationSwConnector
|
|
20
|
+
|
|
21
|
+
from ..models.m2.autosar_templates.sw_component_template.swc_internal_behavior.mode_declaration_group import ModeAccessPoint
|
|
10
22
|
from ..models.m2.autosar_templates.sw_component_template.swc_internal_behavior.server_call import ServerCallPoint
|
|
11
|
-
from ..models.m2.autosar_templates.sw_component_template.communication import ClientComSpec, ModeSwitchSenderComSpec, NonqueuedReceiverComSpec, NonqueuedSenderComSpec, QueuedSenderComSpec, ReceiverComSpec, SenderComSpec, ServerComSpec
|
|
23
|
+
from ..models.m2.autosar_templates.sw_component_template.communication import ClientComSpec, ModeSwitchSenderComSpec, NonqueuedReceiverComSpec, NonqueuedSenderComSpec, ParameterRequireComSpec, QueuedSenderComSpec, ReceiverComSpec, SenderComSpec, ServerComSpec
|
|
12
24
|
from ..models.fibex.lin_communication import LinFrameTriggering
|
|
13
25
|
from ..models.fibex.fibex_core.core_topology import AbstractCanCluster, CanPhysicalChannel, CommunicationCluster, LinPhysicalChannel, PhysicalChannel
|
|
26
|
+
from ..models.m2.msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
14
27
|
from ..models.m2.msr.documentation.block_elements import DocumentationBlock
|
|
15
28
|
from ..models.m2.autosar_templates.system_template import System, SystemMapping
|
|
16
29
|
from ..models.m2.autosar_templates.system_template.data_mapping import SenderReceiverToSignalGroupMapping, SenderReceiverToSignalMapping
|
|
@@ -22,7 +35,7 @@ from ..models.fibex.fibex_core.core_communication import Frame, FrameTriggering,
|
|
|
22
35
|
from ..models.internal_behavior import IncludedDataTypeSet
|
|
23
36
|
from ..models.timing import ExecutionOrderConstraint, TimingExtension
|
|
24
37
|
from ..models.bsw_module_template import BswModeSenderPolicy
|
|
25
|
-
from ..models.m2.autosar_templates.sw_component_template.port_interface import InvalidationPolicy, ModeSwitchInterface, PortInterface
|
|
38
|
+
from ..models.m2.autosar_templates.sw_component_template.port_interface import InvalidationPolicy, ModeSwitchInterface, ParameterInterface, PortInterface
|
|
26
39
|
from ..models.common_structure import IncludedModeDeclarationGroupSet, MemorySection, ModeDeclarationGroup, ModeDeclarationGroupPrototype, ModeRequestTypeMap
|
|
27
40
|
from ..models.implementation import BswImplementation, EngineeringObject
|
|
28
41
|
from ..models.general_structure import MultilanguageReferrable
|
|
@@ -34,25 +47,21 @@ from ..models.calibration import SwAxisGrouped, SwAxisIndividual, SwCalprmAxis,
|
|
|
34
47
|
from ..models.communication import CompositeNetworkRepresentation
|
|
35
48
|
from ..models.end_to_end_protection import EndToEndDescription, EndToEndProtection, EndToEndProtectionSet, EndToEndProtectionVariablePrototype
|
|
36
49
|
from ..models.service_mapping import RoleBasedPortAssignment
|
|
37
|
-
from ..models.
|
|
50
|
+
from ..models.m2.autosar_templates.autosar_top_level_structure import AUTOSAR
|
|
38
51
|
from ..models.ar_object import ARLiteral
|
|
39
52
|
from ..models.service_needs import RoleBasedDataAssignment
|
|
40
|
-
from ..models.
|
|
41
|
-
from ..models.
|
|
42
|
-
from ..models.data_prototype import ApplicationCompositeElementDataPrototype, AutosarDataPrototype, DataPrototype, ParameterDataPrototype, VariableDataPrototype
|
|
53
|
+
from ..models.sw_component import AtomicSwComponentType, PortAPIOption, PortDefinedArgumentValue, ServiceDependency, SwcServiceDependency
|
|
54
|
+
from ..models.m2.autosar_templates.sw_component_template.data_type.data_prototypes import ApplicationCompositeElementDataPrototype, AutosarDataPrototype, DataPrototype, ParameterDataPrototype, VariableDataPrototype
|
|
43
55
|
from ..models.port_prototype import ModeSwitchReceiverComSpec, QueuedReceiverComSpec
|
|
44
56
|
from ..models.annotation import Annotation, GeneralAnnotation
|
|
45
57
|
from ..models.global_constraints import InternalConstrs, DataConstr, DataConstrRule, PhysConstrs
|
|
46
58
|
|
|
47
59
|
from ..models import SwcInternalBehavior, RunnableEntity, RTEEvent, OperationInvokedEvent, DataReceivedEvent, RVariableInAtomicSwcInstanceRef
|
|
48
60
|
from ..models import SwcModeSwitchEvent, RModeInAtomicSwcInstanceRef
|
|
49
|
-
|
|
50
|
-
from ..models import ImplementationDataType, SwPointerTargetProps, DataTypeMappingSet, DataTypeMap
|
|
51
|
-
from ..models import RPortPrototype, PPortPrototype
|
|
61
|
+
|
|
62
|
+
from ..models import ImplementationDataType, SwPointerTargetProps, DataTypeMappingSet, DataTypeMap
|
|
52
63
|
from ..models import SenderReceiverInterface, ClientServerInterface, ClientServerOperation, ArgumentDataPrototype
|
|
53
64
|
from ..models import Identifiable, AdminData, Sdg, Sd
|
|
54
|
-
from ..models import AssemblySwConnector, PPortInCompositionInstanceRef, RPortInCompositionInstanceRef
|
|
55
|
-
from ..models import DelegationSwConnector
|
|
56
65
|
from ..models import CompuMethod, CompuScale, CompuScales, Compu, CompuConst, CompuConstTextContent, CompuScaleConstantContents, CompuScaleRationalFormula, CompuRationalCoeffs, CompuNominatorDenominator
|
|
57
66
|
from ..models import InternalBehavior, ExecutableEntity
|
|
58
67
|
from ..models import Implementation, Code, AutosarEngineeringObject, ResourceConsumption
|
|
@@ -218,7 +227,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
218
227
|
ref = self.getChildElementOptionalRefType(child_element, "BSW-MODULE-ENTRY-REF")
|
|
219
228
|
if (ref is not None):
|
|
220
229
|
parent.addImplementedEntry(ref)
|
|
221
|
-
self.logger.debug("ImplementedEntry <%s> of BswModuleDescription <%s> has been added", ref.value, parent.
|
|
230
|
+
self.logger.debug("ImplementedEntry <%s> of BswModuleDescription <%s> has been added", ref.value, parent.getShortName())
|
|
222
231
|
|
|
223
232
|
def readModeDeclarationGroupPrototype(self, element: ET.Element, prototype: ModeDeclarationGroupPrototype):
|
|
224
233
|
self.readIdentifiable(element, prototype)
|
|
@@ -237,14 +246,14 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
237
246
|
short_name = self.getShortName(child_element)
|
|
238
247
|
self.logger.debug("readRequiredModeGroup %s" % short_name)
|
|
239
248
|
mode_group = parent.createProvidedModeGroup(short_name)
|
|
240
|
-
mode_group.type_tref = self.getChildElementRefType(parent.
|
|
249
|
+
mode_group.type_tref = self.getChildElementRefType(parent.getShortName(), child_element, "TYPE-TREF")
|
|
241
250
|
|
|
242
251
|
def readCanEnterExclusiveAreaRefs(self, element: ET.Element, entity: ExecutableEntity):
|
|
243
252
|
for ref in self.getChildElementRefTypeList(element, "CAN-ENTER-EXCLUSIVE-AREA-REFS/CAN-ENTER-EXCLUSIVE-AREA-REF"):
|
|
244
253
|
entity.addCanEnterExclusiveAreaRef(ref)
|
|
245
254
|
|
|
246
255
|
def readExecutableEntity(self, element: ET.Element, entity: ExecutableEntity):
|
|
247
|
-
self.logger.debug("readExecutableEntity %s" % entity.
|
|
256
|
+
self.logger.debug("readExecutableEntity %s" % entity.getShortName())
|
|
248
257
|
self.readIdentifiable(element, entity)
|
|
249
258
|
self.readCanEnterExclusiveAreaRefs(element, entity)
|
|
250
259
|
entity.setMinimumStartInterval(self.getChildElementOptionalFloatValue(element, "MINIMUM-START-INTERVAL")) \
|
|
@@ -258,7 +267,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
258
267
|
|
|
259
268
|
def readBswModuleEntity(self, element: ET.Element, entity: BswModuleEntity):
|
|
260
269
|
self.readExecutableEntity(element, entity)
|
|
261
|
-
entity.setImplementedEntryRef(self.getChildElementRefType(entity.
|
|
270
|
+
entity.setImplementedEntryRef(self.getChildElementRefType(entity.getShortName(), element, "IMPLEMENTED-ENTRY-REF"))
|
|
262
271
|
self.readBswModuleEntityManagedModeGroup(element, entity)
|
|
263
272
|
|
|
264
273
|
def readBswCalledEntity(self, element: ET.Element, parent: BswInternalBehavior):
|
|
@@ -277,7 +286,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
277
286
|
self.readBswModuleEntity(child_element, entity)
|
|
278
287
|
|
|
279
288
|
def readBswEvent(self, element: ET.Element, event: BswScheduleEvent):
|
|
280
|
-
event.startsOnEventRef = self.getChildElementRefType(event.
|
|
289
|
+
event.startsOnEventRef = self.getChildElementRefType(event.getShortName(), element, "STARTS-ON-EVENT-REF")
|
|
281
290
|
|
|
282
291
|
def readBswScheduleEvent(self, element, event: BswScheduleEvent):
|
|
283
292
|
self.readBswEvent(element, event)
|
|
@@ -304,7 +313,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
304
313
|
short_name = self.getShortName(child_element)
|
|
305
314
|
self.logger.debug("readBswDataReceivedEvent %s" % short_name)
|
|
306
315
|
event = parent.createBswDataReceivedEvent(short_name)
|
|
307
|
-
event.data_ref = self.getChildElementRefType(parent.
|
|
316
|
+
event.data_ref = self.getChildElementRefType(parent.getShortName(), child_element, "DATA-REF")
|
|
308
317
|
# Read the Inherit BswScheduleEvent
|
|
309
318
|
self.readBswScheduleEvent(child_element, event)
|
|
310
319
|
|
|
@@ -313,7 +322,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
313
322
|
short_name = self.getShortName(child_element)
|
|
314
323
|
self.logger.debug("readBswInternalTriggerOccurredEvent %s" % short_name)
|
|
315
324
|
event = parent.createBswInternalTriggerOccurredEvent(short_name)
|
|
316
|
-
event.event_source_ref = self.getChildElementRefType(parent.
|
|
325
|
+
event.event_source_ref = self.getChildElementRefType(parent.getShortName(), child_element, "EVENT-SOURCE-REF")
|
|
317
326
|
# Read the Inherit BswScheduleEvent
|
|
318
327
|
self.readBswScheduleEvent(child_element, event)
|
|
319
328
|
|
|
@@ -507,7 +516,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
507
516
|
entry.sw_service_impl_policy = self.getChildElementOptionalLiteral(element, "SW-SERVICE-IMPL-POLICY")
|
|
508
517
|
|
|
509
518
|
#self.logger.debug("readBswModuleEntry \n%s" % entry)
|
|
510
|
-
self.logger.debug("readBswModuleEntry %s" % entry.
|
|
519
|
+
self.logger.debug("readBswModuleEntry %s" % entry.getShortName())
|
|
511
520
|
|
|
512
521
|
def readEngineeringObject(self, element: ET.Element, engineering_obj: EngineeringObject):
|
|
513
522
|
self.readElementAttributes(element, engineering_obj)
|
|
@@ -547,12 +556,12 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
547
556
|
short_name = self.getShortName(child_element)
|
|
548
557
|
memory_section = consumption.createMemorySection(short_name)
|
|
549
558
|
self.readIdentifiable(child_element, memory_section)
|
|
550
|
-
memory_section.
|
|
559
|
+
memory_section.setAlignment(self.getChildElementOptionalLiteral(child_element, "ALIGNMENT"))
|
|
551
560
|
self.readMemorySectionOptions(child_element, memory_section)
|
|
552
561
|
memory_section.size = self.getChildElementOptionalNumericalValue(child_element, "SIZE")
|
|
553
562
|
memory_section.swAddrMethodRef = self.getChildElementOptionalRefType(child_element, "SW-ADDRMETHOD-REF")
|
|
554
563
|
memory_section.symbol = self.getChildElementOptionalLiteral(child_element, "SYMBOL")
|
|
555
|
-
self.logger.debug("readMemorySections %s" % memory_section.
|
|
564
|
+
self.logger.debug("readMemorySections %s" % memory_section.getShortName())
|
|
556
565
|
|
|
557
566
|
def readResourceConsumption(self, element: ET.Element, impl: Implementation):
|
|
558
567
|
child_element = element.find("./xmlns:RESOURCE-CONSUMPTION", self.nsmap)
|
|
@@ -582,7 +591,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
582
591
|
def readBswImplementation(self, element: ET.Element, parent: ARPackage):
|
|
583
592
|
short_name = self.getShortName(element)
|
|
584
593
|
impl = parent.createBswImplementation(short_name)
|
|
585
|
-
self.logger.debug("readBswImplementation %s" % impl.
|
|
594
|
+
self.logger.debug("readBswImplementation %s" % impl.getShortName())
|
|
586
595
|
self.readImplementation(element, impl)
|
|
587
596
|
impl.ar_release_version = self.getChildElementOptionalLiteral(element, "AR-RELEASE-VERSION")
|
|
588
597
|
impl.behavior_ref = self.getChildElementOptionalRefType(element, "BEHAVIOR-REF")
|
|
@@ -591,7 +600,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
591
600
|
def readSwcImplementation(self, element: ET.Element, parent: ARPackage):
|
|
592
601
|
short_name = self.getShortName(element)
|
|
593
602
|
impl = parent.createSwcImplementation(short_name)
|
|
594
|
-
self.logger.debug("readSwcImplementation %s" % impl.
|
|
603
|
+
self.logger.debug("readSwcImplementation %s" % impl.getShortName())
|
|
595
604
|
self.readImplementation(element, impl)
|
|
596
605
|
impl.behavior_ref = self.getChildElementOptionalRefType(element, "BEHAVIOR-REF")
|
|
597
606
|
|
|
@@ -784,8 +793,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
784
793
|
child_element = element.find("./xmlns:OPERATION-IREF", self.nsmap)
|
|
785
794
|
if (child_element is not None):
|
|
786
795
|
parent.operation_iref = POperationInAtomicSwcInstanceRef()
|
|
787
|
-
parent.operation_iref.context_p_port_ref = self.getChildElementRefType(parent.
|
|
788
|
-
parent.operation_iref.target_provided_operation_ref = self.getChildElementRefType(parent.
|
|
796
|
+
parent.operation_iref.context_p_port_ref = self.getChildElementRefType(parent.getShortName(), child_element, "CONTEXT-P-PORT-REF")
|
|
797
|
+
parent.operation_iref.target_provided_operation_ref = self.getChildElementRefType(parent.getShortName(), child_element, "TARGET-PROVIDED-OPERATION-REF")
|
|
789
798
|
|
|
790
799
|
def readOperationInvokedEvent(self, element: ET.Element, parent: SwcInternalBehavior):
|
|
791
800
|
short_name = self.getShortName(element)
|
|
@@ -870,7 +879,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
870
879
|
short_name = self.getShortName(element)
|
|
871
880
|
event = parent.createInternalTriggerOccurredEvent(short_name)
|
|
872
881
|
self.readRTEEvent(element, event)
|
|
873
|
-
event.event_source_ref = self.getChildElementRefType(parent.
|
|
882
|
+
event.event_source_ref = self.getChildElementRefType(parent.getShortName(), element, "EVENT-SOURCE-REF")
|
|
874
883
|
|
|
875
884
|
def readInitEvent(self, element, parent: SwcInternalBehavior):
|
|
876
885
|
short_name = self.getShortName(element)
|
|
@@ -1042,14 +1051,14 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1042
1051
|
self.readApplicationRecordElements(element, data_type)
|
|
1043
1052
|
|
|
1044
1053
|
def readImplementationDataTypeElements(self, element: ET.Element, parent: ImplementationDataType):
|
|
1045
|
-
for child_element in
|
|
1054
|
+
for child_element in self.findall(element, "SUB-ELEMENTS/IMPLEMENTATION-DATA-TYPE-ELEMENT"):
|
|
1046
1055
|
short_name = self.getShortName(child_element)
|
|
1047
|
-
type_element = parent.createImplementationDataTypeElement(short_name)
|
|
1056
|
+
type_element = parent.createImplementationDataTypeElement(short_name)
|
|
1048
1057
|
self.readIdentifiable(child_element, type_element)
|
|
1049
1058
|
type_element.setArraySize(self.getChildElementOptionalLiteral(child_element, "ARRAY-SIZE")) \
|
|
1050
1059
|
.setArraySizeSemantics(self.getChildElementOptionalLiteral(child_element, "ARRAY-SIZE-SEMANTICS"))
|
|
1051
1060
|
self.readImplementationDataTypeElements(child_element, type_element)
|
|
1052
|
-
type_element.
|
|
1061
|
+
type_element.setSwDataDefProps(self.getSwDataDefProps(child_element, "SW-DATA-DEF-PROPS"))
|
|
1053
1062
|
|
|
1054
1063
|
def readImplementationDataType(self, element: ET.Element, parent: ARPackage):
|
|
1055
1064
|
short_name = self.getShortName(element)
|
|
@@ -1057,16 +1066,34 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1057
1066
|
self.readAutosarDataType(element, data_type)
|
|
1058
1067
|
self.readImplementationDataTypeElements(element, data_type)
|
|
1059
1068
|
data_type.setTypeEmitter(self.getChildElementOptionalLiteral(element, "TYPE-EMITTER"))
|
|
1060
|
-
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
'''
|
|
1072
|
+
if (data_type.getCategory().getValue() == ImplementationDataType.CATEGORY_ARRAY):
|
|
1061
1073
|
if (len(data_type.getImplementationDataTypeElements()) < 1):
|
|
1062
|
-
self._raiseError("Array Sub-Element of <%s> do not defined." % data_type.
|
|
1074
|
+
self._raiseError("Array Sub-Element of <%s> do not defined." % data_type.getShortName())
|
|
1075
|
+
|
|
1063
1076
|
array_sub_element = data_type.getImplementationDataTypeElements()[0]
|
|
1064
|
-
if (array_sub_element.
|
|
1077
|
+
if (array_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_REFERENCE):
|
|
1065
1078
|
data_type.setArrayElementType(array_sub_element.swDataDefProps.implementationDataTypeRef.value)
|
|
1066
|
-
elif (array_sub_element.
|
|
1079
|
+
elif (array_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_VALUE): # TODO: fix
|
|
1067
1080
|
return
|
|
1068
1081
|
else:
|
|
1069
|
-
self._raiseError("The category <%s> of array sub-element <%s> does not support." % (
|
|
1082
|
+
self._raiseError("The category <%s> of array sub-element <%s> does not support." % (
|
|
1083
|
+
array_sub_element.getCategory().getValue(), data_type.getShortName()))
|
|
1084
|
+
elif (data_type.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_STRUCTURE):
|
|
1085
|
+
if len(data_type.getImplementationDataTypeElements()) < 1:
|
|
1086
|
+
self._raiseError("Structure Sub-Element of <%s> do not defined." % data_type.getShortName())
|
|
1087
|
+
self.readImplementationDataTypeSymbolProps(element, data_type)
|
|
1088
|
+
struct_sub_element = data_type.getImplementationDataTypeElements()[0]
|
|
1089
|
+
if struct_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_REFERENCE:
|
|
1090
|
+
data_type.setStructElementType(struct_sub_element.getSwDataDefProps().getImplementationDataTypeRef().getValue())
|
|
1091
|
+
#elif struct_sub_element.getCategory().getValue() == ImplementationDataType.CATEGORY_TYPE_VALUE:
|
|
1092
|
+
# return
|
|
1093
|
+
else:
|
|
1094
|
+
self._raiseError("The category <%s> of structure sub-element <%s> does not support." % (
|
|
1095
|
+
struct_sub_element.getCategory().getValue(), data_type.getShortName()))
|
|
1096
|
+
'''
|
|
1070
1097
|
|
|
1071
1098
|
def readBaseTypeDirectDefinition(self, element: ET.Element, definition: BaseTypeDirectDefinition):
|
|
1072
1099
|
definition.base_type_size = self.getChildElementOptionalNumericalValue(element, "BASE-TYPE-SIZE")
|
|
@@ -1085,8 +1112,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1085
1112
|
iref = None
|
|
1086
1113
|
if child_element is not None:
|
|
1087
1114
|
iref = ApplicationCompositeElementInPortInterfaceInstanceRef()
|
|
1088
|
-
iref.
|
|
1089
|
-
|
|
1115
|
+
iref.setRootDataPrototypeRef(self.getChildElementOptionalRefType(child_element, "ROOT-DATA-PROTOTYPE-REF"))\
|
|
1116
|
+
.setTargetDataPrototypeRef(self.getChildElementOptionalRefType(child_element, "TARGET-DATA-PROTOTYPE-REF"))
|
|
1090
1117
|
return iref
|
|
1091
1118
|
|
|
1092
1119
|
def getCompositeNetworkRepresentation(self, element: ET.Element) -> CompositeNetworkRepresentation:
|
|
@@ -1096,9 +1123,9 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1096
1123
|
representation.network_representation = self.getSwDataDefProps(element, "NETWORK-REPRESENTATION")
|
|
1097
1124
|
return representation
|
|
1098
1125
|
|
|
1099
|
-
def readReceiverComSpec(self, element, com_spec: ReceiverComSpec):
|
|
1126
|
+
def readReceiverComSpec(self, element: ET.Element, com_spec: ReceiverComSpec):
|
|
1100
1127
|
self.readElementAttributes(element, com_spec)
|
|
1101
|
-
for child_element in
|
|
1128
|
+
for child_element in self.findall(element, "COMPOSITE-NETWORK-REPRESENTATIONS/COMPOSITE-NETWORK-REPRESENTATION"):
|
|
1102
1129
|
com_spec.addCompositeNetworkRepresentation(self.getCompositeNetworkRepresentation(child_element))
|
|
1103
1130
|
com_spec.dataElementRef = self.getChildElementOptionalRefType(element, "DATA-ELEMENT-REF")
|
|
1104
1131
|
com_spec.networkRepresentation = self.getSwDataDefProps(element, "NETWORK-REPRESENTATION")
|
|
@@ -1159,6 +1186,13 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1159
1186
|
com_spec.operationRef = self.getChildElementOptionalRefType(element, "OPERATION-REF")
|
|
1160
1187
|
return com_spec
|
|
1161
1188
|
|
|
1189
|
+
def getParameterRequireComSpec(self, element: ET.Element) -> ParameterRequireComSpec:
|
|
1190
|
+
com_spec = ParameterRequireComSpec()
|
|
1191
|
+
self.readElementAttributes(element, com_spec)
|
|
1192
|
+
com_spec.setInitValue(self.getInitValue(element)) \
|
|
1193
|
+
.setParameterRef(self.getChildElementOptionalRefType(element, "PARAMETER-REF"))
|
|
1194
|
+
return com_spec
|
|
1195
|
+
|
|
1162
1196
|
def getQueuedReceiverComSpec(self, element: ET.Element) -> QueuedReceiverComSpec:
|
|
1163
1197
|
com_spec = QueuedReceiverComSpec()
|
|
1164
1198
|
self.readElementAttributes(element, com_spec)
|
|
@@ -1194,6 +1228,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1194
1228
|
parent.addRequiredComSpec(self.getQueuedReceiverComSpec(child_element))
|
|
1195
1229
|
elif tag_name == "MODE-SWITCH-RECEIVER-COM-SPEC":
|
|
1196
1230
|
parent.addRequiredComSpec(self.getModeSwitchReceiverComSpec(child_element))
|
|
1231
|
+
elif tag_name == "PARAMETER-REQUIRE-COM-SPEC":
|
|
1232
|
+
parent.addRequiredComSpec(self.getParameterRequireComSpec(child_element))
|
|
1197
1233
|
else:
|
|
1198
1234
|
self._raiseError("Unsupported RequiredComSpec <%s>" % tag_name)
|
|
1199
1235
|
|
|
@@ -1202,12 +1238,12 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1202
1238
|
self.logger.debug("readRPortPrototype %s" % short_name)
|
|
1203
1239
|
prototype = parent.createRPortPrototype(short_name)
|
|
1204
1240
|
self.readIdentifiable(element, prototype)
|
|
1205
|
-
prototype.
|
|
1241
|
+
prototype.setRequiredInterfaceTRef(self.getChildElementOptionalRefType(element, "REQUIRED-INTERFACE-TREF"))
|
|
1206
1242
|
|
|
1207
1243
|
self.readRequiredComSpec(element, prototype)
|
|
1208
1244
|
|
|
1209
1245
|
def readAtomicSwComponentTypePorts(self, element: ET.Element, sw_component: AtomicSwComponentType):
|
|
1210
|
-
for child_element in
|
|
1246
|
+
for child_element in self.findall(element, "PORTS/*"):
|
|
1211
1247
|
tag_name = self.getTagName(child_element)
|
|
1212
1248
|
if tag_name == "P-PORT-PROTOTYPE":
|
|
1213
1249
|
self.readPPortPrototype(child_element, sw_component)
|
|
@@ -1277,19 +1313,19 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1277
1313
|
self.logger.debug("readPPortPrototype %s" % short_name)
|
|
1278
1314
|
prototype = parent.createPPortPrototype(short_name)
|
|
1279
1315
|
self.readIdentifiable(element, prototype)
|
|
1280
|
-
prototype.
|
|
1316
|
+
prototype.setProvidedInterfaceTRef(self.getChildElementOptionalRefType(element, "PROVIDED-INTERFACE-TREF"))
|
|
1281
1317
|
|
|
1282
1318
|
self.readProvidedComSpec(element, prototype)
|
|
1283
1319
|
|
|
1284
1320
|
def readPortGroupInnerGroupIRefs(self, element: ET.Element, parent: PortGroup):
|
|
1285
|
-
for child_element in
|
|
1321
|
+
for child_element in self.findall(element, "INNER-GROUP-IREFS/INNER-GROUP-IREF"):
|
|
1286
1322
|
inner_group_iref = InnerPortGroupInCompositionInstanceRef()
|
|
1287
|
-
inner_group_iref.contextRef = self.getChildElementOptionalRefType(child_element, "CONTEXT-REF")
|
|
1288
|
-
inner_group_iref.
|
|
1323
|
+
#inner_group_iref.contextRef = self.getChildElementOptionalRefType(child_element, "CONTEXT-REF")
|
|
1324
|
+
inner_group_iref.setTargetRef(self.getChildElementOptionalRefType(child_element, "TARGET-REF"))
|
|
1289
1325
|
parent.addInnerGroupIRef(inner_group_iref)
|
|
1290
1326
|
|
|
1291
1327
|
def readPortGroupOuterPortRefs(self, element: ET.Element, parent: PortGroup):
|
|
1292
|
-
for child_element in
|
|
1328
|
+
for child_element in self.findall(element, "OUTER-PORTS/PORT-PROTOTYPE-REF-CONDITIONAL"):
|
|
1293
1329
|
parent.addOuterPortRef(self.getChildElementOptionalRefType(child_element, "PORT-PROTOTYPE-REF"))
|
|
1294
1330
|
|
|
1295
1331
|
def readPortGroup(self, element: ET.Element, parent: SwComponentType):
|
|
@@ -1346,40 +1382,40 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1346
1382
|
self.readAtomicSwComponentType(element, sw_component)
|
|
1347
1383
|
|
|
1348
1384
|
def readPPortInCompositionInstanceRef(self, element: ET.Element, p_port_in_composition_instance_ref: PPortInCompositionInstanceRef):
|
|
1349
|
-
p_port_in_composition_instance_ref.
|
|
1350
|
-
|
|
1385
|
+
p_port_in_composition_instance_ref.setContextComponentRef(self.getChildElementOptionalRefType(element, "CONTEXT-COMPONENT-REF")) \
|
|
1386
|
+
.setTargetPPortRef(self.getChildElementOptionalRefType(element, "TARGET-P-PORT-REF"))
|
|
1351
1387
|
|
|
1352
1388
|
self.logger.debug("PPortInCompositionInstanceRef")
|
|
1353
1389
|
self.logger.debug(" CONTEXT-COMPONENT-REF DEST: %s, %s"
|
|
1354
|
-
% (p_port_in_composition_instance_ref.
|
|
1390
|
+
% (p_port_in_composition_instance_ref.getContextComponentRef().getDest(), p_port_in_composition_instance_ref.getContextComponentRef().getValue()))
|
|
1355
1391
|
self.logger.debug(" TARGET-P-PORT-REF DEST: %s, %s"
|
|
1356
|
-
% (p_port_in_composition_instance_ref.
|
|
1392
|
+
% (p_port_in_composition_instance_ref.getTargetPPortRef().getDest(), p_port_in_composition_instance_ref.getTargetPPortRef().getValue()))
|
|
1357
1393
|
|
|
1358
1394
|
def readRPortInCompositionInstanceRef(self, element, r_port_in_composition_instance_ref: RPortInCompositionInstanceRef):
|
|
1359
|
-
r_port_in_composition_instance_ref.
|
|
1360
|
-
|
|
1395
|
+
r_port_in_composition_instance_ref.setContextComponentRef(self.getChildElementOptionalRefType(element, "CONTEXT-COMPONENT-REF")) \
|
|
1396
|
+
.setTargetRPortRef(self.getChildElementOptionalRefType(element, "TARGET-R-PORT-REF"))
|
|
1361
1397
|
|
|
1362
1398
|
self.logger.debug("RPortInCompositionInstanceRef")
|
|
1363
1399
|
self.logger.debug(" CONTEXT-COMPONENT-REF DEST: %s, %s"
|
|
1364
|
-
% (r_port_in_composition_instance_ref.
|
|
1400
|
+
% (r_port_in_composition_instance_ref.getContextComponentRef().getDest(), r_port_in_composition_instance_ref.getContextComponentRef().getValue()))
|
|
1365
1401
|
self.logger.debug(" TARGET-P-PORT-REF DEST: %s, %s"
|
|
1366
|
-
% (r_port_in_composition_instance_ref.
|
|
1402
|
+
% (r_port_in_composition_instance_ref.getTargetRPortRef().getDest(), r_port_in_composition_instance_ref.getTargetRPortRef().getValue()))
|
|
1367
1403
|
|
|
1368
1404
|
def readAssemblySwConnectorProviderIRef(self, element: ET.Element, parent: AssemblySwConnector):
|
|
1369
|
-
child_element =
|
|
1405
|
+
child_element = self.find(element, "PROVIDER-IREF")
|
|
1370
1406
|
if (child_element is not None):
|
|
1371
1407
|
provide_iref = PPortInCompositionInstanceRef()
|
|
1372
1408
|
self.readElementAttributes(child_element, provide_iref)
|
|
1373
1409
|
self.readPPortInCompositionInstanceRef(child_element, provide_iref)
|
|
1374
|
-
parent.
|
|
1410
|
+
parent.setProviderIRef(provide_iref)
|
|
1375
1411
|
|
|
1376
1412
|
def readAssemblySwConnectorRequesterIRef(self, element: ET.Element, parent: AssemblySwConnector):
|
|
1377
|
-
child_element =
|
|
1413
|
+
child_element = self.find(element, "REQUESTER-IREF")
|
|
1378
1414
|
if (child_element is not None):
|
|
1379
1415
|
requester_iref = RPortInCompositionInstanceRef()
|
|
1380
1416
|
self.readElementAttributes(child_element, requester_iref)
|
|
1381
1417
|
self.readRPortInCompositionInstanceRef(child_element, requester_iref)
|
|
1382
|
-
parent.requester_iref
|
|
1418
|
+
parent.setRequesterIRef(requester_iref)
|
|
1383
1419
|
|
|
1384
1420
|
def readAssemblySwConnectors(self, element: ET.Element, parent: CompositionSwComponentType):
|
|
1385
1421
|
for child_element in element.findall("./xmlns:CONNECTORS/xmlns:ASSEMBLY-SW-CONNECTOR", self.nsmap):
|
|
@@ -1392,26 +1428,26 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1392
1428
|
self.readAssemblySwConnectorRequesterIRef(child_element, connector)
|
|
1393
1429
|
|
|
1394
1430
|
def readDelegationSwConnectorInnerPortIRef(self, element, parent: DelegationSwConnector):
|
|
1395
|
-
inner_port_iref_element =
|
|
1431
|
+
inner_port_iref_element = self.find(element, "INNER-PORT-IREF")
|
|
1396
1432
|
if (inner_port_iref_element is not None):
|
|
1397
|
-
child_element =
|
|
1433
|
+
child_element = self.find(inner_port_iref_element, "R-PORT-IN-COMPOSITION-INSTANCE-REF")
|
|
1398
1434
|
if (child_element is not None):
|
|
1399
1435
|
r_port_in_composition_instance_ref = RPortInCompositionInstanceRef()
|
|
1400
1436
|
self.readRPortInCompositionInstanceRef(child_element, r_port_in_composition_instance_ref)
|
|
1401
|
-
parent.
|
|
1437
|
+
parent.setInnerPortIRref(r_port_in_composition_instance_ref)
|
|
1402
1438
|
return
|
|
1403
1439
|
|
|
1404
|
-
child_element =
|
|
1440
|
+
child_element = self.find(inner_port_iref_element, "P-PORT-IN-COMPOSITION-INSTANCE-REF")
|
|
1405
1441
|
if (child_element is not None):
|
|
1406
1442
|
p_port_in_composition_instance_ref = PPortInCompositionInstanceRef()
|
|
1407
1443
|
self.readPPortInCompositionInstanceRef(child_element, p_port_in_composition_instance_ref)
|
|
1408
|
-
parent.
|
|
1444
|
+
parent.setInnerPortIRref(p_port_in_composition_instance_ref)
|
|
1409
1445
|
return
|
|
1410
1446
|
|
|
1411
1447
|
self._raiseError("Unsupported child element of INNER-PORT-IREF")
|
|
1412
1448
|
|
|
1413
1449
|
def readDelegationSwConnectors(self, element, parent: CompositionSwComponentType):
|
|
1414
|
-
for child_element in
|
|
1450
|
+
for child_element in self.findall(element, "CONNECTORS/DELEGATION-SW-CONNECTOR"):
|
|
1415
1451
|
short_name = self.getShortName(child_element)
|
|
1416
1452
|
self.logger.debug("readDelegationSwConnectors %s" % short_name)
|
|
1417
1453
|
|
|
@@ -1419,12 +1455,12 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1419
1455
|
self.readIdentifiable(child_element, connector)
|
|
1420
1456
|
self.readDelegationSwConnectorInnerPortIRef(child_element, connector)
|
|
1421
1457
|
|
|
1422
|
-
if connector.
|
|
1458
|
+
if connector.getInnerPortIRref() == None and connector.getOuterPortRef() == None:
|
|
1423
1459
|
self._raiseError("Invalid PortPrototype of DELEGATION-SW-CONNECTOR")
|
|
1424
1460
|
|
|
1425
|
-
connector.
|
|
1461
|
+
connector.setOuterPortRef(self.getChildElementOptionalRefType(child_element, "OUTER-PORT-REF"))
|
|
1426
1462
|
self.logger.debug("OUTER-PORT-REF DEST: %s, %s"
|
|
1427
|
-
% (connector.
|
|
1463
|
+
% (connector.getOuterPortRef().getDest(), connector.getOuterPortRef().getValue()))
|
|
1428
1464
|
|
|
1429
1465
|
def readSwComponentPrototypes(self, element: ET.Element, parent: CompositionSwComponentType):
|
|
1430
1466
|
for child_element in element.findall("./xmlns:COMPONENTS/xmlns:SW-COMPONENT-PROTOTYPE", self.nsmap):
|
|
@@ -1432,7 +1468,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1432
1468
|
self.logger.debug("readSwComponentPrototypes %s" % short_name)
|
|
1433
1469
|
prototype = parent.createSwComponentPrototype(short_name)
|
|
1434
1470
|
self.readIdentifiable(child_element, prototype)
|
|
1435
|
-
prototype.
|
|
1471
|
+
prototype.typeTRef = self.getChildElementOptionalRefType(child_element, "TYPE-TREF")
|
|
1436
1472
|
|
|
1437
1473
|
def readCompositionSwComponentTypeDataTypeMappingSet(self, element: ET.Element, parent: CompositionSwComponentType):
|
|
1438
1474
|
child_element = element.find("./xmlns:DATA-TYPE-MAPPING-REFS", self.nsmap)
|
|
@@ -1496,6 +1532,14 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1496
1532
|
.setHandleInvalid(self.getChildElementOptionalLiteral(child_element, "HANDLE-INVALID"))
|
|
1497
1533
|
sr_interface.addInvalidationPolicy(policy)
|
|
1498
1534
|
|
|
1535
|
+
def readInvalidationPolicys(self, element: ET.Element, parent: SenderReceiverInterface):
|
|
1536
|
+
for child_element in element.findall("./xmlns:INVALIDATION-POLICYS/xmlns:INVALIDATION-POLICY", self.nsmap):
|
|
1537
|
+
# short_name = self.getShortName(child_element)
|
|
1538
|
+
policy = parent.createInvalidationPolicy()
|
|
1539
|
+
self.readIdentifiable(child_element, policy)
|
|
1540
|
+
policy.data_element_ref = self.getChildElementOptionalRefType(child_element, "DATA-ELEMENT-REF")
|
|
1541
|
+
policy.handle_invalid = self.getChildElementOptionalLiteral(child_element, "HANDLE-INVALID")
|
|
1542
|
+
|
|
1499
1543
|
def readSenderReceiverInterfaces(self, element, parent: ARPackage):
|
|
1500
1544
|
short_name = self.getShortName(element)
|
|
1501
1545
|
sr_interface = parent.createSenderReceiverInterface(short_name)
|
|
@@ -1512,6 +1556,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1512
1556
|
prototype.swDataDefProps = self.getSwDataDefProps(child_element, "SW-DATA-DEF-PROPS")
|
|
1513
1557
|
prototype.typeTRef = self.getChildElementOptionalRefType(child_element, "TYPE-TREF")
|
|
1514
1558
|
prototype.direction = self.getChildElementOptionalLiteral(child_element, "DIRECTION")
|
|
1559
|
+
prototype.server_argument_impl_policy = self.getChildElementOptionalLiteral(child_element, "SERVER-ARGUMENT-IMPL-POLICY")
|
|
1515
1560
|
parent.addArgumentDataPrototype(prototype)
|
|
1516
1561
|
|
|
1517
1562
|
def readPossibleErrorRefs(self, element: ET.Element, parent: ClientServerOperation):
|
|
@@ -1532,6 +1577,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1532
1577
|
for child_element in element.findall("./xmlns:POSSIBLE-ERRORS/xmlns:APPLICATION-ERROR", self.nsmap):
|
|
1533
1578
|
short_name = self.getShortName(child_element)
|
|
1534
1579
|
error = parent.createApplicationError(short_name)
|
|
1580
|
+
self.readIdentifiable(child_element, error) # some errors has its uuid
|
|
1535
1581
|
error.error_code = self.getChildElementOptionalNumericalValue(child_element, "ERROR-CODE")
|
|
1536
1582
|
|
|
1537
1583
|
def readPortInterface(self, element: ET.Element, port_interface: PortInterface):
|
|
@@ -1582,6 +1628,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1582
1628
|
for child_element in element.findall('./xmlns:COMPU-SCALES/xmlns:COMPU-SCALE', self.nsmap):
|
|
1583
1629
|
compu_scale = CompuScale()
|
|
1584
1630
|
self.readElementAttributes(child_element, compu_scale)
|
|
1631
|
+
compu_scale.short_label = self.getChildElementOptionalLiteral(child_element, "SHORT-LABEL")
|
|
1585
1632
|
compu_scale.symbol = self.getChildElementOptionalLiteral(child_element, "SYMBOL")
|
|
1586
1633
|
compu_scale.lowerLimit = self.getChildLimitElement(child_element, "LOWER-LIMIT")
|
|
1587
1634
|
compu_scale.upperLimit = self.getChildLimitElement(child_element, "UPPER-LIMIT")
|
|
@@ -1768,10 +1815,10 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1768
1815
|
iref = None
|
|
1769
1816
|
if element is not None:
|
|
1770
1817
|
iref = VariableDataPrototypeInSystemInstanceRef()
|
|
1771
|
-
iref.
|
|
1772
|
-
iref.
|
|
1773
|
-
|
|
1774
|
-
|
|
1818
|
+
#iref.addContextComponentRef() = self.getChildElementOptionalRefType(element, "CONTEXT-COMPONENT-REF")
|
|
1819
|
+
iref.setContextCompositionRef(self.getChildElementOptionalRefType(element, "CONTEXT-COMPOSITION-REF")) \
|
|
1820
|
+
.setContextPortRef(self.getChildElementOptionalRefType(element, "CONTEXT-PORT-REF")) \
|
|
1821
|
+
.setTargetDataPrototypeRef(self.getChildElementOptionalRefType(element, "TARGET-DATA-PROTOTYPE-REF"))
|
|
1775
1822
|
return iref
|
|
1776
1823
|
|
|
1777
1824
|
def getEndToEndProtectionVariablePrototype(self, element: ET.Element) -> EndToEndProtectionVariablePrototype:
|
|
@@ -1815,6 +1862,20 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
1815
1862
|
self.readIdentifiable(element, data_type)
|
|
1816
1863
|
data_type.swDataDefProps = self.getSwDataDefProps(element, "SW-DATA-DEF-PROPS")
|
|
1817
1864
|
|
|
1865
|
+
def readImplementationProps(self, element: ET.Element, props: ImplementationProps):
|
|
1866
|
+
props.setSymbol(self.getChildElementOptionalLiteral(element, "SYMBOL"))
|
|
1867
|
+
|
|
1868
|
+
def readSymbolProps(self, element: ET.Element, props: SymbolProps):
|
|
1869
|
+
self.readImplementationProps(element, props)
|
|
1870
|
+
|
|
1871
|
+
def readImplementationDataTypeSymbolProps(self, element: ET.Element, data_type: ImplementationDataType):
|
|
1872
|
+
child_element = element.find("./xmlns:SYMBOL-PROPS", self.nsmap)
|
|
1873
|
+
if child_element is not None:
|
|
1874
|
+
short_name = self.getShortName(child_element)
|
|
1875
|
+
self.logger.debug("readSymbolProps %s" % short_name)
|
|
1876
|
+
props = data_type.createSymbolProps(short_name)
|
|
1877
|
+
self.readSymbolProps(child_element, props)
|
|
1878
|
+
|
|
1818
1879
|
def readApplicationDataType(self, element: ET.Element, data_type: ApplicationDataType):
|
|
1819
1880
|
self.readAutosarDataType(element, data_type)
|
|
1820
1881
|
|
|
@@ -2162,7 +2223,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2162
2223
|
.setNmRangeConfig(self.getChildElementRxIdentifierRange(element, "NM-RANGE-CONFIG"))
|
|
2163
2224
|
|
|
2164
2225
|
def readNmClusterNmNodes(self, element: ET.Element, parent: NmCluster):
|
|
2165
|
-
self.logger.debug("readNmConfigNmNodes %s" % parent.
|
|
2226
|
+
self.logger.debug("readNmConfigNmNodes %s" % parent.getShortName())
|
|
2166
2227
|
for child_element in self.findall(element, "NM-NODES/*"):
|
|
2167
2228
|
tag_name = self.getTagName(child_element)
|
|
2168
2229
|
if tag_name == "CAN-NM-NODE":
|
|
@@ -2309,7 +2370,7 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2309
2370
|
ref = self.getChildElementOptionalRefType(child_element, "ECUC-MODULE-CONFIGURATION-VALUES-REF")
|
|
2310
2371
|
if (ref is not None):
|
|
2311
2372
|
parent.addEcucValueRef(ref)
|
|
2312
|
-
self.logger.debug("EcucValue <%s> of EcucValueCollection <%s> has been added", ref.value, parent.
|
|
2373
|
+
self.logger.debug("EcucValue <%s> of EcucValueCollection <%s> has been added", ref.value, parent.getShortName())
|
|
2313
2374
|
|
|
2314
2375
|
def readEcucValueCollection(self, element: ET.Element, parent: ARPackage):
|
|
2315
2376
|
short_name = self.getShortName(element)
|
|
@@ -2363,8 +2424,8 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2363
2424
|
if child_element is not None:
|
|
2364
2425
|
instance_ref = AnyInstanceRef()
|
|
2365
2426
|
instance_ref.setBaseRef(self.getChildElementOptionalRefType(child_element, "BASE-REF")) \
|
|
2366
|
-
|
|
2367
|
-
|
|
2427
|
+
.setContextElementRef(self.getChildElementOptionalRefType(child_element, "CONTEXT-ELEMENT-REF")) \
|
|
2428
|
+
.setTargetRef(self.getChildElementOptionalRefType(child_element, "TARGET-REF"))
|
|
2368
2429
|
return instance_ref
|
|
2369
2430
|
|
|
2370
2431
|
def getEcucInstanceReferenceValue(self, element: ET.Element) -> EcucInstanceReferenceValue:
|
|
@@ -2556,9 +2617,22 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2556
2617
|
system.setEcuExtractVersion(self.getChildElementOptionalLiteral(element, "ECU-EXTRACT-VERSION"))
|
|
2557
2618
|
for child_element in self.findall(element, "FIBEX-ELEMENTS/FIBEX-ELEMENT-REF-CONDITIONAL"):
|
|
2558
2619
|
system.addFibexElementRef(self.getChildElementOptionalRefType(child_element, "FIBEX-ELEMENT-REF"))
|
|
2559
|
-
|
|
2560
2620
|
self.readSystemMappings(element, system)
|
|
2561
2621
|
|
|
2622
|
+
def readParameterInterfaceParameters(self, element: ET.Element, parent: ParameterInterface):
|
|
2623
|
+
for child_element in element.findall("./xmlns:PARAMETERS/xmlns:PARAMETER-DATA-PROTOTYPE", self.nsmap):
|
|
2624
|
+
short_name = self.getShortName(child_element)
|
|
2625
|
+
prototype = parent.createParameter(short_name)
|
|
2626
|
+
self.readParameterDataPrototype(child_element, prototype)
|
|
2627
|
+
|
|
2628
|
+
def readParameterInterface(self, element: ET.Element, parent: ARPackage):
|
|
2629
|
+
short_name = self.getShortName(element)
|
|
2630
|
+
self.logger.debug("ParameterInterface %s" % short_name)
|
|
2631
|
+
pi_interface = parent.createParameterInterface(short_name)
|
|
2632
|
+
self.readIdentifiable(element, pi_interface)
|
|
2633
|
+
self.readParameterInterfaceParameters(element, pi_interface)
|
|
2634
|
+
|
|
2635
|
+
|
|
2562
2636
|
def readARPackageElements(self, element: ET.Element, parent: ARPackage):
|
|
2563
2637
|
for child_element in self.findall(element, "./ELEMENTS/*"):
|
|
2564
2638
|
tag_name = self.getTagName(child_element.tag)
|
|
@@ -2668,9 +2742,10 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2668
2742
|
self.readEcucModuleConfigurationValues(child_element, parent)
|
|
2669
2743
|
elif tag_name == "PHYSICAL-DIMENSION":
|
|
2670
2744
|
self.readPhysicalDimensions(child_element, parent)
|
|
2745
|
+
elif tag_name == "PARAMETER-INTERFACE":
|
|
2746
|
+
self.readParameterInterface(child_element, parent)
|
|
2671
2747
|
else:
|
|
2672
2748
|
self._raiseError("Unsupported element type of ARPackage <%s>" % tag_name)
|
|
2673
|
-
#pass
|
|
2674
2749
|
|
|
2675
2750
|
def readARPackages(self, element: ET.Element, parent: ARPackage):
|
|
2676
2751
|
for child_element in element.findall("./xmlns:AR-PACKAGES/xmlns:AR-PACKAGE", self.nsmap):
|
|
@@ -2694,3 +2769,5 @@ class ARXMLParser(AbstractARXMLParser):
|
|
|
2694
2769
|
|
|
2695
2770
|
self.getAUTOSARInfo(root, document)
|
|
2696
2771
|
self.readARPackages(root, document)
|
|
2772
|
+
|
|
2773
|
+
document.reload()
|
|
@@ -5,11 +5,13 @@ from openpyxl.worksheet.worksheet import Worksheet
|
|
|
5
5
|
import openpyxl
|
|
6
6
|
import re
|
|
7
7
|
|
|
8
|
+
from ..models.m2.autosar_templates.generic_structure.ar_package import ARPackage
|
|
9
|
+
|
|
8
10
|
from ..parser.excel_parser import AbstractExcelParser
|
|
9
11
|
from ..data_models.sw_connector import AssemblySwConnectorData, DelegationSwConnectorData, SwConnectorData
|
|
10
12
|
from ..models.ar_ref import PPortInCompositionInstanceRef, RPortInCompositionInstanceRef, RefType
|
|
11
13
|
from ..models.sw_component import CompositionSwComponentType
|
|
12
|
-
from ..models.
|
|
14
|
+
from ..models.m2.autosar_templates.autosar_top_level_structure import AUTOSAR
|
|
13
15
|
|
|
14
16
|
class ConnectorXls:
|
|
15
17
|
|