winIDEA SDK
plugin_controller.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5"""
6TODO_MK: Move loop, which iterates viewContent to test_get_content.py. Try
7to make it more Pythonic-like. Then delete this file.
8
9This script demonstrates the use of the CPluginController.
10Not all plugins are viable for such use.
11"""
12
13import isystem.connect as ic
14
15
16winidea_id = ''
17
18
19def main():
20 print('isystem.connect version: ' + ic.getModuleVersion())
21
22 connMgr = ic.ConnectionMgr()
23 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
24
25 # Plugin names can be found in the "View" dropdown menu.
26 pluginCtrl = ic.CPluginController(connMgr, "[TC399XE.CPU0] TriCore")
27
28 mpuViewName = "Counters"
29
30 # View names are the specific views (windows) that belong to a plugin.
31 if not pluginCtrl.is_open(mpuViewName):
32 pluginCtrl.open(mpuViewName)
33
34 pluginCtrl.refresh(mpuViewName)
35
36 viewContent = pluginCtrl.get_content(mpuViewName, "", ic.IntVector())
37 viewContentIter = viewContent.iterator()
38
39 for _ in range(viewContent.size()):
40 print(next(viewContentIter))
41
42 pluginCtrl.close(mpuViewName)
43
44 print("Example finished.")
45
46
47if __name__ == '__main__':
48 main()