armodel 1.4.3__py3-none-any.whl → 1.5.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_dump_cli.py +1 -1
- armodel/models/ar_package.py +131 -23
- armodel/models/ar_ref.py +28 -5
- armodel/models/bsw_module_template.py +29 -14
- armodel/models/common_structure.py +38 -23
- armodel/models/fibex/__init__.py +0 -0
- armodel/models/fibex/can_communication.py +6 -0
- armodel/models/fibex/fibex_4_multiplatform.py +145 -0
- armodel/models/fibex/fibex_core.py +341 -0
- armodel/models/fibex/lin_communication.py +17 -0
- armodel/models/fibex/lin_topology.py +7 -0
- armodel/models/general_structure.py +19 -3
- armodel/models/implementation.py +4 -5
- armodel/models/internal_behavior.py +63 -0
- armodel/models/mode_declaration.py +8 -0
- armodel/models/port_prototype.py +20 -2
- armodel/models/rpt_scenario.py +20 -0
- armodel/models/sw_component.py +99 -36
- armodel/models/system_template/__init__.py +0 -0
- armodel/models/system_template/network_management.py +7 -0
- armodel/models/system_template/transport_protocols.py +7 -0
- armodel/models/timing.py +91 -0
- armodel/parser/abstract_arxml_parser.py +1 -1
- armodel/parser/arxml_parser.py +329 -72
- armodel/tests/test_armodel/models/test_data_prototype.py +1 -1
- armodel/tests/test_armodel/models/test_datatype.py +7 -7
- armodel/tests/test_armodel/models/test_port_interface.py +5 -5
- armodel/tests/test_armodel/parser/test_parse_bswmd.py +13 -5
- armodel/tests/test_armodel/parser/test_sw_components.py +4 -4
- armodel/writer/arxml_writer.py +250 -21
- {armodel-1.4.3.dist-info → armodel-1.5.0.dist-info}/METADATA +25 -1
- {armodel-1.4.3.dist-info → armodel-1.5.0.dist-info}/RECORD +36 -23
- {armodel-1.4.3.dist-info → armodel-1.5.0.dist-info}/LICENSE +0 -0
- {armodel-1.4.3.dist-info → armodel-1.5.0.dist-info}/WHEEL +0 -0
- {armodel-1.4.3.dist-info → armodel-1.5.0.dist-info}/entry_points.txt +0 -0
- {armodel-1.4.3.dist-info → armodel-1.5.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from armodel.models.ar_ref import RefType
|
|
5
|
+
|
|
6
|
+
from ..ar_object import ARFloat, ARLiteral, ARNumerical, ARObject, ARPositiveInteger
|
|
7
|
+
from ..general_structure import Identifiable
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class FibexElement(Identifiable):
|
|
11
|
+
__metaclass__ = ABCMeta
|
|
12
|
+
|
|
13
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
14
|
+
if type(self) == FibexElement:
|
|
15
|
+
raise NotImplementedError("FibexElement is an abstract class.")
|
|
16
|
+
|
|
17
|
+
super().__init__(parent, short_name)
|
|
18
|
+
|
|
19
|
+
class PhysicalChannel (Identifiable):
|
|
20
|
+
__metaclass__ = ABCMeta
|
|
21
|
+
|
|
22
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
23
|
+
if type(self) == PhysicalChannel:
|
|
24
|
+
raise NotImplementedError("PhysicalChannel is an abstract class.")
|
|
25
|
+
|
|
26
|
+
super().__init__(parent, short_name)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class CommunicationCluster(FibexElement):
|
|
30
|
+
__metaclass__ = ABCMeta
|
|
31
|
+
|
|
32
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
33
|
+
if type(self) == CommunicationCluster:
|
|
34
|
+
raise NotImplementedError("CommunicationCluster is an abstract class.")
|
|
35
|
+
|
|
36
|
+
super().__init__(parent, short_name)
|
|
37
|
+
|
|
38
|
+
self.baudrate = None # type: ARFloat
|
|
39
|
+
self.physical_channels = [] # type: List[PhysicalChannel]
|
|
40
|
+
self.protocol_name = None # type: ARLiteral
|
|
41
|
+
self.protocol_version = None # type: ARLiteral
|
|
42
|
+
|
|
43
|
+
def addPhysicalChannel(self, channel: PhysicalChannel):
|
|
44
|
+
self.physical_channels.append(channel)
|
|
45
|
+
|
|
46
|
+
def getPhysicalChannels(self) -> List[PhysicalChannel]:
|
|
47
|
+
return self.physical_channels
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def protocolName(self) -> ARLiteral:
|
|
51
|
+
return self.protocol_name
|
|
52
|
+
|
|
53
|
+
@protocolName.setter
|
|
54
|
+
def protocolName(self, value: ARLiteral):
|
|
55
|
+
self.protocol_name = value
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def protocolVersion(self) -> ARLiteral:
|
|
59
|
+
return self.protocol_version
|
|
60
|
+
|
|
61
|
+
@protocolVersion.setter
|
|
62
|
+
def protocolVersion(self, value: ARLiteral):
|
|
63
|
+
self.protocol_version = value
|
|
64
|
+
|
|
65
|
+
class Pdu(FibexElement):
|
|
66
|
+
__metaclass__ = ABCMeta
|
|
67
|
+
|
|
68
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
69
|
+
if type(self) == Pdu:
|
|
70
|
+
raise NotImplementedError("Pdu is an abstract class.")
|
|
71
|
+
|
|
72
|
+
super().__init__(parent, short_name)
|
|
73
|
+
|
|
74
|
+
self.length = None # type: ARNumerical
|
|
75
|
+
|
|
76
|
+
class PduToFrameMapping(Identifiable):
|
|
77
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
78
|
+
super().__init__(parent, short_name)
|
|
79
|
+
|
|
80
|
+
self.packing_byte_order = None # type: ARLiteral
|
|
81
|
+
self.pdu_ref = None # type: RefType
|
|
82
|
+
self.start_position = None # type: ARNumerical
|
|
83
|
+
|
|
84
|
+
@property
|
|
85
|
+
def packingByteOrder(self) -> ARLiteral:
|
|
86
|
+
return self.packing_byte_order
|
|
87
|
+
|
|
88
|
+
@packingByteOrder.setter
|
|
89
|
+
def packingByteOrder(self, value: ARLiteral):
|
|
90
|
+
self.packing_byte_order = value
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def pduRef(self) -> RefType:
|
|
94
|
+
return self.pdu_ref
|
|
95
|
+
|
|
96
|
+
@pduRef.setter
|
|
97
|
+
def pduRef(self, value: RefType):
|
|
98
|
+
self.pdu_ref = value
|
|
99
|
+
|
|
100
|
+
@property
|
|
101
|
+
def startPosition(self) -> ARNumerical:
|
|
102
|
+
return self.start_position
|
|
103
|
+
|
|
104
|
+
@startPosition.setter
|
|
105
|
+
def startPosition(self, value: ARNumerical):
|
|
106
|
+
self.start_position = value
|
|
107
|
+
|
|
108
|
+
class Frame(Identifiable):
|
|
109
|
+
__metaclass__ = ABCMeta
|
|
110
|
+
|
|
111
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
112
|
+
if type(self) == Frame:
|
|
113
|
+
raise NotImplementedError("Frame is an abstract class.")
|
|
114
|
+
|
|
115
|
+
super().__init__(parent, short_name)
|
|
116
|
+
|
|
117
|
+
self.frame_length = None
|
|
118
|
+
self.pdu_to_frame_mappings = [] # type: List[PduToFrameMapping]
|
|
119
|
+
|
|
120
|
+
@property
|
|
121
|
+
def frameLength(self) -> ARNumerical:
|
|
122
|
+
return self.frame_length
|
|
123
|
+
|
|
124
|
+
@frameLength.setter
|
|
125
|
+
def frameLength(self, value: ARNumerical):
|
|
126
|
+
self.frame_length = value
|
|
127
|
+
|
|
128
|
+
def createPduToFrameMapping(self, short_name: str) -> PduToFrameMapping:
|
|
129
|
+
if (short_name not in self.elements):
|
|
130
|
+
mapping = PduToFrameMapping(self, short_name)
|
|
131
|
+
self.elements[short_name] = mapping
|
|
132
|
+
self.pdu_to_frame_mappings.append(mapping)
|
|
133
|
+
return self.elements[short_name]
|
|
134
|
+
|
|
135
|
+
def getPduToFrameMappings(self) -> List[PduToFrameMapping]:
|
|
136
|
+
return list(sorted(filter(lambda a: isinstance(a, PduToFrameMapping), self.elements.values()), key= lambda o:o.short_name))
|
|
137
|
+
|
|
138
|
+
class ContainedIPduProps(ARObject):
|
|
139
|
+
def __init__(self):
|
|
140
|
+
super().__init__()
|
|
141
|
+
|
|
142
|
+
self._collection_semantics = None # type: ARLiteral
|
|
143
|
+
self._header_id_long_header = None # type: ARPositiveInteger
|
|
144
|
+
self._header_id_short_header = None # type: ARPositiveInteger
|
|
145
|
+
self._offset = None # type: ARNumerical
|
|
146
|
+
self._timeout = None # type: ARNumerical
|
|
147
|
+
self._trigger = None # type: ARLiteral
|
|
148
|
+
self._update_indication_bit_position = None # type: ARNumerical
|
|
149
|
+
|
|
150
|
+
@property
|
|
151
|
+
def headerIdLongHeader(self) -> ARPositiveInteger:
|
|
152
|
+
return self._header_id_long_header
|
|
153
|
+
|
|
154
|
+
@headerIdLongHeader.setter
|
|
155
|
+
def headerIdLongHeader(self, value: ARPositiveInteger):
|
|
156
|
+
self._header_id_long_header = value
|
|
157
|
+
|
|
158
|
+
@property
|
|
159
|
+
def headerIdShortHeader(self) -> ARPositiveInteger:
|
|
160
|
+
return self._header_id_short_header
|
|
161
|
+
|
|
162
|
+
@headerIdShortHeader.setter
|
|
163
|
+
def headerIdShortHeader(self, value: ARPositiveInteger):
|
|
164
|
+
self._header_id_short_header = value
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def offset(self) -> ARNumerical:
|
|
168
|
+
return self._offset
|
|
169
|
+
|
|
170
|
+
@offset.setter
|
|
171
|
+
def offset(self, value: ARNumerical):
|
|
172
|
+
self._offset = value
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def timeout(self):
|
|
176
|
+
return self._timeout
|
|
177
|
+
|
|
178
|
+
@timeout.setter
|
|
179
|
+
def timeout(self, value):
|
|
180
|
+
self._timeout = value
|
|
181
|
+
|
|
182
|
+
@property
|
|
183
|
+
def collectionSemantics(self) -> ARLiteral:
|
|
184
|
+
return self._collection_semantics
|
|
185
|
+
|
|
186
|
+
@collectionSemantics.setter
|
|
187
|
+
def collectionSemantics(self, value: ARLiteral):
|
|
188
|
+
self._collection_semantics = value
|
|
189
|
+
|
|
190
|
+
@property
|
|
191
|
+
def trigger(self) -> ARLiteral:
|
|
192
|
+
return self._trigger
|
|
193
|
+
|
|
194
|
+
@trigger.setter
|
|
195
|
+
def trigger(self, value: ARLiteral):
|
|
196
|
+
self._trigger = value
|
|
197
|
+
|
|
198
|
+
@property
|
|
199
|
+
def updateIndicationBitPosition(self) -> ARNumerical:
|
|
200
|
+
return self._update_indication_bit_position
|
|
201
|
+
|
|
202
|
+
@updateIndicationBitPosition.setter
|
|
203
|
+
def updateIndicationBitPosition(self, value: ARNumerical):
|
|
204
|
+
self._update_indication_bit_position = value
|
|
205
|
+
|
|
206
|
+
class IPdu(Pdu):
|
|
207
|
+
__metaclass__ = ABCMeta
|
|
208
|
+
|
|
209
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
210
|
+
if type(self) == IPdu:
|
|
211
|
+
raise NotImplementedError("IPdu is an abstract class.")
|
|
212
|
+
|
|
213
|
+
super().__init__(parent, short_name)
|
|
214
|
+
|
|
215
|
+
self._contained_ipdu_props = None # type: ContainedIPduProps
|
|
216
|
+
|
|
217
|
+
@property
|
|
218
|
+
def containedIPduProps(self) -> ContainedIPduProps:
|
|
219
|
+
return self._contained_ipdu_props
|
|
220
|
+
|
|
221
|
+
@containedIPduProps.setter
|
|
222
|
+
def containedIPduProps(self, value: ContainedIPduProps):
|
|
223
|
+
self._contained_ipdu_props = value
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
class NmPdu(Pdu):
|
|
227
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
228
|
+
super().__init__(parent, short_name)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
class NPdu(IPdu):
|
|
232
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
233
|
+
super().__init__(parent, short_name)
|
|
234
|
+
|
|
235
|
+
class DcmIPdu(IPdu):
|
|
236
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
237
|
+
super().__init__(parent, short_name)
|
|
238
|
+
|
|
239
|
+
class FrameTriggering(Identifiable):
|
|
240
|
+
__metaclass__ = ABCMeta
|
|
241
|
+
|
|
242
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
243
|
+
if type(self) == FrameTriggering:
|
|
244
|
+
raise NotImplementedError("FrameTriggering is an abstract class.")
|
|
245
|
+
|
|
246
|
+
super().__init__(parent, short_name)
|
|
247
|
+
|
|
248
|
+
class ISignal(FibexElement):
|
|
249
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
250
|
+
super().__init__(parent, short_name)
|
|
251
|
+
|
|
252
|
+
self._data_transformation_ref = None
|
|
253
|
+
self._data_type_policy = None
|
|
254
|
+
self._i_signal_props = None
|
|
255
|
+
self._i_signal_type = None
|
|
256
|
+
self._init_value = None
|
|
257
|
+
self._length = None
|
|
258
|
+
self._network_representation_props = None
|
|
259
|
+
self._system_signal_ref = None # type: RefType
|
|
260
|
+
self._timeout_substitution_value = None
|
|
261
|
+
self._transformation_i_signal_props = []
|
|
262
|
+
|
|
263
|
+
@property
|
|
264
|
+
def dataTransformationRef(self):
|
|
265
|
+
return self._data_transformation_ref
|
|
266
|
+
|
|
267
|
+
@dataTransformationRef.setter
|
|
268
|
+
def dataTransformationRef(self, value):
|
|
269
|
+
self._data_transformation_ref = value
|
|
270
|
+
|
|
271
|
+
@property
|
|
272
|
+
def dataTypePolicy(self):
|
|
273
|
+
return self._data_type_policy
|
|
274
|
+
|
|
275
|
+
@dataTypePolicy.setter
|
|
276
|
+
def dataTypePolicy(self, value):
|
|
277
|
+
self._data_type_policy = value
|
|
278
|
+
|
|
279
|
+
@property
|
|
280
|
+
def iSignalProps(self):
|
|
281
|
+
return self._i_signal_props
|
|
282
|
+
|
|
283
|
+
@iSignalProps.setter
|
|
284
|
+
def iSignalProps(self, value):
|
|
285
|
+
self._i_signal_props = value
|
|
286
|
+
|
|
287
|
+
@property
|
|
288
|
+
def iSignalType(self):
|
|
289
|
+
return self._i_signal_type
|
|
290
|
+
|
|
291
|
+
@iSignalType.setter
|
|
292
|
+
def iSignalType(self, value):
|
|
293
|
+
self._i_signal_type = value
|
|
294
|
+
|
|
295
|
+
@property
|
|
296
|
+
def initValue(self):
|
|
297
|
+
return self._init_value
|
|
298
|
+
|
|
299
|
+
@initValue.setter
|
|
300
|
+
def initValue(self, value):
|
|
301
|
+
self._init_value = value
|
|
302
|
+
|
|
303
|
+
@property
|
|
304
|
+
def length(self):
|
|
305
|
+
return self._length
|
|
306
|
+
|
|
307
|
+
@length.setter
|
|
308
|
+
def length(self, value):
|
|
309
|
+
self._length = value
|
|
310
|
+
|
|
311
|
+
@property
|
|
312
|
+
def networkRepresentationProps(self):
|
|
313
|
+
return self._network_representation_props
|
|
314
|
+
|
|
315
|
+
@networkRepresentationProps.setter
|
|
316
|
+
def networkRepresentationProps(self, value):
|
|
317
|
+
self._network_representation_props = value
|
|
318
|
+
|
|
319
|
+
@property
|
|
320
|
+
def systemSignalRef(self):
|
|
321
|
+
return self._system_signal_ref
|
|
322
|
+
|
|
323
|
+
@systemSignalRef.setter
|
|
324
|
+
def systemSignalRef(self, value):
|
|
325
|
+
self._system_signal_ref = value
|
|
326
|
+
|
|
327
|
+
@property
|
|
328
|
+
def timeoutSubstitutionValue(self):
|
|
329
|
+
return self._timeout_substitution_value
|
|
330
|
+
|
|
331
|
+
@timeoutSubstitutionValue.setter
|
|
332
|
+
def timeoutSubstitutionValue(self, value):
|
|
333
|
+
self._timeout_substitution_value = value
|
|
334
|
+
|
|
335
|
+
@property
|
|
336
|
+
def transformationISignalProps(self):
|
|
337
|
+
return self._transformation_i_signal_props
|
|
338
|
+
|
|
339
|
+
@transformationISignalProps.setter
|
|
340
|
+
def transformationISignalProps(self, value):
|
|
341
|
+
self._transformation_i_signal_props = value
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
from abc import ABCMeta
|
|
3
|
+
from ..ar_object import ARObject
|
|
4
|
+
from .fibex_core import Frame
|
|
5
|
+
|
|
6
|
+
class LinFrame(Frame):
|
|
7
|
+
__metaclass__ = ABCMeta
|
|
8
|
+
|
|
9
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
10
|
+
if type(self) == LinFrame:
|
|
11
|
+
raise NotImplementedError("LinFrame is an abstract class.")
|
|
12
|
+
|
|
13
|
+
super().__init__(parent, short_name)
|
|
14
|
+
|
|
15
|
+
class LinUnconditionalFrame(LinFrame):
|
|
16
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
17
|
+
super().__init__(parent, short_name)
|
|
@@ -48,12 +48,28 @@ class Referrable(ARObject, metaclass=ABCMeta):
|
|
|
48
48
|
raise NotImplementedError("Referrable is an abstract class.")
|
|
49
49
|
ARObject.__init__(self)
|
|
50
50
|
|
|
51
|
-
self.
|
|
51
|
+
self._parent = parent
|
|
52
52
|
self.short_name = short_name
|
|
53
53
|
|
|
54
|
+
@property
|
|
55
|
+
def parent(self):
|
|
56
|
+
return self._parent
|
|
57
|
+
|
|
58
|
+
@parent.setter
|
|
59
|
+
def parent(self, value):
|
|
60
|
+
self._parent = value
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def shortName(self):
|
|
64
|
+
return self.short_name
|
|
65
|
+
|
|
66
|
+
@shortName.setter
|
|
67
|
+
def shortName(self, value):
|
|
68
|
+
self.short_name = value
|
|
69
|
+
|
|
54
70
|
@property
|
|
55
71
|
def full_name(self) -> str:
|
|
56
|
-
return self.
|
|
72
|
+
return self._parent.full_name + "/" + self.short_name
|
|
57
73
|
|
|
58
74
|
class MultilanguageReferrable(Referrable, metaclass=ABCMeta):
|
|
59
75
|
def __init__(self, parent: ARObject, short_name: str):
|
|
@@ -62,7 +78,7 @@ class MultilanguageReferrable(Referrable, metaclass=ABCMeta):
|
|
|
62
78
|
|
|
63
79
|
super().__init__(parent, short_name)
|
|
64
80
|
|
|
65
|
-
self.
|
|
81
|
+
self._parent = parent
|
|
66
82
|
self.long_name = None # type: MultilanguageLongName
|
|
67
83
|
|
|
68
84
|
class CollectableElement(ARObject, metaclass=ABCMeta):
|
armodel/models/implementation.py
CHANGED
|
@@ -17,13 +17,12 @@ class EngineeringObject(ARObject, metaclass=ABCMeta):
|
|
|
17
17
|
self.revision_label = None # type: ARLiteral
|
|
18
18
|
self.short_label = None # type: ARLiteral
|
|
19
19
|
|
|
20
|
-
def setCategory(self, category:
|
|
20
|
+
def setCategory(self, category: any):
|
|
21
21
|
if isinstance(category, ARLiteral):
|
|
22
22
|
self.category = category
|
|
23
23
|
else:
|
|
24
24
|
self.category = ARLiteral()
|
|
25
25
|
self.category.setValue(str(category))
|
|
26
|
-
|
|
27
26
|
return self
|
|
28
27
|
|
|
29
28
|
def getCategory(self) -> ARLiteral:
|
|
@@ -86,7 +85,7 @@ class Implementation(PackageableElement, metaclass=ABCMeta):
|
|
|
86
85
|
self.programming_language = None # type: ARLiteral
|
|
87
86
|
self.required_artifacts = []
|
|
88
87
|
self.required_generator_tools = []
|
|
89
|
-
self.
|
|
88
|
+
self.resource_consumption = None # type: ResourceConsumption
|
|
90
89
|
self.sw_version = "" # type: ARLiteral
|
|
91
90
|
self.swc_bsw_mapping_ref = None # type: RefType
|
|
92
91
|
self.used_code_generator = None # type: ARLiteral
|
|
@@ -103,11 +102,11 @@ class Implementation(PackageableElement, metaclass=ABCMeta):
|
|
|
103
102
|
|
|
104
103
|
def setResourceConsumption(self, consumption: ResourceConsumption):
|
|
105
104
|
self.elements[consumption.short_name] = consumption
|
|
106
|
-
self.
|
|
105
|
+
self.resource_consumption = consumption
|
|
107
106
|
return self
|
|
108
107
|
|
|
109
108
|
def getResourceConsumption(self) -> ResourceConsumption:
|
|
110
|
-
return self.
|
|
109
|
+
return self.resource_consumption
|
|
111
110
|
|
|
112
111
|
class BswImplementation(Implementation):
|
|
113
112
|
def __init__(self, parent: ARObject, short_name: str) -> None:
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from abc import ABCMeta
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
from .ar_object import ARLiteral, ARObject
|
|
5
|
+
from .ar_ref import RefType
|
|
6
|
+
from .common_structure import ExclusiveArea
|
|
7
|
+
from .data_prototype import ParameterDataPrototype
|
|
8
|
+
from .general_structure import Identifiable
|
|
9
|
+
|
|
10
|
+
class IncludedDataTypeSet(ARObject):
|
|
11
|
+
def __init__(self):
|
|
12
|
+
super().__init__()
|
|
13
|
+
|
|
14
|
+
self.data_type_refs = [] # type: List[RefType]
|
|
15
|
+
self.literal_prefix = None # type: ARLiteral
|
|
16
|
+
|
|
17
|
+
def addDataTypeRef(self, ref_type: RefType):
|
|
18
|
+
self.data_type_refs.append(ref_type)
|
|
19
|
+
|
|
20
|
+
def getDataTypeRefs(self) -> List[RefType]:
|
|
21
|
+
return self.data_type_refs
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def literalPrefix(self) -> ARLiteral:
|
|
25
|
+
return self.literal_prefix
|
|
26
|
+
|
|
27
|
+
@literalPrefix.setter
|
|
28
|
+
def literalPrefix(self, value: ARLiteral):
|
|
29
|
+
self.literal_prefix = value
|
|
30
|
+
|
|
31
|
+
class InternalBehavior(Identifiable, metaclass=ABCMeta):
|
|
32
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
33
|
+
if type(self) == InternalBehavior:
|
|
34
|
+
raise NotImplementedError("InternalBehavior is an abstract class.")
|
|
35
|
+
super().__init__(parent, short_name)
|
|
36
|
+
|
|
37
|
+
self.data_type_mapping_refs = [] # type: List[RefType]
|
|
38
|
+
self.constant_memories = [] # type: List[ParameterDataPrototype]
|
|
39
|
+
|
|
40
|
+
def addDataTypeMappingRef(self, ref: RefType):
|
|
41
|
+
self.data_type_mapping_refs.append(ref)
|
|
42
|
+
|
|
43
|
+
def getDataTypeMappingRefs(self) -> List[RefType]:
|
|
44
|
+
return self.data_type_mapping_refs
|
|
45
|
+
|
|
46
|
+
def createExclusiveArea(self, short_name: str) -> ExclusiveArea:
|
|
47
|
+
if (short_name not in self.elements):
|
|
48
|
+
event = ExclusiveArea(self, short_name)
|
|
49
|
+
self.elements[short_name] = event
|
|
50
|
+
return self.elements[short_name]
|
|
51
|
+
|
|
52
|
+
def getExclusiveAreas(self) -> List[ExclusiveArea]:
|
|
53
|
+
return list(filter(lambda c: isinstance(c, ExclusiveArea), self.elements.values()))
|
|
54
|
+
|
|
55
|
+
def createConstantMemory(self, short_name: str) -> ParameterDataPrototype:
|
|
56
|
+
if (short_name not in self.elements):
|
|
57
|
+
prototype = ParameterDataPrototype(self, short_name)
|
|
58
|
+
self.elements[short_name] = prototype
|
|
59
|
+
self.constant_memories.append(prototype)
|
|
60
|
+
return self.elements[short_name]
|
|
61
|
+
|
|
62
|
+
def getConstantMemorys(self) -> List[ParameterDataPrototype]:
|
|
63
|
+
return self.constant_memories
|
armodel/models/port_prototype.py
CHANGED
|
@@ -49,12 +49,28 @@ class ClientComSpec(RPortComSpec):
|
|
|
49
49
|
super().__init__()
|
|
50
50
|
|
|
51
51
|
self.operation_ref = None # type: RefType
|
|
52
|
-
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def operationRef(self) -> RefType:
|
|
55
|
+
return self.operation_ref
|
|
56
|
+
|
|
57
|
+
@operationRef.setter
|
|
58
|
+
def operationRef(self, value:RefType):
|
|
59
|
+
self.operation_ref = value
|
|
53
60
|
|
|
54
61
|
class ModeSwitchReceiverComSpec(RPortComSpec):
|
|
55
62
|
def __init__(self):
|
|
56
63
|
super().__init__()
|
|
57
64
|
|
|
65
|
+
self.mode_group_ref = None # type: RefType
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def modeGroupRef(self) -> RefType:
|
|
69
|
+
return self.mode_group_ref
|
|
70
|
+
|
|
71
|
+
@modeGroupRef.setter
|
|
72
|
+
def modeGroupRef(self, value: RefType):
|
|
73
|
+
self.mode_group_ref = value
|
|
58
74
|
|
|
59
75
|
class NvRequireComSpec(RPortComSpec):
|
|
60
76
|
def __init__(self):
|
|
@@ -208,8 +224,10 @@ class AbstractRequiredPortPrototype(PortPrototype):
|
|
|
208
224
|
"Invalid date element dest of NonqueuedReceiverComSpec.")
|
|
209
225
|
elif isinstance(com_spec, QueuedReceiverComSpec):
|
|
210
226
|
pass
|
|
227
|
+
elif isinstance(com_spec, ModeSwitchReceiverComSpec):
|
|
228
|
+
pass
|
|
211
229
|
else:
|
|
212
|
-
raise ValueError("Unsupported RPortComSpec")
|
|
230
|
+
raise ValueError("Unsupported RPortComSpec <%s>" % type(com_spec))
|
|
213
231
|
|
|
214
232
|
def addRequiredComSpec(self, com_spec: RPortComSpec):
|
|
215
233
|
self._validateRPortComSpec(com_spec)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
from abc import ABCMeta
|
|
3
|
+
from .ar_object import ARObject
|
|
4
|
+
from .general_structure import Identifiable
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class IdentCaption(Identifiable):
|
|
8
|
+
|
|
9
|
+
__metaclass__ = ABCMeta
|
|
10
|
+
|
|
11
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
12
|
+
if type(self) == IdentCaption:
|
|
13
|
+
raise NotImplementedError("IdentCaption is an abstract class.")
|
|
14
|
+
|
|
15
|
+
super().__init__(parent, short_name)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ModeAccessPointIdent(IdentCaption):
|
|
19
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
20
|
+
super().__init__(parent, short_name)
|