py-eb-model 1.0.1__py3-none-any.whl → 1.0.2__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.
@@ -1,3 +1,4 @@
1
1
  from .abstract import *
2
2
  from .os_xdm import *
3
+ from .rte_xdm import *
3
4
  from .eb_doc import *
eb_model/models/os_xdm.py CHANGED
@@ -159,11 +159,179 @@ class OsAlarm(EcucContainer):
159
159
 
160
160
  return "\n".join(result)
161
161
 
162
+ class OsApplicationHooks(EcucContainer):
163
+ def __init__(self, parent, name):
164
+ super().__init__(parent, name)
165
+
166
+ self.OsAppErrorHook = False # type: bool
167
+ self.OsAppShutdownHook = False # type: bool
168
+ self.OsAppStartupHook = False # type: bool
169
+ self.OsMemoryMappingCodeLocationRef = None # type: EcucRefType
170
+
171
+ def getOsAppErrorHook(self):
172
+ return self.OsAppErrorHook
173
+
174
+ def setOsAppErrorHook(self, value):
175
+ self.OsAppErrorHook = value
176
+ return self
177
+
178
+ def getOsAppShutdownHook(self):
179
+ return self.OsAppShutdownHook
180
+
181
+ def setOsAppShutdownHook(self, value):
182
+ self.OsAppShutdownHook = value
183
+ return self
184
+
185
+ def getOsAppStartupHook(self):
186
+ return self.OsAppStartupHook
187
+
188
+ def setOsAppStartupHook(self, value):
189
+ self.OsAppStartupHook = value
190
+ return self
191
+
192
+ def getOsMemoryMappingCodeLocationRef(self):
193
+ return self.OsMemoryMappingCodeLocationRef
194
+
195
+ def setOsMemoryMappingCodeLocationRef(self, value):
196
+ self.OsMemoryMappingCodeLocationRef = value
197
+ return self
198
+
199
+ class OsApplicationTrustedFunction(EcucContainer):
200
+ def __init__(self, parent, name):
201
+ super().__init__(parent, name)
202
+
203
+ self.OsTrustedFunctionName = None # type: str
204
+ self.OsMemoryMappingCodeLocationRef = None # type: EcucRefType
162
205
 
206
+ def getOsTrustedFunctionName(self):
207
+ return self.OsTrustedFunctionName
208
+
209
+ def setOsTrustedFunctionName(self, value):
210
+ self.OsTrustedFunctionName = value
211
+ return self
212
+
213
+ def getOsMemoryMappingCodeLocationRef(self):
214
+ return self.OsMemoryMappingCodeLocationRef
215
+
216
+ def setOsMemoryMappingCodeLocationRef(self, value):
217
+ self.OsMemoryMappingCodeLocationRef = value
218
+ return self
219
+ class OsAppMode(EcucContainer):
220
+ def __init__(self, parent, name):
221
+ super().__init__(parent, name)
163
222
  class OsApplication(EcucContainer):
164
223
  def __init__(self, parent, name) -> None:
165
224
  super().__init__(parent, name)
166
225
 
