|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
7 [7 V2 j3 Q5 }; l3 G语句是这样的& q+ l; t' G3 d! N8 e
is- I* B( b. H+ e0 T8 K: B
i:integer;
9 w0 {# |' r' U# U- n {1 `) \8 _ Res:string;
6 C6 d8 ]! U2 k3 D# V! b8 m obj:object;
) p& [1 ?6 O# h7 L' ]% |6 _do
) Y( ~" B7 E* V! Z* j9 F if existsObject("Status") then/ D; C0 ]3 Q) T% `* r: u. U. ~
Status.deleteObject;
' N/ b# S3 s3 `5 n( W# _ end;
/ T. t- N# D+ x# Q1 W for i:=1 to 10 loop' K0 W; M8 |# v! v; J# B
Res:=sprint("Store_",i);
! i3 o1 c' J, v" K6 W& O' s if existsObject(Res) then
0 S, T0 A/ b- o; o. v Obj:=str_to_obj(Res);4 n" d" A) E; T/ G' P( z7 ], g1 a
Obj.deleteObject;
0 W! v& _3 x; ~9 C end; Z% N* G5 u0 V' L) d |% ]
next;
, H4 B9 `; u/ B+ N --shengcheng Status:zimoxingceng
1 n6 ~1 [$ @" Q( c/ F Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");4 x( M6 v' S9 y* I8 a+ G9 w
Obj.Label:="warehouse status";
7 q4 B g h0 A$ E" O& M , \! E! z% W' o5 d x$ x0 ?7 P
for i:=1 to WH_nums loop- c& o& N6 e2 l! X4 z
Res:=sprint("Store_",i);; \8 m% M( G# Z) n& W4 d
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);+ l4 X: q3 Q, w: S- t1 T
Obj.Label:=sprint("huojiaceng:",i);
8 t" c" K; N" ^" P2 I6 a Obj.xDim:=WH_x;7 [8 M4 Z ?1 G8 r
Obj.yDim:=WH_y;
3 q9 N b( s2 V: r& ` Res:=sprint("StoreData_",i);
3 F3 n2 J( U% ^3 X; o6 o 2 w/ O/ d9 J/ [9 s
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
+ {9 i9 K$ r# h/ ^8 U- b% f o# v Obj.Label:=sprint("huojiaceng:",i);
# b7 b' ]- Z/ @& p Obj.inheritFormat:=false;: y5 j7 d) X, r) ]! H
Obj.maxxDim:=WH_x;
7 h$ }5 t& P5 D" P0 c; @- m Obj.maxyDim:=WH_y;
/ q6 N9 I; [% j& W0 j" n) F" s/ ` Obj.ColumnWidth:=3;
7 A- y0 X/ T; J. n next;
& q! D& m- V5 e. N- g 9 P" a5 C8 H, S5 K' d8 `
.Delivery.MUs.Forklift.speed:=2;' x; b+ t9 W: q# r0 {' L; m
WH_var.delete({1,Part_Nums+1}..{*,*});
8 o+ [' x0 F7 Z* G5 \ for i:=1 to Part_Nums loop, Y3 ]+ k( q4 J5 i0 ]4 S9 o
WH_var[1,i]:=chr(64+i);
0 w, O: O3 O) C C& y+ S9 H next;8 E* R( ^2 C+ P3 f9 r+ k: }3 y
end;/ z3 M& g V I1 b# n
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 4 H1 ^. t$ ^* P0 L, E7 A3 ?8 M
6 R3 {* r1 r+ u8 X! I
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|