在code editor模块 ,循环是不生效的吗?count0的结果始终为0: ?0 X- E! W6 d6 S
/**Custom Code*/2 H# d5 a7 b- _" z/ ]
Object current = param(1);
, ~5 n1 s1 V7 E% y8 itreenode activity = param(2); v/ w8 S8 f6 c
Token token = param(3);
8 d# Y2 R- F) _ QVariant assignTo = param(4);, u/ o' T w7 v* h' O9 U" G
string labelName = param(5);
! B8 y C, V) B2 B8 `1 ftreenode processFlow = ownerobject(activity);
4 U6 O/ J5 B2 b8 n* p2 i) t1 v* | U0 B$ h
double count0=0;double count1=0;7 S" Z6 O0 Y7 v
! E3 {. K7 Y9 X- L4 d
. ?0 S% e) |) ~% i& n4 ?) d//本工序前暂存区$ U7 e: @: x4 C, c+ ~1 R* ~
# }' h/ z' I( J0 u; w/ r5 \3 G$ ffor (i = 0; i < Model.find("Plane5/1号暂存区").subnodes.length; i++) {; F7 S. r& l. h+ @% x
9 V4 q S. l6 c5 s- f. h- r' i/ [* I // 检查 type 属性是否为 3ded
8 r( |0 w$ \$ F; H1 @* [# _ if (getlabel(Model.find("Plane5/1号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {
5 ]3 g" H& f, l3 S, i9 ? count0++;
: M2 `2 @( b6 j/ z) ?; H) X0 d }
$ D& j$ e. }; F* @2 P& \- ?}, E( b& H! f- M3 t+ H
//上一工序前暂存区" Z& c. r: N$ V6 M
5 N. `9 S3 @- z; D# ifor (i = 0; i < Model.find("Plane5/2号暂存区").subnodes.length; i++) {9 t$ {/ c4 C, @
% z8 j5 g; C, ?2 u; V e+ @/ e- w // 检查 type 属性是否为 3ded, ]9 o$ l2 [$ K
if (getlabel(Model.find("Plane5/2号暂存区").subnodes[i],"type") == getlabel(current,"LastProduction")) {* [0 _1 T7 k9 L- u
count1++;# B: }/ l9 N s% p; {# l+ t- j/ e
}
1 h p/ A0 q/ ]2 n( i}
3 r8 q% c2 z1 J. Q' N& t1 `; l. G3 s1 P
return count0;
' `& m' S; Y% O5 S( J: b/ [- m$ y+ m4 m l
B& m: u9 m3 L3 g5 u% p |