|
|
本帖最后由 zorsite 于 2022-10-28 14:14 编辑 : d/ b% g. n/ J/ r
" [: p6 j/ R& T" g( W
Flexsim可以通过isclasstype函数判断实体类型。
( e: T6 c# L* misclasstype (obj object, num/str classtype)
3 ?2 I: T/ X. i) A* L
9 _6 ?( Z$ r+ [) }/ Y( i" ^8 J# GCompares the object to classtype, returns 1 for yes, 0 for no6 f- R; j3 U I7 g/ |- i/ W. t
Description- p8 L5 l. \9 `* R/ T% Y" }$ _
Returns whether or not the object is of the given classtype. 1 means yes, 0 means no. Possible classtype parameters are:* `" w% {# ^4 m/ @
CLASSTYPE_FLEXSIMOBJECT
- k$ ?: x Q, M* LCLASSTYPE_FIXEDRESOURCE
" ]9 j- n; M/ h$ n, j8 }! }CLASSTYPE_TASKEXECUTER
3 c$ J+ Q# B' m9 q. OCLASSTYPE_NETWORKNODE7 H1 H, {/ P; t8 R1 S2 A
etc./ p, G- b: \9 }/ b Z) ?
8 |8 h" w; U" V. B
Example
; L& Y$ e8 v1 fisclasstype(current, CLASSTYPE_DISPATCHER);/ C' h H) _9 }$ ]+ w v& h+ ]
6 j5 p/ j2 {4 L- S
+ U+ q7 I* l: t8 V) ?' f2 Q( N i$ t! S4 D. e0 J
Flexism有以下实体类型:; T4 h* M: K: y+ t% a
- isclasstype(current,CLASSTYPE_CONVEYOR);; m6 S' E' {. ?" _" N: e% d
- isclasstype(current,CLASSTYPE_DISPATCHER);, d% j) D$ S; c' J3 @
- isclasstype(current,CLASSTYPE_FIXEDRESOURCE);
) l) P6 g' k4 t e' z& N - isclasstype(current,CLASSTYPE_FLEXSIMEVENTHANDLER);' O9 d3 n+ ?5 I& q2 S* k
- isclasstype(current,CLASSTYPE_FLEXSIMOBJECT);
+ J8 ]" Z4 S+ x - isclasstype(current,CLASSTYPE_FLUIDOBJECT);2 L# O, ^8 X# ]0 [7 P% g% T
- isclasstype(current,CLASSTYPE_FLUIDOBJECT2);3 W3 L/ Y% \) q6 o' q
- isclasstype(current,CLASSTYPE_LINECONTROLLER);/ V8 ^+ N/ Z4 [. J
- isclasstype(current,CLASSTYPE_MERGESORT);2 J5 P0 q' k- }% N2 k E
- isclasstype(current,CLASSTYPE_MTBFMTTR);
" Z- [9 z* h% b, i9 o2 j: ~ - isclasstype(current,CLASSTYPE_NAVIGATOR);
& d% d! j( _8 `" z - isclasstype(current,CLASSTYPE_NETWORKNODE);
# t( c2 P2 w6 {5 W" o+ u) \ - isclasstype(current,CLASSTYPE_ODT);
' w. Q+ A5 R! ^" y6 V8 ^- P - isclasstype(current,CLASSTYPE_OWNERDRAWN);* Q$ z& ?& K- K9 Q: m R6 \
- isclasstype(current,CLASSTYPE_PROCESSOR);. b! ?- p' j2 J" r1 C$ N* m
- isclasstype(current,CLASSTYPE_SYSTEMCONTROLLER);. n+ H/ t x% Y
- isclasstype(current,CLASSTYPE_TASKEXECUTER);9 ^, v& E$ q" Y# F; `+ t( s
- isclasstype(current,CLASSTYPE_TRAFFICCONTROLLER);
" p# i& ^; S6 U - isclasstype(current,CLASSTYPE_VISUALTOOL);( Y. A+ d* F, l* r: z0 q( e( ]
- isclasstype(current,CLASSTYPE_WANTCONNECTLOGIC);
复制代码 ' b% X# R0 `6 b. c
& i+ z4 u) a9 T# E5 ^0 f5 o4 G A
isclasstype 的第2个参数应该是数字或文本,正常情况下函数应该写作:- isclasstype(current,"Processor");
复制代码 或者
+ p5 [! K, B2 h9 w
* \' m" W2 V7 H/ U在代码中使用数字不便于理解代码,使用文本时需要注意大小写,而且需要加引号,也常会出现拼写错误。
) r. b) \4 c( s# fFlexsim将常用实体类型设置为常量,可以在代码中直接引用,不仅可以自动补全,也便于代码的阅读和理解。; _. a* [1 x; j9 m' g( ~# m
, |# Q% `4 B5 ]7 \- M; `( E+ M$ o# D$ u& t& L
5 L& F9 ~7 B& N) |9 T5 V0 b5 m9 u
|
|