import os
import isystem.connect as ic
winidea_id = ''
EXAMPLE_TRD_FILE_NAME = "sdk_example.trd"
def test_exports():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
profCtrl = ic.CProfilerController2(connMgr, EXAMPLE_TRD_FILE_NAME, "u")
profCtrl.waitUntilLoaded(5000, isThrow=True)
FILE_NAME = "exportCfg.txt"
wksFolderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
exportFilePath = os.path.join(wksFolderPath, FILE_NAME)
exportCfg = ic.CProfilerExportConfig()
exportCfg.setFileName(FILE_NAME)
profCtrl.exportData(exportCfg)
print(f"Exported file path: {exportFilePath}")
profCtrl.close()
if __name__ == "__main__":
test_exports()