在code editor模块 ,循环是不生效的吗?count0的结果始终为0' z5 b4 F7 A" |2 U* }
/**Custom Code*/4 f8 v8 [( l$ r5 P, Q, J! e; Z
Object current = param(1);
# y% G& t1 f; B' k9 U$ utreenode activity = param(2);
: Z) g( K+ T2 S. O1 b _* jToken token = param(3);% J& N) B4 L; a( f/ N5 ? z
Variant assignTo = param(4);) @ A6 u3 Z f; x: \
string labelName = param(5);
# u: L3 |& f7 T" o* ^; Q) ctreenode processFlow = ownerobject(activity);: p3 M: A$ m# M
% y7 X' g, }( D/ n7 L8 ^
double count0=0;double count1=0;- {' o& d8 q4 k' c& L
& N+ D& b% w% U0 H
- {; @. r; H U//本工序前暂存区
: j/ R, Z5 J2 R$ \
& |4 S# W. ^/ O( ifor (i = 0; i < Model.find("Plane5/1号暂存区").subnodes.length; i++) {
* ^9 v- I7 T6 j' t- I! A3 D
2 E: Z6 M6 W D0 y // 检查 type 属性是否为 3ded
1 p, f3 L+ X8 z4 \" p+ I6 P if (getlabel(Model.find("Plane5/1号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {
8 L. S6 y8 T3 A count0++;: y8 g/ `2 @+ R* t' Y
}
. z4 p. H, @! U- @" U7 B `" L}, M- h" k* V3 o) S
//上一工序前暂存区
1 k9 H- F3 z5 l* \5 L" V4 n; ~6 {1 N4 q1 p$ I( S" o
for (i = 0; i < Model.find("Plane5/2号暂存区").subnodes.length; i++) {
5 [$ ]% ?7 m$ Z/ ?' c' M
, M/ `# Q# o8 b+ S% Q9 O9 R2 ^ // 检查 type 属性是否为 3ded
" {, \' u6 N9 ~4 d5 A2 l if (getlabel(Model.find("Plane5/2号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {2 o' C2 C! G- ^: ~1 o
count1++;
7 H7 q# s" Q7 X) n1 t }
6 r$ O# c7 r, ?% ?: G}0 g0 Z6 j- ^5 X8 |
- p1 f: `7 B) {4 S
return count0;! ~6 W' i; q' k& \+ y M
- ?& E- Y% z- {
+ v/ Q v" }4 Z, _5 V! m/ e, w# ? |