Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.246

Navigation: Plugins > How-to guides

Scroll Prev Top Next More

Plugins SDK access

In this topic:

ItemPath argument for get_content method

Configuration

 

 

ItemPath argument for get_content method

This topic describes how to access plugin window's content via winIDEA SDK. To read a specific row from a plugin window, it is sometimes tedious to write the item's path by hand. To make it easier, winIDEA offers Python snippet generation using row’s context menu option Copy Python access snippet.

 

 

Configuration

number1

Open a plugin via View / <plugin>.

 

number2

Right-click on to open the context menu.

 

number3

Select option Copy Python access snippet.

plugin-sdk-access

 

This option generates 2 lines of code, that extract row’s content into local variable viewContent:

pluginCtrl = ic.CPluginController(connectionMgr, "[TC277TF] Aurix");
viewContent = pluginCtrl.get_content("RCU", "/SCU_RSTCON/SMU", ic.IntVector());

 

This snippet can then be used in a SDK script:

# Snippet from option Copy Python access snippet...
pluginCtrl = ic.CPluginController(connectionMgr, "[TC277TF] Aurix");
viewContent = pluginCtrl.get_content("RCU", "/SCU_RSTCON/SMU", ic.IntVector());

 
# print value from column Value
print(viewContent["/SCU_RSTCON/SMU"][viewContent["header"].index("Value")]);
# output:
# 0b10
 
# print all values
for k in viewContent.iterator():
print(k);
# output:
# ('/SCU_RSTCON/SMU', ('SMU', 'O:  6 S:  2', '0b10', 'An Application Reset is generated for this trigger'))
# ('header', ('Name', 'Address', 'Value', 'Details'))

Copyright © 2024 TASKING Germany GmbH