armodel 1.3.0__py3-none-any.whl → 1.4.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/__init__.py +2 -1
- armodel/cli/arxml_dump_cli.py +8 -6
- armodel/cli/arxml_format_cli.py +72 -0
- armodel/cli/connector2xlsx_cli.py +75 -0
- armodel/cli/connector_update_cli.py +77 -0
- armodel/cli/swc_list_cli.py +2 -2
- armodel/data_models/__init__.py +0 -0
- armodel/data_models/sw_connector.py +22 -0
- armodel/lib/__init__.py +1 -1
- armodel/lib/sw_component.py +34 -0
- armodel/models/__init__.py +8 -2
- armodel/models/annotation.py +20 -0
- armodel/models/ar_object.py +184 -0
- armodel/models/ar_package.py +144 -14
- armodel/models/ar_ref.py +74 -8
- armodel/models/bsw_module_template.py +97 -25
- armodel/models/calibration.py +119 -0
- armodel/models/common_structure.py +203 -36
- armodel/models/communication.py +17 -0
- armodel/models/data_def_properties.py +16 -0
- armodel/models/data_dictionary.py +46 -9
- armodel/models/data_prototype.py +24 -5
- armodel/models/datatype.py +86 -19
- armodel/models/end_to_end_protection.py +67 -0
- armodel/models/general_structure.py +72 -17
- armodel/models/global_constraints.py +40 -0
- armodel/models/implementation.py +80 -32
- armodel/models/m2_msr.py +82 -6
- armodel/models/multilanguage_data.py +42 -0
- armodel/models/per_instance_memory.py +14 -0
- armodel/models/port_interface.py +27 -4
- armodel/models/port_prototype.py +48 -23
- armodel/models/record_layout.py +118 -0
- armodel/models/service_mapping.py +11 -0
- armodel/models/service_needs.py +48 -0
- armodel/models/sw_component.py +257 -43
- armodel/models/unit.py +14 -0
- armodel/parser/abstract_arxml_parser.py +248 -0
- armodel/parser/arxml_parser.py +1550 -648
- armodel/parser/connector_xlsx_parser.py +190 -0
- armodel/parser/excel_parser.py +18 -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_object.py +152 -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_implementation.py +26 -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_arxml_parser.py +15 -0
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +192 -0
- armodel/tests/test_armodel/parser/test_sw_components.py +93 -0
- armodel/writer/__init__.py +1 -0
- armodel/writer/abstract_arxml_writer.py +123 -0
- armodel/writer/arxml_writer.py +1755 -0
- {armodel-1.3.0.dist-info → armodel-1.4.3.dist-info}/METADATA +124 -4
- armodel-1.4.3.dist-info/RECORD +78 -0
- armodel-1.4.3.dist-info/entry_points.txt +7 -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.3.dist-info}/LICENSE +0 -0
- {armodel-1.3.0.dist-info → armodel-1.4.3.dist-info}/WHEEL +0 -0
- {armodel-1.3.0.dist-info → armodel-1.4.3.dist-info}/top_level.txt +0 -0
armodel/models/m2_msr.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
from .ar_object import ARLiteral
|
|
1
2
|
from .general_structure import ARObject, ARElement, Limit
|
|
3
|
+
from .ar_ref import RefType
|
|
2
4
|
from abc import ABCMeta
|
|
3
5
|
from typing import List
|
|
4
6
|
|
|
@@ -6,6 +8,7 @@ class CompuContent(ARObject, metaclass=ABCMeta):
|
|
|
6
8
|
def __init__(self):
|
|
7
9
|
if type(self) == CompuContent:
|
|
8
10
|
raise NotImplementedError("CompuContent is an abstract class.")
|
|
11
|
+
|
|
9
12
|
super().__init__()
|
|
10
13
|
|
|
11
14
|
class Compu(ARObject):
|
|
@@ -18,36 +21,108 @@ class Compu(ARObject):
|
|
|
18
21
|
'''optional'''
|
|
19
22
|
self.compu_default_value = None # type: CompuConst
|
|
20
23
|
|
|
21
|
-
class CompuConstContent(ARObject):
|
|
24
|
+
class CompuConstContent(ARObject, metaclass=ABCMeta):
|
|
25
|
+
'''
|
|
26
|
+
This meta-class represents the fact that the constant value of the computation method can be numerical or textual.
|
|
27
|
+
Base : ARObject
|
|
28
|
+
Subclasses : CompuConstFormulaContent, CompuConstNumericContent, CompuConstTextContent
|
|
29
|
+
Aggregated by : CompuConst.compuConstContentType
|
|
30
|
+
'''
|
|
22
31
|
def __init__(self):
|
|
32
|
+
if type(self) == CompuConstContent:
|
|
33
|
+
raise NotImplementedError("CompuConstContent is an abstract class.")
|
|
34
|
+
|
|
23
35
|
super().__init__()
|
|
24
36
|
|
|
25
37
|
class CompuConstTextContent(CompuConstContent):
|
|
38
|
+
'''
|
|
39
|
+
This meta-class represents the textual content of a scale.
|
|
40
|
+
Base: ARObject, CompuConstContent
|
|
41
|
+
Aggregated by: CompuConst.compuConstContentType
|
|
42
|
+
'''
|
|
26
43
|
def __init__(self):
|
|
27
44
|
super().__init__()
|
|
28
45
|
|
|
29
46
|
self.vt = None
|
|
30
47
|
|
|
31
48
|
class CompuConstNumericContent(CompuConstContent):
|
|
49
|
+
|
|
32
50
|
def __init__(self):
|
|
33
51
|
super().__init__()
|
|
34
52
|
|
|
35
53
|
self.v = None
|
|
36
54
|
|
|
37
55
|
class CompuConst(ARObject):
|
|
56
|
+
'''
|
|
57
|
+
This meta-class represents the fact that the value of a computation method scale is constant.
|
|
58
|
+
Base : ARObject
|
|
59
|
+
Aggregated by : Compu.compuDefaultValue, CompuScale.compuInverseValue, CompuScaleConstantContents.compuCons
|
|
60
|
+
'''
|
|
38
61
|
def __init__(self):
|
|
39
62
|
super().__init__()
|
|
40
63
|
|
|
41
64
|
self.compu_const_content_type = None # type: CompuConstContent
|
|
42
65
|
|
|
66
|
+
class CompuScaleContents(ARObject, metaclass=ABCMeta):
|
|
67
|
+
def __init__(self):
|
|
68
|
+
if type(self) == CompuScaleContents:
|
|
69
|
+
raise NotImplementedError("CompuScaleContents is an abstract class.")
|
|
70
|
+
|
|
71
|
+
super().__init__()
|
|
72
|
+
|
|
73
|
+
class CompuScaleConstantContents(CompuScaleContents):
|
|
74
|
+
def __init__(self):
|
|
75
|
+
super().__init__()
|
|
76
|
+
|
|
77
|
+
self.compu_const = None # type: CompuConst
|
|
78
|
+
|
|
79
|
+
class CompuScaleRationalFormula(CompuScaleContents):
|
|
80
|
+
'''
|
|
81
|
+
This meta-class represents the fact that the computation in this scale is represented as rational term.
|
|
82
|
+
'''
|
|
83
|
+
def __init__(self):
|
|
84
|
+
super().__init__()
|
|
85
|
+
|
|
86
|
+
self.compu_rational_coeffs = None # type: CompuRationalCoeffs
|
|
87
|
+
|
|
88
|
+
class CompuNominatorDenominator(ARObject):
|
|
89
|
+
'''
|
|
90
|
+
This class represents the ability to express a polynomial either as Nominator or as Denominator.
|
|
91
|
+
Base : ARObject
|
|
92
|
+
Aggregated by : CompuRationalCoeffs.compuDenominator, CompuRationalCoeffs.compuNumerator
|
|
93
|
+
'''
|
|
94
|
+
def __init__(self):
|
|
95
|
+
super().__init__()
|
|
96
|
+
|
|
97
|
+
self.v = [] # type List[float]
|
|
98
|
+
|
|
99
|
+
def add_v(self, v: float):
|
|
100
|
+
self.v.append(v)
|
|
101
|
+
|
|
102
|
+
def get_vs(self) -> List[float]:
|
|
103
|
+
return self.v
|
|
104
|
+
|
|
105
|
+
class CompuRationalCoeffs(ARObject):
|
|
106
|
+
'''
|
|
107
|
+
This meta-class represents the ability to express a rational function by specifying the coefficients of nominator and denominator.
|
|
108
|
+
Base : ARObject
|
|
109
|
+
Aggregated by : CompuScaleRationalFormula.compuRationalCoeffs
|
|
110
|
+
'''
|
|
111
|
+
def __init__(self):
|
|
112
|
+
super().__init__()
|
|
113
|
+
|
|
114
|
+
self.compu_denominator = None # type: CompuNominatorDenominator
|
|
115
|
+
self.compu_numerator = None # type: CompuNominatorDenominator
|
|
116
|
+
|
|
43
117
|
class CompuScale(Compu):
|
|
44
118
|
def __init__(self):
|
|
45
119
|
super().__init__()
|
|
46
120
|
|
|
47
|
-
self.
|
|
48
|
-
self.
|
|
49
|
-
self.
|
|
50
|
-
self.
|
|
121
|
+
self.symbol = None # type: ARLiteral
|
|
122
|
+
self.lowerLimit = None # type: Limit
|
|
123
|
+
self.upperLimit = None # type: Limit
|
|
124
|
+
self.compuInverseValue = None # type: CompuConst
|
|
125
|
+
self.compuScaleContents = None # type: CompuScaleContents
|
|
51
126
|
|
|
52
127
|
class CompuScales(CompuContent):
|
|
53
128
|
def __init__(self):
|
|
@@ -69,4 +144,5 @@ class CompuMethod(ARElement):
|
|
|
69
144
|
|
|
70
145
|
self.compu_internal_to_phys = None # type: Compu
|
|
71
146
|
self.compu_phys_to_internal = None # type: Compu
|
|
72
|
-
self.display_format = None # type: DisplayFormatString
|
|
147
|
+
self.display_format = None # type: DisplayFormatString
|
|
148
|
+
self.unit_ref = None # type: RefType
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
from typing import List
|
|
3
|
+
from .ar_object import ARObject
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class LLongName(ARObject):
|
|
7
|
+
def __init__(self):
|
|
8
|
+
super().__init__()
|
|
9
|
+
|
|
10
|
+
self.l = ""
|
|
11
|
+
self.value = ""
|
|
12
|
+
|
|
13
|
+
class LOverviewParagraph(ARObject):
|
|
14
|
+
def __init__(self):
|
|
15
|
+
super().__init__()
|
|
16
|
+
|
|
17
|
+
self.l = ""
|
|
18
|
+
self.value = ""
|
|
19
|
+
|
|
20
|
+
class MultilanguageLongName(ARObject):
|
|
21
|
+
def __init__(self):
|
|
22
|
+
super().__init__()
|
|
23
|
+
|
|
24
|
+
self.l4 = [] # type:List[LLongName]
|
|
25
|
+
|
|
26
|
+
def addL4(self, l4: LLongName):
|
|
27
|
+
self.l4.append(l4)
|
|
28
|
+
|
|
29
|
+
def getL4s(self) -> List[LLongName]:
|
|
30
|
+
return self.l4
|
|
31
|
+
|
|
32
|
+
class MultiLanguageOverviewParagraph(ARObject):
|
|
33
|
+
def __init__(self):
|
|
34
|
+
super().__init__()
|
|
35
|
+
|
|
36
|
+
self.l2 = [] # type: List[str]
|
|
37
|
+
|
|
38
|
+
def addL2(self, l2: LOverviewParagraph):
|
|
39
|
+
self.l2.append(l2)
|
|
40
|
+
|
|
41
|
+
def getL2s(self) -> List[LOverviewParagraph]:
|
|
42
|
+
return self.l2
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
from .data_dictionary import SwDataDefProps
|
|
3
|
+
from .ar_object import ARObject
|
|
4
|
+
from .general_structure import Identifiable
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PerInstanceMemory(Identifiable):
|
|
8
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
9
|
+
super().__init__(parent, short_name)
|
|
10
|
+
|
|
11
|
+
self.init_value = None # type: str
|
|
12
|
+
self.sw_data_def_props = None # type: SwDataDefProps
|
|
13
|
+
self.type = None # type: str
|
|
14
|
+
self.type_definition = None # type: str
|
armodel/models/port_interface.py
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
2
|
from typing import List
|
|
3
3
|
|
|
4
|
+
from .ar_object import ARBoolean, ARLiteral, ARNumerical
|
|
5
|
+
from .common_structure import ModeDeclarationGroupPrototype, Trigger
|
|
4
6
|
from .datatype import AtpType
|
|
5
7
|
from .general_structure import ARObject, Identifiable, AtpFeature
|
|
6
8
|
from .data_prototype import VariableDataPrototype, AutosarDataPrototype
|
|
7
9
|
from .ar_ref import RefType
|
|
8
10
|
|
|
9
|
-
class PortInterface(AtpType, metaclass=ABCMeta):
|
|
11
|
+
class PortInterface(AtpType, metaclass = ABCMeta):
|
|
10
12
|
def __init__(self, parent: ARObject, short_name: str):
|
|
11
13
|
if type(self) == PortInterface:
|
|
12
14
|
raise NotImplementedError("PortInterface is an abstract class.")
|
|
13
15
|
super().__init__(parent, short_name)
|
|
14
16
|
|
|
15
|
-
self.is_service =
|
|
16
|
-
|
|
17
|
+
self.is_service = None # type: ARBoolean
|
|
18
|
+
self.serviceKind = None # type: ARLiteral
|
|
17
19
|
|
|
18
20
|
class DataInterface(PortInterface, metaclass=ABCMeta):
|
|
19
21
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -63,7 +65,7 @@ class ApplicationError(Identifiable):
|
|
|
63
65
|
def __init__(self, parent: ARObject, short_name: str):
|
|
64
66
|
super().__init__(parent, short_name)
|
|
65
67
|
|
|
66
|
-
self.error_code =
|
|
68
|
+
self.error_code = None # type: ARNumerical
|
|
67
69
|
|
|
68
70
|
class ClientServerOperation(AtpFeature):
|
|
69
71
|
"""
|
|
@@ -140,3 +142,24 @@ class ClientServerInterface(PortInterface):
|
|
|
140
142
|
|
|
141
143
|
def getPossibleErrors(self) -> List[ApplicationError]:
|
|
142
144
|
return list(filter(lambda c: isinstance(c, ApplicationError), self.elements.values()))
|
|
145
|
+
|
|
146
|
+
class TriggerInterface(PortInterface):
|
|
147
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
148
|
+
super().__init__(parent, short_name)
|
|
149
|
+
|
|
150
|
+
self._triggers = [] # type: Trigger
|
|
151
|
+
|
|
152
|
+
class ModeSwitchInterface(PortInterface):
|
|
153
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
154
|
+
super().__init__(parent, short_name)
|
|
155
|
+
|
|
156
|
+
self._modeGroup = [] # type: List[ModeDeclarationGroupPrototype]
|
|
157
|
+
|
|
158
|
+
def createModeGroup(self, short_name: str) -> ModeDeclarationGroupPrototype:
|
|
159
|
+
prototype = ModeDeclarationGroupPrototype(self, short_name)
|
|
160
|
+
if (short_name not in self.elements):
|
|
161
|
+
self.elements[short_name] = prototype
|
|
162
|
+
return self.elements[short_name]
|
|
163
|
+
|
|
164
|
+
def getModeGroups(self) -> List[ModeDeclarationGroupPrototype]:
|
|
165
|
+
return list(sorted(filter(lambda c: isinstance(c, ModeDeclarationGroupPrototype), self.elements.values()), key= lambda o: o.short_name))
|
armodel/models/port_prototype.py
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
from typing import List
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from .ar_object import ARBoolean
|
|
4
|
+
from .data_dictionary import SwDataDefProps
|
|
2
5
|
from .general_structure import ARObject, Identifiable
|
|
3
6
|
from .ar_ref import RefType, TRefType
|
|
7
|
+
from .communication import CompositeNetworkRepresentation, TransmissionAcknowledgementRequest
|
|
8
|
+
from .common_structure import ValueSpecification
|
|
4
9
|
|
|
5
10
|
from abc import ABCMeta
|
|
6
11
|
|
|
@@ -67,10 +72,17 @@ class ReceiverComSpec(RPortComSpec):
|
|
|
67
72
|
def __init__(self):
|
|
68
73
|
super().__init__()
|
|
69
74
|
|
|
70
|
-
self.
|
|
71
|
-
self.
|
|
72
|
-
self.
|
|
75
|
+
self._composite_network_representation = [] # type: List[CompositeNetworkRepresentation]
|
|
76
|
+
self.data_element_ref = None # type: RefType
|
|
77
|
+
self.network_representation = None # type: SwDataDefProps
|
|
78
|
+
self.handle_out_of_range = None # type: str
|
|
79
|
+
self.uses_end_to_end_protection = None # type: ARBoolean
|
|
80
|
+
|
|
81
|
+
def addCompositeNetworkRepresentation(self, representation: CompositeNetworkRepresentation):
|
|
82
|
+
self._composite_network_representation.append(representation)
|
|
73
83
|
|
|
84
|
+
def getCompositeNetworkRepresentations(self) -> List[CompositeNetworkRepresentation]:
|
|
85
|
+
return self._composite_network_representation
|
|
74
86
|
|
|
75
87
|
class ModeSwitchSenderComSpec(RPortComSpec):
|
|
76
88
|
def __init__(self):
|
|
@@ -87,10 +99,18 @@ class SenderComSpec(PPortComSpec):
|
|
|
87
99
|
|
|
88
100
|
def __init__(self):
|
|
89
101
|
super().__init__()
|
|
90
|
-
self.
|
|
91
|
-
self.
|
|
92
|
-
self.
|
|
102
|
+
self._composite_network_representation = [] # type: List[CompositeNetworkRepresentation]
|
|
103
|
+
self.data_element_ref = None # type: RefType
|
|
104
|
+
self.network_representation = None # type: SwDataDefProps
|
|
105
|
+
self.handle_out_of_range = None # type: str
|
|
106
|
+
self.transmission_acknowledge = None # type: TransmissionAcknowledgementRequest
|
|
107
|
+
self.uses_end_to_end_protection = None # type: ARBoolean
|
|
93
108
|
|
|
109
|
+
def addCompositeNetworkRepresentation(self, representation: CompositeNetworkRepresentation):
|
|
110
|
+
self._composite_network_representation.append(representation)
|
|
111
|
+
|
|
112
|
+
def getCompositeNetworkRepresentations(self) -> List[CompositeNetworkRepresentation]:
|
|
113
|
+
return self._composite_network_representation
|
|
94
114
|
|
|
95
115
|
class QueuedSenderComSpec(PPortComSpec):
|
|
96
116
|
def __init__(self):
|
|
@@ -107,7 +127,9 @@ class NonqueuedSenderComSpec(SenderComSpec):
|
|
|
107
127
|
class ServerComSpec(PPortComSpec):
|
|
108
128
|
def __init__(self):
|
|
109
129
|
super().__init__()
|
|
110
|
-
|
|
130
|
+
|
|
131
|
+
self.operation_ref = None # type: RefType
|
|
132
|
+
self.queue_length = None # type: int
|
|
111
133
|
|
|
112
134
|
|
|
113
135
|
class NonqueuedReceiverComSpec(ReceiverComSpec):
|
|
@@ -115,13 +137,13 @@ class NonqueuedReceiverComSpec(ReceiverComSpec):
|
|
|
115
137
|
super().__init__()
|
|
116
138
|
|
|
117
139
|
self.alive_timeout = 0
|
|
118
|
-
self.enable_updated =
|
|
119
|
-
self.filter = None
|
|
120
|
-
self.handle_data_status = None
|
|
121
|
-
self.handle_never_received =
|
|
140
|
+
self.enable_updated = None # type: ARBoolean
|
|
141
|
+
self.filter = None # type: DataFilter
|
|
142
|
+
self.handle_data_status = None # type: bool
|
|
143
|
+
self.handle_never_received = None # type: ARBoolean
|
|
122
144
|
self.handel_timeout_type = ""
|
|
123
|
-
self.init_value = None
|
|
124
|
-
self.timeout_substitution = None
|
|
145
|
+
self.init_value = None # type: ValueSpecification
|
|
146
|
+
self.timeout_substitution = None # type: ValueSpecification
|
|
125
147
|
|
|
126
148
|
class QueuedReceiverComSpec(ReceiverComSpec):
|
|
127
149
|
def __init__(self):
|
|
@@ -134,21 +156,22 @@ class PortPrototype(Identifiable):
|
|
|
134
156
|
def __init__(self, parent: ARObject, short_name: str):
|
|
135
157
|
super().__init__(parent, short_name)
|
|
136
158
|
|
|
137
|
-
|
|
138
159
|
class AbstractProvidedPortPrototype(PortPrototype):
|
|
139
160
|
def __init__(self, parent: ARObject, short_name: str):
|
|
140
161
|
super().__init__(parent, short_name)
|
|
141
162
|
|
|
142
|
-
self.provided_com_specs = [] # type:
|
|
163
|
+
self.provided_com_specs = [] # type: List[PPortComSpec]
|
|
143
164
|
|
|
144
165
|
def _validateRPortComSpec(self, com_spec: PPortComSpec):
|
|
145
|
-
if
|
|
146
|
-
if
|
|
166
|
+
if isinstance(com_spec, NonqueuedSenderComSpec):
|
|
167
|
+
if com_spec.data_element_ref == None:
|
|
147
168
|
raise ValueError(
|
|
148
169
|
"operation of NonqueuedSenderComSpec is invalid")
|
|
149
|
-
if
|
|
170
|
+
if com_spec.data_element_ref.dest != "VARIABLE-DATA-PROTOTYPE":
|
|
150
171
|
raise ValueError(
|
|
151
172
|
"Invalid operation dest of NonqueuedSenderComSpec")
|
|
173
|
+
elif isinstance(com_spec, ServerComSpec):
|
|
174
|
+
pass
|
|
152
175
|
else:
|
|
153
176
|
raise ValueError("Unsupported com spec")
|
|
154
177
|
|
|
@@ -160,14 +183,14 @@ class AbstractProvidedPortPrototype(PortPrototype):
|
|
|
160
183
|
return self.provided_com_specs
|
|
161
184
|
|
|
162
185
|
def getNonqueuedSenderComSpecs(self) -> List[NonqueuedSenderComSpec]:
|
|
163
|
-
return
|
|
186
|
+
return filter(lambda c: isinstance(c, NonqueuedSenderComSpec), self.provided_com_specs)
|
|
164
187
|
|
|
165
188
|
|
|
166
189
|
class AbstractRequiredPortPrototype(PortPrototype):
|
|
167
190
|
def __init__(self, parent: ARObject, short_name: str):
|
|
168
191
|
super().__init__(parent, short_name)
|
|
169
192
|
|
|
170
|
-
self.required_com_specs = [] # type:
|
|
193
|
+
self.required_com_specs = [] # type: List[RPortComSpec]
|
|
171
194
|
|
|
172
195
|
def _validateRPortComSpec(self, com_spec: RPortComSpec):
|
|
173
196
|
if (isinstance(com_spec, ClientComSpec)):
|
|
@@ -183,6 +206,8 @@ class AbstractRequiredPortPrototype(PortPrototype):
|
|
|
183
206
|
if (com_spec.data_element_ref.dest != "VARIABLE-DATA-PROTOTYPE"):
|
|
184
207
|
raise ValueError(
|
|
185
208
|
"Invalid date element dest of NonqueuedReceiverComSpec.")
|
|
209
|
+
elif isinstance(com_spec, QueuedReceiverComSpec):
|
|
210
|
+
pass
|
|
186
211
|
else:
|
|
187
212
|
raise ValueError("Unsupported RPortComSpec")
|
|
188
213
|
|
|
@@ -194,10 +219,10 @@ class AbstractRequiredPortPrototype(PortPrototype):
|
|
|
194
219
|
return self.required_com_specs
|
|
195
220
|
|
|
196
221
|
def getClientComSpecs(self) -> List[ClientComSpec]:
|
|
197
|
-
return
|
|
222
|
+
return filter(lambda c: isinstance(c, ClientComSpec), self.required_com_specs)
|
|
198
223
|
|
|
199
224
|
def getNonqueuedReceiverComSpecs(self) -> List[NonqueuedReceiverComSpec]:
|
|
200
|
-
return
|
|
225
|
+
return filter(lambda c: isinstance(c, NonqueuedReceiverComSpec), self.required_com_specs)
|
|
201
226
|
|
|
202
227
|
|
|
203
228
|
class PPortPrototype(AbstractProvidedPortPrototype):
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
|
|
2
|
+
from .multilanguage_data import MultiLanguageOverviewParagraph
|
|
3
|
+
from .ar_ref import RefType
|
|
4
|
+
from .ar_object import ARLiteral, ARNumerical, ARObject
|
|
5
|
+
from .general_structure import ARElement
|
|
6
|
+
|
|
7
|
+
class SwRecordLayoutV(ARObject):
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
|
|
11
|
+
self.baseTypeRef = None # type: RefType
|
|
12
|
+
self.desc = None # type: MultiLanguageOverviewParagraph
|
|
13
|
+
self.shortLabel = None # type: ARLiteral
|
|
14
|
+
self.swGenericAxisParamTypeRef = None # type: RefType
|
|
15
|
+
self.swRecordLayoutVAxis = None # type: ARNumerical
|
|
16
|
+
self.swRecordLayoutVFixValue = None # type: ARNumerical
|
|
17
|
+
self.swRecordLayoutVIndex = None # type: ARLiteral
|
|
18
|
+
self.swRecordLayoutVProp = None # type: ARLiteral
|
|
19
|
+
|
|
20
|
+
def setShortLabel(self, short_label: ARLiteral):
|
|
21
|
+
self.shortLabel = short_label
|
|
22
|
+
return self
|
|
23
|
+
|
|
24
|
+
def setBaseTypeRef(self, ref: RefType):
|
|
25
|
+
self.baseTypeRef = ref
|
|
26
|
+
return self
|
|
27
|
+
|
|
28
|
+
def setSwRecordLayoutVAxis(self, axis: ARNumerical):
|
|
29
|
+
self.swRecordLayoutVAxis = axis
|
|
30
|
+
return self
|
|
31
|
+
|
|
32
|
+
def setSwRecordLayoutVFixValue(self, value: ARNumerical):
|
|
33
|
+
self.swRecordLayoutVFixValue = value
|
|
34
|
+
return self
|
|
35
|
+
|
|
36
|
+
def setSwRecordLayoutVIndex(self, index: ARLiteral):
|
|
37
|
+
self.swRecordLayoutVIndex = index
|
|
38
|
+
return self
|
|
39
|
+
|
|
40
|
+
def setSwRecordLayoutVProp(self, prop: ARLiteral):
|
|
41
|
+
self.swRecordLayoutVProp = prop
|
|
42
|
+
return self
|
|
43
|
+
|
|
44
|
+
class SwRecordLayoutGroupContent(ARObject):
|
|
45
|
+
def __init__(self):
|
|
46
|
+
super().__init__()
|
|
47
|
+
|
|
48
|
+
self.swRecordLayoutRef = None # type: RefType
|
|
49
|
+
self.swRecordLayoutGroup = None # type: SwRecordLayoutGroup
|
|
50
|
+
self.swRecordLayoutV = None # type: SwRecordLayoutV
|
|
51
|
+
|
|
52
|
+
class SwRecordLayoutGroup(ARObject):
|
|
53
|
+
def __init__(self):
|
|
54
|
+
super().__init__()
|
|
55
|
+
|
|
56
|
+
self.category = None # type: ARLiteral
|
|
57
|
+
self.desc = None # type: MultiLanguageOverviewParagraph
|
|
58
|
+
self.shortLabel = None # type: ARLiteral
|
|
59
|
+
self.swGenericAxisParamTypeRef = None # type: RefType
|
|
60
|
+
self.swRecordLayoutComponent = None # type: ARLiteral
|
|
61
|
+
self.swRecordLayoutGroupAxis = None # type: ARNumerical
|
|
62
|
+
self.swRecordLayoutGroupContentType = None # type: SwRecordLayoutGroupContent
|
|
63
|
+
self.swRecordLayoutGroupIndex = None # type: ARLiteral
|
|
64
|
+
self.swRecordLayoutGroupFrom = None # type: ARLiteral
|
|
65
|
+
self.swRecordLayoutGroupTo = None # type: ARLiteral
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def setCategory(self, category: ARLiteral):
|
|
69
|
+
self.category = category
|
|
70
|
+
return self
|
|
71
|
+
|
|
72
|
+
def setDesc(self, desc):
|
|
73
|
+
self.desc = desc
|
|
74
|
+
return self
|
|
75
|
+
|
|
76
|
+
def setShortLabel(self, label: ARLiteral):
|
|
77
|
+
self.shortLabel = label
|
|
78
|
+
return self
|
|
79
|
+
|
|
80
|
+
def setSwGenericAxisParamTypeRef(self, ref: RefType):
|
|
81
|
+
self.swGenericAxisParamTypeRef = ref
|
|
82
|
+
return self
|
|
83
|
+
|
|
84
|
+
def setSwRecordLayoutComponent(self, component: ARLiteral):
|
|
85
|
+
self.swRecordLayoutComponent = component
|
|
86
|
+
return self
|
|
87
|
+
|
|
88
|
+
def setSwRecordLayoutGroupAxis(self, axis: ARNumerical):
|
|
89
|
+
self.swRecordLayoutGroupAxis = axis
|
|
90
|
+
return self
|
|
91
|
+
|
|
92
|
+
def setSwRecordLayoutGroupIndex(self, index: ARLiteral):
|
|
93
|
+
self.swRecordLayoutGroupIndex = index
|
|
94
|
+
return self
|
|
95
|
+
|
|
96
|
+
def setSwRecordLayoutGroupFrom(self, from_value: ARLiteral):
|
|
97
|
+
self.swRecordLayoutGroupFrom = from_value
|
|
98
|
+
return self
|
|
99
|
+
|
|
100
|
+
def setSwRecordLayoutGroupTo(self, to_value: ARLiteral):
|
|
101
|
+
self.swRecordLayoutGroupTo = to_value
|
|
102
|
+
return self
|
|
103
|
+
|
|
104
|
+
def setSwRecordLayoutGroupContentType(self, content_type: SwRecordLayoutGroupContent):
|
|
105
|
+
self.swRecordLayoutGroupContentType = content_type
|
|
106
|
+
return self
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class SwRecordLayout(ARElement):
|
|
110
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
111
|
+
super().__init__(parent, short_name)
|
|
112
|
+
|
|
113
|
+
self.swRecordLayoutGroup = None # type: SwRecordLayoutGroup
|
|
114
|
+
|
|
115
|
+
def setSwRecordLayoutGroup(self, group: SwRecordLayoutGroup):
|
|
116
|
+
self.swRecordLayoutGroup = group
|
|
117
|
+
return self
|
|
118
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
from abc import ABCMeta
|
|
3
|
+
from .general_structure import Identifiable
|
|
4
|
+
from .ar_ref import AutosarVariableRef, AutosarParameterRef, RefType
|
|
5
|
+
from .ar_object import ARBoolean, ARLiteral, ARObject
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class RoleBasedDataAssignment(ARObject):
|
|
9
|
+
def __init__(self):
|
|
10
|
+
super().__init__()
|
|
11
|
+
|
|
12
|
+
self.role = None # type: ARLiteral
|
|
13
|
+
self.used_data_element = None # type: AutosarVariableRef
|
|
14
|
+
self.used_parameter_element = None # type: AutosarParameterRef
|
|
15
|
+
self.used_pim_ref = None # type: RefType
|
|
16
|
+
|
|
17
|
+
class ServiceNeeds(Identifiable, metaclass = ABCMeta):
|
|
18
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
19
|
+
if type(self) == ServiceNeeds:
|
|
20
|
+
raise NotImplementedError("ServiceNeeds is an abstract class.")
|
|
21
|
+
|
|
22
|
+
super().__init__(parent, short_name)
|
|
23
|
+
|
|
24
|
+
class NvBlockNeeds(ServiceNeeds):
|
|
25
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
26
|
+
super().__init__(parent, short_name)
|
|
27
|
+
|
|
28
|
+
self.calc_ram_block_crc = None # type: ARBoolean
|
|
29
|
+
self.check_static_block_id = None # type: ARBoolean
|
|
30
|
+
self.n_data_sets = None # type: int
|
|
31
|
+
self.n_rom_blocks = None # type: int
|
|
32
|
+
self.ram_block_status_control = None # type: str
|
|
33
|
+
self.readonly = None # type: ARBoolean
|
|
34
|
+
self.reliability = None # type: str
|
|
35
|
+
self.resistant_to_changed_sw = None # type: ARBoolean
|
|
36
|
+
self.restore_at_start = None # type: ARBoolean
|
|
37
|
+
self.select_block_for_first_init_all = None # type: ARBoolean
|
|
38
|
+
self.store_at_shutdown = None # type: ARBoolean
|
|
39
|
+
self.store_cyclic = None # type: ARBoolean
|
|
40
|
+
self.store_emergency = None # type: ARBoolean
|
|
41
|
+
self.store_immediate = None # type: ARBoolean
|
|
42
|
+
self.store_on_change = None # type: ARBoolean
|
|
43
|
+
self.use_auto_validation_at_shut_down = None # type: ARBoolean
|
|
44
|
+
self.use_crc_comp_mechanism = None # type: ARBoolean
|
|
45
|
+
self.write_only_once = None # type: ARBoolean
|
|
46
|
+
self.write_verification = None # type: ARBoolean
|
|
47
|
+
self.writing_frequency = None # type: ARBoolean
|
|
48
|
+
self.writing_priority = None # type: ARBoolean
|