|
各位先進,我想要利用VisualTool來動態顯示tree內的變數值/ v; k9 H: K. f$ B/ D
,例如Queue中objectinfo,可是objectinfo內有三個變數8 P3 J8 A' P( S; I; G2 X3 I
,包括CurContent, MaxContent, AvgStaytime,我試過在
2 u8 `. C) |/ W3 MVisualTool內的text display中設定指令,但仍顯示數值0,沒有達到預期的等候線的等候量( B1 q7 H7 d7 p
treenode current = ownerobject(c);
5 A# N! J4 j \+ y/ R1 i' qtreenode textnode = parnode(1);
1 ?" \* T- z8 ]" v! |& Y/**Display Text*/
$ S0 e& k5 c! q1 N7 f+ s \5 A7 C: [$ c2 n( R& c4 y/ a
/** \nText: */
) U, x3 N; E9 g& F+ U7 hstring text = /**/"Hello"/**/;
+ ~4 N+ |" `1 Ltreenode queuevar1 = node("/Queue2/objectinfo/CurContent", model());
4 I# v5 ]. z& E+ D! C8 T% Wdouble curcontent = getnodenum(queuevar1);
: G" R3 d- u: K; {
' w$ @# f5 x6 \& f3 b" i3 Q% W7 xsetnodestr(textnode,numtostring(curcontent));
9 W: }; B+ Z; L, p0 o' y- Y8 V$ T
; F+ K2 h( Y* ~return 1;
9 u9 f: ]- ~. z# }; z' v ]5 t我知道以下指令可以顯示等候線量,但我仍想知道如何得到tree中的數值8 y! l* d6 g f7 I* ~- S
double curcontent = getnodenum(queuevar1);
5 Y+ h+ r7 L* K2 Rdouble zz = content(node("/Queue2",model()));
- |6 J" k, I" E3 p( n% ^* tsetnodestr(textnode,numtostring(zz)); |
|