winIDEA SDK
test_plugin_control.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_control():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 pluginCtrl = ic.CPluginController(connMgr, "[TC399XE.CPU0] TriCore")
16
17 print(f"Is view 'Counters' already opened: {pluginCtrl.is_open('Counters')}")
18 pluginCtrl.open("Counters")
19 print(f"\tOpened: {pluginCtrl.is_open('Counters')}")
20
21 print("Forcing values refresh...")
22 pluginCtrl.refresh("Counters")
23
24 # execute view specific command - reset
25 pluginCtrl.invoke('Counters',
26 "ResetCounters",
27 "")
28
29 print("Closing 'Counters' view.")
30 pluginCtrl.close("Counters")
31
32
33if __name__ == "__main__":
34 test_control()