226
+ self.OsTrusted = False # type: bool
227
+ self.OsTrustedApplicationDelayTimingViolationCall = False # type: bool
228
+ self.OsTrustedApplicationWithProtection = False # type: bool
229
+ self.OsAppAlarmRefs = [] # type: List[EcucRefType]
230
+ self.OsAppCounterRefs = [] # type: List[EcucRefType]
231
+ self.OsAppEcucPartitionRefs = [] # type: List[EcucRefType]
232
+ self.OsAppIsrRefs = [] # type: List[EcucRefType]
233
+ self.OsApplicationCoreRefs = [] # type: List[EcucRefType]
234
+ self.OsAppScheduleTableRefs = [] # type: List[EcucRefType]
235
+ self.OsAppTaskRefs = [] # type: List[EcucRefType]
236
+ self.OsMemoryMappingCodeLocationRef = None # type: EcucRefType
237
+ self.OsRestartTask = None # type: EcucRefType
238
+
239
+ '''
240
+ EB Tresos
241
+ '''
242
+ self.OsAppResourceRefs = [] # type: List[EcucRefType]
243
+
244
+ def getOsTrusted(self):
245
+ return self.OsTrusted
246
+
247
+ def setOsTrusted(self, value):
248
+ self.OsTrusted = value
249
+ return self
250
+
251
+ def getOsTrustedApplicationDelayTimingViolationCall(self):
252
+ return self.OsTrustedApplicationDelayTimingViolationCall
253
+
254
+ def setOsTrustedApplicationDelayTimingViolationCall(self, value):
255
+ self.OsTrustedApplicationDelayTimingViolationCall = value
256
+ return self
257
+
258
+ def getOsTrustedApplicationWithProtection(self):
259
+ return self.OsTrustedApplicationWithProtection
260
+
261
+ def setOsTrustedApplicationWithProtection(self, value):
262
+ self.OsTrustedApplicationWithProtection = value
263
+ return self
264
+
265
+ def getOsAppAlarmRefs(self):
266
+ return self.OsAppAlarmRefs
267
+
268
+ def addOsAppAlarmRef(self, value):
269
+ self.OsAppAlarmRefs.append(value)
270
+ return self
271
+
272
+ def getOsAppCounterRefs(self):
273
+ return self.OsAppCounterRefs
274
+
275
+ def addOsAppCounterRefs(self, value):
276
+ self.OsAppCounterRefs.append(value)
277
+ return self
278
+
279
+ def getOsAppEcucPartitionRefs(self):
280
+ return self.OsAppEcucPartitionRefs
281
+
282
+ def addOsAppEcucPartitionRefs(self, value):
283
+ self.OsAppEcucPartitionRefs.append(value)
284
+ return self
285
+
286
+ def getOsAppIsrRefs(self):
287
+ return self.OsAppIsrRefs
288
+
289
+ def addOsAppIsrRefs(self, value):
290
+ self.OsAppIsrRefs.append(value)
291
+ return self
292
+
293
+ def getOsApplicationCoreRefs(self):
294
+ return self.OsApplicationCoreRefs
295
+
296
+ def addOsApplicationCoreRefs(self, value):
297
+ self.OsApplicationCoreRefs.append(value)
298
+ return self
299
+
300
+ def getOsAppScheduleTableRefs(self):
301
+ return self.OsAppScheduleTableRefs
302
+
303
+ def addOsAppScheduleTableRef(self, value):
304
+ self.OsAppScheduleTableRefs.append(value)
305
+ return self
306
+
307
+ def getOsAppTaskRefs(self):
308
+ return self.OsAppTaskRefs
309
+
310
+ def addOsAppTaskRefs(self, value):
311
+ self.OsAppTaskRefs.append(value)
312
+ return self
313
+
314
+ def getOsMemoryMappingCodeLocationRef(self):
315
+ return self.OsMemoryMappingCodeLocationRef
316
+
317
+ def setOsMemoryMappingCodeLocationRef(self, value):
318
+ self.OsMemoryMappingCodeLocationRef = value
319
+ return self
320
+
321
+ def getOsRestartTask(self):
322
+ return self.OsRestartTask
323
+
324
+ def setOsRestartTask(self, value):
325
+ self.OsRestartTask = value
326
+ return self
327
+
328
+ def getOsAppResourceRefs(self):
329
+ return self.OsAppResourceRefs
330
+
331
+ def addOsAppResourceRef(self, value):
332
+ self.OsAppResourceRefs.append(value)
333
+ return self
334
+
167
335
 
168
336
  class OsDriver(EcucContainer):
169
337
  def __init__(self, parent, name) -> None:
@@ -435,9 +603,9 @@ class OsTask(EcucObject):
435
603
  self.osTaskPriority = None # type: int
436
604
  self.osTaskSchedule = ""
437
605
  self.osStacksize = 0 # type: int
438
- self.osMemoryMappingCodeLocationRef = None
606
+ self.osMemoryMappingCodeLocationRef = None # type: EcucRefType
439
607
  self.osTaskAccessingApplication = None
440
- self.osTaskEventRef = None
608
+ self.osTaskEventRef = None # type: EcucRefType
441
609
  self.osTaskResourceRefs = [] # type: List[EcucRefType]
442
610
 
443
611
  def getOsTaskActivation(self):
@@ -750,6 +918,7 @@ class Os(EcucContainer):
750
918
  self.osAlarms = [] # type: List[OsAlarm]
751
919
  self.osScheduleTables = [] # type: List[OsScheduleTable]
752
920
  self.osCounters = [] # type: List[OsCounter]
921
+ self.osApplications = [] # type: List[OsApplication]
753
922
 
754
923
  def getOsTaskList(self) -> List[OsTask]:
