winIDEA SDK
test_evaluate_composite.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_evaluateComposite():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 dataCtrl2 = ic.CDataController2(connMgr)
16
17 print("Evaluating complex composite variable 'g_complexStruct'...")
18 data = dataCtrl2.evaluateComposite(ic.IConnectDebug.fRealTime,
19 "g_complexStruct",
20 True,
21 1)
22
23 children = ic.VectorDataComposite()
24 data.getChildren(children)
25 print(f"Children ({len(children)}):")
26 for childrenData in children:
27 childrenData: ic.CDataComposite
28 var = childrenData.getVariable()
29 var: ic.CVariable
30 print(f"\tVariable name: {var.getName()}")
31 print(f"\tQualified name: {var.getQualifiedName()}")
32 print(f"\tValue: {childrenData.getValue().getResult()}")
33 print(f"\tType: {var.getType()}")
34 print(f"\tArray dimension: {var.getArrayDimension()}")
35 print(f"\tScope: {var.getScope()}")
36 print(f"\tSize: {var.getSize()}")
37 print()
38
39
40if __name__ == "__main__":
41 test_evaluateComposite()