armodel 1.6.0__py3-none-any.whl → 1.6.1__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/data_models/sw_connector.py +3 -3
- armodel/models/__init__.py +4 -2
- 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 +5 -69
- 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/common_structure/implementation.py +21 -0
- armodel/models/m2/autosar_templates/common_structure/implementation_data_types.py +148 -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/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/arxml_parser.py +124 -58
- armodel/parser/file_parser.py +43 -0
- armodel/tests/test_armodel/models/test_ar_package.py +5 -2
- 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 +8 -8
- armodel/tests/test_armodel/models/test_port_interface.py +1 -1
- armodel/tests/test_armodel/parser/test_sw_components.py +1 -1
- armodel/writer/abstract_arxml_writer.py +5 -1
- armodel/writer/arxml_writer.py +68 -58
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/METADATA +5 -1
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/RECORD +52 -39
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/LICENSE +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/WHEEL +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/entry_points.txt +0 -0
- {armodel-1.6.0.dist-info → armodel-1.6.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
|
|
2
|
+
from abc import ABCMeta
|
|
3
|
+
|
|
4
|
+
from .....ar_ref import RefType
|
|
5
|
+
from ...generic_structure.abstract_structure import AtpInstanceRef
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class PortInCompositionTypeInstanceRef(AtpInstanceRef, metaclass = ABCMeta):
|
|
9
|
+
def __init__(self):
|
|
10
|
+
if type(self) == PortInCompositionTypeInstanceRef:
|
|
11
|
+
raise NotImplementedError("PortInCompositionTypeInstanceRef is an abstract class.")
|
|
12
|
+
|
|
13
|
+
super().__init__()
|
|
14
|
+
|
|
15
|
+
self.abstractContextComponentRef = None # type: RefType
|
|
16
|
+
self.baseRef = None # type: RefType
|
|
17
|
+
self.targetPortRef = None # type: RefType
|
|
18
|
+
|
|
19
|
+
def getAbstractContextComponentRef(self):
|
|
20
|
+
return self.abstractContextComponentRef
|
|
21
|
+
|
|
22
|
+
def setAbstractContextComponentRef(self, value):
|
|
23
|
+
self.abstractContextComponentRef = value
|
|
24
|
+
return self
|
|
25
|
+
|
|
26
|
+
def getBaseRef(self):
|
|
27
|
+
return self.baseRef
|
|
28
|
+
|
|
29
|
+
def setBaseRef(self, value):
|
|
30
|
+
self.baseRef = value
|
|
31
|
+
return self
|
|
32
|
+
|
|
33
|
+
def getTargetPortRef(self):
|
|
34
|
+
return self.targetPortRef
|
|
35
|
+
|
|
36
|
+
def setTargetPortRef(self, value):
|
|
37
|
+
self.targetPortRef = value
|
|
38
|
+
return self
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class PPortInCompositionInstanceRef(PortInCompositionTypeInstanceRef):
|
|
42
|
+
def __init__(self):
|
|
43
|
+
super().__init__()
|
|
44
|
+
|
|
45
|
+
self.contextComponentRef = None # type: RefType
|
|
46
|
+
self.targetPPortRef = None # type: RefType
|
|
47
|
+
|
|
48
|
+
def getContextComponentRef(self):
|
|
49
|
+
return self.contextComponentRef
|
|
50
|
+
|
|
51
|
+
def setContextComponentRef(self, value):
|
|
52
|
+
self.contextComponentRef = value
|
|
53
|
+
return self
|
|
54
|
+
|
|
55
|
+
def getTargetPPortRef(self):
|
|
56
|
+
return self.targetPPortRef
|
|
57
|
+
|
|
58
|
+
def setTargetPPortRef(self, value):
|
|
59
|
+
self.targetPPortRef = value
|
|
60
|
+
return self
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class RPortInCompositionInstanceRef(PortInCompositionTypeInstanceRef):
|
|
64
|
+
def __init__(self):
|
|
65
|
+
super().__init__()
|
|
66
|
+
|
|
67
|
+
self.contextComponentRef = None # type: RefType
|
|
68
|
+
self.targetRPortRef = None # type: RefType
|
|
69
|
+
|
|
70
|
+
def getContextComponentRef(self):
|
|
71
|
+
return self.contextComponentRef
|
|
72
|
+
|
|
73
|
+
def setContextComponentRef(self, value):
|
|
74
|
+
self.contextComponentRef = value
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
def getTargetRPortRef(self):
|
|
78
|
+
return self.targetRPortRef
|
|
79
|
+
|
|
80
|
+
def setTargetRPortRef(self, value):
|
|
81
|
+
self.targetRPortRef = value
|
|
82
|
+
return self
|
|
83
|
+
|
|
84
|
+
class OperationInAtomicSwcInstanceRef(AtpInstanceRef, metaclass=ABCMeta):
|
|
85
|
+
def __init__(self):
|
|
86
|
+
if type(self) == OperationInAtomicSwcInstanceRef:
|
|
87
|
+
raise NotImplementedError("OperationInAtomicSwcInstanceRef is an abstract class.")
|
|
88
|
+
|
|
89
|
+
super().__init__()
|
|
90
|
+
|
|
91
|
+
self.baseRef = None # type: RefType
|
|
92
|
+
self.contextPortRef = None # type: RefType
|
|
93
|
+
self.targetOperationRef = None # type: RefType
|
|
94
|
+
|
|
95
|
+
def getBaseRef(self):
|
|
96
|
+
return self.baseRef
|
|
97
|
+
|
|
98
|
+
def setBaseRef(self, value):
|
|
99
|
+
self.baseRef = value
|
|
100
|
+
return self
|
|
101
|
+
|
|
102
|
+
def getContextPortRef(self):
|
|
103
|
+
return self.contextPortRef
|
|
104
|
+
|
|
105
|
+
def setContextPortRef(self, value):
|
|
106
|
+
self.contextPortRef = value
|
|
107
|
+
return self
|
|
108
|
+
|
|
109
|
+
def getTargetOperationRef(self):
|
|
110
|
+
return self.targetOperationRef
|
|
111
|
+
|
|
112
|
+
def setTargetOperationRef(self, value):
|
|
113
|
+
self.targetOperationRef = value
|
|
114
|
+
return self
|
|
115
|
+
|
|
116
|
+
class POperationInAtomicSwcInstanceRef(OperationInAtomicSwcInstanceRef):
|
|
117
|
+
def __init__(self):
|
|
118
|
+
super().__init__()
|
|
119
|
+
|
|
120
|
+
self.contextPPortRef = None # type: RefType
|
|
121
|
+
self.targetProvidedOperationRef = None # type: RefType
|
|
122
|
+
|
|
123
|
+
def getContextPPortRef(self):
|
|
124
|
+
return self.contextPPortRef
|
|
125
|
+
|
|
126
|
+
def setContextPPortRef(self, value):
|
|
127
|
+
self.contextPPortRef = value
|
|
128
|
+
return self
|
|
129
|
+
|
|
130
|
+
def getTargetProvidedOperationRef(self):
|
|
131
|
+
return self.targetProvidedOperationRef
|
|
132
|
+
|
|
133
|
+
def setTargetProvidedOperationRef(self, value):
|
|
134
|
+
self.targetProvidedOperationRef = value
|
|
135
|
+
return self
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class ROperationInAtomicSwcInstanceRef(OperationInAtomicSwcInstanceRef):
|
|
139
|
+
def __init__(self):
|
|
140
|
+
super().__init__()
|
|
141
|
+
|
|
142
|
+
self.contextRPortRef = None # type: RefType
|
|
143
|
+
self.targetRequiredOperationRef = None # type: RefType
|
|
144
|
+
|
|
145
|
+
def getContextRPortRef(self):
|
|
146
|
+
return self.contextRPortRef
|
|
147
|
+
|
|
148
|
+
def setContextRPortRef(self, value):
|
|
149
|
+
self.contextRPortRef = value
|
|
150
|
+
return self
|
|
151
|
+
|
|
152
|
+
def getTargetRequiredOperationRef(self):
|
|
153
|
+
return self.targetRequiredOperationRef
|
|
154
|
+
|
|
155
|
+
def setTargetRequiredOperationRef(self, value):
|
|
156
|
+
self.targetRequiredOperationRef = value
|
|
157
|
+
return self
|
|
File without changes
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
|
|
3
|
+
from .....ar_object import ARNumerical
|
|
4
|
+
from .....ar_ref import RefType
|
|
5
|
+
from ....msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
6
|
+
from ...common_structure import ValueSpecification
|
|
7
|
+
from .....general_structure import AtpFeature, ARObject
|
|
8
|
+
|
|
9
|
+
class AtpPrototype(AtpFeature, metaclass = ABCMeta):
|
|
10
|
+
def __init__(self, parent:ARObject, short_name: str):
|
|
11
|
+
if type(self) == AtpPrototype:
|
|
12
|
+
raise NotImplementedError("AtpPrototype is an abstract class.")
|
|
13
|
+
|
|
14
|
+
super().__init__(parent, short_name)
|
|
15
|
+
|
|
16
|
+
class DataPrototype(AtpPrototype, metaclass = ABCMeta):
|
|
17
|
+
def __init__(self, parent:ARObject, short_name: str):
|
|
18
|
+
if type(self) == DataPrototype:
|
|
19
|
+
raise NotImplementedError("DataPrototype is an abstract class.")
|
|
20
|
+
|
|
21
|
+
super().__init__(parent, short_name)
|
|
22
|
+
|
|
23
|
+
self.swDataDefProps = None # type: SwDataDefProps
|
|
24
|
+
|
|
25
|
+
def getSwDataDefProps(self):
|
|
26
|
+
return self.swDataDefProps
|
|
27
|
+
|
|
28
|
+
def setSwDataDefProps(self, value):
|
|
29
|
+
self.swDataDefProps = value
|
|
30
|
+
return self
|
|
31
|
+
|
|
32
|
+
class AutosarDataPrototype(DataPrototype, metaclass = ABCMeta):
|
|
33
|
+
def __init__(self, parent:ARObject, short_name: str):
|
|
34
|
+
if type(self) == AutosarDataPrototype:
|
|
35
|
+
raise NotImplementedError("AutosarDataPrototype is an abstract class.")
|
|
36
|
+
|
|
37
|
+
super().__init__(parent, short_name)
|
|
38
|
+
|
|
39
|
+
self.typeTRef = None
|
|
40
|
+
|
|
41
|
+
def getTypeTRef(self):
|
|
42
|
+
return self.typeTRef
|
|
43
|
+
|
|
44
|
+
def setTypeTRef(self, value):
|
|
45
|
+
self.typeTRef = value
|
|
46
|
+
return self
|
|
47
|
+
|
|
48
|
+
class VariableDataPrototype(AutosarDataPrototype):
|
|
49
|
+
def __init__(self, parent:ARObject, short_name: str):
|
|
50
|
+
super().__init__(parent, short_name)
|
|
51
|
+
|
|
52
|
+
self.initValue = None # type: ValueSpecification
|
|
53
|
+
|
|
54
|
+
def getInitValue(self):
|
|
55
|
+
return self.initValue
|
|
56
|
+
|
|
57
|
+
def setInitValue(self, value):
|
|
58
|
+
self.initValue = value
|
|
59
|
+
return self
|
|
60
|
+
|
|
61
|
+
class ApplicationCompositeElementDataPrototype(DataPrototype, metaclass = ABCMeta):
|
|
62
|
+
def __init__(self, parent:ARObject, short_name: str):
|
|
63
|
+
if type(self) == ApplicationCompositeElementDataPrototype:
|
|
64
|
+
raise NotImplementedError("ApplicationCompositeElementDataPrototype is an abstract class.")
|
|
65
|
+
|
|
66
|
+
super().__init__(parent, short_name)
|
|
67
|
+
|
|
68
|
+
self.typeTRef = None # type: RefType
|
|
69
|
+
|
|
70
|
+
def getTypeTRef(self):
|
|
71
|
+
return self.typeTRef
|
|
72
|
+
|
|
73
|
+
def setTypeTRef(self, value):
|
|
74
|
+
self.typeTRef = value
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class ApplicationArrayElement(ApplicationCompositeElementDataPrototype):
|
|
79
|
+
def __init__(self, parent:ARObject, short_name: str):
|
|
80
|
+
super().__init__(parent, short_name)
|
|
81
|
+
|
|
82
|
+
self.arraySizeHandling = None # type: str
|
|
83
|
+
self.arraySizeSemantics = None # type: str
|
|
84
|
+
self.indexDataTypeRef = None # type: RefType
|
|
85
|
+
self.maxNumberOfElements = None # type: ARNumerical
|
|
86
|
+
|
|
87
|
+
class ApplicationRecordElement(ApplicationCompositeElementDataPrototype):
|
|
88
|
+
def __init__(self, parent:ARObject, short_name: str):
|
|
89
|
+
super().__init__(parent, short_name)
|
|
90
|
+
|
|
91
|
+
self.isOptional = None
|
|
92
|
+
|
|
93
|
+
class ParameterDataPrototype(AutosarDataPrototype):
|
|
94
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
95
|
+
super().__init__(parent, short_name)
|
|
96
|
+
|
|
97
|
+
self.initValue = None # type: ValueSpecification
|
|
98
|
+
|
|
99
|
+
def getInitValue(self):
|
|
100
|
+
return self.initValue
|
|
101
|
+
|
|
102
|
+
def setInitValue(self, value):
|
|
103
|
+
self.initValue = value
|
|
104
|
+
return self
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from ..data_type.data_prototypes import ParameterDataPrototype, VariableDataPrototype, AutosarDataPrototype
|
|
5
|
+
from .....ar_object import ARBoolean, ARLiteral, ARNumerical
|
|
6
|
+
from .....common_structure import ModeDeclarationGroupPrototype, Trigger
|
|
7
|
+
from .....datatype import AtpType
|
|
8
|
+
from .....general_structure import ARObject, Identifiable, AtpFeature
|
|
9
|
+
from .....ar_ref import RefType
|
|
10
|
+
|
|
11
|
+
class PortInterface(AtpType, metaclass = ABCMeta):
|
|
12
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
13
|
+
if type(self) == PortInterface:
|
|
14
|
+
raise NotImplementedError("PortInterface is an abstract class.")
|
|
15
|
+
super().__init__(parent, short_name)
|
|
16
|
+
|
|
17
|
+
self.isService = None # type: ARBoolean
|
|
18
|
+
self.serviceKind = None # type: ARLiteral
|
|
19
|
+
|
|
20
|
+
def getIsService(self):
|
|
21
|
+
return self.isService
|
|
22
|
+
|
|
23
|
+
def setIsService(self, value):
|
|
24
|
+
self.isService = value
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def getServiceKind(self):
|
|
28
|
+
return self.serviceKind
|
|
29
|
+
|
|
30
|
+
def setServiceKind(self, value):
|
|
31
|
+
self.serviceKind = value
|
|
32
|
+
return self
|
|
33
|
+
|
|
34
|
+
class DataInterface(PortInterface, metaclass = ABCMeta):
|
|
35
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
36
|
+
if type(self) == DataInterface:
|
|
37
|
+
raise NotImplementedError("DataInterface is an abstract class.")
|
|
38
|
+
super().__init__(parent, short_name)
|
|
39
|
+
|
|
40
|
+
class NvDataInterface(DataInterface):
|
|
41
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
42
|
+
super().__init__(parent, short_name)
|
|
43
|
+
|
|
44
|
+
self.nvDatas = [] # type: List[VariableDataPrototype]
|
|
45
|
+
|
|
46
|
+
def getNvDatas(self):
|
|
47
|
+
return self.nvDatas
|
|
48
|
+
|
|
49
|
+
def setNvData(self, value):
|
|
50
|
+
self.nvDatas.append(value)
|
|
51
|
+
return self
|
|
52
|
+
|
|
53
|
+
class ParameterInterface(DataInterface):
|
|
54
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
55
|
+
super().__init__(parent, short_name)
|
|
56
|
+
|
|
57
|
+
self.parameters = [] # type: List[ParameterDataPrototype]
|
|
58
|
+
|
|
59
|
+
def getParameters(self):
|
|
60
|
+
return list(sorted(filter(lambda a : isinstance(a, ParameterDataPrototype), self.elements.values()), key = lambda a: a.short_name))
|
|
61
|
+
|
|
62
|
+
def createParameter(self, short_name: str) -> ParameterDataPrototype:
|
|
63
|
+
if (short_name not in self.elements):
|
|
64
|
+
parameter = ParameterDataPrototype(self, short_name)
|
|
65
|
+
self.elements[short_name] = parameter
|
|
66
|
+
self.parameters.append(parameter)
|
|
67
|
+
return self.elements[short_name]
|
|
68
|
+
|
|
69
|
+
class InvalidationPolicy(ARObject):
|
|
70
|
+
def __init__(self):
|
|
71
|
+
super().__init__()
|
|
72
|
+
|
|
73
|
+
self.dataElementRef = None # type: RefType
|
|
74
|
+
self.handleInvalid = None # type: ARLiteral
|
|
75
|
+
|
|
76
|
+
def getDataElementRef(self):
|
|
77
|
+
return self.dataElementRef
|
|
78
|
+
|
|
79
|
+
def setDataElementRef(self, value):
|
|
80
|
+
self.dataElementRef = value
|
|
81
|
+
return self
|
|
82
|
+
|
|
83
|
+
def getHandleInvalid(self):
|
|
84
|
+
return self.handleInvalid
|
|
85
|
+
|
|
86
|
+
def setHandleInvalid(self, value):
|
|
87
|
+
self.handleInvalid = value
|
|
88
|
+
return self
|
|
89
|
+
|
|
90
|
+
class SenderReceiverInterface(DataInterface):
|
|
91
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
92
|
+
super().__init__(parent, short_name)
|
|
93
|
+
|
|
94
|
+
self.invalidationPolicies = [] # type: List[InvalidationPolicy]
|
|
95
|
+
self.metaDataItemSets = [] # type: List[MetaDataItemSet]
|
|
96
|
+
|
|
97
|
+
def getInvalidationPolicies(self):
|
|
98
|
+
return self.invalidationPolicies
|
|
99
|
+
|
|
100
|
+
def addInvalidationPolicy(self, value):
|
|
101
|
+
self.invalidationPolicies.append(value)
|
|
102
|
+
return self
|
|
103
|
+
|
|
104
|
+
def getMetaDataItemSets(self):
|
|
105
|
+
return self.metaDataItemSets
|
|
106
|
+
|
|
107
|
+
def addMetaDataItemSet(self, value):
|
|
108
|
+
self.metaDataItemSets.append(value)
|
|
109
|
+
return self
|
|
110
|
+
|
|
111
|
+
def createDataElement(self, short_name) -> VariableDataPrototype:
|
|
112
|
+
if (short_name not in self.elements):
|
|
113
|
+
data_element = VariableDataPrototype(self, short_name)
|
|
114
|
+
self.elements[short_name] = data_element
|
|
115
|
+
return self.elements[short_name]
|
|
116
|
+
|
|
117
|
+
def getDataElements(self) -> List[VariableDataPrototype]:
|
|
118
|
+
return list(filter(lambda c: isinstance(c, VariableDataPrototype), self.elements.values()))
|
|
119
|
+
|
|
120
|
+
def getDataElement(self, short_name) -> VariableDataPrototype:
|
|
121
|
+
if (short_name in self.elements):
|
|
122
|
+
data_element = self.elements[short_name]
|
|
123
|
+
#if (not isinstance(data_element, VariableDataPrototype)):
|
|
124
|
+
# raise IndexError("%s is not data element." % short_name)
|
|
125
|
+
return data_element
|
|
126
|
+
raise IndexError("data element <%s> can not be found." % short_name)
|
|
127
|
+
|
|
128
|
+
def createInvalidationPolicy(self) -> InvalidationPolicy:
|
|
129
|
+
policy = InvalidationPolicy(self)
|
|
130
|
+
self.invalidation_polivys.append(policy)
|
|
131
|
+
return policy
|
|
132
|
+
|
|
133
|
+
def getInvalidationPolicys(self) -> List[InvalidationPolicy]:
|
|
134
|
+
return list(filter(lambda c: isinstance(c, InvalidationPolicy), self.invalidation_polivys))
|
|
135
|
+
|
|
136
|
+
class ArgumentDataPrototype(AutosarDataPrototype):
|
|
137
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
138
|
+
super().__init__(parent, short_name)
|
|
139
|
+
self.direction = ""
|
|
140
|
+
self.server_argument_impl_policy = ""
|
|
141
|
+
|
|
142
|
+
class ApplicationError(Identifiable):
|
|
143
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
144
|
+
super().__init__(parent, short_name)
|
|
145
|
+
|
|
146
|
+
self.error_code = None # type: ARNumerical
|
|
147
|
+
|
|
148
|
+
class ClientServerOperation(AtpFeature):
|
|
149
|
+
"""
|
|
150
|
+
An operation declared within the scope of a client/server interface.
|
|
151
|
+
Package: M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
|
|
152
|
+
Base: ARObject, AtpClassifier , AtpFeature, AtpStructureElement, Identifiable, MultilanguageReferrable, Referrable
|
|
153
|
+
|
|
154
|
+
Attributes:
|
|
155
|
+
-----------
|
|
156
|
+
_argument: ArgumentDataPrototype (optional)
|
|
157
|
+
An argument of this ClientServerOperation
|
|
158
|
+
|
|
159
|
+
_possibleError: RefType -> ApplicationError (optional)
|
|
160
|
+
Possible errors that may by raised by the referring operation
|
|
161
|
+
|
|
162
|
+
Methods:
|
|
163
|
+
--------
|
|
164
|
+
addArgumentDataPrototype add the argument
|
|
165
|
+
getArgumentDataPrototypes get the arguments
|
|
166
|
+
addPossibleErrorRef add the possible error
|
|
167
|
+
getPossbileErrorRefs get the possible errors
|
|
168
|
+
|
|
169
|
+
"""
|
|
170
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
171
|
+
super().__init__(parent, short_name)
|
|
172
|
+
|
|
173
|
+
self._arguments = []
|
|
174
|
+
self._possible_error_refs = [] # type: List[RefType]
|
|
175
|
+
|
|
176
|
+
def addArgumentDataPrototype(self, prototype: ArgumentDataPrototype):
|
|
177
|
+
self._arguments.append(prototype)
|
|
178
|
+
|
|
179
|
+
def getArgumentDataPrototypes(self) -> List[ArgumentDataPrototype]:
|
|
180
|
+
return self._arguments
|
|
181
|
+
|
|
182
|
+
def addPossibleErrorRef(self, possible_error_ref: RefType):
|
|
183
|
+
self._possible_error_refs.append(possible_error_ref)
|
|
184
|
+
|
|
185
|
+
def getPossbileErrorRefs(self) -> List[RefType]:
|
|
186
|
+
return self._possible_error_refs
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class ClientServerInterface(PortInterface):
|
|
190
|
+
"""
|
|
191
|
+
A client/server interface declares a number of operations that can be invoked on a server by a client.
|
|
192
|
+
Package: M2::AUTOSARTemplates::SWComponentTemplate::PortInterface
|
|
193
|
+
Base: ARElement, ARObject, AtpBlueprint, AtpBlueprintable, AtpClassifier , AtpType, CollectableElement, Identifiable, MultilanguageReferrable, PackageableElement, PortInterface, Referrable
|
|
194
|
+
|
|
195
|
+
Methods:
|
|
196
|
+
--------
|
|
197
|
+
createOperation create ClientServerOperation(s) of this ClientServerInterface.
|
|
198
|
+
createApplicationError create Application errors that are defined as part of this interface
|
|
199
|
+
getOperations get all ClientServerOperation(s) of this ClientServerInterface
|
|
200
|
+
getPossibleErrors get all Application error(s) of this ClientServerInterface
|
|
201
|
+
|
|
202
|
+
"""
|
|
203
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
204
|
+
super().__init__(parent, short_name)
|
|
205
|
+
|
|
206
|
+
def createOperation(self, short_name: str) -> ClientServerOperation:
|
|
207
|
+
if (short_name not in self.elements):
|
|
208
|
+
operation = ClientServerOperation(self, short_name)
|
|
209
|
+
self.elements[short_name] = operation
|
|
210
|
+
return self.elements[short_name]
|
|
211
|
+
|
|
212
|
+
def createApplicationError(self, short_name: str) -> ApplicationError:
|
|
213
|
+
if (short_name not in self.elements):
|
|
214
|
+
error = ApplicationError(self, short_name)
|
|
215
|
+
self.elements[short_name] = error
|
|
216
|
+
return self.elements[short_name]
|
|
217
|
+
|
|
218
|
+
def getOperations(self) -> List[ClientServerOperation]:
|
|
219
|
+
return list(filter(lambda c: isinstance(c, ClientServerOperation), self.elements.values()))
|
|
220
|
+
|
|
221
|
+
def getPossibleErrors(self) -> List[ApplicationError]:
|
|
222
|
+
return list(filter(lambda c: isinstance(c, ApplicationError), self.elements.values()))
|
|
223
|
+
|
|
224
|
+
class TriggerInterface(PortInterface):
|
|
225
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
226
|
+
super().__init__(parent, short_name)
|
|
227
|
+
|
|
228
|
+
self._triggers = [] # type: Trigger
|
|
229
|
+
|
|
230
|
+
class ModeSwitchInterface(PortInterface):
|
|
231
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
232
|
+
super().__init__(parent, short_name)
|
|
233
|
+
|
|
234
|
+
self._modeGroup = [] # type: List[ModeDeclarationGroupPrototype]
|
|
235
|
+
|
|
236
|
+
def createModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
237
|
+
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
238
|
+
if (short_name not in self.elements):
|
|
239
|
+
self.elements[short_name] = prototype
|
|
240
|
+
return self.elements[short_name]
|
|
241
|
+
|
|
242
|
+
def getModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
243
|
+
return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key= lambda o: o.short_name))
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from .....ar_ref import RefType
|
|
2
|
+
from ...generic_structure.abstract_structure import AtpInstanceRef
|
|
3
|
+
|
|
4
|
+
class ApplicationCompositeElementInPortInterfaceInstanceRef(AtpInstanceRef):
|
|
5
|
+
def __init__(self):
|
|
6
|
+
super().__init__()
|
|
7
|
+
|
|
8
|
+
self.baseRef = None # type: RefType
|
|
9
|
+
self.contextDataPrototypeRef = None # type: RefType
|
|
10
|
+
self.rootDataPrototypeRef = None # type: RefType
|
|
11
|
+
self.targetDataPrototypeRef = None # type: RefType
|
|
12
|
+
|
|
13
|
+
def getBaseRef(self):
|
|
14
|
+
return self.baseRef
|
|
15
|
+
|
|
16
|
+
def setBaseRef(self, value):
|
|
17
|
+
self.baseRef = value
|
|
18
|
+
return self
|
|
19
|
+
|
|
20
|
+
def getContextDataPrototypeRef(self):
|
|
21
|
+
return self.contextDataPrototypeRef
|
|
22
|
+
|
|
23
|
+
def setContextDataPrototypeRef(self, value):
|
|
24
|
+
self.contextDataPrototypeRef = value
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def getRootDataPrototypeRef(self):
|
|
28
|
+
return self.rootDataPrototypeRef
|
|
29
|
+
|
|
30
|
+
def setRootDataPrototypeRef(self, value):
|
|
31
|
+
self.rootDataPrototypeRef = value
|
|
32
|
+
return self
|
|
33
|
+
|
|
34
|
+
def getTargetDataPrototypeRef(self):
|
|
35
|
+
return self.targetDataPrototypeRef
|
|
36
|
+
|
|
37
|
+
def setTargetDataPrototypeRef(self, value):
|
|
38
|
+
self.targetDataPrototypeRef = value
|
|
39
|
+
return self
|
armodel/models/m2/autosar_templates/sw_component_template/swc_internal_behavior/data_elements.py
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from .access_count import AbstractAccessPoint
|
|
4
|
-
|
|
5
1
|
from .....general_structure import Identifiable
|
|
2
|
+
from .....ar_object import ARLiteral, ARObject
|
|
6
3
|
from ....msr.data_dictionary.data_def_properties import SwDataDefProps
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
|
|
4
|
+
from ..swc_internal_behavior.instance_refs_usage import AutosarParameterRef, AutosarVariableRef
|
|
5
|
+
from .access_count import AbstractAccessPoint
|
|
10
6
|
class ParameterAccess(AbstractAccessPoint):
|
|
11
7
|
def __init__(self, parent: ARObject, short_name: str):
|
|
12
8
|
super().__init__(parent, short_name)
|
|
@@ -32,10 +28,6 @@ class VariableAccess(Identifiable):
|
|
|
32
28
|
def __init__(self, parent: ARObject, short_name):
|
|
33
29
|
super().__init__(parent, short_name)
|
|
34
30
|
|
|
35
|
-
#self.accessedVariableRef = AutosarVariableRef() # type: AutosarVariableRef
|
|
36
|
-
#self.accessedVariableRef.parent = self
|
|
37
|
-
#self.localVariableRef = None # type: RefType
|
|
38
|
-
|
|
39
31
|
self.accessedVariableRef = None # type: AutosarVariableRef
|
|
40
32
|
self.scope = None # type: ARLiteral
|
|
41
33
|
|