755
924
  return list(sorted(filter(lambda a: isinstance(a, OsTask), self.elements.values()), key=lambda o: o.name))
@@ -789,4 +958,12 @@ class Os(EcucContainer):
789
958
  def addOsCounter(self, os_counter: OsCounter):
790
959
  self.addElement(os_counter)
791
960
  self.osCounters.append(os_counter)
792
- return self
961
+ return self
962
+
963
+ def getOsApplicationList(self) -> List[OsApplication]:
964
+ return list(sorted(filter(lambda a: isinstance(a, OsApplication), self.elements.values()), key=lambda o: o.name))
965
+
966
+ def addOsApplication(self, value):
967
+ self.addElement(value)
968
+ self.osApplications.append(value)
969
+ return self
@@ -402,11 +402,11 @@ class RteBswModuleInstance(AbstractRteInstance):
402
402
  self.rteBswImplementationRef = None
403
403
  self.rteBswModuleConfigurationRefs = []
404
404
  self.rteBswEventToIsrMappings = []
405
- self.rteBswEventToTaskMappings = [] # List[RteBswEventToTaskMapping]
405
+ self.rteBswEventToTaskMappings = [] # type: List[RteBswEventToTaskMapping]
406
406
  self.rteBswExclusiveAreaImpls = []
407
407
  self.rteBswExternalTriggerConfigs = []
408
408
  self.rteBswInternalTriggerConfigs = []
409
- self.rteMappedToOsApplicationRef = None
409
+ self.rteMappedToOsApplicationRef = None # type: EcucRefType
410
410
  self.rteBswModeMachineInstanceConfigs = []
411
411
  self.rteBswRequiredClientServerConnections = []
412
412
  self.rteBswRequiredModeGroupConnections = []
@@ -515,7 +515,7 @@ class Rte(EcucContainer):
515
515
  self.elements[value.getName()] = value
516
516
 
517
517
  def getRteSwComponentInstanceList(self) -> List[RteSwComponentInstance]:
518
- return list(sorted(filter(lambda a: isinstance(a, RteBswModuleInstance), self.elements.values()), key= lambda o:o.name))
518
+ return list(sorted(filter(lambda a: isinstance(a, RteSwComponentInstance), self.elements.values()), key= lambda o:o.name))
519
519
 
520
520
  def addRteSwComponentInstance(self, value: RteSwComponentInstance):
521
521
  self.elements[value.getName()] = value
@@ -1 +1,2 @@
1
1
  from .os_xdm_parser import OsXdmParser
2
+ from .rte_xdm_parser import RteXdmParser
@@ -1,10 +1,9 @@
1
1
  import xml.etree.ElementTree as ET
2
-
3
2
  from ..models.eb_doc import EBModel
4
- from ..models.os_xdm import Os, OsAlarm, OsAlarmActivateTask, OsAlarmCallback, OsAlarmIncrementCounter, OsAlarmSetEvent, OsCounter, OsScheduleTable, OsScheduleTableEventSetting, OsScheduleTableExpiryPoint, OsScheduleTableTaskActivation, OsScheduleTblAdjustableExpPoint, OsTask, OsIsr
3
+ from ..models.os_xdm import Os, OsAlarm, OsAlarmActivateTask, OsAlarmCallback, OsAlarmIncrementCounter, OsAlarmSetEvent, OsCounter, OsScheduleTable, OsScheduleTableEventSetting, OsScheduleTableExpiryPoint, OsScheduleTableTaskActivation, OsScheduleTblAdjustableExpPoint
4
+ from ..models.os_xdm import OsTask, OsIsr, OsApplication
5
5
  from .eb_parser import AbstractEbModelParser
6
6
 
7
-
8
7
  class OsXdmParser(AbstractEbModelParser):
9
8
  def __init__(self, ) -> None:
10
9
  super().__init__()
@@ -20,6 +19,7 @@ class OsXdmParser(AbstractEbModelParser):
20
19
  self.read_os_alarms(element, os)
21
20
  self.read_os_schedule_tables(element, os)
22
21
  self.read_os_counters(element, os)
22
+ self.read_os_applications(element, os)
23
23
 
24
24
  def read_os_tasks(self, element: ET.Element, os: Os):
25
25
  for ctr_tag in self.find_ctr_tag_list(element, "OsTask"):
@@ -62,7 +62,7 @@ class OsXdmParser(AbstractEbModelParser):
62
62
  .setOsAlarmSetEventTaskRef(self.read_ref_value(element, "OsAlarmSetEventTaskRef"))
