|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。8 e3 c2 J3 A2 B8 M9 D# C2 d, I
语句是这样的
+ c% X2 _0 O( q' A/ K0 dis
6 D/ m# W: a. B8 r& | i:integer;( E* n- ^' t, Y' ?) v8 r/ o7 v, a
Res:string;. i! D; U$ w1 t1 r0 }7 C
obj:object;
' u3 t, C$ R+ hdo
% n. M; z" X) [8 _7 }& Z! H. v4 {# M if existsObject("Status") then
A1 b1 U' a* A* C+ B z9 }2 G Status.deleteObject;# a3 e; Q2 e q, M$ j7 j* J
end;
% J0 y: b1 S8 {* j. _1 D4 B% D# e for i:=1 to 10 loop O8 `5 F7 L4 O" O" v
Res:=sprint("Store_",i);
4 I4 o( e! K4 s4 n if existsObject(Res) then
^4 J/ d( k; j8 L Obj:=str_to_obj(Res);
. _: v- ]+ n9 A Obj.deleteObject;5 [( D$ ^% P) I2 O; o" B" P
end;# O5 B5 {7 X2 `$ g D: P# Y- N
next;( H! @. b* z9 f
--shengcheng Status:zimoxingceng
+ g1 i2 ^: i$ Z g t( J! y Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
" ~! x, y/ U! `' E& l! q$ K Obj.Label:="warehouse status";
4 w2 S7 c9 R. ?1 ?; D& f ( j! V b% i& p) q3 Q7 R
for i:=1 to WH_nums loop Y( J1 R1 N$ s8 b
Res:=sprint("Store_",i);+ \- h ~$ E& w7 b: p+ _, y
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
( I1 s/ w% B9 ~* ]8 ?% s Obj.Label:=sprint("huojiaceng:",i);7 F( G! d0 ]5 S
Obj.xDim:=WH_x;! M" n) Q& y) S. k! m8 }
Obj.yDim:=WH_y;, T" A/ L$ ^% v' O0 P
Res:=sprint("StoreData_",i);8 F3 I4 e. m4 w/ Q- I# }
$ R: {7 ~/ H0 V$ P9 v# Q Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);2 `8 S" c, t4 T7 C
Obj.Label:=sprint("huojiaceng:",i);
# F! G' ?% a+ F: g( y$ @ Obj.inheritFormat:=false;
$ f8 D( ^& U0 S/ [$ [; L2 d# R Obj.maxxDim:=WH_x;0 w2 g2 S* z. b: j* q" k
Obj.maxyDim:=WH_y;( `$ F( U& ?8 m* i: B" X
Obj.ColumnWidth:=3;% S. i8 \; m' C: j& z4 n/ W; \6 H
next;8 g, t/ s9 m$ S# m/ W% A! Z
+ q" n2 N7 `; y' c2 L .Delivery.MUs.Forklift.speed:=2;
) c. v% U+ j$ E WH_var.delete({1,Part_Nums+1}..{*,*});
& O( m" Z' k' ?6 l2 @4 P; E7 g" _ o for i:=1 to Part_Nums loop
3 Y3 o4 W* z: g W6 v- z' h WH_var[1,i]:=chr(64+i);
+ c* `- A6 E( W8 z# p$ \$ [ next;# ^+ K* l% w# P' ?3 Z2 p
end;
6 y" k4 @* V; A出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
& u2 u2 S4 p- [6 `' m& K
- e6 W# D- A: C! o4 c |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|