请教一下,我创建了6个钢板用entity表示,钢板的厚度有三种分别用1,2,3表示。在entity的自定义属性里面创建了thickness的属性定义为integer型分别给每个钢板厚度赋值。在分流运输时,创建了一个flow对象,后接三个buffer,编辑了一个method对象添加给flow的exit从而根据厚度对钢板进行分流,我写的method如下:
( z4 N) [+ H6 w1 M4 u:integer+ {& C( u& U! E! t0 }0 m8 N/ P; O
is
) \! r0 a4 _6 R1 U7 ~4 U. Fm :integer;Thickness :integer;
4 ^0 ~8 m4 F! A, \do( R. L3 H' R. s! p7 G
m=@.Thickness;
, R6 ?3 N4 T; I3 X- R4 X7 K) Eif m=1then
' W7 N+ w5 ~# G8 K& @- e/ p, |return 1;3 _: B5 e" \7 c( W
elseif m=2then L/ u! z, f5 Y; @- b2 ~
return 2;
; Y4 D' t0 G3 s& }7 `$ Lelse
% X* ]2 w4 q+ t$ Yreturn 3 ;
. S2 d* W* ~$ M; Q' gend;
2 G8 ]( i# U; @+ aend;只有读了entity1可以被运输到相应的Buffer上,再读entity2就说不识别Thickness了,我想不明白了,请大家有时间帮忙解惑一下,不甚感激 |