winIDEA SDK
test_exports.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import os
6
7import isystem.connect as ic
8
9winidea_id = ''
10
11
12EXAMPLE_TRD_FILE_NAME = "sdk_example.trd"
13
14
15def test_exports():
16 connMgr = ic.ConnectionMgr()
17 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
18
19 profCtrl = ic.CProfilerController2(connMgr, EXAMPLE_TRD_FILE_NAME, "u")
20 profCtrl.waitUntilLoaded(5000, isThrow=True)
21
22 FILE_NAME = "exportCfg.txt"
23 wksFolderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
24 exportFilePath = os.path.join(wksFolderPath, FILE_NAME)
25
26 exportCfg = ic.CProfilerExportConfig()
27 exportCfg.setFileName(FILE_NAME)
28 profCtrl.exportData(exportCfg)
29 print(f"Exported file path: {exportFilePath}")
30 profCtrl.close()
31
32
33if __name__ == "__main__":
34 test_exports()