winIDEA SDK
test_get_set_session_duration.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
7winidea_id = ''
8
9
10EXAMPLE_TRD_FILE_NAME = "sdk_example.trd"
11
12
13def test_getSetSessionDuration():
14 connMgr = ic.ConnectionMgr()
15 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
16
17 profCtrl = ic.CProfilerController2(connMgr, EXAMPLE_TRD_FILE_NAME, "u")
18 profCtrl.waitUntilLoaded(5000, isThrow=True)
19
20 print("Setting session duration of trigger with index 0 to 100 ms:")
21 profCtrl.setSessionDuration(0, 100)
22
23 if profCtrl.getSessionDuration(0) == 100:
24 print("\tSuccess.")
25 else:
26 print(f"\tError, actual session duration: {profCtrl.getSessionDuration(0)} ms")
27 profCtrl.close()
28
29
30if __name__ == "__main__":
31 test_getSetSessionDuration()