armodel 1.7.2__py3-none-any.whl → 1.7.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- armodel/cli/arxml_dump_cli.py +1 -1
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +42 -19
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswInterfaces.py +104 -30
- armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +12 -16
- armodel/models/M2/AUTOSARTemplates/CommonStructure/FlatMap.py +70 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/Implementation.py +12 -9
- armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +29 -22
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/HardwareConfiguration.py +33 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/HeapUsage.py +10 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/SoftwareContext.py +23 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/StackUsage.py +93 -0
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ResourceConsumption/__init__.py +39 -5
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +26 -2
- armodel/models/M2/AUTOSARTemplates/CommonStructure/SwcBswMapping.py +48 -6
- armodel/models/M2/AUTOSARTemplates/GenericStructure/AbstractStructure.py +5 -5
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +21 -1
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +12 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +8 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +196 -5
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +11 -2
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +36 -21
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +10 -1
- armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +16 -1
- armodel/models/M2/MSR/CalibrationData/CalibrationValue.py +34 -3
- armodel/models/M2/MSR/DataDictionary/DataDefProperties.py +7 -0
- armodel/models/M2/MSR/DataDictionary/ServiceProcessTask.py +33 -0
- armodel/models/__init__.py +3 -0
- armodel/parser/abstract_arxml_parser.py +4 -14
- armodel/parser/arxml_parser.py +347 -180
- armodel/tests/test_armodel/models/test_ar_object.py +6 -2
- armodel/tests/test_armodel/models/test_port_interface.py +4 -4
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +48 -48
- armodel/writer/abstract_arxml_writer.py +1 -0
- armodel/writer/arxml_writer.py +351 -226
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/METADATA +15 -2
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/RECORD +40 -34
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/LICENSE +0 -0
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/WHEEL +0 -0
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.2.dist-info → armodel-1.7.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
from .....M2.AUTOSARTemplates.CommonStructure.ResourceConsumption import SoftwareContext
|
|
3
|
+
from .....M2.AUTOSARTemplates.CommonStructure.ResourceConsumption.HardwareConfiguration import HardwareConfiguration
|
|
4
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import PositiveInteger, RefType
|
|
5
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
6
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
7
|
+
|
|
8
|
+
class StackUsage(Identifiable, metaclass = ABCMeta):
|
|
9
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
10
|
+
if type(self) == StackUsage:
|
|
11
|
+
raise NotImplementedError("StackUsage is an abstract class.")
|
|
12
|
+
|
|
13
|
+
super().__init__(parent, short_name)
|
|
14
|
+
|
|
15
|
+
self.executableEntityRef = None # type: RefType
|
|
16
|
+
self.hardwareConfiguration = None # type: HardwareConfiguration
|
|
17
|
+
self.hwElementRef = None # type: RefType
|
|
18
|
+
self.softwareContext = None # type: SoftwareContext
|
|
19
|
+
|
|
20
|
+
def getExecutableEntityRef(self):
|
|
21
|
+
return self.executableEntityRef
|
|
22
|
+
|
|
23
|
+
def setExecutableEntityRef(self, value):
|
|
24
|
+
self.executableEntityRef = value
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def getHardwareConfiguration(self):
|
|
28
|
+
return self.hardwareConfiguration
|
|
29
|
+
|
|
30
|
+
def setHardwareConfiguration(self, value):
|
|
31
|
+
self.hardwareConfiguration = value
|
|
32
|
+
return self
|
|
33
|
+
|
|
34
|
+
def getHwElementRef(self):
|
|
35
|
+
return self.hwElementRef
|
|
36
|
+
|
|
37
|
+
def setHwElementRef(self, value):
|
|
38
|
+
self.hwElementRef = value
|
|
39
|
+
return self
|
|
40
|
+
|
|
41
|
+
def getSoftwareContext(self):
|
|
42
|
+
return self.softwareContext
|
|
43
|
+
|
|
44
|
+
def setSoftwareContext(self, value):
|
|
45
|
+
self.softwareContext = value
|
|
46
|
+
return self
|
|
47
|
+
|
|
48
|
+
class MeasuredStackUsage(StackUsage):
|
|
49
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
50
|
+
super().__init__(parent, short_name)
|
|
51
|
+
|
|
52
|
+
self.averageMemoryConsumption = None # type: PositiveInteger
|
|
53
|
+
self.maximumMemoryConsumption = None # type: PositiveInteger
|
|
54
|
+
|
|
55
|
+
def getAverageMemoryConsumption(self):
|
|
56
|
+
return self.averageMemoryConsumption
|
|
57
|
+
|
|
58
|
+
def setAverageMemoryConsumption(self, value):
|
|
59
|
+
self.averageMemoryConsumption = value
|
|
60
|
+
return self
|
|
61
|
+
|
|
62
|
+
def getMaximumMemoryConsumption(self):
|
|
63
|
+
return self.maximumMemoryConsumption
|
|
64
|
+
|
|
65
|
+
def setMaximumMemoryConsumption(self, value):
|
|
66
|
+
self.maximumMemoryConsumption = value
|
|
67
|
+
return self
|
|
68
|
+
|
|
69
|
+
class RoughEstimateStackUsage(StackUsage):
|
|
70
|
+
def __init__(self, parent, short_name):
|
|
71
|
+
super().__init__(parent, short_name)
|
|
72
|
+
|
|
73
|
+
self.memoryConsumption = None # type: PositiveInteger
|
|
74
|
+
|
|
75
|
+
def getMemoryConsumption(self):
|
|
76
|
+
return self.memoryConsumption
|
|
77
|
+
|
|
78
|
+
def setMemoryConsumption(self, value):
|
|
79
|
+
self.memoryConsumption = value
|
|
80
|
+
return self
|
|
81
|
+
|
|
82
|
+
class WorstCaseStackUsage(StackUsage):
|
|
83
|
+
def __init__(self, parent, short_name):
|
|
84
|
+
super().__init__(parent, short_name)
|
|
85
|
+
|
|
86
|
+
self.memoryConsumption = None # type: PositiveInteger
|
|
87
|
+
|
|
88
|
+
def getMemoryConsumption(self):
|
|
89
|
+
return self.memoryConsumption
|
|
90
|
+
|
|
91
|
+
def setMemoryConsumption(self, value):
|
|
92
|
+
self.memoryConsumption = value
|
|
93
|
+
return self
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from .....M2.AUTOSARTemplates.CommonStructure.ResourceConsumption.StackUsage import MeasuredStackUsage, RoughEstimateStackUsage, StackUsage, WorstCaseStackUsage
|
|
2
|
+
from .....M2.AUTOSARTemplates.CommonStructure.ResourceConsumption.HeapUsage import HeapUsage
|
|
1
3
|
from .....M2.AUTOSARTemplates.CommonStructure.ResourceConsumption.MemorySectionUsage import MemorySection
|
|
2
4
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
3
5
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
@@ -7,14 +9,46 @@ class ResourceConsumption(Identifiable):
|
|
|
7
9
|
def __init__(self, parent: ARObject, short_name: str):
|
|
8
10
|
super().__init__(parent, short_name)
|
|
9
11
|
|
|
12
|
+
self.accessCountSets = [] # type: List[AccessCountSet]
|
|
13
|
+
self.executionTimes = [] # type: List[ExecutionTime]
|
|
14
|
+
self.heapUsages = [] # type: List[HeapUsage]
|
|
15
|
+
self.memorySections = []
|
|
16
|
+
self.sectionNamePrefixs = [] # type: List[SectionNamePrefix]
|
|
17
|
+
self.stackUsages = [] # type: List[StackUsage]
|
|
18
|
+
|
|
10
19
|
def createMemorySection(self, short_name: str) -> MemorySection:
|
|
11
20
|
if (short_name not in self.elements):
|
|
12
|
-
|
|
13
|
-
self.
|
|
14
|
-
|
|
21
|
+
section = MemorySection(self, short_name)
|
|
22
|
+
self.addElement(section)
|
|
23
|
+
self.memorySections.append(section)
|
|
24
|
+
return self.getElement(short_name)
|
|
15
25
|
|
|
16
26
|
def getMemorySections(self) -> List[MemorySection]:
|
|
17
|
-
return list(filter(lambda a
|
|
27
|
+
return list(sorted(filter(lambda a: isinstance(a, MemorySection), self.elements.values()), key= lambda o:o.short_name))
|
|
18
28
|
|
|
19
29
|
def getMemorySection(self, short_name: str) -> MemorySection:
|
|
20
|
-
return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements.values()), None)
|
|
30
|
+
return next(filter(lambda o: isinstance(o, MemorySection) and (o.short_name == short_name), self.elements.values()), None)
|
|
31
|
+
|
|
32
|
+
def createMeasuredStackUsage(self, short_name: str) -> MeasuredStackUsage:
|
|
33
|
+
if (short_name not in self.elements):
|
|
34
|
+
section = MeasuredStackUsage(self, short_name)
|
|
35
|
+
self.addElement(section)
|
|
36
|
+
self.stackUsages.append(section)
|
|
37
|
+
return self.getElement(short_name)
|
|
38
|
+
|
|
39
|
+
def createRoughEstimateStackUsage(self, short_name: str) -> RoughEstimateStackUsage:
|
|
40
|
+
if (short_name not in self.elements):
|
|
41
|
+
section = RoughEstimateStackUsage(self, short_name)
|
|
42
|
+
self.addElement(section)
|
|
43
|
+
self.stackUsages.append(section)
|
|
44
|
+
return self.getElement(short_name)
|
|
45
|
+
|
|
46
|
+
def createWorstCaseStackUsage(self, short_name: str) -> WorstCaseStackUsage:
|
|
47
|
+
if (short_name not in self.elements):
|
|
48
|
+
section = WorstCaseStackUsage(self, short_name)
|
|
49
|
+
self.addElement(section)
|
|
50
|
+
self.stackUsages.append(section)
|
|
51
|
+
return self.getElement(short_name)
|
|
52
|
+
|
|
53
|
+
def getStackUsages(self) -> List[StackUsage]:
|
|
54
|
+
return list(sorted(filter(lambda a: isinstance(a, StackUsage), self.elements.values()), key= lambda o:o.short_name))
|
|
@@ -611,6 +611,28 @@ class DiagEventDebounceTimeBased(DiagEventDebounceAlgorithm):
|
|
|
611
611
|
self.timePassedThreshold = value
|
|
612
612
|
return self
|
|
613
613
|
|
|
614
|
+
class DiagnosticEventInfoNeeds(DiagnosticCapabilityElement):
|
|
615
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
616
|
+
super().__init__(parent, short_name)
|
|
617
|
+
|
|
618
|
+
# type: PositiveInteger
|
|
619
|
+
self.obdDtcNumber = None
|
|
620
|
+
# type: PositiveInteger
|
|
621
|
+
self.udsDtcNumber = None
|
|
622
|
+
|
|
623
|
+
def getObdDtcNumber(self):
|
|
624
|
+
return self.obdDtcNumber
|
|
625
|
+
|
|
626
|
+
def setObdDtcNumber(self, value):
|
|
627
|
+
self.obdDtcNumber = value
|
|
628
|
+
return self
|
|
629
|
+
|
|
630
|
+
def getUdsDtcNumber(self):
|
|
631
|
+
return self.udsDtcNumber
|
|
632
|
+
|
|
633
|
+
def setUdsDtcNumber(self, value):
|
|
634
|
+
self.udsDtcNumber = value
|
|
635
|
+
return self
|
|
614
636
|
|
|
615
637
|
class DiagnosticEventNeeds(DiagnosticCapabilityElement):
|
|
616
638
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -698,8 +720,6 @@ class DiagnosticEventNeeds(DiagnosticCapabilityElement):
|
|
|
698
720
|
self.udsDtcNumber = value
|
|
699
721
|
return self
|
|
700
722
|
|
|
701
|
-
|
|
702
|
-
|
|
703
723
|
class CryptoServiceNeeds(ServiceNeeds):
|
|
704
724
|
def __init__(self, parent: ARObject, short_name: str):
|
|
705
725
|
super().__init__(parent, short_name)
|
|
@@ -736,3 +756,7 @@ class CryptoServiceNeeds(ServiceNeeds):
|
|
|
736
756
|
def setMaximumKeyLength(self, value):
|
|
737
757
|
self.maximumKeyLength = value
|
|
738
758
|
return self
|
|
759
|
+
|
|
760
|
+
class EcuStateMgrUserNeeds(ServiceNeeds):
|
|
761
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
762
|
+
super().__init__(parent, short_name)
|
|
@@ -14,22 +14,64 @@ class SwcBswRunnableMapping(ARObject):
|
|
|
14
14
|
'''
|
|
15
15
|
super().__init__()
|
|
16
16
|
|
|
17
|
-
self.bswEntityRef
|
|
17
|
+
self.bswEntityRef = None # type: RefType
|
|
18
18
|
self.swcRunnableRef = None # type: RefType
|
|
19
19
|
|
|
20
|
+
def getBswEntityRef(self):
|
|
21
|
+
return self.bswEntityRef
|
|
22
|
+
|
|
23
|
+
def setBswEntityRef(self, value):
|
|
24
|
+
self.bswEntityRef = value
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def getSwcRunnableRef(self):
|
|
28
|
+
return self.swcRunnableRef
|
|
29
|
+
|
|
30
|
+
def setSwcRunnableRef(self, value):
|
|
31
|
+
self.swcRunnableRef = value
|
|
32
|
+
return self
|
|
20
33
|
|
|
21
34
|
class SwcBswMapping(Identifiable):
|
|
22
35
|
def __init__(self, parent: ARObject, short_name: str):
|
|
23
36
|
super().__init__(parent, short_name)
|
|
24
37
|
|
|
25
38
|
self.bswBehaviorRef = None # type: RefType
|
|
26
|
-
self.
|
|
39
|
+
self.runnableMappings = [] # type: List[SwcBswRunnableMapping]
|
|
27
40
|
self.swcBehaviorRef = None # type: RefType
|
|
28
41
|
self.synchronizedModeGroups = []
|
|
29
42
|
self.synchronizedTriggers = []
|
|
30
43
|
|
|
31
|
-
def
|
|
32
|
-
self.
|
|
44
|
+
def getBswBehaviorRef(self):
|
|
45
|
+
return self.bswBehaviorRef
|
|
46
|
+
|
|
47
|
+
def setBswBehaviorRef(self, value):
|
|
48
|
+
self.bswBehaviorRef = value
|
|
49
|
+
return self
|
|
50
|
+
|
|
51
|
+
def getRunnableMappings(self):
|
|
52
|
+
return self.runnableMappings
|
|
53
|
+
|
|
54
|
+
def addRunnableMapping(self, value):
|
|
55
|
+
self.runnableMappings.append(value)
|
|
56
|
+
return self
|
|
57
|
+
|
|
58
|
+
def getSwcBehaviorRef(self):
|
|
59
|
+
return self.swcBehaviorRef
|
|
60
|
+
|
|
61
|
+
def setSwcBehaviorRef(self, value):
|
|
62
|
+
self.swcBehaviorRef = value
|
|
63
|
+
return self
|
|
64
|
+
|
|
65
|
+
def getSynchronizedModeGroups(self):
|
|
66
|
+
return self.synchronizedModeGroups
|
|
67
|
+
|
|
68
|
+
def setSynchronizedModeGroups(self, value):
|
|
69
|
+
self.synchronizedModeGroups = value
|
|
70
|
+
return self
|
|
71
|
+
|
|
72
|
+
def getSynchronizedTriggers(self):
|
|
73
|
+
return self.synchronizedTriggers
|
|
33
74
|
|
|
34
|
-
def
|
|
35
|
-
|
|
75
|
+
def setSynchronizedTriggers(self, value):
|
|
76
|
+
self.synchronizedTriggers = value
|
|
77
|
+
return self
|
|
@@ -42,7 +42,7 @@ class AnyInstanceRef(ARObject):
|
|
|
42
42
|
super().__init__()
|
|
43
43
|
|
|
44
44
|
self.baseRef = None # type: RefType
|
|
45
|
-
self.
|
|
45
|
+
self.contextElementRefs = [] # type: List[RefType]
|
|
46
46
|
self.targetRef = None # type: RefType
|
|
47
47
|
|
|
48
48
|
def getBaseRef(self) -> RefType:
|
|
@@ -52,11 +52,11 @@ class AnyInstanceRef(ARObject):
|
|
|
52
52
|
self.baseRef = value
|
|
53
53
|
return self
|
|
54
54
|
|
|
55
|
-
def
|
|
56
|
-
return self.
|
|
55
|
+
def getContextElementRefs(self) -> List[RefType]:
|
|
56
|
+
return self.contextElementRefs
|
|
57
57
|
|
|
58
|
-
def
|
|
59
|
-
self.
|
|
58
|
+
def addContextElementRef(self, value: RefType):
|
|
59
|
+
self.contextElementRefs.append(value)
|
|
60
60
|
return self
|
|
61
61
|
|
|
62
62
|
def getTargetRef(self) -> RefType:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from typing import Dict, List
|
|
2
|
+
|
|
2
3
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Boolean, Identifier, RefType, ReferrableSubtypesEnum
|
|
3
4
|
from .....M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.EcuInstance import EcuInstance
|
|
4
5
|
from .....M2.AUTOSARTemplates.CommonStructure.Timing.TimingConstraint.TimingExtensions import SwcTiming
|
|
@@ -13,6 +14,7 @@ from .....M2.MSR.DataDictionary.RecordLayout import SwRecordLayout
|
|
|
13
14
|
from .....M2.AUTOSARTemplates.BswModuleTemplate.BswOverview import BswModuleDescription
|
|
14
15
|
from .....M2.AUTOSARTemplates.BswModuleTemplate.BswInterfaces import BswModuleEntry
|
|
15
16
|
from .....M2.AUTOSARTemplates.CommonStructure.Implementation import Implementation
|
|
17
|
+
from .....M2.AUTOSARTemplates.CommonStructure.FlatMap import FlatMap
|
|
16
18
|
from .....M2.AUTOSARTemplates.BswModuleTemplate.BswImplementation import BswImplementation
|
|
17
19
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
18
20
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import CollectableElement, Identifiable, Referrable
|
|
@@ -31,7 +33,7 @@ from .....M2.AUTOSARTemplates.SWComponentTemplate.SwcImplementation import SwcIm
|
|
|
31
33
|
from .....M2.AUTOSARTemplates.CommonStructure import ConstantSpecification
|
|
32
34
|
from .....M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
|
|
33
35
|
from .....M2.AUTOSARTemplates.ECUCDescriptionTemplate import EcucModuleConfigurationValues, EcucValueCollection
|
|
34
|
-
from .....M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ClientServerInterface, ModeSwitchInterface, ParameterInterface, SenderReceiverInterface, TriggerInterface
|
|
36
|
+
from .....M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import ClientServerInterface, ModeSwitchInterface, ParameterInterface, PortInterfaceMappingSet, SenderReceiverInterface, TriggerInterface
|
|
35
37
|
from .....M2.AUTOSARTemplates.SystemTemplate import System
|
|
36
38
|
from .....M2.AUTOSARTemplates.SystemTemplate.NetworkManagement import NmConfig
|
|
37
39
|
from .....M2.AUTOSARTemplates.SystemTemplate.TransportProtocols import CanTpConfig
|
|
@@ -186,6 +188,12 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
186
188
|
set = LifeCycleInfoSet(self, short_name)
|
|
187
189
|
self.addElement(set)
|
|
188
190
|
return self.getElement(short_name)
|
|
191
|
+
|
|
192
|
+
def createFlatMap(self, short_name: str) -> FlatMap:
|
|
193
|
+
if (short_name not in self.elements):
|
|
194
|
+
set = FlatMap(self, short_name)
|
|
195
|
+
self.addElement(set)
|
|
196
|
+
return self.getElement(short_name)
|
|
189
197
|
|
|
190
198
|
def createClientServerInterface(self, short_name: str) -> ClientServerInterface:
|
|
191
199
|
if (short_name not in self.elements):
|
|
@@ -456,6 +464,18 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
456
464
|
element = System(self, short_name)
|
|
457
465
|
self.addElement(element)
|
|
458
466
|
return self.getElement(short_name)
|
|
467
|
+
|
|
468
|
+
def createFlatMap(self, short_name: str) -> FlatMap:
|
|
469
|
+
if (short_name not in self.elements):
|
|
470
|
+
map = FlatMap(self, short_name)
|
|
471
|
+
self.addElement(map)
|
|
472
|
+
return self.getElement(short_name)
|
|
473
|
+
|
|
474
|
+
def createPortInterfaceMappingSet(self, short_name: str) -> PortInterfaceMappingSet:
|
|
475
|
+
if (short_name not in self.elements):
|
|
476
|
+
map = PortInterfaceMappingSet(self, short_name)
|
|
477
|
+
self.addElement(map)
|
|
478
|
+
return self.getElement(short_name)
|
|
459
479
|
|
|
460
480
|
def getApplicationPrimitiveDataTypes(self) -> List[ApplicationPrimitiveDataType]:
|
|
461
481
|
return list(sorted(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()), key= lambda o:o.short_name))
|
armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py
CHANGED
|
@@ -447,3 +447,15 @@ class DiagRequirementIdString(ARLiteral):
|
|
|
447
447
|
def __init__(self):
|
|
448
448
|
super().__init__()
|
|
449
449
|
|
|
450
|
+
|
|
451
|
+
class ArgumentDirectionEnum(AREnum):
|
|
452
|
+
IN = "in"
|
|
453
|
+
INOUT = "inout"
|
|
454
|
+
OUT = "out"
|
|
455
|
+
|
|
456
|
+
def __init__(self):
|
|
457
|
+
super().__init__((
|
|
458
|
+
ArgumentDirectionEnum.IN,
|
|
459
|
+
ArgumentDirectionEnum.INOUT,
|
|
460
|
+
ArgumentDirectionEnum.OUT
|
|
461
|
+
))
|
|
@@ -34,9 +34,17 @@ class AssemblySwConnector(SwConnector):
|
|
|
34
34
|
def __init__(self, parent: ARObject, short_name: str):
|
|
35
35
|
super().__init__(parent, short_name)
|
|
36
36
|
|
|
37
|
+
self.mappingRef = None # type: RefType
|
|
37
38
|
self.providerIRef = None # type: PPortInCompositionInstanceRef
|
|
38
39
|
self.requesterIRef = None # type: RPortInCompositionInstanceRef
|
|
39
40
|
|
|
41
|
+
def getMappingRef(self):
|
|
42
|
+
return self.mappingRef
|
|
43
|
+
|
|
44
|
+
def setMappingRef(self, value):
|
|
45
|
+
self.mappingRef = value
|
|
46
|
+
return self
|
|
47
|
+
|
|
40
48
|
def getProviderIRef(self) -> PPortInCompositionInstanceRef:
|
|
41
49
|
return self.providerIRef
|
|
42
50
|
|
|
@@ -3,9 +3,9 @@ from typing import List
|
|
|
3
3
|
|
|
4
4
|
from .....M2.AUTOSARTemplates.CommonStructure import TextValueSpecification
|
|
5
5
|
from .....M2.AUTOSARTemplates.CommonStructure.TriggerDeclaration import Trigger
|
|
6
|
-
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
6
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import ARElement, Identifiable
|
|
7
7
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
8
|
-
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical, PositiveInteger
|
|
8
|
+
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARLiteral, ARNumerical, ArgumentDirectionEnum, PositiveInteger
|
|
9
9
|
from .....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import ParameterDataPrototype, VariableDataPrototype, AutosarDataPrototype
|
|
10
10
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARBoolean
|
|
11
11
|
from .....M2.AUTOSARTemplates.CommonStructure.ModeDeclaration import ModeDeclarationGroupPrototype
|
|
@@ -183,8 +183,24 @@ class SenderReceiverInterface(DataInterface):
|
|
|
183
183
|
class ArgumentDataPrototype(AutosarDataPrototype):
|
|
184
184
|
def __init__(self, parent: ARObject, short_name: str):
|
|
185
185
|
super().__init__(parent, short_name)
|
|
186
|
-
|
|
187
|
-
self.
|
|
186
|
+
|
|
187
|
+
self.direction = None # type: ArgumentDirectionEnum
|
|
188
|
+
# type: ServerArgumentImplPolicyEnum
|
|
189
|
+
self.serverArgumentImplPolicy = None
|
|
190
|
+
|
|
191
|
+
def getDirection(self):
|
|
192
|
+
return self.direction
|
|
193
|
+
|
|
194
|
+
def setDirection(self, value):
|
|
195
|
+
self.direction = value
|
|
196
|
+
return self
|
|
197
|
+
|
|
198
|
+
def getServerArgumentImplPolicy(self):
|
|
199
|
+
return self.serverArgumentImplPolicy
|
|
200
|
+
|
|
201
|
+
def setServerArgumentImplPolicy(self, value):
|
|
202
|
+
self.serverArgumentImplPolicy = value
|
|
203
|
+
return self
|
|
188
204
|
|
|
189
205
|
class ApplicationError(Identifiable):
|
|
190
206
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -287,4 +303,179 @@ class ModeSwitchInterface(PortInterface):
|
|
|
287
303
|
return self.elements[short_name]
|
|
288
304
|
|
|
289
305
|
def getModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
290
|
-
return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key= lambda o: o.short_name))
|
|
306
|
+
return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key= lambda o: o.short_name))
|
|
307
|
+
|
|
308
|
+
class PortInterfaceMapping(Identifiable, metaclass = ABCMeta):
|
|
309
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
310
|
+
if type(self) == PortInterface:
|
|
311
|
+
raise NotImplementedError("PortInterfaceMapping is an abstract class.")
|
|
312
|
+
super().__init__(parent, short_name)
|
|
313
|
+
|
|
314
|
+
class ClientServerApplicationErrorMapping(ARObject):
|
|
315
|
+
def __init__(self):
|
|
316
|
+
super().__init__()
|
|
317
|
+
|
|
318
|
+
self.firstApplicationErrorRef = None # type: RefType
|
|
319
|
+
self.secondApplicationErrorRef = None # type: RefType
|
|
320
|
+
|
|
321
|
+
def getFirstApplicationErrorRef(self):
|
|
322
|
+
return self.firstApplicationErrorRef
|
|
323
|
+
|
|
324
|
+
def setFirstApplicationErrorRef(self, value):
|
|
325
|
+
self.firstApplicationErrorRef = value
|
|
326
|
+
return self
|
|
327
|
+
|
|
328
|
+
def getSecondApplicationErrorRef(self):
|
|
329
|
+
return self.secondApplicationErrorRef
|
|
330
|
+
|
|
331
|
+
def setSecondApplicationErrorRef(self, value):
|
|
332
|
+
self.secondApplicationErrorRef = value
|
|
333
|
+
return self
|
|
334
|
+
|
|
335
|
+
class ClientServerOperationMapping(ARObject):
|
|
336
|
+
def __init__(self):
|
|
337
|
+
super().__init__()
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
self.argumentMappings = [] # type: List[DataPrototypeMapping]
|
|
341
|
+
self.firstOperationRef = None # type: RefType
|
|
342
|
+
self.firstToSecondDataTransformationRef = None # type: RefType
|
|
343
|
+
self.secondOperationRef = None # type: RefType
|
|
344
|
+
|
|
345
|
+
def getArgumentMappings(self):
|
|
346
|
+
return self.argumentMappings
|
|
347
|
+
|
|
348
|
+
def addArgumentMapping(self, value):
|
|
349
|
+
self.argumentMappings.append(value)
|
|
350
|
+
return self
|
|
351
|
+
|
|
352
|
+
def getFirstOperationRef(self):
|
|
353
|
+
return self.firstOperationRef
|
|
354
|
+
|
|
355
|
+
def setFirstOperationRef(self, value):
|
|
356
|
+
self.firstOperationRef = value
|
|
357
|
+
return self
|
|
358
|
+
|
|
359
|
+
def getFirstToSecondDataTransformationRef(self):
|
|
360
|
+
return self.firstToSecondDataTransformationRef
|
|
361
|
+
|
|
362
|
+
def setFirstToSecondDataTransformationRef(self, value):
|
|
363
|
+
self.firstToSecondDataTransformationRef = value
|
|
364
|
+
return self
|
|
365
|
+
|
|
366
|
+
def getSecondOperationRef(self):
|
|
367
|
+
return self.secondOperationRef
|
|
368
|
+
|
|
369
|
+
def setSecondOperationRef(self, value):
|
|
370
|
+
self.secondOperationRef = value
|
|
371
|
+
return self
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
class DataPrototypeMapping(ARObject):
|
|
375
|
+
def __init__(self):
|
|
376
|
+
super().__init__()
|
|
377
|
+
|
|
378
|
+
self.firstDataPrototypeRef = None # type: RefType
|
|
379
|
+
self.firstToSecondDataTransformationRef = None # type: RefType
|
|
380
|
+
self.secondDataPrototypeRef = None # type: RefType
|
|
381
|
+
self.secondToFirstDataTransformationRef = None # type: RefType
|
|
382
|
+
self.subElementMappings = [] # type: List[SubElementMapping]
|
|
383
|
+
self.textTableMappings = [] # type: List[TextTableMapping]
|
|
384
|
+
|
|
385
|
+
def getFirstDataPrototypeRef(self):
|
|
386
|
+
return self.firstDataPrototypeRef
|
|
387
|
+
|
|
388
|
+
def setFirstDataPrototypeRef(self, value):
|
|
389
|
+
self.firstDataPrototypeRef = value
|
|
390
|
+
return self
|
|
391
|
+
|
|
392
|
+
def getFirstToSecondDataTransformationRef(self):
|
|
393
|
+
return self.firstToSecondDataTransformationRef
|
|
394
|
+
|
|
395
|
+
def setFirstToSecondDataTransformationRef(self, value):
|
|
396
|
+
self.firstToSecondDataTransformationRef = value
|
|
397
|
+
return self
|
|
398
|
+
|
|
399
|
+
def getSecondDataPrototypeRef(self):
|
|
400
|
+
return self.secondDataPrototypeRef
|
|
401
|
+
|
|
402
|
+
def setSecondDataPrototypeRef(self, value):
|
|
403
|
+
self.secondDataPrototypeRef = value
|
|
404
|
+
return self
|
|
405
|
+
|
|
406
|
+
def getSecondToFirstDataTransformationRef(self):
|
|
407
|
+
return self.secondToFirstDataTransformationRef
|
|
408
|
+
|
|
409
|
+
def setSecondToFirstDataTransformationRef(self, value):
|
|
410
|
+
self.secondToFirstDataTransformationRef = value
|
|
411
|
+
return self
|
|
412
|
+
|
|
413
|
+
def getSubElementMappings(self):
|
|
414
|
+
return self.subElementMappings
|
|
415
|
+
|
|
416
|
+
def setSubElementMappings(self, value):
|
|
417
|
+
self.subElementMappings = value
|
|
418
|
+
return self
|
|
419
|
+
|
|
420
|
+
def getTextTableMappings(self):
|
|
421
|
+
return self.textTableMappings
|
|
422
|
+
|
|
423
|
+
def setTextTableMappings(self, value):
|
|
424
|
+
self.textTableMappings = value
|
|
425
|
+
return self
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
class ClientServerInterfaceMapping(PortInterfaceMapping):
|
|
430
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
431
|
+
super().__init__(parent, short_name)
|
|
432
|
+
|
|
433
|
+
# type: ClientServerApplicationErrorMapping
|
|
434
|
+
self.errorMappings = []
|
|
435
|
+
# type: ClientServerOperationMapping
|
|
436
|
+
self.operationMappings = []
|
|
437
|
+
|
|
438
|
+
def getErrorMappings(self):
|
|
439
|
+
return self.errorMappings
|
|
440
|
+
|
|
441
|
+
def setErrorMappings(self, value):
|
|
442
|
+
self.errorMappings = value
|
|
443
|
+
return self
|
|
444
|
+
|
|
445
|
+
def getOperationMappings(self):
|
|
446
|
+
return self.operationMappings
|
|
447
|
+
|
|
448
|
+
def setOperationMappings(self, value):
|
|
449
|
+
self.operationMappings = value
|
|
450
|
+
return self
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
class VariableAndParameterInterfaceMapping(PortInterfaceMapping):
|
|
454
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
455
|
+
super().__init__(parent, short_name)
|
|
456
|
+
|
|
457
|
+
self.dataMappings = [] # type: List[DataPrototypeMapping]
|
|
458
|
+
|
|
459
|
+
def getDataMappings(self):
|
|
460
|
+
return self.dataMappings
|
|
461
|
+
|
|
462
|
+
def addDataMapping(self, value):
|
|
463
|
+
self.dataMappings.append(value)
|
|
464
|
+
return self
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
class PortInterfaceMappingSet(ARElement):
|
|
468
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
469
|
+
super().__init__(parent, short_name)
|
|
470
|
+
|
|
471
|
+
self.portInterfaceMappings = [] # type: List[PortInterfaceMapping]
|
|
472
|
+
|
|
473
|
+
def getPortInterfaceMappings(self):
|
|
474
|
+
return self.portInterfaceMappings
|
|
475
|
+
|
|
476
|
+
def createVariableAndParameterInterfaceMapping(self, short_name):
|
|
477
|
+
if (short_name not in self.elements):
|
|
478
|
+
mapping = VariableAndParameterInterfaceMapping(self, short_name)
|
|
479
|
+
self.addElement(mapping)
|
|
480
|
+
self.portInterfaceMappings.append(mapping)
|
|
481
|
+
return self.getElement(short_name)
|
armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import List
|
|
2
|
-
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagnosticCommunicationManagerNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, NvBlockNeeds, RoleBasedDataAssignment, ServiceNeeds
|
|
2
|
+
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagnosticCommunicationManagerNeeds, DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds, EcuStateMgrUserNeeds, NvBlockNeeds, RoleBasedDataAssignment, ServiceNeeds
|
|
3
3
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
4
4
|
from .....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Identifier, RefType
|
|
5
5
|
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import ServiceDependency
|
|
@@ -78,7 +78,13 @@ class SwcServiceDependency(ServiceDependency):
|
|
|
78
78
|
needs = CryptoServiceNeeds(self, short_name)
|
|
79
79
|
self.addElement(needs)
|
|
80
80
|
return self.getElement(short_name)
|
|
81
|
-
|
|
81
|
+
|
|
82
|
+
def createEcuStateMgrUserNeeds(self, short_name: str) -> EcuStateMgrUserNeeds:
|
|
83
|
+
if (short_name not in self.elements):
|
|
84
|
+
needs = EcuStateMgrUserNeeds(self, short_name)
|
|
85
|
+
self.addElement(needs)
|
|
86
|
+
return self.getElement(short_name)
|
|
87
|
+
|
|
82
88
|
def getNvBlockNeeds(self) -> List[NvBlockNeeds]:
|
|
83
89
|
return sorted(filter(lambda c: isinstance(c, NvBlockNeeds), self.elements.values()), key=lambda e: e.short_name)
|
|
84
90
|
|
|
@@ -93,6 +99,9 @@ class SwcServiceDependency(ServiceDependency):
|
|
|
93
99
|
|
|
94
100
|
def getCryptoServiceNeeds(self) -> List[CryptoServiceNeeds]:
|
|
95
101
|
return sorted(filter(lambda c: isinstance(c, CryptoServiceNeeds), self.elements.values()), key=lambda e: e.short_name)
|
|
102
|
+
|
|
103
|
+
def getEcuStateMgrUserNeeds(self) -> List[EcuStateMgrUserNeeds]:
|
|
104
|
+
return sorted(filter(lambda c: isinstance(c, EcuStateMgrUserNeeds), self.elements.values()), key=lambda e: e.short_name)
|
|
96
105
|
|
|
97
106
|
def getServiceNeeds(self) -> List[ServiceNeeds]:
|
|
98
107
|
return sorted(filter(lambda c: isinstance(c, ServiceNeeds), self.elements.values()), key=lambda e: e.short_name)
|