armodel 1.7.6__py3-none-any.whl → 1.7.8__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.
Files changed (69) hide show
  1. armodel/cli/arxml_dump_cli.py +33 -22
  2. armodel/cli/arxml_format_cli.py +25 -13
  3. armodel/models/M2/AUTOSARTemplates/AutosarTopLevelStructure.py +95 -21
  4. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswBehavior.py +359 -59
  5. armodel/models/M2/AUTOSARTemplates/BswModuleTemplate/BswOverview.py +134 -35
  6. armodel/models/M2/AUTOSARTemplates/CommonStructure/Filter.py +17 -7
  7. armodel/models/M2/AUTOSARTemplates/CommonStructure/InternalBehavior.py +10 -1
  8. armodel/models/M2/AUTOSARTemplates/CommonStructure/TriggerDeclaration.py +18 -2
  9. armodel/models/M2/AUTOSARTemplates/ECUCDescriptionTemplate.py +20 -19
  10. armodel/models/M2/AUTOSARTemplates/EcuResourceTemplate/HwElementCategory.py +59 -0
  11. armodel/models/M2/AUTOSARTemplates/EcuResourceTemplate/__init__.py +145 -0
  12. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/ARPackage.py +215 -157
  13. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/Identifiable.py +69 -35
  14. armodel/models/M2/AUTOSARTemplates/GenericStructure/GeneralTemplateClasses/PrimitiveTypes.py +17 -1
  15. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Communication.py +19 -5
  16. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Components/__init__.py +113 -39
  17. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Composition/__init__.py +3 -2
  18. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/DataPrototypes.py +41 -16
  19. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/Datatype/Datatypes.py +10 -3
  20. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/EndToEndProtection.py +13 -6
  21. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/PortInterface/__init__.py +111 -38
  22. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/AccessCount.py +9 -1
  23. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/ModeDeclarationGroup.py +5 -4
  24. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/RTEEvents.py +26 -8
  25. armodel/models/M2/AUTOSARTemplates/SWComponentTemplate/SwcInternalBehavior/__init__.py +28 -6
  26. armodel/models/M2/AUTOSARTemplates/SystemTemplate/DataMapping.py +167 -5
  27. armodel/models/M2/AUTOSARTemplates/SystemTemplate/DoIp.py +29 -0
  28. armodel/models/M2/AUTOSARTemplates/SystemTemplate/EcuResourceMapping.py +45 -0
  29. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Can/CanTopology.py +31 -21
  30. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetFrame.py +5 -3
  31. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Ethernet/EthernetTopology.py +9 -0
  32. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/FlexrayCommunication.py +76 -0
  33. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/FlexrayTopology.py +654 -0
  34. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/Fibex4Flexray/__init__.py +0 -0
  35. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreCommunication.py +539 -77
  36. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/CoreTopology.py +158 -40
  37. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Fibex/FibexCore/EcuInstance.py +28 -6
  38. armodel/models/M2/AUTOSARTemplates/SystemTemplate/InstanceRefs.py +2 -0
  39. armodel/models/M2/AUTOSARTemplates/SystemTemplate/NetworkManagement.py +245 -130
  40. armodel/models/M2/AUTOSARTemplates/SystemTemplate/SWmapping.py +27 -0
  41. armodel/models/M2/AUTOSARTemplates/SystemTemplate/Transformer/__init__.py +524 -0
  42. armodel/models/M2/AUTOSARTemplates/SystemTemplate/TransportProtocols.py +592 -17
  43. armodel/models/M2/AUTOSARTemplates/SystemTemplate/__init__.py +33 -21
  44. armodel/models/M2/MSR/AsamHdo/AdminData.py +1 -2
  45. armodel/models/M2/MSR/AsamHdo/ComputationMethod.py +3 -1
  46. armodel/models/M2/MSR/AsamHdo/SpecialData.py +35 -8
  47. armodel/models/M2/MSR/DataDictionary/RecordLayout.py +0 -3
  48. armodel/models/__init__.py +8 -0
  49. armodel/parser/abstract_arxml_parser.py +34 -27
  50. armodel/parser/arxml_parser.py +1778 -616
  51. armodel/parser/file_parser.py +5 -3
  52. armodel/tests/test_armodel/models/test_ar_package.py +6 -11
  53. armodel/tests/test_armodel/models/test_bsw_module_template.py +5 -3
  54. armodel/tests/test_armodel/models/test_datatype.py +1 -1
  55. armodel/tests/test_armodel/models/test_port_interface.py +116 -117
  56. armodel/tests/test_armodel/parser/test_bsw_module_descriiption.py +218 -0
  57. armodel/tests/test_armodel/parser/test_sw_components.py +54 -22
  58. armodel/tests/test_armodel/parser/test_system.py +2 -8
  59. armodel/transformer/__init__.py +0 -0
  60. armodel/transformer/abstract.py +6 -0
  61. armodel/transformer/admin_data.py +31 -0
  62. armodel/writer/abstract_arxml_writer.py +27 -33
  63. armodel/writer/arxml_writer.py +1875 -599
  64. {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/METADATA +81 -3
  65. {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/RECORD +69 -56
  66. {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/LICENSE +0 -0
  67. {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/WHEEL +0 -0
  68. {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/entry_points.txt +0 -0
  69. {armodel-1.7.6.dist-info → armodel-1.7.8.dist-info}/top_level.txt +0 -0
@@ -1,22 +1,77 @@
1
1
  from abc import ABCMeta
2
2
  from enum import Enum
3
3
  from typing import List
4
+
5
+ from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Flexray.FlexrayCommunication import FlexrayFrameTriggering
6
+ from ......M2.AUTOSARTemplates.CommonStructure.Filter import DataFilter
4
7
  from ......M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.ArObject import ARObject
5
- from ......M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import ARFloat, Boolean, PositiveInteger, PositiveUnlimitedInteger, RefType, ARLiteral, TimeValue
6
8
  from ......M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.Identifiable import Identifiable
9
+ from ......M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import AREnum, ARFloat, Boolean, Integer, PositiveInteger
10
+ from ......M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import PositiveUnlimitedInteger, RefType, ARLiteral, TimeValue
7
11
  from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication import CanFrameTriggering
8
12
  from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinCommunication import LinFrameTriggering, LinScheduleTable
9
- from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import FibexElement, FrameTriggering, ISignalTriggering, PduTriggering
10
13
  from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Ethernet.NetworkEndpoint import NetworkEndpoint
14
+ from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import FibexElement, FrameTriggering, ISignalTriggering, PduTriggering
15
+
16
+
17
+ class CommunicationCycle(ARObject):
18
+ def __init__(self):
19
+ super().__init__()
20
+
21
+
22
+ class CycleCounter(CommunicationCycle):
23
+ def __init__(self):
24
+ super().__init__()
25
+
26
+ self.CycleCounter = None # type: Integer
27
+
28
+ def getCycleCounter(self):
29
+ return self.CycleCounter
30
+
31
+ def setCycleCounter(self, value):
32
+ if value is not None:
33
+ self.CycleCounter = value
34
+ return self
35
+
36
+
37
+ class CycleRepetitionType(AREnum):
38
+ def __init__(self):
39
+ super().__init__([])
40
+
41
+
42
+ class CycleRepetition(CommunicationCycle):
43
+ def __init__(self):
44
+ super().__init__()
45
+
46
+ self.BaseCycle = None # type: Integer
47
+ self.CycleRepetition = None # type: CycleRepetitionType
48
+
49
+ def getBaseCycle(self):
50
+ return self.BaseCycle
51
+
52
+ def setBaseCycle(self, value):
53
+ if value is not None:
54
+ self.BaseCycle = value
55
+ return self
56
+
57
+ def getCycleRepetition(self):
58
+ return self.CycleRepetition
59
+
60
+ def setCycleRepetition(self, value):
61
+ if value is not None:
62
+ self.CycleRepetition = value
63
+ return self
11
64
 
12
- class PhysicalChannel (Identifiable, metaclass = ABCMeta):
65
+
66
+ class PhysicalChannel (Identifiable, metaclass=ABCMeta):
13
67
  def __init__(self, parent: ARObject, short_name: str):
14
- if type(self) == PhysicalChannel:
68
+ if type(self) is PhysicalChannel:
15
69
  raise NotImplementedError("PhysicalChannel is an abstract class.")
16
70
 
17
71
  super().__init__(parent, short_name)
18
72
 
19
73
  self.commConnectorRefs = [] # type: List[RefType]
74
+ self.frameTriggerings = [] # type: List[FrameTriggering]
20
75
  self.managedPhysicalChannelRefs = [] # type: List[RefType]
21
76
 
22
77
  def getCommConnectorRefs(self):
@@ -27,22 +82,31 @@ class PhysicalChannel (Identifiable, metaclass = ABCMeta):
27
82
  return self
28
83
 
29
84
  def getFrameTriggerings(self) -> List[FrameTriggering]:
30
- return list(sorted(filter(lambda a: isinstance(a, FrameTriggering), self.elements.values()), key= lambda o:o.getShortName()))
85
+ return list(sorted(filter(lambda a: isinstance(a, FrameTriggering), self.elements.values()), key=lambda o: o.getShortName()))
31
86
 
32
- def createCanFrameTriggering(self, short_name: str):
87
+ def createCanFrameTriggering(self, short_name: str) -> CanFrameTriggering:
33
88
  if (short_name not in self.elements):
34
89
  triggering = CanFrameTriggering(self, short_name)
35
90
  self.addElement(triggering)
91
+ self.frameTriggerings.append(triggering)
36
92
  return self.getElement(short_name)
37
93
 
38
- def createLinFrameTriggering(self, short_name: str):
94
+ def createLinFrameTriggering(self, short_name: str) -> LinFrameTriggering:
39
95
  if (short_name not in self.elements):
40
96
  triggering = LinFrameTriggering(self, short_name)
41
97
  self.addElement(triggering)
98
+ self.frameTriggerings.append(triggering)
99
+ return self.getElement(short_name)
100
+
101
+ def createFlexrayFrameTriggering(self, short_name: str) -> FlexrayFrameTriggering:
102
+ if (short_name not in self.elements):
103
+ triggering = FlexrayFrameTriggering(self, short_name)
104
+ self.addElement(triggering)
105
+ self.frameTriggerings.append(triggering)
42
106
  return self.getElement(short_name)
43
107
 
44
108
  def getISignalTriggerings(self) -> List[ISignalTriggering]:
45
- return list(sorted(filter(lambda a: isinstance(a, ISignalTriggering), self.elements.values()), key= lambda o:o.getShortName()))
109
+ return list(sorted(filter(lambda a: isinstance(a, ISignalTriggering), self.elements.values()), key=lambda o: o.getShortName()))
46
110
 
47
111
  def createISignalTriggering(self, short_name: str):
48
112
  if (short_name not in self.elements):
@@ -58,7 +122,7 @@ class PhysicalChannel (Identifiable, metaclass = ABCMeta):
58
122
  return self
59
123
 
60
124
  def getPduTriggerings(self) -> List[PduTriggering]:
61
- return list(sorted(filter(lambda a: isinstance(a, PduTriggering), self.elements.values()), key= lambda o:o.getShortName()))
125
+ return list(sorted(filter(lambda a: isinstance(a, PduTriggering), self.elements.values()), key=lambda o: o.getShortName()))
62
126
 
63
127
  def createPduTriggering(self, short_name: str):
64
128
  if (short_name not in self.elements):
@@ -66,16 +130,19 @@ class PhysicalChannel (Identifiable, metaclass = ABCMeta):
66
130
  self.addElement(triggering)
67
131
  return self.getElement(short_name)
68
132
 
69
- class AbstractCanPhysicalChannel(PhysicalChannel, metaclass = ABCMeta):
133
+
134
+ class AbstractCanPhysicalChannel(PhysicalChannel, metaclass=ABCMeta):
70
135
  def __init__(self, parent, short_name):
71
- if type(self) == ARObject:
136
+ if type(self) is AbstractCanPhysicalChannel:
72
137
  raise NotImplementedError("AbstractCanPhysicalChannel is an abstract class.")
73
138
 
74
139
  super().__init__(parent, short_name)
75
140
 
141
+
76
142
  class CanPhysicalChannel(AbstractCanPhysicalChannel):
77
143
  def __init__(self, parent, short_name):
78
- super().__init__(parent, short_name)
144
+ super().__init__(parent, short_name)
145
+
79
146
 
80
147
  class LinPhysicalChannel(PhysicalChannel):
81
148
  def __init__(self, parent: ARObject, short_name: str):
@@ -96,13 +163,14 @@ class LinPhysicalChannel(PhysicalChannel):
96
163
  def getScheduleTables(self):
97
164
  return self.scheduleTables
98
165
 
99
- def createLinScheduleTable(self, short_name:str) -> LinScheduleTable:
166
+ def createLinScheduleTable(self, short_name: str) -> LinScheduleTable:
100
167
  if (short_name not in self.elements):
101
168
  end_point = LinScheduleTable(self, short_name)
102
169
  self.addElement(end_point)
103
170
  self.scheduleTables.append(end_point)
104
171
  return self.getElement(short_name)
105
-
172
+
173
+
106
174
  class VlanConfig(Identifiable):
107
175
  def __init__(self, parent: ARObject, short_name: str):
108
176
  super().__init__(parent, short_name)
@@ -116,6 +184,8 @@ class VlanConfig(Identifiable):
116
184
  if value is not None:
117
185
  self.vlanIdentifier = value
118
186
  return self
187
+
188
+
119
189
  class EthernetPhysicalChannel(PhysicalChannel):
120
190
  def __init__(self, parent: ARObject, short_name: str):
121
191
  super().__init__(parent, short_name)
@@ -127,7 +197,7 @@ class EthernetPhysicalChannel(PhysicalChannel):
127
197
  def getNetworkEndpoints(self):
128
198
  return self.networkEndpoints
129
199
 
130
- def createNetworkEndPoint(self, short_name:str) -> NetworkEndpoint:
200
+ def createNetworkEndPoint(self, short_name: str) -> NetworkEndpoint:
131
201
  if (short_name not in self.elements):
132
202
  end_point = NetworkEndpoint(self, short_name)
133
203
  self.addElement(end_point)
@@ -149,18 +219,46 @@ class EthernetPhysicalChannel(PhysicalChannel):
149
219
  config = VlanConfig(self, short_name)
150
220
  self.vlan = config
151
221
  self.addElement(config)
152
- return self.getElement(short_name)
222
+ return self.getElement(short_name)
223
+
153
224
 
154
- class CommunicationCluster(FibexElement, metaclass = ABCMeta):
225
+ class FlexrayChannelName(AREnum):
226
+ CHANNEL_A = "channelA"
227
+ channel_B = "channelB"
228
+
229
+ def __init__(self):
230
+ super().__init__([
231
+ FlexrayChannelName.CHANNEL_A,
232
+ FlexrayChannelName.channel_B
233
+ ])
234
+
235
+
236
+ class FlexrayPhysicalChannel(PhysicalChannel):
155
237
  def __init__(self, parent: ARObject, short_name: str):
156
- if type(self) == CommunicationCluster:
238
+ super().__init__(parent, short_name)
239
+
240
+ self.channelName = None # type: FlexrayChannelName
241
+
242
+ def getChannelName(self):
243
+ return self.channelName
244
+
245
+ def setChannelName(self, value):
246
+ if value is not None:
247
+ self.channelName = value
248
+ return self
249
+
250
+
251
+ class CommunicationCluster(FibexElement, metaclass=ABCMeta):
252
+ def __init__(self, parent: ARObject, short_name: str):
253
+ if type(self) is CommunicationCluster:
157
254
  raise NotImplementedError("CommunicationCluster is an abstract class.")
158
255
 
159
256
  super().__init__(parent, short_name)
160
257
 
161
- self.baudrate = None # type: ARFloat
162
- self.protocolName = None # type: ARLiteral
163
- self.protocolVersion = None # type: ARLiteral
258
+ self.baudrate = None # type: ARFloat
259
+ self.physicalChannel = [] # type: List[PhysicalChannel]
260
+ self.protocolName = None # type: ARLiteral
261
+ self.protocolVersion = None # type: ARLiteral
164
262
 
165
263
  def getBaudrate(self):
166
264
  return self.baudrate
@@ -170,33 +268,43 @@ class CommunicationCluster(FibexElement, metaclass = ABCMeta):
170
268
  return self
171
269
 
172
270
  def getPhysicalChannels(self) -> List[PhysicalChannel]:
173
- return list(sorted(filter(lambda a: isinstance(a, PhysicalChannel), self.elements.values()), key= lambda o:o.getShortName()))
271
+ return list(sorted(filter(lambda a: isinstance(a, PhysicalChannel), self.elements.values()), key=lambda o: o.getShortName()))
174
272
 
175
273
  def getCanPhysicalChannels(self) -> List[CanPhysicalChannel]:
176
- return list(sorted(filter(lambda a: isinstance(a, CanPhysicalChannel), self.elements.values()), key= lambda o:o.getShortName()))
274
+ return list(sorted(filter(lambda a: isinstance(a, CanPhysicalChannel), self.elements.values()), key=lambda o: o.getShortName()))
177
275
 
178
276
  def getLinPhysicalChannels(self) -> List[LinPhysicalChannel]:
179
- return list(sorted(filter(lambda a: isinstance(a, LinPhysicalChannel), self.elements.values()), key= lambda o:o.getShortName()))
277
+ return list(sorted(filter(lambda a: isinstance(a, LinPhysicalChannel), self.elements.values()), key=lambda o: o.getShortName()))
180
278
 
181
279
  def getEthernetPhysicalChannels(self) -> List[EthernetPhysicalChannel]:
182
- return list(sorted(filter(lambda a: isinstance(a, EthernetPhysicalChannel), self.elements.values()), key= lambda o:o.getShortName()))
280
+ return list(sorted(filter(lambda a: isinstance(a, EthernetPhysicalChannel), self.elements.values()), key=lambda o: o.getShortName()))
183
281
 
184
282
  def createCanPhysicalChannel(self, short_name: str):
185
283
  if (short_name not in self.elements):
186
284
  channel = CanPhysicalChannel(self, short_name)
187
285
  self.addElement(channel)
286
+ self.physicalChannel.append(channel)
188
287
  return self.getElement(short_name)
189
288
 
190
289
  def createLinPhysicalChannel(self, short_name: str):
191
290
  if (short_name not in self.elements):
192
291
  channel = LinPhysicalChannel(self, short_name)
193
292
  self.addElement(channel)
293
+ self.physicalChannel.append(channel)
194
294
  return self.getElement(short_name)
195
295
 
196
296
  def createEthernetPhysicalChannel(self, short_name: str):
197
297
  if (short_name not in self.elements):
198
298
  channel = EthernetPhysicalChannel(self, short_name)
199
299
  self.addElement(channel)
300
+ self.physicalChannel.append(channel)
301
+ return self.getElement(short_name)
302
+
303
+ def createFlexrayPhysicalChannel(self, short_name: str):
304
+ if (short_name not in self.elements):
305
+ channel = FlexrayPhysicalChannel(self, short_name)
306
+ self.addElement(channel)
307
+ self.physicalChannel.append(channel)
200
308
  return self.getElement(short_name)
201
309
 
202
310
  def getProtocolName(self):
@@ -212,7 +320,8 @@ class CommunicationCluster(FibexElement, metaclass = ABCMeta):
212
320
  def setProtocolVersion(self, value):
213
321
  self.protocolVersion = value
214
322
  return self
215
-
323
+
324
+
216
325
  class CanClusterBusOffRecovery(ARObject):
217
326
  def __init__(self):
218
327
  super().__init__()
@@ -263,9 +372,10 @@ class CanClusterBusOffRecovery(ARObject):
263
372
  self.mainFunctionPeriod = value
264
373
  return self
265
374
 
266
- class AbstractCanCluster(CommunicationCluster, metaclass = ABCMeta):
375
+
376
+ class AbstractCanCluster(CommunicationCluster, metaclass=ABCMeta):
267
377
  def __init__(self, parent: ARObject, short_name: str):
268
- if type(self) == AbstractCanCluster:
378
+ if type(self) is AbstractCanCluster:
269
379
  raise NotImplementedError("AbstractCanCluster is an abstract class.")
270
380
 
271
381
  super().__init__(parent, short_name)
@@ -303,17 +413,20 @@ class AbstractCanCluster(CommunicationCluster, metaclass = ABCMeta):
303
413
  self.speed = value
304
414
  return self
305
415
 
416
+
306
417
  class CanCluster(AbstractCanCluster):
307
418
  def __init__(self, parent: ARObject, short_name: str):
308
- super().__init__(parent, short_name)
419
+ super().__init__(parent, short_name)
420
+
309
421
 
310
422
  class LinCluster(CommunicationCluster):
311
423
  def __init__(self, parent: ARObject, short_name: str):
312
424
  super().__init__(parent, short_name)
313
425
 
314
- class CommunicationController(Identifiable, metaclass = ABCMeta):
426
+
427
+ class CommunicationController(Identifiable, metaclass=ABCMeta):
315
428
  def __init__(self, parent: ARObject, short_name: str):
316
- if type(self) == CommunicationController:
429
+ if type(self) is CommunicationController:
317
430
  raise NotImplementedError("CommunicationController is an abstract class.")
318
431
 
319
432
  super().__init__(parent, short_name)
@@ -326,19 +439,22 @@ class CommunicationController(Identifiable, metaclass = ABCMeta):
326
439
  def setWakeUpByControllerSupported(self, value):
327
440
  self.wakeUpByControllerSupported = value
328
441
  return self
329
-
442
+
443
+
330
444
  class PncGatewayTypeEnum(Enum):
331
445
  ENUM_ACTIVE = "active"
332
446
  ENUM_NONE = "none"
333
447
  ENUM_PASSIVE = "passive"
334
448
 
449
+
335
450
  class CommunicationDirectionType(Enum):
336
451
  ENUM_IN = "in"
337
452
  ENUM_OUT = "out"
338
453
 
339
- class CommConnectorPort(Identifiable, metaclass = ABCMeta):
454
+
455
+ class CommConnectorPort(Identifiable, metaclass=ABCMeta):
340
456
  def __init__(self, parent: ARObject, short_name: str):
341
- if type(self) == CommConnectorPort:
457
+ if type(self) is CommConnectorPort:
342
458
  raise NotImplementedError("CommConnectorPort is an abstract class.")
343
459
 
344
460
  super().__init__(parent, short_name)
@@ -358,9 +474,11 @@ class FramePort(CommConnectorPort):
358
474
  def __init__(self, parent: ARObject, short_name: str):
359
475
  super().__init__(parent, short_name)
360
476
 
477
+
361
478
  class IPduSignalProcessingEnum(Enum):
362
479
  ENUM_DEFERRED = "deferred"
363
- ENUM_IMMEDIATE = "immediate"
480
+ ENUM_IMMEDIATE = "immediate"
481
+
364
482
 
365
483
  class IPduPort(CommConnectorPort):
366
484
  def __init__(self, parent: ARObject, short_name: str):
@@ -412,6 +530,7 @@ class IPduPort(CommConnectorPort):
412
530
  self.useAuthDataFreshness = value
413
531
  return self
414
532
 
533
+
415
534
  class ISignalPort(CommConnectorPort):
416
535
  def __init__(self, parent: ARObject, short_name: str):
417
536
  super().__init__(parent, short_name)
@@ -462,9 +581,10 @@ class ISignalPort(CommConnectorPort):
462
581
  self.timeout = value
463
582
  return self
464
583
 
465
- class CommunicationConnector(Identifiable, metaclass = ABCMeta):
584
+
585
+ class CommunicationConnector(Identifiable, metaclass=ABCMeta):
466
586
  def __init__(self, parent: ARObject, short_name: str):
467
- if type(self) == CommunicationConnector:
587
+ if type(self) is CommunicationConnector:
468
588
  raise NotImplementedError("CommunicationConnector is an abstract class.")
469
589
 
470
590
  super().__init__(parent, short_name)
@@ -498,7 +618,7 @@ class CommunicationConnector(Identifiable, metaclass = ABCMeta):
498
618
  return self
499
619
 
500
620
  def getEcuCommPortInstances(self):
501
- return list(sorted(filter(lambda a: isinstance(a, CommConnectorPort), self.elements.values()), key= lambda o:o.getShortName()))
621
+ return list(sorted(filter(lambda a: isinstance(a, CommConnectorPort), self.elements.values()), key=lambda o: o.getShortName()))
502
622
 
503
623
  def createFramePort(self, short_name) -> FramePort:
504
624
  if short_name not in self.elements:
@@ -534,5 +654,3 @@ class CommunicationConnector(Identifiable, metaclass = ABCMeta):
534
654
  def setPncGatewayType(self, value):
535
655
  self.pncGatewayType = value
536
656
  return self
537
-
538
-
@@ -4,6 +4,7 @@ from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanCommunication i
4
4
  from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Can.CanTopology import CanCommunicationConnector, CanCommunicationController
5
5
  from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreCommunication import FibexElement
6
6
  from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.FibexCore.CoreTopology import CommunicationConnector, CommunicationController
7
+ from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Flexray.FlexrayTopology import FlexrayCommunicationConnector, FlexrayCommunicationController
7
8
  from ......M2.AUTOSARTemplates.SystemTemplate.Fibex.Fibex4Lin.LinTopology import LinCommunicationConnector, LinMaster
8
9
  from typing import List
9
10
 
@@ -22,6 +23,7 @@ class EcuInstance(FibexElement):
22
23
  self.comEnableMDTForCyclicTransmission = None # type: Boolean
23
24
  self.commControllers = [] # type: List[CommunicationController]
24
25
  self.connectors = [] # type: List[CommunicationConnector]
26
+ self.diagnosticAddress = None # type: Integer ## Only AR 4.3.1
25
27
  self.dltConfig = None # type: DltConfig
26
28
  self.doIpConfig = None # type: DoIpConfig
27
29
  self.ecuTaskProxyRefs = [] # type: List[RefType]
@@ -105,43 +107,63 @@ class EcuInstance(FibexElement):
105
107
  return list(sorted(filter(lambda a: isinstance(a, CommunicationController), self.elements.values()), key= lambda o:o.short_name))
106
108
 
107
109
  def createCanCommunicationController(self, short_name: str) -> CanCommunicationController:
108
- if (short_name not in self.elements):
110
+ if (not self.IsElementExists(short_name)):
109
111
  controller = CanCommunicationController(self, short_name)
110
112
  self.addElement(controller)
111
113
  return self.getElement(short_name)
112
114
 
113
115
  def createEthernetCommunicationController(self, short_name: str) -> EthernetCommunicationController:
114
- if (short_name not in self.elements):
116
+ if (not self.IsElementExists(short_name)):
115
117
  controller = EthernetCommunicationController(self, short_name)
116
118
  self.addElement(controller)
117
119
  return self.getElement(short_name)
118
120
 
119
121
  def createLinMaster(self, short_name: str) -> LinMaster:
120
- if (short_name not in self.elements):
122
+ if (not self.IsElementExists(short_name)):
121
123
  controller = LinMaster(self, short_name)
122
124
  self.addElement(controller)
123
125
  return self.getElement(short_name)
126
+
127
+ def createFlexrayCommunicationController(self, short_name: str) -> FlexrayCommunicationController:
128
+ if (not self.IsElementExists(short_name)):
129
+ controller = FlexrayCommunicationController(self, short_name)
130
+ self.addElement(controller)
131
+ return self.getElement(short_name)
124
132
 
125
133
  def getConnectors(self):
126
134
  return list(sorted(filter(lambda a: isinstance(a, CommunicationConnector), self.elements.values()), key= lambda o:o.short_name))
127
135
 
128
136
  def createCanCommunicationConnector(self, short_name: str) -> CanCommunicationConnector:
129
- if (short_name not in self.elements):
137
+ if (not self.IsElementExists(short_name)):
130
138
  connector = CanCommunicationConnector(self, short_name)
131
139
  self.addElement(connector)
132
140
  return self.getElement(short_name)
133
141
 
134
142
  def createEthernetCommunicationConnector(self, short_name: str) -> EthernetCommunicationConnector:
135
- if (short_name not in self.elements):
143
+ if (not self.IsElementExists(short_name)):
136
144
  connector = EthernetCommunicationConnector(self, short_name)
137
145
  self.addElement(connector)
138
146
  return self.getElement(short_name)
139
147
 
140
148
  def createLinCommunicationConnector(self, short_name: str) -> LinCommunicationConnector:
141
- if (short_name not in self.elements):
149
+ if (not self.IsElementExists(short_name)):
142
150
  connector = LinCommunicationConnector(self, short_name)
143
151
  self.addElement(connector)
144
152
  return self.getElement(short_name)
153
+
154
+ def createFlexrayCommunicationConnector(self, short_name: str) -> FlexrayCommunicationConnector:
155
+ if (not self.IsElementExists(short_name)):
156
+ connector = FlexrayCommunicationConnector(self, short_name)
157
+ self.addElement(connector)
158
+ return self.getElement(short_name)
159
+
160
+ def getDiagnosticAddress(self):
161
+ return self.diagnosticAddress
162
+
163
+ def setDiagnosticAddress(self, value):
164
+ if value is not None:
165
+ self.diagnosticAddress = value
166
+ return self
145
167
 
146
168
  def getDltConfig(self):
147
169
  return self.dltConfig
@@ -2,6 +2,7 @@ from typing import List
2
2
  from ....M2.AUTOSARTemplates.GenericStructure.GeneralTemplateClasses.PrimitiveTypes import RefType
3
3
  from ....M2.AUTOSARTemplates.GenericStructure.AbstractStructure import AtpInstanceRef
4
4
 
5
+
5
6
  class VariableDataPrototypeInSystemInstanceRef(AtpInstanceRef):
6
7
  def __init__(self):
7
8
  super().__init__()
@@ -47,6 +48,7 @@ class VariableDataPrototypeInSystemInstanceRef(AtpInstanceRef):
47
48
  self.targetDataPrototypeRef = value
48
49
  return self
49
50
 
51
+
50
52
  class ComponentInSystemInstanceRef(AtpInstanceRef):
51
53
  def __init__(self):
52
54
  super().__init__()