63
63
  elif chc == "OsAlarmCallback":
64
64
  os_alarm_action = OsAlarmCallback(os_alarm, "OsAlarmCallback") \
65
- .setOsAlarmCallbackName(self.read_value(os_alarm, "OsAlarmCallbackName"))
65
+ .setOsAlarmCallbackName(self.read_value(element, "OsAlarmCallbackName"))
66
66
  else:
67
67
  raise ValueError("Unsupported OsAlarmAction <%s>" % chc)
68
68
  os_alarm.setOsAlarmAction(os_alarm_action)
@@ -140,3 +140,14 @@ class OsXdmParser(AbstractEbModelParser):
140
140
 
141
141
  self.logger.debug("Read OsCounter <%s>" % counter.getName())
142
142
  os.addOsScheduleTable(counter)
143
+
144
+ def read_os_applications(self, element: ET.Element, os: Os):
145
+ for ctr_tag in self.find_ctr_tag_list(element, "OsApplication"):
146
+ os_app = OsApplication(os, ctr_tag.attrib["name"]) \
147
+ .setOsTrusted(self.read_value(ctr_tag, "OsTrusted"))
148
+
149
+ for ref in self.read_ref_value_list(ctr_tag, "OsAppResourceRef"):
150
+ os_app.addOsAppResourceRef(ref)
151
+
152
+ self.logger.debug("Read OsApplication <%s>" % os_app.getName())
153
+ os.addOsApplication(os_app)
@@ -4,7 +4,6 @@ from ..models.rte_xdm import Rte, RteBswEventToTaskMapping, RteBswModuleInstance
4
4
  from ..models.eb_doc import EBModel
5
5
  from .eb_parser import AbstractEbModelParser
6
6
 
7
-
8
7
  class RteXdmParser(AbstractEbModelParser):
9
8
  def __init__(self, ) -> None:
10
9
  super().__init__()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-eb-model
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: The parser for EB XDM file
5
5
  Home-page: UNKNOWN
6
6
  Author: melodypapa
@@ -89,6 +89,9 @@ rte-xdm-xlsx -r data/Rte.xdm data/Os.xdm data/Runnable.xlsx
89
89
  1. Change the attribute to start with lowercase
90
90
  2. *read_ref_value* and *read_optional_ref_value* method returns EcucRefType.
91
91
  3. Read the OsScheduleTable and export to excel
92
- 4. REad the OsCounter and export to excel
92
+ 4. Read the OsCounter and export to excel
93
93
 
94
+ **Version 1.0.2**
95
+
96
+ 1. Fix the setOsAlarmCallbackName bug
94
97
 
@@ -2,16 +2,16 @@ eb_model/__init__.py,sha256=u3VUin2V_1eExLd9NIpw_LGHIAwaG2vEoyhssZurrvM,69
2
2
  eb_model/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  eb_model/cli/os_xdm_2_xls_cli.py,sha256=lTIYNVDDMIKu6sosjV8I3pLQxD-I11cKjUDXTyKDrLE,1643
4
4
  eb_model/cli/rte_xdm_2_xls_cli.py,sha256=83uzE2Vk0h267gWxF9mnWN3Bh69RJpYyKULFXpxTByY,2127
5
- eb_model/models/__init__.py,sha256=_WDgFMwl8w3WnI4ZpjHXMdJVdmqPRpwJ8GLMb4_RGk0,71
5
+ eb_model/models/__init__.py,sha256=TH1OtmIdLdd_sLh9o4rczuRDL68OXxdKjDVuxj4Lfsw,95
6
6
  eb_model/models/abstract.py,sha256=4jy328yy2sedIHNwfxjzW3CnVsnTCoskatT8JXjv-rE,2402
7
7
  eb_model/models/eb_doc.py,sha256=wWMHdLYpyvmEVlgNLzFLvC8C_uGnlPP4xnx_DlkslY4,1417
