winIDEA SDK
test_doc_an_trig_process_profiler_code.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_doc_an_trig_process_profiler_code():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 cfgCtrl = ic.CConfigurationController(connMgr)
16
17 traceCtrl = ic.CTraceController(connMgr, "example.trd", "w")
18 optCtrl = cfgCtrl.doc("example.trd")
19
20 # Prerequisite for obtaining profiler code configuration node,
21 # is to first select valid trigger and then valid process.
22 trigOptCtrl = cfgCtrl.doc_an_triggers(optCtrl)
23 if trigOptCtrl.size() == 0:
24 trigOptCtrl = trigOptCtrl.add()
25 else:
26 trigOptCtrl = trigOptCtrl.at(0)
27
28 procOptCtrl = cfgCtrl.doc_an_trig_processes(trigOptCtrl)
29 if procOptCtrl.size() == 0:
30 procOptCtrl = procOptCtrl.add()
31 else:
32 procOptCtrl = procOptCtrl.at(0)
33
34 codeOptCtrl = cfgCtrl.doc_an_trig_process_profiler_code(procOptCtrl)
35 url = codeOptCtrl.URL()
36 print(f"URL of the 'document' controller for file 'example.trd', "
37 f"process profiler code: {url}")
38
39 traceCtrl.close()
40
41
42if __name__ == "__main__":
43 test_doc_an_trig_process_profiler_code()