|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。) P! T t, I6 K6 x& U6 T
语句是这样的
+ s& k7 g( t) V6 Y! c7 ^& wis
: P4 H8 g- n& {5 M i:integer; |0 H: E/ X: ?* R
Res:string;- v" f3 h3 ] e( r+ m
obj:object; m1 O8 _- M) z5 P% ?, i3 P
do; s1 V( D, e! V* Z
if existsObject("Status") then
~9 `9 [# R$ U' p4 M( E8 { Status.deleteObject;
: ]9 w& y$ [4 \3 a( n9 o ~7 i end;
$ Q5 N/ I5 ~% a+ s1 |# ?8 W/ K for i:=1 to 10 loop
! \: B; M0 Y- [/ Q( n9 Q Res:=sprint("Store_",i);
. O/ `' _1 f: k( S* R5 Z if existsObject(Res) then @6 b' d- _6 J6 j0 D2 H
Obj:=str_to_obj(Res);9 q5 `6 U- ~8 D) S5 }
Obj.deleteObject;5 m5 R6 d; @& M+ q6 J
end;
3 }' I6 H* v$ o @0 a* j) A1 G; y next;; r# {! _9 l+ R* w# H2 E( D3 a
--shengcheng Status:zimoxingceng1 J, E- t, ]/ K3 _# v0 j$ r
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");. H0 D0 O C# G, L) n
Obj.Label:="warehouse status";. n$ z4 O* T2 D1 @' i
3 d7 J1 p! e: E1 y$ n% C
for i:=1 to WH_nums loop
. B0 k9 S, ]2 d1 F/ t7 T Res:=sprint("Store_",i);" F, b) W* s; M
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
& O- V4 V4 M. c% G Obj.Label:=sprint("huojiaceng:",i);
( a- ?, h3 c% i& {- K* X' m5 X( g! @ Obj.xDim:=WH_x;" H- m" r+ E* ~: \# s x. J, J
Obj.yDim:=WH_y;7 p' ], l @ {# t% ]$ a8 T
Res:=sprint("StoreData_",i);
; ]0 p3 x0 k w3 C' C( s 2 D8 X. H4 F9 y. p. E5 b
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);; ]4 |7 D) W* F& f
Obj.Label:=sprint("huojiaceng:",i);. J2 e, e2 ^$ s5 _4 Q+ Q" ? a" L
Obj.inheritFormat:=false;
2 a2 N4 m# `* |! I Obj.maxxDim:=WH_x;! t+ w9 \4 r& H( P8 J
Obj.maxyDim:=WH_y;
. _- a9 s) C, p1 c+ Q9 |) {3 r" \ Obj.ColumnWidth:=3;+ }) f, F6 I+ f
next;3 a! C0 h$ J: _, A
* x5 N% a5 t. A1 P& R4 C
.Delivery.MUs.Forklift.speed:=2;2 c3 L% ~8 ~- a+ F, e& }
WH_var.delete({1,Part_Nums+1}..{*,*});& a. R: \" h( G% f4 _
for i:=1 to Part_Nums loop9 @# S0 a% ~4 f
WH_var[1,i]:=chr(64+i);" p( R) `: r _$ G! @/ w/ g
next;$ Q J/ E6 t: B$ @2 O! G) l" M
end;+ `& s6 h g ], g; d' X6 d# s
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
. \$ K/ d* i% Z
& G4 c9 `3 ?* w$ I v0 j& ]; g |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|