armodel 1.3.0__py3-none-any.whl → 1.4.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/connector2xlsx_cli.py +75 -0
- armodel/cli/connector_update_cli.py +70 -0
- armodel/cli/swc_list_cli.py +2 -2
- armodel/lib/__init__.py +1 -1
- armodel/lib/data_analyzer.py +1 -1
- armodel/lib/sw_component.py +34 -0
- armodel/models/__init__.py +6 -1
- armodel/models/ar_object.py +39 -0
- armodel/models/ar_package.py +35 -1
- armodel/models/ar_ref.py +12 -2
- armodel/models/bsw_module_template.py +3 -2
- armodel/models/calibration.py +16 -0
- armodel/models/common_structure.py +92 -0
- armodel/models/communication.py +8 -0
- armodel/models/datatype.py +23 -5
- armodel/models/general_structure.py +48 -3
- armodel/models/global_constraints.py +40 -0
- armodel/models/m2_msr.py +76 -2
- armodel/models/port_prototype.py +21 -16
- armodel/models/sw_component.py +47 -18
- armodel/models/unit.py +14 -0
- armodel/parser/arxml_parser.py +552 -120
- armodel/parser/excel_parser.py +0 -0
- armodel/report/__init__.py +1 -0
- armodel/report/connector_xls_report.py +76 -0
- armodel/report/excel_report.py +42 -0
- armodel/tests/__init__.py +0 -0
- armodel/tests/test_armodel/__init__.py +0 -0
- armodel/tests/test_armodel/models/__init__.py +0 -0
- armodel/tests/test_armodel/models/test_ar_package.py +294 -0
- armodel/tests/test_armodel/models/test_ar_ref.py +74 -0
- armodel/tests/test_armodel/models/test_bsw_module_template.py +46 -0
- armodel/tests/test_armodel/models/test_common_structure.py +73 -0
- armodel/tests/test_armodel/models/test_data_dictionary.py +29 -0
- armodel/tests/test_armodel/models/test_data_prototype.py +86 -0
- armodel/tests/test_armodel/models/test_datatype.py +239 -0
- armodel/tests/test_armodel/models/test_general_structure.py +50 -0
- armodel/tests/test_armodel/models/test_m2_msr.py +77 -0
- armodel/tests/test_armodel/models/test_port_interface.py +198 -0
- armodel/tests/test_armodel/models/test_port_prototype.py +14 -0
- armodel/tests/test_armodel/parser/__init__.py +0 -0
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +168 -0
- armodel/writer/__init__.py +1 -0
- armodel/writer/arxml_writer.py +641 -0
- {armodel-1.3.0.dist-info → armodel-1.4.0.dist-info}/METADATA +38 -5
- armodel-1.4.0.dist-info/RECORD +60 -0
- {armodel-1.3.0.dist-info → armodel-1.4.0.dist-info}/WHEEL +1 -1
- armodel-1.4.0.dist-info/entry_points.txt +5 -0
- armodel-1.3.0.dist-info/RECORD +0 -31
- armodel-1.3.0.dist-info/entry_points.txt +0 -4
- {armodel-1.3.0.dist-info → armodel-1.4.0.dist-info}/LICENSE +0 -0
- {armodel-1.3.0.dist-info → armodel-1.4.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from .ar_ref import RefType
|
|
2
|
+
from .ar_object import ARObject
|
|
3
|
+
from .general_structure import Identifiable, Limit
|
|
4
|
+
|
|
5
|
+
from typing import List
|
|
6
|
+
|
|
7
|
+
class InternalConstrs(ARObject):
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
|
|
11
|
+
self.lower_limit = None # type: Limit
|
|
12
|
+
self.upper_limit = None # type: Limit
|
|
13
|
+
|
|
14
|
+
class PhysConstrs(ARObject):
|
|
15
|
+
def __init__(self):
|
|
16
|
+
super().__init__()
|
|
17
|
+
|
|
18
|
+
self.lower_limit = None # type: Limit
|
|
19
|
+
self.upper_limit = None # type: Limit
|
|
20
|
+
self.unit_ref = None # type: RefType
|
|
21
|
+
|
|
22
|
+
class DataConstrRule(ARObject):
|
|
23
|
+
def __init__(self):
|
|
24
|
+
super().__init__()
|
|
25
|
+
|
|
26
|
+
self.constr_level = None # type: int
|
|
27
|
+
self.internal_constrs = None # type: InternalConstrs
|
|
28
|
+
self.phys_constrs = None # type: PhysConstrs
|
|
29
|
+
|
|
30
|
+
class DataConstr(Identifiable):
|
|
31
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
32
|
+
super().__init__(parent, short_name)
|
|
33
|
+
|
|
34
|
+
self.data_constr_rule = [] # type: List[DataConstrRule]
|
|
35
|
+
|
|
36
|
+
def addDataConstrRule(self, rule: DataConstrRule):
|
|
37
|
+
self.data_constr_rule.append(rule)
|
|
38
|
+
|
|
39
|
+
def getDataConstrRules(self) -> List[DataConstrRule]:
|
|
40
|
+
return self.data_constr_rule
|
armodel/models/m2_msr.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from .general_structure import ARObject, ARElement, Limit
|
|
2
|
+
from .ar_ref import RefType
|
|
2
3
|
from abc import ABCMeta
|
|
3
4
|
from typing import List
|
|
4
5
|
|
|
@@ -6,6 +7,7 @@ class CompuContent(ARObject, metaclass=ABCMeta):
|
|
|
6
7
|
def __init__(self):
|
|
7
8
|
if type(self) == CompuContent:
|
|
8
9
|
raise NotImplementedError("CompuContent is an abstract class.")
|
|
10
|
+
|
|
9
11
|
super().__init__()
|
|
10
12
|
|
|
11
13
|
class Compu(ARObject):
|
|
@@ -18,28 +20,99 @@ class Compu(ARObject):
|
|
|
18
20
|
'''optional'''
|
|
19
21
|
self.compu_default_value = None # type: CompuConst
|
|
20
22
|
|
|
21
|
-
class CompuConstContent(ARObject):
|
|
23
|
+
class CompuConstContent(ARObject, metaclass=ABCMeta):
|
|
24
|
+
'''
|
|
25
|
+
This meta-class represents the fact that the constant value of the computation method can be numerical or textual.
|
|
26
|
+
Base : ARObject
|
|
27
|
+
Subclasses : CompuConstFormulaContent, CompuConstNumericContent, CompuConstTextContent
|
|
28
|
+
Aggregated by : CompuConst.compuConstContentType
|
|
29
|
+
'''
|
|
22
30
|
def __init__(self):
|
|
31
|
+
if type(self) == CompuConstContent:
|
|
32
|
+
raise NotImplementedError("CompuConstContent is an abstract class.")
|
|
33
|
+
|
|
23
34
|
super().__init__()
|
|
24
35
|
|
|
25
36
|
class CompuConstTextContent(CompuConstContent):
|
|
37
|
+
'''
|
|
38
|
+
This meta-class represents the textual content of a scale.
|
|
39
|
+
Base: ARObject, CompuConstContent
|
|
40
|
+
Aggregated by: CompuConst.compuConstContentType
|
|
41
|
+
'''
|
|
26
42
|
def __init__(self):
|
|
27
43
|
super().__init__()
|
|
28
44
|
|
|
29
45
|
self.vt = None
|
|
30
46
|
|
|
31
47
|
class CompuConstNumericContent(CompuConstContent):
|
|
48
|
+
|
|
32
49
|
def __init__(self):
|
|
33
50
|
super().__init__()
|
|
34
51
|
|
|
35
52
|
self.v = None
|
|
36
53
|
|
|
37
54
|
class CompuConst(ARObject):
|
|
55
|
+
'''
|
|
56
|
+
This meta-class represents the fact that the value of a computation method scale is constant.
|
|
57
|
+
Base : ARObject
|
|
58
|
+
Aggregated by : Compu.compuDefaultValue, CompuScale.compuInverseValue, CompuScaleConstantContents.compuCons
|
|
59
|
+
'''
|
|
38
60
|
def __init__(self):
|
|
39
61
|
super().__init__()
|
|
40
62
|
|
|
41
63
|
self.compu_const_content_type = None # type: CompuConstContent
|
|
42
64
|
|
|
65
|
+
class CompuScaleContents(ARObject, metaclass=ABCMeta):
|
|
66
|
+
def __init__(self):
|
|
67
|
+
if type(self) == CompuScaleContents:
|
|
68
|
+
raise NotImplementedError("CompuScaleContents is an abstract class.")
|
|
69
|
+
|
|
70
|
+
super().__init__()
|
|
71
|
+
|
|
72
|
+
class CompuScaleConstantContents(CompuScaleContents):
|
|
73
|
+
def __init__(self):
|
|
74
|
+
super().__init__()
|
|
75
|
+
|
|
76
|
+
self.compu_const = None # type: CompuConst
|
|
77
|
+
|
|
78
|
+
class CompuScaleRationalFormula(CompuScaleContents):
|
|
79
|
+
'''
|
|
80
|
+
This meta-class represents the fact that the computation in this scale is represented as rational term.
|
|
81
|
+
'''
|
|
82
|
+
def __init__(self):
|
|
83
|
+
super().__init__()
|
|
84
|
+
|
|
85
|
+
self.compu_rational_coeffs = None # type: CompuRationalCoeffs
|
|
86
|
+
|
|
87
|
+
class CompuNominatorDenominator(ARObject):
|
|
88
|
+
'''
|
|
89
|
+
This class represents the ability to express a polynomial either as Nominator or as Denominator.
|
|
90
|
+
Base : ARObject
|
|
91
|
+
Aggregated by : CompuRationalCoeffs.compuDenominator, CompuRationalCoeffs.compuNumerator
|
|
92
|
+
'''
|
|
93
|
+
def __init__(self):
|
|
94
|
+
super().__init__()
|
|
95
|
+
|
|
96
|
+
self.v = [] # type List[float]
|
|
97
|
+
|
|
98
|
+
def add_v(self, v: float):
|
|
99
|
+
self.v.append(v)
|
|
100
|
+
|
|
101
|
+
def get_vs(self) -> List[float]:
|
|
102
|
+
return self.v
|
|
103
|
+
|
|
104
|
+
class CompuRationalCoeffs(ARObject):
|
|
105
|
+
'''
|
|
106
|
+
This meta-class represents the ability to express a rational function by specifying the coefficients of nominator and denominator.
|
|
107
|
+
Base : ARObject
|
|
108
|
+
Aggregated by : CompuScaleRationalFormula.compuRationalCoeffs
|
|
109
|
+
'''
|
|
110
|
+
def __init__(self):
|
|
111
|
+
super().__init__()
|
|
112
|
+
|
|
113
|
+
self.compu_denominator = None # type: CompuNominatorDenominator
|
|
114
|
+
self.compu_numerator = None # type: CompuNominatorDenominator
|
|
115
|
+
|
|
43
116
|
class CompuScale(Compu):
|
|
44
117
|
def __init__(self):
|
|
45
118
|
super().__init__()
|
|
@@ -69,4 +142,5 @@ class CompuMethod(ARElement):
|
|
|
69
142
|
|
|
70
143
|
self.compu_internal_to_phys = None # type: Compu
|
|
71
144
|
self.compu_phys_to_internal = None # type: Compu
|
|
72
|
-
self.display_format = None # type: DisplayFormatString
|
|
145
|
+
self.display_format = None # type: DisplayFormatString
|
|
146
|
+
self.unit_ref = None # type: RefType
|
armodel/models/port_prototype.py
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from .data_dictionary import SwDataDefProps
|
|
2
4
|
from .general_structure import ARObject, Identifiable
|
|
3
5
|
from .ar_ref import RefType, TRefType
|
|
6
|
+
from .communication import TransmissionAcknowledgementRequest
|
|
7
|
+
from .common_structure import ValueSpecification
|
|
4
8
|
|
|
5
9
|
from abc import ABCMeta
|
|
6
10
|
|
|
@@ -68,9 +72,10 @@ class ReceiverComSpec(RPortComSpec):
|
|
|
68
72
|
super().__init__()
|
|
69
73
|
|
|
70
74
|
self.data_element_ref = None # type: RefType
|
|
71
|
-
self.
|
|
72
|
-
self.
|
|
73
|
-
|
|
75
|
+
self.network_representation = None # type: SwDataDefProps
|
|
76
|
+
self.handle_out_of_range = None # type: HandleOutOfRangeStatusEnum
|
|
77
|
+
self.uses_end_to_end_protection = False
|
|
78
|
+
|
|
74
79
|
|
|
75
80
|
class ModeSwitchSenderComSpec(RPortComSpec):
|
|
76
81
|
def __init__(self):
|
|
@@ -87,11 +92,12 @@ class SenderComSpec(PPortComSpec):
|
|
|
87
92
|
|
|
88
93
|
def __init__(self):
|
|
89
94
|
super().__init__()
|
|
90
|
-
self.data_element_ref = None
|
|
95
|
+
self.data_element_ref = None # type: RefType
|
|
96
|
+
self.network_representation = None # type: SwDataDefProps
|
|
91
97
|
self.handle_out_of_range = ""
|
|
98
|
+
self.transmission_acknowledge = None # type: TransmissionAcknowledgementRequest
|
|
92
99
|
self.uses_end_to_end_protection = False
|
|
93
100
|
|
|
94
|
-
|
|
95
101
|
class QueuedSenderComSpec(PPortComSpec):
|
|
96
102
|
def __init__(self):
|
|
97
103
|
super().__init__()
|
|
@@ -116,12 +122,12 @@ class NonqueuedReceiverComSpec(ReceiverComSpec):
|
|
|
116
122
|
|
|
117
123
|
self.alive_timeout = 0
|
|
118
124
|
self.enable_updated = False
|
|
119
|
-
self.filter = None
|
|
120
|
-
self.handle_data_status = None
|
|
125
|
+
self.filter = None # type: DataFilter
|
|
126
|
+
self.handle_data_status = None # type: bool
|
|
121
127
|
self.handle_never_received = False
|
|
122
128
|
self.handel_timeout_type = ""
|
|
123
|
-
self.init_value = None
|
|
124
|
-
self.timeout_substitution = None
|
|
129
|
+
self.init_value = None # type: ValueSpecification
|
|
130
|
+
self.timeout_substitution = None # type: ValueSpecification
|
|
125
131
|
|
|
126
132
|
class QueuedReceiverComSpec(ReceiverComSpec):
|
|
127
133
|
def __init__(self):
|
|
@@ -134,12 +140,11 @@ class PortPrototype(Identifiable):
|
|
|
134
140
|
def __init__(self, parent: ARObject, short_name: str):
|
|
135
141
|
super().__init__(parent, short_name)
|
|
136
142
|
|
|
137
|
-
|
|
138
143
|
class AbstractProvidedPortPrototype(PortPrototype):
|
|
139
144
|
def __init__(self, parent: ARObject, short_name: str):
|
|
140
145
|
super().__init__(parent, short_name)
|
|
141
146
|
|
|
142
|
-
self.provided_com_specs = [] # type:
|
|
147
|
+
self.provided_com_specs = [] # type: List[PPortComSpec]
|
|
143
148
|
|
|
144
149
|
def _validateRPortComSpec(self, com_spec: PPortComSpec):
|
|
145
150
|
if (isinstance(com_spec, NonqueuedSenderComSpec)):
|
|
@@ -160,14 +165,14 @@ class AbstractProvidedPortPrototype(PortPrototype):
|
|
|
160
165
|
return self.provided_com_specs
|
|
161
166
|
|
|
162
167
|
def getNonqueuedSenderComSpecs(self) -> List[NonqueuedSenderComSpec]:
|
|
163
|
-
return
|
|
168
|
+
return filter(lambda c: isinstance(c, NonqueuedSenderComSpec), self.provided_com_specs)
|
|
164
169
|
|
|
165
170
|
|
|
166
171
|
class AbstractRequiredPortPrototype(PortPrototype):
|
|
167
172
|
def __init__(self, parent: ARObject, short_name: str):
|
|
168
173
|
super().__init__(parent, short_name)
|
|
169
174
|
|
|
170
|
-
self.required_com_specs = [] # type:
|
|
175
|
+
self.required_com_specs = [] # type: List[RPortComSpec]
|
|
171
176
|
|
|
172
177
|
def _validateRPortComSpec(self, com_spec: RPortComSpec):
|
|
173
178
|
if (isinstance(com_spec, ClientComSpec)):
|
|
@@ -194,10 +199,10 @@ class AbstractRequiredPortPrototype(PortPrototype):
|
|
|
194
199
|
return self.required_com_specs
|
|
195
200
|
|
|
196
201
|
def getClientComSpecs(self) -> List[ClientComSpec]:
|
|
197
|
-
return
|
|
202
|
+
return filter(lambda c: isinstance(c, ClientComSpec), self.required_com_specs)
|
|
198
203
|
|
|
199
204
|
def getNonqueuedReceiverComSpecs(self) -> List[NonqueuedReceiverComSpec]:
|
|
200
|
-
return
|
|
205
|
+
return filter(lambda c: isinstance(c, NonqueuedReceiverComSpec), self.required_com_specs)
|
|
201
206
|
|
|
202
207
|
|
|
203
208
|
class PPortPrototype(AbstractProvidedPortPrototype):
|
armodel/models/sw_component.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
from typing import List, Dict
|
|
2
2
|
from abc import ABCMeta
|
|
3
3
|
from .general_structure import ARElement, Identifiable, ARObject
|
|
4
|
-
from .ar_ref import AutosarVariableRef, RefType, POperationInAtomicSwcInstanceRef, ROperationInAtomicSwcInstanceRef
|
|
5
|
-
from .ar_ref import
|
|
6
|
-
from .
|
|
4
|
+
from .ar_ref import AutosarVariableRef, RefType, POperationInAtomicSwcInstanceRef, ROperationInAtomicSwcInstanceRef
|
|
5
|
+
from .ar_ref import PortInCompositionTypeInstanceRef, PPortInCompositionInstanceRef, RPortInCompositionInstanceRef
|
|
6
|
+
from .ar_ref import RVariableInAtomicSwcInstanceRef, RModeInAtomicSwcInstanceRef
|
|
7
|
+
from .port_prototype import RPortPrototype, PPortPrototype, PortPrototype
|
|
7
8
|
from .data_prototype import VariableDataPrototype
|
|
8
9
|
from .common_structure import ExecutableEntity, InternalBehavior
|
|
9
10
|
|
|
@@ -321,23 +322,33 @@ class SwComponentType(ARElement):
|
|
|
321
322
|
def __init__(self, parent: ARObject, short_name: str):
|
|
322
323
|
super().__init__(parent, short_name)
|
|
323
324
|
|
|
325
|
+
self.ports = [] # List[PortPrototype]
|
|
326
|
+
|
|
324
327
|
def createPPortPrototype(self, short_name: str) -> PPortPrototype:
|
|
328
|
+
prototype = PPortPrototype(self, short_name)
|
|
329
|
+
self.ports.append(prototype)
|
|
325
330
|
if (short_name not in self.elements):
|
|
326
|
-
prototype = PPortPrototype(self, short_name)
|
|
327
331
|
self.elements[short_name] = prototype
|
|
328
332
|
return self.elements[short_name]
|
|
329
333
|
|
|
330
334
|
def createRPortPrototype(self, short_name) -> RPortPrototype:
|
|
335
|
+
prototype = RPortPrototype(self, short_name)
|
|
336
|
+
self.ports.append(prototype)
|
|
331
337
|
if (short_name not in self.elements):
|
|
332
|
-
prototype = RPortPrototype(self, short_name)
|
|
333
338
|
self.elements[short_name] = prototype
|
|
334
339
|
return self.elements[short_name]
|
|
335
340
|
|
|
336
341
|
def getPPortPrototypes(self) -> List[PPortPrototype]:
|
|
337
|
-
return list(filter(lambda c: isinstance(c, PPortPrototype), self.elements.values()))
|
|
342
|
+
#return list(sorted(filter(lambda c: isinstance(c, PPortPrototype), self.elements.values()), key= lambda o: o.short_name))
|
|
343
|
+
return list(sorted(filter(lambda c: isinstance(c, PPortPrototype), self.ports), key= lambda o: o.short_name))
|
|
338
344
|
|
|
339
345
|
def getRPortPrototypes(self) -> List[RPortPrototype]:
|
|
340
|
-
return list(filter(lambda c: isinstance(c, RPortPrototype), self.elements.values()))
|
|
346
|
+
#return list(sorted(filter(lambda c: isinstance(c, RPortPrototype), self.elements.values()), key= lambda o: o.short_name))
|
|
347
|
+
return list(sorted(filter(lambda c: isinstance(c, RPortPrototype), self.ports), key= lambda o: o.short_name))
|
|
348
|
+
|
|
349
|
+
def getPortPrototype(self) -> List[PortPrototype]:
|
|
350
|
+
#return list(sorted(filter(lambda c: isinstance(c, PortPrototype), self.elements.values()), key= lambda o: o.short_name))
|
|
351
|
+
return list(sorted(self.ports, key= lambda o: o.short_name))
|
|
341
352
|
|
|
342
353
|
class AtomicSwComponentType(SwComponentType):
|
|
343
354
|
__metaclass__ = ABCMeta
|
|
@@ -397,22 +408,22 @@ class AssemblySwConnector(SwConnector):
|
|
|
397
408
|
def __init__(self, parent: ARObject, short_name: str):
|
|
398
409
|
super().__init__(parent, short_name)
|
|
399
410
|
|
|
400
|
-
self.provider_iref = None # type:
|
|
401
|
-
self.requester_iref = None # type:
|
|
411
|
+
self.provider_iref = None # type: PPortInCompositionInstanceRef
|
|
412
|
+
self.requester_iref = None # type: RPortInCompositionInstanceRef
|
|
402
413
|
|
|
403
414
|
class DelegationSwConnector(SwConnector):
|
|
404
415
|
def __init__(self, parent: ARObject, short_name: str):
|
|
405
416
|
super().__init__(parent, short_name)
|
|
406
417
|
|
|
407
|
-
self.inner_port_iref = None # type:
|
|
408
|
-
self.
|
|
418
|
+
self.inner_port_iref = None # type: PortInCompositionInstanceRef
|
|
419
|
+
self.outer_port_ref = None # type: RefType
|
|
409
420
|
|
|
410
421
|
class PassThroughSwConnector(SwConnector):
|
|
411
422
|
def __init__(self, parent: ARObject, short_name: str):
|
|
412
423
|
super().__init__(parent, short_name)
|
|
413
424
|
|
|
414
|
-
self.
|
|
415
|
-
self.
|
|
425
|
+
self.provided_outer_port_ref = None # type: RefType
|
|
426
|
+
self.required_outer_port_ref = None # type: RefType
|
|
416
427
|
|
|
417
428
|
class SwComponentPrototype(Identifiable):
|
|
418
429
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -425,18 +436,30 @@ class CompositionSwComponentType(SwComponentType):
|
|
|
425
436
|
super().__init__(parent, short_name)
|
|
426
437
|
|
|
427
438
|
self.constant_value_mapping_refs = [] # type: List[RefType]
|
|
428
|
-
self.
|
|
439
|
+
self._data_type_mapping_refs = [] # type: List[RefType]
|
|
429
440
|
self.instantiation_rte_event_props = [] # type: List[InstantiationRTEEventProps]
|
|
430
441
|
|
|
431
442
|
def createAssemblySwConnector(self, short_name: str) -> AssemblySwConnector:
|
|
432
443
|
if (short_name not in self.elements):
|
|
433
444
|
connector = AssemblySwConnector(self, short_name)
|
|
434
445
|
self.elements[short_name] = connector
|
|
435
|
-
return self.elements[short_name]
|
|
446
|
+
return self.elements[short_name]
|
|
447
|
+
|
|
448
|
+
def createDelegationSwConnector(self, short_name: str) -> DelegationSwConnector:
|
|
449
|
+
if short_name not in self.elements:
|
|
450
|
+
connector = DelegationSwConnector(self, short_name)
|
|
451
|
+
self.elements[short_name] = connector
|
|
452
|
+
return self.elements[short_name]
|
|
436
453
|
|
|
437
454
|
def getAssemblySwConnectors(self) -> List[AssemblySwConnector]:
|
|
438
|
-
return list(filter(lambda e: isinstance(e, AssemblySwConnector), self.elements.values()))
|
|
439
|
-
|
|
455
|
+
return list(sorted(filter(lambda e: isinstance(e, AssemblySwConnector), self.elements.values()), key = lambda c: c.short_name))
|
|
456
|
+
|
|
457
|
+
def getDelegationSwConnectors(self) -> List[DelegationSwConnector]:
|
|
458
|
+
return list(sorted(filter(lambda e: isinstance(e, DelegationSwConnector), self.elements.values()), key = lambda c: c.short_name))
|
|
459
|
+
|
|
460
|
+
def getSwConnectors(self) -> List[SwConnector]:
|
|
461
|
+
return list(sorted(filter(lambda e: isinstance(e, SwConnector), self.elements.values()), key = lambda c: c.short_name))
|
|
462
|
+
|
|
440
463
|
def createSwComponentPrototype(self, short_name: str) -> SwComponentPrototype:
|
|
441
464
|
if (short_name not in self.elements):
|
|
442
465
|
connector = SwComponentPrototype(self, short_name)
|
|
@@ -444,4 +467,10 @@ class CompositionSwComponentType(SwComponentType):
|
|
|
444
467
|
return self.elements[short_name]
|
|
445
468
|
|
|
446
469
|
def getSwComponentPrototypes(self) -> List[SwComponentPrototype]:
|
|
447
|
-
return list(filter(lambda e: isinstance(e, SwComponentPrototype), self.elements.values()))
|
|
470
|
+
return list(filter(lambda e: isinstance(e, SwComponentPrototype), self.elements.values()))
|
|
471
|
+
|
|
472
|
+
def addDataTypeMapping(self, data_type_mapping_ref: RefType):
|
|
473
|
+
self._data_type_mapping_refs.append(data_type_mapping_ref)
|
|
474
|
+
|
|
475
|
+
def getDataTypeMappings(self) -> List[RefType]:
|
|
476
|
+
return self._data_type_mapping_refs
|
armodel/models/unit.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
from .ar_object import ARLiteral, ARObject
|
|
3
|
+
from .general_structure import ARElement
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SingleLanguageUnitNames(ARLiteral):
|
|
7
|
+
def __init__(self) -> None:
|
|
8
|
+
super().__init__()
|
|
9
|
+
|
|
10
|
+
class Unit(ARElement):
|
|
11
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
12
|
+
super().__init__(parent, short_name)
|
|
13
|
+
|
|
14
|
+
self.display_name = None # type: SingleLanguageUnitNames
|