在code editor模块 ,循环是不生效的吗?count0的结果始终为05 g8 [. Y N: \$ P/ g% S' T, y
/**Custom Code*/
" t L2 R, H8 c$ m8 oObject current = param(1);6 C/ M+ e+ p; z/ z! ^! Q. r
treenode activity = param(2);0 y/ M u4 p. V$ c8 m
Token token = param(3);
2 w* Y5 F5 V/ O& eVariant assignTo = param(4);
' n9 W h: _( q; A r: Ostring labelName = param(5);
( ]8 `0 I* E: K5 |% Dtreenode processFlow = ownerobject(activity);
& y- X( ~% N; ~: o( y" \
. _) o4 R7 C# y+ [1 Hdouble count0=0;double count1=0;0 X+ l ^; b& d) Y
9 I1 [" k5 p& h
8 p7 X: y4 C" M# R5 Y8 ^+ C8 @//本工序前暂存区- k% B& J2 J% _0 V: K2 J i5 `8 T
1 X+ l$ p+ P3 d( V
for (i = 0; i < Model.find("Plane5/1号暂存区").subnodes.length; i++) {! N, @& J9 H9 X8 {5 s- w
8 t$ ?, [0 P0 Z7 Z& I4 d
// 检查 type 属性是否为 3ded
: d& L5 |9 b" D" Y; Z% n if (getlabel(Model.find("Plane5/1号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {7 t' s( h3 i) a4 i5 d
count0++;
9 o* `% _# v- c% I9 E0 Q, I: d }0 O1 Z0 m5 S7 b! _ u
}* P$ H4 ?6 Z, X0 a2 |/ m. o8 I# t
//上一工序前暂存区
( S" M( w; U' T# p* C
9 { ?9 Q8 ~9 [$ A" |: Ufor (i = 0; i < Model.find("Plane5/2号暂存区").subnodes.length; i++) {8 m2 i+ ]: k; B
2 u; _& R# A5 ]4 {0 g! \ // 检查 type 属性是否为 3ded
3 ?4 r1 n. H0 u8 F# j5 H if (getlabel(Model.find("Plane5/2号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {
6 S. I) v Y3 _ count1++;
2 x F: c" G# a( C- | }9 k+ H. [ ~$ N9 w. p5 V
}
3 q- U9 [! G' \1 g7 O' C+ [, x1 A" b6 q2 ]8 T) ]- T$ B& h
return count0;
: v/ |, I+ I; _& H- Z$ t; {8 ^+ M& e7 u# t! `
1 l! v8 o' ?/ k2 \ [ |