winIDEA SDK
test_set_profiling_sections.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_setProfilingSections():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 ideCtrl = ic.CIDEController(connMgr)
16 profCtrl = ic.CProfilerController2(connMgr, "sdk_example.trd", "w")
17
18 print(f"Setting profiling sections:")
19 baseUrl = profCtrl.getDocumentOptionURL("Trigger.Items[0].Processes[0].Profiler")
20 profCtrl.setProfilingSections(0, True, False, True, False)
21 url = f"{baseUrl}.ProfileData"
22 print(f"\tProfile data: {ideCtrl.getOptionStr(url)}")
23 url = f"{baseUrl}.ProfileExec"
24 print(f"\tProfile code: {ideCtrl.getOptionStr(url)}")
25 url = f"{baseUrl}.ProfileOSObjects"
26 print(f"\tProfile OS objects: {ideCtrl.getOptionStr(url)}")
27 profCtrl.closeDiscard()
28
29
30if __name__ == "__main__":
31 test_setProfilingSections()