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"""
6This script demonstrates the use of the CPluginController.
7Not all plugins are viable for such use.
8"""
9
10import isystem.connect as ic
11
12
13winidea_id = ''
14
15
16def main():
17 print('isystem.connect version: ' + ic.getModuleVersion())
18
19 connMgr = ic.ConnectionMgr()
20 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
21
22 # Plugin names can be found in the "View" dropdown menu.
23 pluginCtrl = ic.CPluginController(connMgr, "[TC399XE.CPU0] TriCore")
24
25 mpuViewName = "Counters"
26
27 # View names are the specific views (windows) that belong to a plugin.
28 if not pluginCtrl.is_open(mpuViewName):
29 pluginCtrl.open(mpuViewName)
30
31 pluginCtrl.refresh(mpuViewName)
32
33 viewContent = pluginCtrl.get_content(mpuViewName, "", ic.IntVector())
34 viewContentIter = viewContent.iterator()
35
36 for _ in range(viewContent.size()):
37 print(next(viewContentIter))
38
39 pluginCtrl.close(mpuViewName)
40
41 print("Example finished.")
42
43
44if __name__ == '__main__':
45 main()