|
本帖最后由 zorsite 于 2022-10-28 14:14 编辑
' e, a, P2 ], z1 r1 |, n: \% ^" @0 a
Flexsim可以通过isclasstype函数判断实体类型。
$ | } V4 A3 x; X" H$ uisclasstype (obj object, num/str classtype)
! V5 h1 G1 j% z
" W" _, s g7 b) s' XCompares the object to classtype, returns 1 for yes, 0 for no
. u( n* e! z5 n) ODescription% {" i! ~( \& v' x
Returns whether or not the object is of the given classtype. 1 means yes, 0 means no. Possible classtype parameters are:
) d. L6 ]: N2 W2 z8 s6 S( u' kCLASSTYPE_FLEXSIMOBJECT |, e9 s- O. N% L; L3 b
CLASSTYPE_FIXEDRESOURCE0 f# ]7 {! H, S& }9 u0 m
CLASSTYPE_TASKEXECUTER# f- n1 w5 r' D' x
CLASSTYPE_NETWORKNODE, f: B1 y9 _$ C
etc.- f* a0 l3 Q* e x$ `' g0 h' e
& N* B. r% W! b* q' R
Example
8 b8 }( y1 r( g! z5 Yisclasstype(current, CLASSTYPE_DISPATCHER);/ y0 d! O6 p6 ^9 ^+ p
! R' I s% v# P8 l+ @& V
. x: z4 d* `7 R- {5 e
% P8 ^8 [) e2 bFlexism有以下实体类型:
% H# }0 f P! D7 n& i0 Z! X- isclasstype(current,CLASSTYPE_CONVEYOR);# j0 f1 E$ z* O. J/ G" u
- isclasstype(current,CLASSTYPE_DISPATCHER);
. ~; D5 m6 C, c: u" @ - isclasstype(current,CLASSTYPE_FIXEDRESOURCE);5 h3 t* s; `5 K+ A
- isclasstype(current,CLASSTYPE_FLEXSIMEVENTHANDLER);: O' u: z4 W4 z' u$ P( D
- isclasstype(current,CLASSTYPE_FLEXSIMOBJECT);: i" S0 l8 n; b$ Q O
- isclasstype(current,CLASSTYPE_FLUIDOBJECT);
; x1 b; m5 U; K8 ? - isclasstype(current,CLASSTYPE_FLUIDOBJECT2);
1 z5 t* d1 v; o) q9 `( f ` - isclasstype(current,CLASSTYPE_LINECONTROLLER);1 i- t) c4 Y ^ j' G& q) w
- isclasstype(current,CLASSTYPE_MERGESORT);8 R7 f; v$ }8 Q" O/ J! t# Y! S* T
- isclasstype(current,CLASSTYPE_MTBFMTTR);
' V3 b& n" [" I4 K1 L - isclasstype(current,CLASSTYPE_NAVIGATOR);
* k' `! B* m' E. N' A. W - isclasstype(current,CLASSTYPE_NETWORKNODE);
% Z' o( ?/ M2 E - isclasstype(current,CLASSTYPE_ODT);1 k0 a# ~, r& Z* I& [ J) e) P
- isclasstype(current,CLASSTYPE_OWNERDRAWN);# S2 A/ x/ w/ j. Z3 X) N6 X* I
- isclasstype(current,CLASSTYPE_PROCESSOR);, ]+ [; \; |- G) n! N) W' q, j
- isclasstype(current,CLASSTYPE_SYSTEMCONTROLLER);
~% G0 e) O0 f - isclasstype(current,CLASSTYPE_TASKEXECUTER);
. |1 Y2 q0 t4 q* @ - isclasstype(current,CLASSTYPE_TRAFFICCONTROLLER);
6 @; n7 g2 d& A! E: L# ?7 k - isclasstype(current,CLASSTYPE_VISUALTOOL);/ K& ]# o a1 s3 ^
- isclasstype(current,CLASSTYPE_WANTCONNECTLOGIC);
复制代码 & c: M& Y& j; ^+ u7 {+ J& A
% n2 x, S# l/ Z
isclasstype 的第2个参数应该是数字或文本,正常情况下函数应该写作:- isclasstype(current,"Processor");
复制代码 或者/ I2 E) ~ M1 @( c0 Z+ R
& W; `* m6 B4 F9 z8 E/ M( o在代码中使用数字不便于理解代码,使用文本时需要注意大小写,而且需要加引号,也常会出现拼写错误。
/ p0 P1 A1 V0 q0 a Y+ C$ bFlexsim将常用实体类型设置为常量,可以在代码中直接引用,不仅可以自动补全,也便于代码的阅读和理解。
m$ j' Z, B% F, n. P/ g
) Z; M! [7 x! J" m9 M# u6 C z& l+ t8 E! X
5 ~ m5 x( Y: ?+ R: f/ G |
|