|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。! [# G; B6 J% g, z6 V
语句是这样的) G. n% F8 W5 @4 i: R: _9 T
is
$ t) _. {- k8 A6 l i:integer;7 I8 K" V1 K* ?" E6 {3 Y
Res:string;
2 j& q; Q0 g2 k( ]# S% G: A obj:object;' }# V6 h9 i& Z, [2 t* c+ G: t6 f! f
do
k6 s" \& V8 Y) ?8 j) q5 s if existsObject("Status") then
6 j' g1 Q) t7 h, j Status.deleteObject;
$ C+ P! e, W; z2 s' N end;
, f# T6 {# h+ T; W: ^3 T( K for i:=1 to 10 loop( S' j" D2 T# G+ U5 {
Res:=sprint("Store_",i);
& c1 e* B. h! ^5 s8 \* R3 |" o if existsObject(Res) then' b. n; U" B: ~
Obj:=str_to_obj(Res);5 i% U% ]! d( ^; Q9 C3 j/ Z
Obj.deleteObject;
4 w) K6 t2 j" C/ l end;
' q/ p% g! k& K/ t! y$ U next;; E; n$ ?9 T$ C0 I
--shengcheng Status:zimoxingceng* S9 c( H8 Q; U9 \# N
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");2 x. v n9 A, A
Obj.Label:="warehouse status";* f6 f. x1 N+ S
5 P! G2 }: U8 a7 f for i:=1 to WH_nums loop% s* y% g1 T; F. k' _) a
Res:=sprint("Store_",i);% N' ~1 H X+ I( R. J$ L
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
/ X& m2 {2 W5 w7 V: c Obj.Label:=sprint("huojiaceng:",i);: U8 n$ c2 ?( p
Obj.xDim:=WH_x;" i, A/ I- ~& x2 x
Obj.yDim:=WH_y;
. m$ \6 ?& K: S2 r8 w Res:=sprint("StoreData_",i);% b/ n* I. a) j5 K$ V
4 @4 ^: U y3 d& q! u$ T$ P Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);+ A, e! C; @) ]7 p5 x7 V
Obj.Label:=sprint("huojiaceng:",i);
! A0 a+ X! A- l6 V Obj.inheritFormat:=false;
2 V6 ]& ?1 |! S5 X- s" r |9 ^ Obj.maxxDim:=WH_x;
7 u2 q. q; ?. K/ s5 A' Y+ J Obj.maxyDim:=WH_y;) z) g+ u, d- B* J9 f4 \
Obj.ColumnWidth:=3;
. ?" \: O* `& ^4 \ [ next;
$ T0 o) ]* ^& G' o0 V! H6 j
# x/ P2 H: I* p6 V/ E .Delivery.MUs.Forklift.speed:=2;- n( Z9 ]) L, _, O& k
WH_var.delete({1,Part_Nums+1}..{*,*});
! J2 x( b2 F( ]8 ]! c" A for i:=1 to Part_Nums loop$ t# O t* n* m% ~. \
WH_var[1,i]:=chr(64+i);
+ X0 K4 s: D7 v( N' ` next;7 ]( d! Z* Z% y. o
end;
$ V; c6 s9 n( U2 i' v$ {8 I& C出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
% G9 o1 q' Z. ^# @. ]- B! ]+ O. P
5 {% x8 ?: l2 q, @" T |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|