8
- eb_model/models/os_xdm.py,sha256=KouM8Gh4ELl7oQUcgeQ-3Sm1gk4GhTOVZUNt25Rvowo,25163
9
- eb_model/models/rte_xdm.py,sha256=8nYX567TgOH6BzsgaNOd2WTPGCxETTYXO9MQICrfCfQ,19328
10
- eb_model/parser/__init__.py,sha256=5qHXKEfEMcE0WvvinJQu_21bNzWFdXTJxUudy-85DEE,40
8
+ eb_model/models/os_xdm.py,sha256=Wk_B3yBvXwZpxwKyTKJBIBhr4ovpiglGCq2XEmYX6gs,31678
9
+ eb_model/models/rte_xdm.py,sha256=3fygp2zmvVL9enWqvrERAp5sexNowbsscCKZbIdZiKU,19372
10
+ eb_model/parser/__init__.py,sha256=aQxwzw9OSziRSoZERED_vDxUUGU5GG0yhwMn14ugACw,82
11
11
  eb_model/parser/eb_parser.py,sha256=H5NTDdM0DaGiHsZ6VjaA1pKla5mDePmTDp1jjbeFAbE,7057
12
12
  eb_model/parser/eb_parser_factory.py,sha256=zqsqq52uImU4-WcS5dvHfhM95hiEPAGRtNzVik8i8wc,971
13
- eb_model/parser/os_xdm_parser.py,sha256=rczz4YjDzCqNhOb4xAlGLfmWhIMBT9fQ6tSDmIk9kRs,8405
14
- eb_model/parser/rte_xdm_parser.py,sha256=VbzrowPLpSww8E-Zl--aKTJ9ltHaZ9-wlVGL1nF79FE,4029
13
+ eb_model/parser/os_xdm_parser.py,sha256=5qF8LouRHjA95YjpXtJwa7s2Vm1eIwvp49FMwc4oacs,9032
14
+ eb_model/parser/rte_xdm_parser.py,sha256=ywAJiBTgI2WifB-rSdoh6PWvRZ4hSSdy4hmdilSTfU0,4027
15
15
  eb_model/reporter/__init__.py,sha256=H8D_23UwJi1Ph6yjBfZhxWVbu9ci5_O4471gqXGiZCM,36
16
16
  eb_model/reporter/markdown.py,sha256=NhcJOFQ_BVbkgGe66uAT7KUPIchWU4kfVMtMLQtbK-w,1647
17
17
  eb_model/reporter/excel_reporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -37,9 +37,9 @@ py_eb_model/reporter/markdown.py,sha256=NhcJOFQ_BVbkgGe66uAT7KUPIchWU4kfVMtMLQtb
37
37
  py_eb_model/reporter/excel_reporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  py_eb_model/reporter/excel_reporter/abstract.py,sha256=BOuLhWwwTwqBzErtmwPrelB1iByMfZP9haFmg9ayFQw,1488
39
39
  py_eb_model/reporter/excel_reporter/os_xdm.py,sha256=WGMxK0PYxi9J5fUZ-EeiiM8NBpIg2WyxRsrN-gK37YE,1589
40
- py_eb_model-1.0.1.dist-info/LICENSE,sha256=I52rGS7W1IwAmYCUfqTpDaSHoFAdt7grcNiBhk-Z3eI,1088
41
- py_eb_model-1.0.1.dist-info/METADATA,sha256=9Z-Evx5Ti6je_cIEhCiwJeYSux4bHJb1ZW5GdCu9wK0,2400
42
- py_eb_model-1.0.1.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
43
- py_eb_model-1.0.1.dist-info/entry_points.txt,sha256=vC-sGaF_j37QgkuYsJooGZBN1jnHYWQC4jehliu37fY,119
44
- py_eb_model-1.0.1.dist-info/top_level.txt,sha256=DGBNh6YW_x4RF_UoLKW3cKqb2SLnmfuEIZlkTewR66A,9
45
- py_eb_model-1.0.1.dist-info/RECORD,,
40
+ py_eb_model-1.0.2.dist-info/LICENSE,sha256=I52rGS7W1IwAmYCUfqTpDaSHoFAdt7grcNiBhk-Z3eI,1088
41
+ py_eb_model-1.0.2.dist-info/METADATA,sha256=Fzh5KTLcGdBnJALQrNXQKEiw0Qv-iTlCLcw0Zz6u7NM,2460
42
+ py_eb_model-1.0.2.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
43
+ py_eb_model-1.0.2.dist-info/entry_points.txt,sha256=vC-sGaF_j37QgkuYsJooGZBN1jnHYWQC4jehliu37fY,119
44
+ py_eb_model-1.0.2.dist-info/top_level.txt,sha256=DGBNh6YW_x4RF_UoLKW3cKqb2SLnmfuEIZlkTewR66A,9
45
+ py_eb_model-1.0.2.dist-info/RECORD,,