|
|
各位先進,我想要利用VisualTool來動態顯示tree內的變數值
,例如Queue中objectinfo,可是objectinfo內有三個變數
,包括CurContent, MaxContent, AvgStaytime,我試過在
VisualTool內的text display中設定指令,但仍顯示數值0,沒有達到預期的等候線的等候量
treenode current = ownerobject(c);
treenode textnode = parnode(1);
/**Display Text*/
/** \nText: */
string text = /**/"Hello"/**/;
treenode queuevar1 = node("/Queue2/objectinfo/CurContent", model());
double curcontent = getnodenum(queuevar1);
setnodestr(textnode,numtostring(curcontent));
return 1;
我知道以下指令可以顯示等候線量,但我仍想知道如何得到tree中的數值
double curcontent = getnodenum(queuevar1);
double zz = content(node("/Queue2",model()));
setnodestr(textnode,numtostring(zz)); |
|