armodel 1.7.9__py3-none-any.whl → 1.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- armodel/cli/arxml_format_cli.py +1 -0
- armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +50 -11
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ImplementationDataTypes.py +30 -28
- armodel/models/M2/AUTOSARTemplates/CommonStructure/ServiceNeeds.py +5 -0
- armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +5 -0
- armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py +19 -9
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +11 -10
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +8 -2
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/RteEventToOsTaskMapping.py +35 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SWmapping.py +25 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/SecureCommunication.py +83 -0
- armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +84 -32
- armodel/models/__init__.py +2 -0
- armodel/models/utils/__init__.py +0 -0
- armodel/models/utils/uuid_mgr.py +23 -0
- armodel/parser/abstract_arxml_parser.py +5 -0
- armodel/parser/arxml_parser.py +80 -69
- armodel/tests/test_armodel/models/test_datatype.py +136 -138
- armodel/writer/arxml_writer.py +38 -28
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/METADATA +15 -1
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/RECORD +25 -21
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/LICENSE +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/WHEEL +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/entry_points.txt +0 -0
- {armodel-1.7.9.dist-info → armodel-1.8.0.dist-info}/top_level.txt +0 -0
armodel/cli/arxml_format_cli.py
CHANGED
|
@@ -69,6 +69,7 @@ def main():
|
|
|
69
69
|
ap = argparse.ArgumentParser()
|
|
70
70
|
ap.description = "arxml-format ver: %s" % version
|
|
71
71
|
ap.add_argument("-v", "--verbose", required=False, help="Print debug information", action="store_true")
|
|
72
|
+
ap.add_argument("--log", required=False, help="Log all information to file")
|
|
72
73
|
ap.add_argument("-w", "--warning", required=False, help="Skip the error and report it as warning message", action="store_true")
|
|
73
74
|
ap.add_argument("--remove-admin-data", required=False, help="Remove all the AdminData", action="store_true")
|
|
74
75
|
ap.add_argument("INPUT", help="The path of AUTOSAR ARXML file")
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
from typing import Dict, List
|
|
2
2
|
|
|
3
|
+
from armodel.models.M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
|
|
3
4
|
|
|
5
|
+
from ...utils.uuid_mgr import UUIDMgr
|
|
4
6
|
from ...M2.MSR.AsamHdo.SpecialData import Sdg
|
|
5
7
|
from ...M2.MSR.AsamHdo import AdminData
|
|
6
8
|
from ...M2.MSR.AsamHdo.BaseTypes import SwBaseType
|
|
7
9
|
from ...M2.MSR.Documentation.TextModel.BlockElements import DocumentationBlock
|
|
10
|
+
|
|
8
11
|
from ...M2.AUTOSARTemplates.CommonStructure.InternalBehavior import InternalBehavior
|
|
9
12
|
from ...M2.AUTOSARTemplates.CommonStructure.Implementation import Implementation
|
|
10
13
|
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
11
14
|
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import CollectableElement, Referrable
|
|
12
15
|
from ...M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ARPackage import ARPackage
|
|
13
16
|
from ...M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import ApplicationDataType, DataTypeMap
|
|
14
|
-
from ...M2.AUTOSARTemplates.SWComponentTemplate.Components import CompositionSwComponentType
|
|
17
|
+
from ...M2.AUTOSARTemplates.SWComponentTemplate.Components import AtomicSwComponentType, CompositionSwComponentType, PortPrototype
|
|
18
|
+
from ...M2.AUTOSARTemplates.SWComponentTemplate.Datatype.DataPrototypes import VariableDataPrototype
|
|
15
19
|
from ...M2.AUTOSARTemplates.CommonStructure.ImplementationDataTypes import ImplementationDataType
|
|
16
20
|
from ...M2.AUTOSARTemplates.SystemTemplate import RootSwCompositionPrototype, System
|
|
21
|
+
from ...M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import SystemSignal, SystemSignalGroup
|
|
17
22
|
|
|
18
23
|
|
|
19
24
|
class FileInfoComment(ARObject):
|
|
@@ -93,7 +98,7 @@ class AbstractAUTOSAR(CollectableElement):
|
|
|
93
98
|
self._behavior_impl_maps = {} # type: Dict[str, str]
|
|
94
99
|
self._impl_behavior_maps = {} # type: Dict[str, str]
|
|
95
100
|
|
|
96
|
-
self.
|
|
101
|
+
self.uuid_mgr = UUIDMgr()
|
|
97
102
|
|
|
98
103
|
self.systems = {} # type: Dict[str, System]
|
|
99
104
|
self.compositionSwComponentTypes = {} # type: Dict[str, CompositionSwComponentType]
|
|
@@ -120,7 +125,14 @@ class AbstractAUTOSAR(CollectableElement):
|
|
|
120
125
|
self.arPackages[short_name] = ar_package
|
|
121
126
|
return self.arPackages[short_name]
|
|
122
127
|
|
|
123
|
-
def find(self,
|
|
128
|
+
def find(self, referred) -> Referrable:
|
|
129
|
+
if isinstance(referred, RefType):
|
|
130
|
+
referred_name = referred.getValue()
|
|
131
|
+
referred_type = referred.getDest()
|
|
132
|
+
else:
|
|
133
|
+
referred_name = referred
|
|
134
|
+
referred_type = None
|
|
135
|
+
|
|
124
136
|
short_name_list = referred_name.split("/")
|
|
125
137
|
element = AUTOSAR.getInstance()
|
|
126
138
|
for short_name in short_name_list:
|
|
@@ -129,17 +141,46 @@ class AbstractAUTOSAR(CollectableElement):
|
|
|
129
141
|
element = element.getElement(short_name)
|
|
130
142
|
if (element is None):
|
|
131
143
|
return element
|
|
132
|
-
|
|
144
|
+
|
|
145
|
+
# validate the dest
|
|
146
|
+
if referred_type is not None and referred_type != "":
|
|
147
|
+
base_type = self.getDestType(element)
|
|
148
|
+
if base_type != referred_type:
|
|
149
|
+
raise ValueError("The type does not matched of <%s> (Dest: %s, Actual: %s)" % (referred_name, referred_type, base_type))
|
|
150
|
+
|
|
133
151
|
return element
|
|
134
152
|
|
|
153
|
+
def getDestType(self, type) -> str:
|
|
154
|
+
if isinstance(type, ImplementationDataType):
|
|
155
|
+
return "IMPLEMENTATION-DATA-TYPE"
|
|
156
|
+
return ""
|
|
157
|
+
|
|
158
|
+
def findAtomicSwComponentType(self, referred) -> AtomicSwComponentType:
|
|
159
|
+
return self.find(referred)
|
|
160
|
+
|
|
161
|
+
def findSystemSignal(self, referred) -> SystemSignal:
|
|
162
|
+
return self.find(referred)
|
|
163
|
+
|
|
164
|
+
def findSystemSignalGroup(self, referred) -> SystemSignalGroup:
|
|
165
|
+
return self.find(referred)
|
|
166
|
+
|
|
167
|
+
def findPort(self, referred: str) -> PortPrototype:
|
|
168
|
+
return self.find(referred)
|
|
169
|
+
|
|
170
|
+
def findVariableDataPrototype(self, referred) -> VariableDataPrototype:
|
|
171
|
+
return self.find(referred)
|
|
172
|
+
|
|
173
|
+
def findImplementationDataType(self, referred) -> ImplementationDataType:
|
|
174
|
+
return self.find(referred)
|
|
175
|
+
|
|
135
176
|
def getDataType(self, data_type: ImplementationDataType) -> ImplementationDataType:
|
|
136
177
|
if (isinstance(data_type, ImplementationDataType) or isinstance(data_type, SwBaseType)):
|
|
137
178
|
if (data_type.category == ImplementationDataType.CATEGORY_TYPE_REFERENCE):
|
|
138
179
|
referred_type = self.find(data_type.swDataDefProps.implementationDataTypeRef.value)
|
|
139
180
|
return self.getDataType(referred_type)
|
|
140
181
|
if (data_type.category == ImplementationDataType.CATEGORY_DATA_REFERENCE):
|
|
141
|
-
if (data_type.swDataDefProps.swPointerTargetProps.
|
|
142
|
-
referred_type = self.find(data_type.swDataDefProps.swPointerTargetProps.
|
|
182
|
+
if (data_type.swDataDefProps.swPointerTargetProps.getTargetCategory() == "VALUE"):
|
|
183
|
+
referred_type = self.find(data_type.swDataDefProps.swPointerTargetProps.getSwDataDefProps().getBaseTypeRef())
|
|
143
184
|
return self.getDataType(referred_type)
|
|
144
185
|
return data_type
|
|
145
186
|
else:
|
|
@@ -206,14 +247,12 @@ class AbstractAUTOSAR(CollectableElement):
|
|
|
206
247
|
self.compositionSwComponentTypes[short_name] = sw_component_type
|
|
207
248
|
return self
|
|
208
249
|
|
|
209
|
-
def getARObjectByUUID(self, uuid: str):
|
|
210
|
-
|
|
211
|
-
return self.uuid_objects[uuid]
|
|
212
|
-
return None
|
|
250
|
+
def getARObjectByUUID(self, uuid: str) -> List[ARObject]:
|
|
251
|
+
return self.uuid_mgr.getObjects()
|
|
213
252
|
|
|
214
253
|
def addARObject(self, value: ARObject):
|
|
215
254
|
if value is not None:
|
|
216
|
-
self.
|
|
255
|
+
self.uuid_mgr.addObject(value)
|
|
217
256
|
return self
|
|
218
257
|
|
|
219
258
|
def setARRelease(self, release: str):
|
|
@@ -8,10 +8,12 @@ from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTy
|
|
|
8
8
|
from ....M2.AUTOSARTemplates.SWComponentTemplate.Datatype.Datatypes import AutosarDataType
|
|
9
9
|
from ....M2.AUTOSARTemplates.SWComponentTemplate.Components import SymbolProps
|
|
10
10
|
|
|
11
|
+
|
|
11
12
|
class AbstractImplementationDataTypeElement(Identifiable):
|
|
12
13
|
def __init__(self, parent, short_name: str):
|
|
13
14
|
super().__init__(parent, short_name)
|
|
14
15
|
|
|
16
|
+
|
|
15
17
|
class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
16
18
|
ARRAY_SIZE_SEMANTICS_FIXED_SIZE = "FIXED-SIZE"
|
|
17
19
|
ARRAY_SIZE_SEMANTICS_VARIABLE_SIZE = "VARIABLE_SIZE"
|
|
@@ -30,45 +32,51 @@ class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
|
30
32
|
return self.arrayImplPolicy
|
|
31
33
|
|
|
32
34
|
def setArrayImplPolicy(self, value):
|
|
33
|
-
|
|
35
|
+
if value is not None:
|
|
36
|
+
self.arrayImplPolicy = value
|
|
34
37
|
return self
|
|
35
38
|
|
|
36
39
|
def getArraySize(self):
|
|
37
40
|
return self.arraySize
|
|
38
41
|
|
|
39
42
|
def setArraySize(self, value):
|
|
40
|
-
|
|
43
|
+
if value is not None:
|
|
44
|
+
self.arraySize = value
|
|
41
45
|
return self
|
|
42
46
|
|
|
43
47
|
def getArraySizeHandling(self):
|
|
44
48
|
return self.arraySizeHandling
|
|
45
49
|
|
|
46
50
|
def setArraySizeHandling(self, value):
|
|
47
|
-
|
|
51
|
+
if value is not None:
|
|
52
|
+
self.arraySizeHandling = value
|
|
48
53
|
return self
|
|
49
54
|
|
|
50
55
|
def getArraySizeSemantics(self):
|
|
51
56
|
return self.arraySizeSemantics
|
|
52
57
|
|
|
53
58
|
def setArraySizeSemantics(self, value):
|
|
54
|
-
|
|
59
|
+
if value is not None:
|
|
60
|
+
self.arraySizeSemantics = value
|
|
55
61
|
return self
|
|
56
62
|
|
|
57
63
|
def getIsOptional(self):
|
|
58
64
|
return self.isOptional
|
|
59
65
|
|
|
60
66
|
def setIsOptional(self, value):
|
|
61
|
-
|
|
67
|
+
if value is not None:
|
|
68
|
+
self.isOptional = value
|
|
62
69
|
return self
|
|
63
70
|
|
|
64
71
|
def getSwDataDefProps(self):
|
|
65
72
|
return self.swDataDefProps
|
|
66
73
|
|
|
67
74
|
def setSwDataDefProps(self, value):
|
|
68
|
-
|
|
75
|
+
if value is not None:
|
|
76
|
+
self.swDataDefProps = value
|
|
69
77
|
return self
|
|
70
|
-
|
|
71
|
-
def createImplementationDataTypeElement(self, short_name: str):
|
|
78
|
+
|
|
79
|
+
def createImplementationDataTypeElement(self, short_name: str): # type: (...) -> ImplementationDataTypeElement
|
|
72
80
|
if (short_name not in self.elements):
|
|
73
81
|
event = ImplementationDataTypeElement(self, short_name)
|
|
74
82
|
self.elements[short_name] = event
|
|
@@ -78,13 +86,14 @@ class ImplementationDataTypeElement(AbstractImplementationDataTypeElement):
|
|
|
78
86
|
return list(filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements.values()))
|
|
79
87
|
|
|
80
88
|
|
|
81
|
-
class AbstractImplementationDataType(AutosarDataType, metaclass
|
|
89
|
+
class AbstractImplementationDataType(AutosarDataType, metaclass=ABCMeta):
|
|
82
90
|
def __init__(self, parent: ARObject, short_name: str):
|
|
83
|
-
if type(self)
|
|
91
|
+
if type(self) is AbstractImplementationDataType:
|
|
84
92
|
raise NotImplementedError("AbstractImplementationDataType is an abstract class.")
|
|
85
93
|
|
|
86
94
|
super().__init__(parent, short_name)
|
|
87
95
|
|
|
96
|
+
|
|
88
97
|
class ImplementationDataType(AbstractImplementationDataType):
|
|
89
98
|
|
|
90
99
|
CATEGORY_TYPE_REFERENCE = "TYPE_REFERENCE"
|
|
@@ -99,12 +108,9 @@ class ImplementationDataType(AbstractImplementationDataType):
|
|
|
99
108
|
self.dynamicArraySizeProfile = None # type: String
|
|
100
109
|
self.isStructWithOptionalElement = None # type: Boolean
|
|
101
110
|
|
|
102
|
-
self.subElements = [] # type: List[
|
|
111
|
+
self.subElements = [] # type: List[ImplementationDataTypeElement]
|
|
103
112
|
self.symbolProps = None # type: SymbolProps
|
|
104
|
-
self.typeEmitter = None
|
|
105
|
-
|
|
106
|
-
#self._array_type = None # ImplementationDataType
|
|
107
|
-
#self._struct_type = None # ImplementationDataType
|
|
113
|
+
self.typeEmitter = None # type: ARLiteral
|
|
108
114
|
|
|
109
115
|
def getDynamicArraySizeProfile(self):
|
|
110
116
|
return self.dynamicArraySizeProfile
|
|
@@ -120,19 +126,15 @@ class ImplementationDataType(AbstractImplementationDataType):
|
|
|
120
126
|
self.isStructWithOptionalElement = value
|
|
121
127
|
return self
|
|
122
128
|
|
|
123
|
-
def createImplementationDataTypeElement(self, short_name: str) -> ImplementationDataTypeElement:
|
|
124
|
-
self.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
self.
|
|
128
|
-
return self.
|
|
129
|
+
def createImplementationDataTypeElement(self, short_name: str) -> ImplementationDataTypeElement:
|
|
130
|
+
if not self.IsElementExists(short_name):
|
|
131
|
+
type_element = ImplementationDataTypeElement(self, short_name)
|
|
132
|
+
self.addElement(type_element)
|
|
133
|
+
self.subElements.append(type_element)
|
|
134
|
+
return self.getElement(short_name)
|
|
129
135
|
|
|
130
|
-
def
|
|
131
|
-
|
|
132
|
-
for sub_element in self.subElements:
|
|
133
|
-
elements.append(self.elements[sub_element])
|
|
134
|
-
return elements
|
|
135
|
-
# return filter(lambda c: isinstance(c, ImplementationDataTypeElement), self.elements.values())
|
|
136
|
+
def getSubElements(self) -> List[ImplementationDataTypeElement]:
|
|
137
|
+
return self.subElements
|
|
136
138
|
|
|
137
139
|
def getArrayElementType(self) -> str:
|
|
138
140
|
return self._array_type
|
|
@@ -163,4 +165,4 @@ class ImplementationDataType(AbstractImplementationDataType):
|
|
|
163
165
|
return self.symbolProps
|
|
164
166
|
|
|
165
167
|
def getSymbolProps(self) -> SymbolProps:
|
|
166
|
-
return self.symbolProps
|
|
168
|
+
return self.symbolProps
|
|
@@ -832,3 +832,8 @@ class CryptoServiceNeeds(ServiceNeeds):
|
|
|
832
832
|
class EcuStateMgrUserNeeds(ServiceNeeds):
|
|
833
833
|
def __init__(self, parent: ARObject, short_name: str):
|
|
834
834
|
super().__init__(parent, short_name)
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
class DltUserNeeds(ServiceNeeds):
|
|
838
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
839
|
+
super().__init__(parent, short_name)
|
armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ServiceMapping.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from typing import List
|
|
2
2
|
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import CryptoServiceNeeds, DiagnosticCommunicationManagerNeeds, DiagnosticEventInfoNeeds
|
|
3
|
+
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import DltUserNeeds
|
|
3
4
|
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import DiagnosticEventNeeds, DiagnosticRoutineNeeds, DiagnosticValueNeeds
|
|
4
5
|
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import DtcStatusChangeNotificationNeeds, EcuStateMgrUserNeeds, NvBlockNeeds
|
|
5
6
|
from .....M2.AUTOSARTemplates.CommonStructure.ServiceNeeds import RoleBasedDataAssignment, ServiceNeeds, ServiceDependency
|
|
@@ -49,59 +50,65 @@ class SwcServiceDependency(ServiceDependency):
|
|
|
49
50
|
return self._assigned_ports
|
|
50
51
|
|
|
51
52
|
def createNvBlockNeeds(self, short_name: str) -> NvBlockNeeds:
|
|
52
|
-
if (
|
|
53
|
+
if (not self.IsElementExists(short_name)):
|
|
53
54
|
needs = NvBlockNeeds(self, short_name)
|
|
54
55
|
self.addElement(needs)
|
|
55
56
|
return self.getElement(short_name)
|
|
56
57
|
|
|
57
58
|
def createDiagnosticCommunicationManagerNeeds(self, short_name: str) -> DiagnosticCommunicationManagerNeeds:
|
|
58
|
-
if (
|
|
59
|
+
if (not self.IsElementExists(short_name)):
|
|
59
60
|
needs = DiagnosticCommunicationManagerNeeds(self, short_name)
|
|
60
61
|
self.addElement(needs)
|
|
61
62
|
return self.getElement(short_name)
|
|
62
63
|
|
|
63
64
|
def createDiagnosticRoutineNeeds(self, short_name: str) -> DiagnosticRoutineNeeds:
|
|
64
|
-
if (
|
|
65
|
+
if (not self.IsElementExists(short_name)):
|
|
65
66
|
needs = DiagnosticRoutineNeeds(self, short_name)
|
|
66
67
|
self.addElement(needs)
|
|
67
68
|
return self.getElement(short_name)
|
|
68
69
|
|
|
69
70
|
def createDiagnosticValueNeeds(self, short_name: str) -> DiagnosticValueNeeds:
|
|
70
|
-
if (
|
|
71
|
+
if (not self.IsElementExists(short_name)):
|
|
71
72
|
needs = DiagnosticValueNeeds(self, short_name)
|
|
72
73
|
self.addElement(needs)
|
|
73
74
|
return self.getElement(short_name)
|
|
74
75
|
|
|
75
76
|
def createDiagnosticEventNeeds(self, short_name: str) -> DiagnosticEventNeeds:
|
|
76
|
-
if (
|
|
77
|
+
if (not self.IsElementExists(short_name)):
|
|
77
78
|
needs = DiagnosticEventNeeds(self, short_name)
|
|
78
79
|
self.addElement(needs)
|
|
79
80
|
return self.getElement(short_name)
|
|
80
81
|
|
|
81
82
|
def createDiagnosticEventInfoNeeds(self, short_name: str) -> DiagnosticEventInfoNeeds:
|
|
82
|
-
if (
|
|
83
|
+
if (not self.IsElementExists(short_name)):
|
|
83
84
|
needs = DiagnosticEventInfoNeeds(self, short_name)
|
|
84
85
|
self.addElement(needs)
|
|
85
86
|
return self.getElement(short_name)
|
|
86
87
|
|
|
87
88
|
def createCryptoServiceNeeds(self, short_name: str) -> CryptoServiceNeeds:
|
|
88
|
-
if (
|
|
89
|
+
if (not self.IsElementExists(short_name)):
|
|
89
90
|
needs = CryptoServiceNeeds(self, short_name)
|
|
90
91
|
self.addElement(needs)
|
|
91
92
|
return self.getElement(short_name)
|
|
92
93
|
|
|
93
94
|
def createEcuStateMgrUserNeeds(self, short_name: str) -> EcuStateMgrUserNeeds:
|
|
94
|
-
if (
|
|
95
|
+
if (not self.IsElementExists(short_name)):
|
|
95
96
|
needs = EcuStateMgrUserNeeds(self, short_name)
|
|
96
97
|
self.addElement(needs)
|
|
97
98
|
return self.getElement(short_name)
|
|
98
99
|
|
|
99
100
|
def createDtcStatusChangeNotificationNeeds(self, short_name: str) -> DtcStatusChangeNotificationNeeds:
|
|
100
|
-
if (
|
|
101
|
+
if (not self.IsElementExists(short_name)):
|
|
101
102
|
needs = DtcStatusChangeNotificationNeeds(self, short_name)
|
|
102
103
|
self.addElement(needs)
|
|
103
104
|
return self.getElement(short_name)
|
|
104
105
|
|
|
106
|
+
def createDltUserNeeds(self, short_name: str) -> DltUserNeeds:
|
|
107
|
+
if (not self.IsElementExists(short_name)):
|
|
108
|
+
needs = DltUserNeeds(self, short_name)
|
|
109
|
+
self.addElement(needs)
|
|
110
|
+
return self.getElement(short_name)
|
|
111
|
+
|
|
105
112
|
def getNvBlockNeeds(self) -> List[NvBlockNeeds]:
|
|
106
113
|
return sorted(filter(lambda c: isinstance(c, NvBlockNeeds), self.elements.values()), key=lambda e: e.short_name)
|
|
107
114
|
|
|
@@ -122,6 +129,9 @@ class SwcServiceDependency(ServiceDependency):
|
|
|
122
129
|
|
|
123
130
|
def getDtcStatusChangeNotificationNeeds(self) -> List[DtcStatusChangeNotificationNeeds]:
|
|
124
131
|
return sorted(filter(lambda c: isinstance(c, DtcStatusChangeNotificationNeeds), self.elements.values()), key=lambda e: e.short_name)
|
|
132
|
+
|
|
133
|
+
def getDltUserNeeds(self) -> List[DltUserNeeds]:
|
|
134
|
+
return sorted(filter(lambda c: isinstance(c, DltUserNeeds), self.elements.values()), key=lambda e: e.short_name)
|
|
125
135
|
|
|
126
136
|
def getServiceNeeds(self) -> List[ServiceNeeds]:
|
|
127
137
|
return sorted(filter(lambda c: isinstance(c, ServiceNeeds), self.elements.values()), key=lambda e: e.short_name)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
|
+
from ....M2.AUTOSARTemplates.SystemTemplate.InstanceRefs import VariableDataPrototypeInSystemInstanceRef
|
|
4
5
|
from ....M2.AUTOSARTemplates.SWComponentTemplate.PortInterface import TextTableMapping
|
|
5
6
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Integer, RefType
|
|
6
7
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
|
|
@@ -29,43 +30,43 @@ class SenderReceiverToSignalMapping(DataMapping):
|
|
|
29
30
|
super().__init__()
|
|
30
31
|
|
|
31
32
|
self.communicationDirection = None # type: CommunicationDirectionType
|
|
32
|
-
self.dataElementIRef = None
|
|
33
|
-
self.senderToSignalTextTableMapping = None
|
|
34
|
-
self.signalToReceiverTextTableMapping = None
|
|
35
|
-
self.systemSignalRef = None
|
|
33
|
+
self.dataElementIRef = None # type: VariableDataPrototypeInSystemInstanceRef
|
|
34
|
+
self.senderToSignalTextTableMapping = None # type: TextTableMapping
|
|
35
|
+
self.signalToReceiverTextTableMapping = None # type: TextTableMapping
|
|
36
|
+
self.systemSignalRef = None # type: RefType
|
|
36
37
|
|
|
37
38
|
def getCommunicationDirection(self):
|
|
38
39
|
return self.communicationDirection
|
|
39
40
|
|
|
40
|
-
def setCommunicationDirection(self, value):
|
|
41
|
+
def setCommunicationDirection(self, value: CommunicationDirectionType):
|
|
41
42
|
self.communicationDirection = value
|
|
42
43
|
return self
|
|
43
44
|
|
|
44
45
|
def getDataElementIRef(self):
|
|
45
46
|
return self.dataElementIRef
|
|
46
47
|
|
|
47
|
-
def setDataElementIRef(self, value):
|
|
48
|
+
def setDataElementIRef(self, value: VariableDataPrototypeInSystemInstanceRef):
|
|
48
49
|
self.dataElementIRef = value
|
|
49
50
|
return self
|
|
50
51
|
|
|
51
52
|
def getSenderToSignalTextTableMapping(self):
|
|
52
53
|
return self.senderToSignalTextTableMapping
|
|
53
54
|
|
|
54
|
-
def setSenderToSignalTextTableMapping(self, value):
|
|
55
|
+
def setSenderToSignalTextTableMapping(self, value: TextTableMapping):
|
|
55
56
|
self.senderToSignalTextTableMapping = value
|
|
56
57
|
return self
|
|
57
58
|
|
|
58
59
|
def getSignalToReceiverTextTableMapping(self):
|
|
59
60
|
return self.signalToReceiverTextTableMapping
|
|
60
61
|
|
|
61
|
-
def setSignalToReceiverTextTableMapping(self, value):
|
|
62
|
+
def setSignalToReceiverTextTableMapping(self, value: TextTableMapping):
|
|
62
63
|
self.signalToReceiverTextTableMapping = value
|
|
63
64
|
return self
|
|
64
65
|
|
|
65
66
|
def getSystemSignalRef(self):
|
|
66
67
|
return self.systemSignalRef
|
|
67
68
|
|
|
68
|
-
def setSystemSignalRef(self, value):
|
|
69
|
+
def setSystemSignalRef(self, value: RefType):
|
|
69
70
|
self.systemSignalRef = value
|
|
70
71
|
return self
|
|
71
72
|
|
|
@@ -232,7 +233,7 @@ class SenderReceiverToSignalGroupMapping(DataMapping):
|
|
|
232
233
|
def __init__(self):
|
|
233
234
|
super().__init__()
|
|
234
235
|
|
|
235
|
-
self.dataElementIRef = None # type:
|
|
236
|
+
self.dataElementIRef = None # type: VariableDataPrototypeInSystemInstanceRef
|
|
236
237
|
self.signalGroupRef = None # type: RefType
|
|
237
238
|
self.typeMapping = None # type: SenderRecCompositeTypeMapping
|
|
238
239
|
|
|
@@ -441,16 +441,22 @@ class CommunicationController(Identifiable, metaclass=ABCMeta):
|
|
|
441
441
|
return self
|
|
442
442
|
|
|
443
443
|
|
|
444
|
-
class PncGatewayTypeEnum(
|
|
444
|
+
class PncGatewayTypeEnum(AREnum):
|
|
445
445
|
ENUM_ACTIVE = "active"
|
|
446
446
|
ENUM_NONE = "none"
|
|
447
447
|
ENUM_PASSIVE = "passive"
|
|
448
448
|
|
|
449
|
+
def __init__(self):
|
|
450
|
+
super().__init__([])
|
|
451
|
+
|
|
449
452
|
|
|
450
|
-
class CommunicationDirectionType(
|
|
453
|
+
class CommunicationDirectionType(AREnum):
|
|
451
454
|
ENUM_IN = "in"
|
|
452
455
|
ENUM_OUT = "out"
|
|
453
456
|
|
|
457
|
+
def __init__(self):
|
|
458
|
+
super().__init__([])
|
|
459
|
+
|
|
454
460
|
|
|
455
461
|
class CommConnectorPort(Identifiable, metaclass=ABCMeta):
|
|
456
462
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
|
|
2
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class AppOsTaskProxyToEcuTaskProxyMapping(Identifiable):
|
|
6
|
+
def __init__(self, parent, short_name):
|
|
7
|
+
super().__init__(parent, short_name)
|
|
8
|
+
|
|
9
|
+
self.appTaskProxyRef = None # type: RefType
|
|
10
|
+
self.ecuTaskProxyRef = None # type: RefType
|
|
11
|
+
self.offset = None # type: RefType
|
|
12
|
+
|
|
13
|
+
def getAppTaskProxyRef(self):
|
|
14
|
+
return self.appTaskProxyRef
|
|
15
|
+
|
|
16
|
+
def setAppTaskProxyRef(self, value):
|
|
17
|
+
if value is not None:
|
|
18
|
+
self.appTaskProxyRef = value
|
|
19
|
+
return self
|
|
20
|
+
|
|
21
|
+
def getEcuTaskProxyRef(self):
|
|
22
|
+
return self.ecuTaskProxyRef
|
|
23
|
+
|
|
24
|
+
def setEcuTaskProxyRef(self, value):
|
|
25
|
+
if value is not None:
|
|
26
|
+
self.ecuTaskProxyRef = value
|
|
27
|
+
return self
|
|
28
|
+
|
|
29
|
+
def getOffset(self):
|
|
30
|
+
return self.offset
|
|
31
|
+
|
|
32
|
+
def setOffset(self, value):
|
|
33
|
+
if value is not None:
|
|
34
|
+
self.offset = value
|
|
35
|
+
return self
|
|
@@ -3,6 +3,7 @@ from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiabl
|
|
|
3
3
|
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
|
|
4
4
|
from ....M2.AUTOSARTemplates.SystemTemplate.InstanceRefs import ComponentInSystemInstanceRef
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
class SwcToImplMapping(Identifiable):
|
|
7
8
|
def __init__(self, parent, short_name):
|
|
8
9
|
super().__init__(parent, short_name)
|
|
@@ -25,3 +26,27 @@ class SwcToImplMapping(Identifiable):
|
|
|
25
26
|
if value is not None:
|
|
26
27
|
self.componentImplementationRef = value
|
|
27
28
|
return self
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ApplicationPartitionToEcuPartitionMapping(Identifiable):
|
|
32
|
+
def __init__(self, parent, short_name):
|
|
33
|
+
super().__init__(parent, short_name)
|
|
34
|
+
|
|
35
|
+
self.applicationPartitionRefs = [] # type: List[RefType]
|
|
36
|
+
self.ecuPartitionRef = None # type: RefType
|
|
37
|
+
|
|
38
|
+
def getApplicationPartitionRefs(self):
|
|
39
|
+
return self.applicationPartitionRefs
|
|
40
|
+
|
|
41
|
+
def addApplicationPartitionRef(self, value):
|
|
42
|
+
if value is not None:
|
|
43
|
+
self.applicationPartitionRefs.append(value)
|
|
44
|
+
return self
|
|
45
|
+
|
|
46
|
+
def getEcuPartitionRef(self):
|
|
47
|
+
return self.ecuPartitionRef
|
|
48
|
+
|
|
49
|
+
def setEcuPartitionRef(self, value):
|
|
50
|
+
if value is not None:
|
|
51
|
+
self.ecuPartitionRef = value
|
|
52
|
+
return self
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import Boolean, RefType
|
|
3
|
+
from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CryptoServiceMapping(Identifiable):
|
|
7
|
+
def __init__(self, parent, short_name):
|
|
8
|
+
super().__init__(parent, short_name)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SecOcCryptoServiceMapping(CryptoServiceMapping):
|
|
12
|
+
def __init__(self, parent, short_name):
|
|
13
|
+
super().__init__(parent, short_name)
|
|
14
|
+
|
|
15
|
+
self.authenticationRef = None # type: RefType
|
|
16
|
+
self.cryptoServiceKeyRef = None # type: RefType
|
|
17
|
+
self.cryptoServiceQueueRef = None # type: RefType
|
|
18
|
+
|
|
19
|
+
def getAuthenticationRef(self):
|
|
20
|
+
return self.authenticationRef
|
|
21
|
+
|
|
22
|
+
def setAuthenticationRef(self, value):
|
|
23
|
+
if value is not None:
|
|
24
|
+
self.authenticationRef = value
|
|
25
|
+
return self
|
|
26
|
+
|
|
27
|
+
def getCryptoServiceKeyRef(self):
|
|
28
|
+
return self.cryptoServiceKeyRef
|
|
29
|
+
|
|
30
|
+
def setCryptoServiceKeyRef(self, value):
|
|
31
|
+
if value is not None:
|
|
32
|
+
self.cryptoServiceKeyRef = value
|
|
33
|
+
return self
|
|
34
|
+
|
|
35
|
+
def getCryptoServiceQueueRef(self):
|
|
36
|
+
return self.cryptoServiceQueueRef
|
|
37
|
+
|
|
38
|
+
def setCryptoServiceQueueRef(self, value):
|
|
39
|
+
if value is not None:
|
|
40
|
+
self.cryptoServiceQueueRef = value
|
|
41
|
+
return self
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class TlsCryptoServiceMapping(CryptoServiceMapping):
|
|
45
|
+
def __init__(self, parent, short_name):
|
|
46
|
+
super().__init__(parent, short_name)
|
|
47
|
+
|
|
48
|
+
self.keyExchangeRef = None # type: RefType
|
|
49
|
+
self.tlsCipherSuites = [] # type: List[TlsCryptoCipherSuite]
|
|
50
|
+
self.useClientAuthenticationRequest = None # type: Boolean
|
|
51
|
+
self.useSecurityExtensionRecordSizeLimit = None # type: Boolean
|
|
52
|
+
|
|
53
|
+
def getKeyExchangeRef(self):
|
|
54
|
+
return self.keyExchangeRef
|
|
55
|
+
|
|
56
|
+
def setKeyExchangeRef(self, value):
|
|
57
|
+
if value is not None:
|
|
58
|
+
self.keyExchangeRef = value
|
|
59
|
+
return self
|
|
60
|
+
|
|
61
|
+
def getTlsCipherSuites(self):
|
|
62
|
+
return self.tlsCipherSuites
|
|
63
|
+
|
|
64
|
+
def addTlsCipherSuite(self, value):
|
|
65
|
+
if value is not None:
|
|
66
|
+
self.tlsCipherSuites.append(value)
|
|
67
|
+
return self
|
|
68
|
+
|
|
69
|
+
def getUseClientAuthenticationRequest(self):
|
|
70
|
+
return self.useClientAuthenticationRequest
|
|
71
|
+
|
|
72
|
+
def setUseClientAuthenticationRequest(self, value):
|
|
73
|
+
if value is not None:
|
|
74
|
+
self.useClientAuthenticationRequest = value
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
def getUseSecurityExtensionRecordSizeLimit(self):
|
|
78
|
+
return self.useSecurityExtensionRecordSizeLimit
|
|
79
|
+
|
|
80
|
+
def setUseSecurityExtensionRecordSizeLimit(self, value):
|
|
81
|
+
if value is not None:
|
|
82
|
+
self.useSecurityExtensionRecordSizeLimit = value
|
|
83
|
+
return self
|