|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。1 \6 u; z1 Z" |( `+ F
语句是这样的
0 e! y( `; R7 |' q) u# c/ Uis. E0 T& N5 Y" t) t% w: N
i:integer;' }/ j7 \5 u8 ?% M, M! @: `
Res:string;; h( I! G& U# ]& E ]' e8 N- D
obj:object;5 ]# K9 r4 H. j, U0 o R- E# |& |
do3 _6 G: L0 u1 y/ u4 [
if existsObject("Status") then
" ?4 G4 {3 ?% H0 K) k( l, R Status.deleteObject;
% i( T$ d d0 [; y+ u# e end;
0 ~; u& S O3 S8 w1 H- I' h# {5 J for i:=1 to 10 loop
9 D6 {! d9 N- M( N( { Res:=sprint("Store_",i);
! h; j$ D2 g+ j4 ~8 w' K2 j if existsObject(Res) then: |' O* }8 I4 ~* Z* G% p& _
Obj:=str_to_obj(Res);
/ s w( s3 O( u1 N# `6 \ Obj.deleteObject;
2 G% h4 B5 S/ C) j1 c, ? end;
4 \ C7 P6 _. T( R) M) E( ] next;
( r% O ^0 x5 Y7 X6 |0 q3 ` --shengcheng Status:zimoxingceng
$ B- |- f( O; Q: A/ j/ r Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
( Z$ J6 A2 i1 L& V1 ^* n9 l Obj.Label:="warehouse status";7 p. F' y7 \2 O& X& g
p+ \4 v0 d" z$ R' W
for i:=1 to WH_nums loop
8 N% s- O$ a. ^+ f6 a7 b( \ Res:=sprint("Store_",i);
8 M/ A0 Y' ]( R! l( k Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);: T" U8 j7 ?# g1 I7 d/ M) f
Obj.Label:=sprint("huojiaceng:",i);
( A/ K, P3 g- y% p: t3 l1 C$ X* G i Obj.xDim:=WH_x;
+ L0 @$ `+ z/ ~: j" ? Obj.yDim:=WH_y;1 C- `* u5 t/ H7 m# X1 g
Res:=sprint("StoreData_",i);
& t4 m2 r1 R! v: V1 Z/ H $ C- @. i0 y1 u# w6 B/ f( d) ]
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);" v" B( R) \9 [. f4 ]
Obj.Label:=sprint("huojiaceng:",i);8 h% g# n* j; Q# E6 V
Obj.inheritFormat:=false;
$ c9 K) U4 O- x7 M& N Obj.maxxDim:=WH_x;
2 R- p3 q% Q/ ^5 }+ s7 B2 e Obj.maxyDim:=WH_y;3 e, C0 e7 N; {. V% _
Obj.ColumnWidth:=3;0 t6 v: d5 X/ S( s, T7 o; u
next;
* ]" Z) O* ~7 a: N
9 r/ \: K" z! k( v1 f* H* J3 D9 c .Delivery.MUs.Forklift.speed:=2;) s2 a6 _; B2 o# L/ u$ Q* b2 ^
WH_var.delete({1,Part_Nums+1}..{*,*});
' P7 J! d5 A4 K for i:=1 to Part_Nums loop
$ Y# i7 R" b0 Y WH_var[1,i]:=chr(64+i);
- {: Z/ s# c, \ a- M next;) m6 k* D* {. d! K
end;
) o. T1 Z4 u9 g( A) [+ v: g出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
' @$ y0 N- W+ @- @. M8 D, t: d
0 x" M& h1 {3 ~) F |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|