在code editor模块 ,循环是不生效的吗?count0的结果始终为0
) T1 n7 b" j: \5 I* `/**Custom Code*/
; B0 R: G1 i+ m- M2 CObject current = param(1);! S5 U- u$ l+ X
treenode activity = param(2);- v+ O$ x+ m# a7 ?* i8 Y
Token token = param(3);
6 ^9 o' Q j$ G2 u& w( WVariant assignTo = param(4);* p+ E; X$ a* w% ^6 U
string labelName = param(5);# r# @5 @( h2 ?- n6 d" y! a \
treenode processFlow = ownerobject(activity);
9 [3 N0 Z6 W7 O7 z W
9 A; w# i7 r% Z1 W q( vdouble count0=0;double count1=0;3 d( ~! w+ @- \
8 w# ~1 ?! i. @6 ]2 ^
, I* u2 B. f8 f* Y3 h. O//本工序前暂存区
3 {* E4 U; {: x* U
; X4 T- W. i8 n& p; T5 Ffor (i = 0; i < Model.find("Plane5/1号暂存区").subnodes.length; i++) {* l/ Z6 c- D; Y% d4 S1 M4 O
$ ?' ^$ _+ f- l# Q7 M( ~* \
// 检查 type 属性是否为 3ded
* }, O. v* T: a7 m% m if (getlabel(Model.find("Plane5/1号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {
* k3 y R: l& n5 j) T+ | count0++;5 f n; z) q8 H- I. s2 Q
}
6 r/ m! f" t' E* ^ `}3 g% Z9 U, T( h1 z* r1 t. V2 M
//上一工序前暂存区
3 ?; y3 ~" h8 b7 g' n( p: K- W
4 p l8 J0 h# g. _! D" N H& Ifor (i = 0; i < Model.find("Plane5/2号暂存区").subnodes.length; i++) {
0 I0 s! C- _; X3 g, o4 ^6 |9 ]6 y# ^! ~" `- r
// 检查 type 属性是否为 3ded
1 n7 D6 B4 y: T if (getlabel(Model.find("Plane5/2号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {
I: ?0 B* t0 m, Q0 i2 T6 _ count1++;
3 |; i. B) Y4 b' l% p }; _8 u+ X: w8 m5 Y/ b1 M
}, u7 g; G9 c8 n2 W$ j4 L8 @ O1 V
1 G6 P$ G, }4 q2 `$ Z& V' b m3 N6 oreturn count0;
1 o, G0 d7 N. {6 ?+ z1 m( t3 u0 p; d% O- c: B( z- l
" F9 D( f: b, n6 V9 F% {9 X' l# A |