|
各位先進,我想要利用VisualTool來動態顯示tree內的變數值
; s+ t% C, _+ o4 ]/ T# T6 },例如Queue中objectinfo,可是objectinfo內有三個變數
* A3 D+ `* s, N,包括CurContent, MaxContent, AvgStaytime,我試過在
, G! B' V. C0 T% E3 I: AVisualTool內的text display中設定指令,但仍顯示數值0,沒有達到預期的等候線的等候量
) l$ |/ |9 N p) G) i3 utreenode current = ownerobject(c);1 }! B* h" q1 Q; D5 w1 ~
treenode textnode = parnode(1);
) O) Q6 ~9 l+ r w! `4 ]& h3 `: i/**Display Text*/, e* l7 h" R$ L y7 q
0 s: i2 `, ^# B/** \nText: */. ^3 X3 W' S5 w$ H, J4 t) I
string text = /**/"Hello"/**/;
2 l; N9 }# Q5 I dtreenode queuevar1 = node("/Queue2/objectinfo/CurContent", model());5 V/ S, d, Y3 z8 x; U& s+ U/ c
double curcontent = getnodenum(queuevar1);
+ _* M. s$ j* g% B1 V/ D
8 `. o" m P# k3 msetnodestr(textnode,numtostring(curcontent));
& O" G1 y; f8 S0 Y4 ~4 J8 B& ~" F3 F5 \
return 1;2 g9 {2 n) y, ^8 e* n
我知道以下指令可以顯示等候線量,但我仍想知道如何得到tree中的數值. s0 T# u) t+ W# S0 o" g0 q! i. @
double curcontent = getnodenum(queuevar1);$ ^. m% Q3 }9 y' c$ l% B0 K5 }9 N1 i
double zz = content(node("/Queue2",model()));
3 M- Q. M2 j; e; x! r. tsetnodestr(textnode,numtostring(zz)); |
|