winIDEA SDK
test_execution_control.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
9
10winidea_id = ''
11
12
13def test_executionControl():
14 connMgr = ic.ConnectionMgr()
15 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
16
17 trdFilePath = "example.trd"
18 covCtrl = ic.CCoverageController2(connMgr, trdFilePath, "u")
19 covCtrl.waitUntilLoaded(5000, isThrow=True)
20
21 covCtrl.abort()
22 print("Loading of a really large file can be interrupted with '.abort()' method.")
23 print("\tDoes not really have effect here, since we have created a new empty document.")
24
25 covCtrl.start()
26 print(f"Analyzer started: {covCtrl.isActive()}")
27 print(f"Data acquisition in progress, analyzer is busy: {covCtrl.isBusy()}")
28
29 covCtrl.stopSampling()
30 print(f"Data acquisition stopped.")
31
32 covCtrl.stopUploading()
33 print(f"Uploading data to PC forcibly stopped.")
34
35 covCtrl.stopAnalyzing()
36 print(f"Data analysis forcibly stopped.")
37
38 covCtrl.resume()
39 print(f"Analyzer resumed: {covCtrl.isActive()}")
40 covCtrl.stop()
41
42 status = covCtrl.waitUntilLoaded(2000)
43 print(f"All analyzer data is loaded: {status}")
44
45 covCtrl.start1()
46 print(f"Analyzer can be reconfigured and restarted for post analysis.")
47 covCtrl.stop()
48
49 covCtrl.setDirty(True)
50 print(f"Analyzer document state set to 'dirty'.")
51
52 covCtrl.stopLoadingOrSaving()
53 covCtrl.closeAll()
54
55
56if __name__ == "__main__":
57 test_executionControl()