|
各位先進,我想要利用VisualTool來動態顯示tree內的變數值 K. p8 u4 v- S; a5 J
,例如Queue中objectinfo,可是objectinfo內有三個變數; Z6 w9 y5 h( u |
,包括CurContent, MaxContent, AvgStaytime,我試過在
/ E/ g" I% g6 y( B2 IVisualTool內的text display中設定指令,但仍顯示數值0,沒有達到預期的等候線的等候量/ V" w" G# j! ]4 k
treenode current = ownerobject(c);) S. l7 Z( ^% y6 U% {4 C/ O* {2 L( Q
treenode textnode = parnode(1);) Y- d+ H) i; c# j, h
/**Display Text*/
0 }$ {' R3 K5 Q* s0 L, b
: o( j! _7 K! \/** \nText: */
2 U* q4 _: S! b7 N2 A2 g) rstring text = /**/"Hello"/**/;
/ Q. I! P) }7 i4 v; Rtreenode queuevar1 = node("/Queue2/objectinfo/CurContent", model());4 F5 x9 c2 p+ E3 o3 b0 [+ P
double curcontent = getnodenum(queuevar1);. j) S$ c# W! I- \7 C" z
- l/ ~" t* B W7 j
setnodestr(textnode,numtostring(curcontent));- [. h1 L0 i6 Y6 w& b
2 a! G7 s! H: ?: I+ y0 Hreturn 1;
+ [; l$ R$ @- Q5 ^' d0 g) d6 J7 `我知道以下指令可以顯示等候線量,但我仍想知道如何得到tree中的數值1 Z( x6 Q% ~$ W
double curcontent = getnodenum(queuevar1);
9 T2 ? {+ C4 j! s, fdouble zz = content(node("/Queue2",model()));
3 y& T2 q# j- u9 n/ x8 s: ~setnodestr(textnode,numtostring(zz)); |
|