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
armodel/cli/arxml_dump_cli.py
CHANGED
|
@@ -32,7 +32,7 @@ def show_port(indent:int, port_prototype: PortPrototype):
|
|
|
32
32
|
raise ValueError("Unsupported Port prototype")
|
|
33
33
|
|
|
34
34
|
def show_type(indent: int, data_type: ImplementationDataType):
|
|
35
|
-
print("%s-Implementation Type: %s (%s)" % (" " * indent, data_type.short_name, data_type.
|
|
35
|
+
print("%s-Implementation Type: %s (%s)" % (" " * indent, data_type.short_name, data_type._parent.full_name))
|
|
36
36
|
print("%s : %s" % (" " * indent, data_type.category))
|
|
37
37
|
if (data_type.sw_data_def_props != None):
|
|
38
38
|
if (data_type.sw_data_def_props.baseTypeRef != None):
|
armodel/models/ar_package.py
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
from typing import Dict, List
|
|
2
2
|
|
|
3
|
+
from armodel.models.fibex.can_communication import CanFrame
|
|
4
|
+
from armodel.models.fibex.fibex_4_multiplatform import Gateway
|
|
5
|
+
|
|
6
|
+
from .system_template.transport_protocols import CanTpConfig
|
|
7
|
+
from .system_template.network_management import NmConfig
|
|
8
|
+
from .fibex.fibex_core import DcmIPdu, ISignal, NPdu, NmPdu
|
|
9
|
+
from .fibex.lin_communication import LinUnconditionalFrame
|
|
10
|
+
from .fibex.lin_topology import LinCluster
|
|
11
|
+
from .timing import SwcTiming
|
|
3
12
|
from .data_dictionary import SwAddrMethod
|
|
4
13
|
from .record_layout import SwRecordLayout
|
|
5
14
|
from .end_to_end_protection import EndToEndProtectionSet
|
|
@@ -153,8 +162,8 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
153
162
|
|
|
154
163
|
def createSwcBswMapping(self, short_name: str) -> SwcBswMapping:
|
|
155
164
|
if (short_name not in self.elements):
|
|
156
|
-
|
|
157
|
-
self.elements[short_name] =
|
|
165
|
+
mapping = SwcBswMapping(self, short_name)
|
|
166
|
+
self.elements[short_name] = mapping
|
|
158
167
|
return self.elements[short_name]
|
|
159
168
|
|
|
160
169
|
def createConstantSpecification(self, short_name: str) -> ConstantSpecification:
|
|
@@ -165,14 +174,14 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
165
174
|
|
|
166
175
|
def createDataConstr(self, short_name: str) -> DataConstr:
|
|
167
176
|
if (short_name not in self.elements):
|
|
168
|
-
|
|
169
|
-
self.elements[short_name] =
|
|
177
|
+
constr = DataConstr(self, short_name)
|
|
178
|
+
self.elements[short_name] = constr
|
|
170
179
|
return self.elements[short_name]
|
|
171
180
|
|
|
172
181
|
def createUnit(self, short_name: str) -> Unit:
|
|
173
182
|
if (short_name not in self.elements):
|
|
174
|
-
|
|
175
|
-
self.elements[short_name] =
|
|
183
|
+
unit = Unit(self, short_name)
|
|
184
|
+
self.elements[short_name] = unit
|
|
176
185
|
return self.elements[short_name]
|
|
177
186
|
|
|
178
187
|
def createEndToEndProtectionSet(self, short_name: str) -> EndToEndProtectionSet:
|
|
@@ -183,48 +192,114 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
183
192
|
|
|
184
193
|
def createApplicationArrayDataType(self, short_name: str) -> ApplicationArrayDataType:
|
|
185
194
|
if (short_name not in self.elements):
|
|
186
|
-
|
|
187
|
-
self.elements[short_name] =
|
|
195
|
+
data_type = ApplicationArrayDataType(self, short_name)
|
|
196
|
+
self.elements[short_name] = data_type
|
|
188
197
|
return self.elements[short_name]
|
|
189
198
|
|
|
190
199
|
def createSwRecordLayout(self, short_name: str) -> SwRecordLayout:
|
|
191
200
|
if (short_name not in self.elements):
|
|
192
|
-
|
|
193
|
-
self.elements[short_name] =
|
|
201
|
+
layout = SwRecordLayout(self, short_name)
|
|
202
|
+
self.elements[short_name] = layout
|
|
194
203
|
return self.elements[short_name]
|
|
195
204
|
|
|
196
205
|
def createSwAddrMethod(self, short_name: str) -> SwAddrMethod:
|
|
197
206
|
if (short_name not in self.elements):
|
|
198
|
-
|
|
199
|
-
self.elements[short_name] =
|
|
207
|
+
method = SwAddrMethod(self, short_name)
|
|
208
|
+
self.elements[short_name] = method
|
|
200
209
|
return self.elements[short_name]
|
|
201
210
|
|
|
202
211
|
def createTriggerInterface(self, short_name: str) -> TriggerInterface:
|
|
203
212
|
if (short_name not in self.elements):
|
|
204
|
-
|
|
205
|
-
self.elements[short_name] =
|
|
213
|
+
trigger_interface = TriggerInterface(self, short_name)
|
|
214
|
+
self.elements[short_name] = trigger_interface
|
|
206
215
|
return self.elements[short_name]
|
|
207
216
|
|
|
208
217
|
def createModeDeclarationGroup(self, short_name: str) -> ModeDeclarationGroup:
|
|
209
218
|
if (short_name not in self.elements):
|
|
210
|
-
|
|
211
|
-
self.elements[short_name] =
|
|
219
|
+
group = ModeDeclarationGroup(self, short_name)
|
|
220
|
+
self.elements[short_name] = group
|
|
212
221
|
return self.elements[short_name]
|
|
213
222
|
|
|
214
223
|
def createModeSwitchInterface(self, short_name: str) -> ModeSwitchInterface:
|
|
215
224
|
if (short_name not in self.elements):
|
|
216
|
-
|
|
217
|
-
self.elements[short_name] =
|
|
225
|
+
switch_interface = ModeSwitchInterface(self, short_name)
|
|
226
|
+
self.elements[short_name] = switch_interface
|
|
218
227
|
return self.elements[short_name]
|
|
219
|
-
|
|
228
|
+
|
|
229
|
+
def createSwcTiming(self, short_name: str) -> SwcTiming:
|
|
230
|
+
if (short_name not in self.elements):
|
|
231
|
+
timing = SwcTiming(self, short_name)
|
|
232
|
+
self.elements[short_name] = timing
|
|
233
|
+
return self.elements[short_name]
|
|
234
|
+
|
|
235
|
+
def createLinCluster(self, short_name: str) -> LinCluster:
|
|
236
|
+
if (short_name not in self.elements):
|
|
237
|
+
cluster = LinCluster(self, short_name)
|
|
238
|
+
self.elements[short_name] = cluster
|
|
239
|
+
return self.elements[short_name]
|
|
240
|
+
|
|
241
|
+
def createLinUnconditionalFrame(self, short_name: str) -> LinUnconditionalFrame:
|
|
242
|
+
if (short_name not in self.elements):
|
|
243
|
+
frame = LinUnconditionalFrame(self, short_name)
|
|
244
|
+
self.elements[short_name] = frame
|
|
245
|
+
return self.elements[short_name]
|
|
246
|
+
|
|
247
|
+
def createNmPdu(self, short_name: str) -> NmPdu:
|
|
248
|
+
if (short_name not in self.elements):
|
|
249
|
+
pdu = NmPdu(self, short_name)
|
|
250
|
+
self.elements[short_name] = pdu
|
|
251
|
+
return self.elements[short_name]
|
|
252
|
+
|
|
253
|
+
def createNPdu(self, short_name: str) -> NPdu:
|
|
254
|
+
if (short_name not in self.elements):
|
|
255
|
+
pdu = NPdu(self, short_name)
|
|
256
|
+
self.elements[short_name] = pdu
|
|
257
|
+
return self.elements[short_name]
|
|
258
|
+
|
|
259
|
+
def createDcmIPdu(self, short_name: str) -> DcmIPdu:
|
|
260
|
+
if (short_name not in self.elements):
|
|
261
|
+
pdu = DcmIPdu(self, short_name)
|
|
262
|
+
self.elements[short_name] = pdu
|
|
263
|
+
return self.elements[short_name]
|
|
264
|
+
|
|
265
|
+
def createNmConfig(self, short_name: str) -> NmConfig:
|
|
266
|
+
if (short_name not in self.elements):
|
|
267
|
+
config = NmConfig(self, short_name)
|
|
268
|
+
self.elements[short_name] = config
|
|
269
|
+
return self.elements[short_name]
|
|
270
|
+
|
|
271
|
+
def createCanTpConfig(self, short_name: str) -> CanTpConfig:
|
|
272
|
+
if (short_name not in self.elements):
|
|
273
|
+
config = CanTpConfig(self, short_name)
|
|
274
|
+
self.elements[short_name] = config
|
|
275
|
+
return self.elements[short_name]
|
|
276
|
+
|
|
277
|
+
def createCanFrame(self, short_name: str) -> CanFrame:
|
|
278
|
+
if (short_name not in self.elements):
|
|
279
|
+
frame = CanFrame(self, short_name)
|
|
280
|
+
self.elements[short_name] = frame
|
|
281
|
+
return self.elements[short_name]
|
|
282
|
+
|
|
283
|
+
def createGateway(self, short_name: str) -> Gateway:
|
|
284
|
+
if (short_name not in self.elements):
|
|
285
|
+
gateway = Gateway(self, short_name)
|
|
286
|
+
self.elements[short_name] = gateway
|
|
287
|
+
return self.elements[short_name]
|
|
288
|
+
|
|
289
|
+
def createISignal(self, short_name: str) -> ISignal:
|
|
290
|
+
if (short_name not in self.elements):
|
|
291
|
+
signal = ISignal(self, short_name)
|
|
292
|
+
self.elements[short_name] = signal
|
|
293
|
+
return self.elements[short_name]
|
|
294
|
+
|
|
220
295
|
def getApplicationPrimitiveDataTypes(self) -> List[ApplicationPrimitiveDataType]:
|
|
221
|
-
return list(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()))
|
|
296
|
+
return list(sorted(filter(lambda a: isinstance(a, ApplicationPrimitiveDataType), self.elements.values()), key= lambda o:o.short_name))
|
|
222
297
|
|
|
223
298
|
def getApplicationDataType(self) -> List[ApplicationDataType]:
|
|
224
299
|
return list(sorted(filter(lambda a: isinstance(a, ApplicationDataType), self.elements.values()), key= lambda o:o.short_name))
|
|
225
300
|
|
|
226
301
|
def getImplementationDataTypes(self) -> List[ImplementationDataType]:
|
|
227
|
-
return list(filter(lambda a: isinstance(a, ImplementationDataType), self.elements.values()))
|
|
302
|
+
return list(sorted(filter(lambda a: isinstance(a, ImplementationDataType), self.elements.values()), key= lambda o:o.short_name))
|
|
228
303
|
|
|
229
304
|
def getSwBaseTypes(self) -> List[SwBaseType]:
|
|
230
305
|
return list(filter(lambda a: isinstance(a, SwBaseType), self.elements.values()))
|
|
@@ -300,8 +375,41 @@ class ARPackage(Identifiable, CollectableElement):
|
|
|
300
375
|
|
|
301
376
|
def getModeSwitchInterfaces(self) -> List[ModeSwitchInterface]:
|
|
302
377
|
return list(sorted(filter(lambda a : isinstance(a, ModeSwitchInterface), self.elements.values()), key = lambda a: a.short_name))
|
|
303
|
-
|
|
304
|
-
|
|
378
|
+
|
|
379
|
+
def getSwcTimings(self) -> List[SwcTiming]:
|
|
380
|
+
return list(sorted(filter(lambda a : isinstance(a, SwcTiming), self.elements.values()), key = lambda a: a.short_name))
|
|
381
|
+
|
|
382
|
+
def getLinClusters(self) -> List[LinCluster]:
|
|
383
|
+
return list(sorted(filter(lambda a : isinstance(a, LinCluster), self.elements.values()), key = lambda a: a.short_name))
|
|
384
|
+
|
|
385
|
+
def getLinUnconditionalFrames(self) -> List[LinUnconditionalFrame]:
|
|
386
|
+
return list(sorted(filter(lambda a : isinstance(a, LinUnconditionalFrame), self.elements.values()), key = lambda a: a.short_name))
|
|
387
|
+
|
|
388
|
+
def getNmPdus(self) -> List[NmPdu]:
|
|
389
|
+
return list(sorted(filter(lambda a : isinstance(a, NmPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
390
|
+
|
|
391
|
+
def getNPdus(self) -> List[NPdu]:
|
|
392
|
+
return list(sorted(filter(lambda a : isinstance(a, NPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
393
|
+
|
|
394
|
+
def getDcmIPdus(self) -> List[DcmIPdu]:
|
|
395
|
+
return list(sorted(filter(lambda a : isinstance(a, DcmIPdu), self.elements.values()), key = lambda a: a.short_name))
|
|
396
|
+
|
|
397
|
+
def getNmConfigs(self) -> List[NmConfig]:
|
|
398
|
+
return list(sorted(filter(lambda a : isinstance(a, NmConfig), self.elements.values()), key = lambda a: a.short_name))
|
|
399
|
+
|
|
400
|
+
def getCanTpConfigs(self) -> List[CanTpConfig]:
|
|
401
|
+
return list(sorted(filter(lambda a : isinstance(a, CanTpConfig), self.elements.values()), key = lambda a: a.short_name))
|
|
402
|
+
|
|
403
|
+
def getCanFrames(self) -> List[CanFrame]:
|
|
404
|
+
return list(sorted(filter(lambda a : isinstance(a, CanFrame), self.elements.values()), key = lambda a: a.short_name))
|
|
405
|
+
|
|
406
|
+
def getGateways(self) -> List[Gateway]:
|
|
407
|
+
return list(sorted(filter(lambda a : isinstance(a, Gateway), self.elements.values()), key = lambda a: a.short_name))
|
|
408
|
+
|
|
409
|
+
def getISignals(self) -> List[ISignal]:
|
|
410
|
+
return list(sorted(filter(lambda a : isinstance(a, ISignal), self.elements.values()), key = lambda a: a.short_name))
|
|
411
|
+
|
|
412
|
+
class AUTOSAR (CollectableElement):
|
|
305
413
|
__instance = None
|
|
306
414
|
|
|
307
415
|
@staticmethod
|
armodel/models/ar_ref.py
CHANGED
|
@@ -150,8 +150,31 @@ class VariableDataPrototypeInSystemInstanceRef(AtpInstanceRef):
|
|
|
150
150
|
def __init__(self):
|
|
151
151
|
super().__init__()
|
|
152
152
|
|
|
153
|
-
self.
|
|
154
|
-
self.
|
|
155
|
-
self.
|
|
156
|
-
self.
|
|
157
|
-
self.
|
|
153
|
+
self.base_ref = None # type: RefType
|
|
154
|
+
self.context_component_refs = [] # type: List[RefType]
|
|
155
|
+
self.context_composition_ref = None # type: RefType
|
|
156
|
+
self.context_port_ref = None # type: RefType
|
|
157
|
+
self.target_data_prototype_ref = None # type: RefType
|
|
158
|
+
|
|
159
|
+
class RModeGroupInAtomicSWCInstanceRef(AtpInstanceRef):
|
|
160
|
+
def __init__(self):
|
|
161
|
+
super().__init__()
|
|
162
|
+
|
|
163
|
+
self.context_r_port = None # type: RefType
|
|
164
|
+
self.target_mode_group = None # type: RefType
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def contextRPort(self) -> RefType:
|
|
168
|
+
return self.context_r_port
|
|
169
|
+
|
|
170
|
+
@contextRPort.setter
|
|
171
|
+
def contextRPort(self, value: RefType):
|
|
172
|
+
self.context_r_port = value
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def targetModeGroup(self) -> RefType:
|
|
176
|
+
return self.target_mode_group
|
|
177
|
+
|
|
178
|
+
@targetModeGroup.setter
|
|
179
|
+
def targetModeGroup(self, value: RefType):
|
|
180
|
+
self.target_mode_group = value
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
from abc import ABCMeta
|
|
2
2
|
from typing import Dict, List
|
|
3
|
+
|
|
4
|
+
from .internal_behavior import IncludedDataTypeSet, InternalBehavior
|
|
3
5
|
from .general_structure import AtpStructureElement, ARObject, ARElement
|
|
4
6
|
from .ar_object import ARBoolean, ARFloat, ARLiteral, ARNumerical, ARPositiveInteger
|
|
5
|
-
from .common_structure import ExecutableEntity,
|
|
7
|
+
from .common_structure import ExecutableEntity, IncludedModeDeclarationGroupSet, ModeDeclarationGroupPrototype, Identifiable
|
|
6
8
|
from .ar_ref import RefType
|
|
7
9
|
|
|
8
10
|
class BswModuleEntity(ExecutableEntity, metaclass=ABCMeta):
|
|
@@ -105,7 +107,6 @@ class BswInternalTriggerOccurredEvent(BswScheduleEvent):
|
|
|
105
107
|
|
|
106
108
|
self.event_source_ref = None # type: RefType
|
|
107
109
|
|
|
108
|
-
|
|
109
110
|
class BswModeSwitchAckRequest(ARObject):
|
|
110
111
|
def __init__(self):
|
|
111
112
|
super().__init__()
|
|
@@ -144,21 +145,23 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
144
145
|
def __init__(self, parent: ARObject, short_name: str):
|
|
145
146
|
super().__init__(parent, short_name)
|
|
146
147
|
|
|
147
|
-
self.
|
|
148
|
-
self.
|
|
149
|
-
self.
|
|
148
|
+
self.entities = [] # type: List[BswModuleEntity]
|
|
149
|
+
self.events = [] # type: List[BswEvent]
|
|
150
|
+
self.mode_sender_policies = [] # type: List[BswModeSenderPolicy]
|
|
151
|
+
self.included_mode_declaration_group_sets = [] # type: List[IncludedModeDeclarationGroupSet]
|
|
152
|
+
self.included_data_type_sets = [] # type: List[IncludedDataTypeSet]
|
|
150
153
|
|
|
151
154
|
def addModeSenderPolicy(self, policy: BswModeSenderPolicy):
|
|
152
|
-
self.
|
|
155
|
+
self.mode_sender_policies.append(policy)
|
|
153
156
|
|
|
154
157
|
def getModeSenderPolicies(self) -> List[BswModeSenderPolicy]:
|
|
155
|
-
return self.
|
|
158
|
+
return self.mode_sender_policies
|
|
156
159
|
|
|
157
160
|
def createBswCalledEntity(self, short_name: str) -> BswCalledEntity:
|
|
158
161
|
if (short_name not in self.elements):
|
|
159
162
|
event = BswCalledEntity(self, short_name)
|
|
160
163
|
self.elements[short_name] = event
|
|
161
|
-
self.
|
|
164
|
+
self.entities.append(event)
|
|
162
165
|
return self.elements[short_name]
|
|
163
166
|
|
|
164
167
|
def getBswCalledEntities(self) -> List[BswCalledEntity]:
|
|
@@ -168,7 +171,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
168
171
|
if (short_name not in self.elements):
|
|
169
172
|
event = BswSchedulableEntity(self, short_name)
|
|
170
173
|
self.elements[short_name] = event
|
|
171
|
-
self.
|
|
174
|
+
self.entities.append(event)
|
|
172
175
|
return self.elements[short_name]
|
|
173
176
|
|
|
174
177
|
def getBswSchedulableEntities(self) -> List[BswSchedulableEntity]:
|
|
@@ -181,7 +184,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
181
184
|
if (short_name not in self.elements):
|
|
182
185
|
event = BswModeSwitchEvent(self, short_name)
|
|
183
186
|
self.elements[short_name] = event
|
|
184
|
-
self.
|
|
187
|
+
self.events.append(event)
|
|
185
188
|
return self.elements[short_name]
|
|
186
189
|
|
|
187
190
|
def getBswModeSwitchEvents(self) -> List[BswModeSwitchEvent]:
|
|
@@ -191,7 +194,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
191
194
|
if (short_name not in self.elements):
|
|
192
195
|
event = BswTimingEvent(self, short_name)
|
|
193
196
|
self.elements[short_name] = event
|
|
194
|
-
self.
|
|
197
|
+
self.events.append(event)
|
|
195
198
|
return self.elements[short_name]
|
|
196
199
|
|
|
197
200
|
def getBswTimingEvents(self) -> List[BswTimingEvent]:
|
|
@@ -201,7 +204,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
201
204
|
if (short_name not in self.elements):
|
|
202
205
|
event = BswDataReceivedEvent(self, short_name)
|
|
203
206
|
self.elements[short_name] = event
|
|
204
|
-
self.
|
|
207
|
+
self.events.append(event)
|
|
205
208
|
return self.elements[short_name]
|
|
206
209
|
|
|
207
210
|
def getBswDataReceivedEvents(self) -> List[BswDataReceivedEvent]:
|
|
@@ -211,7 +214,7 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
211
214
|
if (short_name not in self.elements):
|
|
212
215
|
event = BswInternalTriggerOccurredEvent(self, short_name)
|
|
213
216
|
self.elements[short_name] = event
|
|
214
|
-
self.
|
|
217
|
+
self.events.append(event)
|
|
215
218
|
return self.elements[short_name]
|
|
216
219
|
|
|
217
220
|
def getBswInternalTriggerOccurredEvents(self) -> List[BswInternalTriggerOccurredEvent]:
|
|
@@ -219,6 +222,18 @@ class BswInternalBehavior(InternalBehavior):
|
|
|
219
222
|
|
|
220
223
|
def getBswEvents(self) -> List[BswEvent]:
|
|
221
224
|
return list(filter(lambda a: isinstance(a, BswEvent), self.elements.values()))
|
|
225
|
+
|
|
226
|
+
def addIncludedModeDeclarationGroupSet(self, group_set: IncludedModeDeclarationGroupSet):
|
|
227
|
+
self.included_mode_declaration_group_sets.append(group_set)
|
|
228
|
+
|
|
229
|
+
def getIncludedModeDeclarationGroupSets(self) -> List[IncludedModeDeclarationGroupSet]:
|
|
230
|
+
return self.included_mode_declaration_group_sets
|
|
231
|
+
|
|
232
|
+
def addIncludedDataTypeSet(self, type_set: IncludedDataTypeSet):
|
|
233
|
+
self.included_data_type_sets.append(type_set)
|
|
234
|
+
|
|
235
|
+
def getIncludedDataTypeSets(self) -> List[IncludedDataTypeSet]:
|
|
236
|
+
return self.included_data_type_sets
|
|
222
237
|
|
|
223
238
|
class BswModuleDescription(AtpStructureElement):
|
|
224
239
|
'''
|
|
@@ -239,7 +254,7 @@ class BswModuleDescription(AtpStructureElement):
|
|
|
239
254
|
self._implementedEntryRefs = [] # type: List[RefType]
|
|
240
255
|
|
|
241
256
|
self.providedModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
242
|
-
self.requiredModeGroups = {} #
|
|
257
|
+
self.requiredModeGroups = {} # type: Dict[str, ModeDeclarationGroupPrototype]
|
|
243
258
|
|
|
244
259
|
def addImplementedEntry(self, entry_ref: RefType):
|
|
245
260
|
self._implementedEntryRefs.append(entry_ref)
|
|
@@ -152,29 +152,27 @@ class ExclusiveArea(Identifiable):
|
|
|
152
152
|
def __init__(self, parent: ARObject, short_name: str):
|
|
153
153
|
super().__init__(parent, short_name)
|
|
154
154
|
|
|
155
|
-
class
|
|
156
|
-
def __init__(self
|
|
157
|
-
|
|
158
|
-
raise NotImplementedError("InternalBehavior is an abstract class.")
|
|
159
|
-
super().__init__(parent, short_name)
|
|
160
|
-
|
|
161
|
-
self._dataTypeMappingRefs = [] # type: List[RefType]
|
|
162
|
-
|
|
163
|
-
def addDataTypeMappingRef(self, ref: RefType):
|
|
164
|
-
self._dataTypeMappingRefs.append(ref)
|
|
155
|
+
class IncludedModeDeclarationGroupSet(ARObject):
|
|
156
|
+
def __init__(self):
|
|
157
|
+
super().__init__()
|
|
165
158
|
|
|
166
|
-
|
|
167
|
-
|
|
159
|
+
self.mode_declaration_group_refs = [] # type: List[RefType]
|
|
160
|
+
self.prefix = None # type: ARLiteral
|
|
168
161
|
|
|
169
|
-
def
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
self.elements[short_name] = event
|
|
173
|
-
return self.elements[short_name]
|
|
162
|
+
def addModeDeclarationGroupRef(self, ref: RefType):
|
|
163
|
+
self.mode_declaration_group_refs.append(ref)
|
|
164
|
+
return self
|
|
174
165
|
|
|
175
|
-
def
|
|
176
|
-
return
|
|
166
|
+
def getModeDeclarationGroupRefs(self) -> List[RefType]:
|
|
167
|
+
return self.mode_declaration_group_refs
|
|
177
168
|
|
|
169
|
+
def setPrefix(self, prefix: str):
|
|
170
|
+
self.prefix = prefix
|
|
171
|
+
return self
|
|
172
|
+
|
|
173
|
+
def getPrefix(self) -> ARLiteral:
|
|
174
|
+
return self.prefix
|
|
175
|
+
|
|
178
176
|
class ModeDeclaration(Identifiable):
|
|
179
177
|
def __init__(self, parent: ARObject, short_name: str):
|
|
180
178
|
super().__init__(parent, short_name)
|
|
@@ -197,19 +195,36 @@ class ExecutableEntity(Identifiable, metaclass=ABCMeta):
|
|
|
197
195
|
self.activation_reason = None # *
|
|
198
196
|
self.minimum_start_interval = None # type: ARFloat
|
|
199
197
|
self.reentrancy_level = None #
|
|
200
|
-
self.
|
|
198
|
+
self.can_enter_exclusive_area_refs = [] # type: List[RefType]
|
|
199
|
+
self.sw_addr_method_ref = None # type: RefType
|
|
201
200
|
|
|
202
201
|
@property
|
|
203
|
-
def
|
|
202
|
+
def minimumStartIntervalMs(self) -> int:
|
|
204
203
|
if self.minimum_start_interval is not None:
|
|
205
204
|
return int(self.minimum_start_interval.getValue() * 1000)
|
|
206
205
|
return None
|
|
207
206
|
|
|
207
|
+
@property
|
|
208
|
+
def minimumStartInterval(self) -> ARFloat:
|
|
209
|
+
return self.minimum_start_interval
|
|
210
|
+
|
|
211
|
+
@minimumStartInterval.setter
|
|
212
|
+
def minimumStartInterval(self, value: ARFloat):
|
|
213
|
+
self.minimum_start_interval = value
|
|
214
|
+
|
|
215
|
+
@property
|
|
216
|
+
def swAddrMethodRef(self) -> RefType:
|
|
217
|
+
return self.sw_addr_method_ref
|
|
218
|
+
|
|
219
|
+
@swAddrMethodRef.setter
|
|
220
|
+
def swAddrMethodRef(self, ref: RefType):
|
|
221
|
+
self.sw_addr_method_ref = ref
|
|
222
|
+
|
|
208
223
|
def addCanEnterExclusiveAreaRef(self, ref: RefType):
|
|
209
|
-
self.
|
|
224
|
+
self.can_enter_exclusive_area_refs.append(ref)
|
|
210
225
|
|
|
211
226
|
def getCanEnterExclusiveAreaRefs(self):
|
|
212
|
-
return self.
|
|
227
|
+
return self.can_enter_exclusive_area_refs
|
|
213
228
|
|
|
214
229
|
class ModeDeclarationGroupPrototype(Identifiable):
|
|
215
230
|
"""
|
|
File without changes
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from ..ar_ref import RefType
|
|
4
|
+
from ..ar_object import ARObject, ARPositiveInteger
|
|
5
|
+
from .fibex_core import FibexElement
|
|
6
|
+
|
|
7
|
+
class FrameMapping(ARObject):
|
|
8
|
+
def __init__(self):
|
|
9
|
+
super().__init__()
|
|
10
|
+
|
|
11
|
+
self._introduction = None # type: DocumentationBlock
|
|
12
|
+
self._source_frame_ref = None # type: RefType
|
|
13
|
+
self._target_frame_ref = None # type: RefType
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def introduction(self):
|
|
17
|
+
return self._introduction
|
|
18
|
+
|
|
19
|
+
@introduction.setter
|
|
20
|
+
def introduction(self, value):
|
|
21
|
+
self._introduction = value
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def sourceFrameRef(self):
|
|
25
|
+
return self._source_frame_ref
|
|
26
|
+
|
|
27
|
+
@sourceFrameRef.setter
|
|
28
|
+
def sourceFrameRef(self, value):
|
|
29
|
+
self._source_frame_ref = value
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def targetFrameRef(self):
|
|
33
|
+
return self._target_frame_ref
|
|
34
|
+
|
|
35
|
+
@targetFrameRef.setter
|
|
36
|
+
def targetFrameRef(self, value):
|
|
37
|
+
self._target_frame_ref = value
|
|
38
|
+
|
|
39
|
+
class ISignalMapping(ARObject):
|
|
40
|
+
def __init__(self):
|
|
41
|
+
super().__init__()
|
|
42
|
+
|
|
43
|
+
self._introduction = None # type: DocumentationBlock
|
|
44
|
+
self._source_signal_ref = None # type: RefType
|
|
45
|
+
self._target_signal_ref = None # type: RefType
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def introduction(self):
|
|
49
|
+
return self._introduction
|
|
50
|
+
|
|
51
|
+
@introduction.setter
|
|
52
|
+
def introduction(self, value):
|
|
53
|
+
self._introduction = value
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def sourceSignalRef(self):
|
|
57
|
+
return self._source_signal_ref
|
|
58
|
+
|
|
59
|
+
@sourceSignalRef.setter
|
|
60
|
+
def sourceSignalRef(self, value):
|
|
61
|
+
self._source_signal_ref = value
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def targetSignalRef(self):
|
|
65
|
+
return self._target_signal_ref
|
|
66
|
+
|
|
67
|
+
@targetSignalRef.setter
|
|
68
|
+
def targetSignalRef(self, value):
|
|
69
|
+
self._target_signal_ref = value
|
|
70
|
+
|
|
71
|
+
class IPduMapping(ARObject):
|
|
72
|
+
def __init__(self):
|
|
73
|
+
super().__init__()
|
|
74
|
+
|
|
75
|
+
self._introduction = None # type: DocumentationBlock
|
|
76
|
+
self._pdur_tp_chunk_size = None # type: ARPositiveInteger
|
|
77
|
+
self._source_ipdu_ref = None # type: RefType
|
|
78
|
+
self._target_ipdu_ref = None # type: RefType
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def introduction(self):
|
|
82
|
+
return self._introduction
|
|
83
|
+
|
|
84
|
+
@introduction.setter
|
|
85
|
+
def introduction(self, value):
|
|
86
|
+
self._introduction = value
|
|
87
|
+
|
|
88
|
+
@property
|
|
89
|
+
def pdurTpChunkSize(self):
|
|
90
|
+
return self._pdur_tp_chunk_size
|
|
91
|
+
|
|
92
|
+
@pdurTpChunkSize.setter
|
|
93
|
+
def pdurTpChunkSize(self, value):
|
|
94
|
+
self._pdur_tp_chunk_size = value
|
|
95
|
+
|
|
96
|
+
@property
|
|
97
|
+
def sourceIPduRef(self):
|
|
98
|
+
return self._source_ipdu_ref
|
|
99
|
+
|
|
100
|
+
@sourceIPduRef.setter
|
|
101
|
+
def sourceIPduRef(self, value):
|
|
102
|
+
self._source_ipdu_ref = value
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def targetIPduRef(self):
|
|
106
|
+
return self._target_ipdu_ref
|
|
107
|
+
|
|
108
|
+
@targetIPduRef.setter
|
|
109
|
+
def targetIPduRef(self, value):
|
|
110
|
+
self._target_ipdu_ref = value
|
|
111
|
+
|
|
112
|
+
class Gateway(FibexElement):
|
|
113
|
+
def __init__(self, parent: ARObject, short_name: str):
|
|
114
|
+
super().__init__(parent, short_name)
|
|
115
|
+
|
|
116
|
+
self._ecu_ref = None # type: RefType
|
|
117
|
+
self._frame_mappings = [] # type: List[FrameMapping]
|
|
118
|
+
self._i_pdu_mappings = [] # type: List[IPduMapping]
|
|
119
|
+
self._signal_mappings = [] # type: List[ISignalMapping]
|
|
120
|
+
|
|
121
|
+
@property
|
|
122
|
+
def ecuRef(self) -> RefType:
|
|
123
|
+
return self._ecu_ref
|
|
124
|
+
|
|
125
|
+
@ecuRef.setter
|
|
126
|
+
def ecuRef(self, value: RefType):
|
|
127
|
+
self._ecu_ref = value
|
|
128
|
+
|
|
129
|
+
def getFrameMappings(self) -> List[FrameMapping]:
|
|
130
|
+
return self._frame_mappings
|
|
131
|
+
|
|
132
|
+
def addFrameMapping(self, mapping: FrameMapping):
|
|
133
|
+
self._frame_mappings.append(mapping)
|
|
134
|
+
|
|
135
|
+
def getIPduMappings(self) -> List[FrameMapping]:
|
|
136
|
+
return self._i_pdu_mappings
|
|
137
|
+
|
|
138
|
+
def addIPduMappings(self, mapping: FrameMapping):
|
|
139
|
+
self._i_pdu_mappings.append(mapping)
|
|
140
|
+
|
|
141
|
+
def getSignalMappings(self) -> List[FrameMapping]:
|
|
142
|
+
return self._signal_mappings
|
|
143
|
+
|
|
144
|
+
def addSignalMapping(self, mapping: FrameMapping):
|
|
145
|
+
self._signal_mappings.append(mapping)
|