|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。% ^5 @) d% |3 y4 x
语句是这样的
% K- a5 H- g% c3 gis
6 l# H& p. F( p ` i:integer;5 v3 L0 W9 e- ^5 B
Res:string;& p8 E3 b7 u+ |, C5 u
obj:object;5 J. V# n! X* k# T) H/ Z. N
do7 {4 w$ n- L1 j. l# Y2 q' l
if existsObject("Status") then1 k, s5 E) `0 I" s: w' Q
Status.deleteObject;
. R, ?$ Z# N# ~ end;4 k) @- Y) u' E- E; q3 A2 S+ ]
for i:=1 to 10 loop) S' `0 M- o; d# ~% \
Res:=sprint("Store_",i);7 ?7 C. H. e3 q5 t
if existsObject(Res) then0 M7 t2 u- }. i4 U* V8 P
Obj:=str_to_obj(Res);
9 b6 s+ y; a: d! m5 L4 U3 |8 P Obj.deleteObject;% ]5 x7 }+ Q. o/ U
end;/ u$ r# t1 f# Y3 s* ~
next;" S9 a0 Q9 ^* |* D; |" S* ]( Q
--shengcheng Status:zimoxingceng5 g( P7 _. E5 Z
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");) d g3 _. K$ u6 N r5 l! X5 w
Obj.Label:="warehouse status";- e/ t- _2 i4 \! v% D0 G& h& f
! E" n- w9 _/ K4 s
for i:=1 to WH_nums loop
& }3 m5 u2 {2 D6 S5 E0 {. Z Res:=sprint("Store_",i);9 N3 r3 P7 o+ D# F, L& |, {1 t
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);2 E, U8 u, {' { y
Obj.Label:=sprint("huojiaceng:",i);; _0 t: `# j1 p) A$ K
Obj.xDim:=WH_x;
) w; G! E& h- `; Z Obj.yDim:=WH_y;
% K( L: F6 g' p Res:=sprint("StoreData_",i);! T8 e% U4 A: p3 d
, M) f4 [- ?/ w, z7 H/ u
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
( i9 c! R, ^* Q' p) P! n# _ Obj.Label:=sprint("huojiaceng:",i);
9 ~; l) }% Q. _$ L8 Z% C1 s3 ] Obj.inheritFormat:=false;
4 D- g# `. s" I# Q$ b* b- ? Obj.maxxDim:=WH_x;
2 Z! I& m* B% J& m Obj.maxyDim:=WH_y;, Y a& s: w% e5 T$ {0 `+ P
Obj.ColumnWidth:=3;
3 ^9 z2 a# d& q next;9 I. {+ F. C- A/ `8 K
" F. w' P# x9 x& ]& a
.Delivery.MUs.Forklift.speed:=2;9 R( |# W' _, r4 Z: s
WH_var.delete({1,Part_Nums+1}..{*,*});, {6 v* c7 K& P r3 T p
for i:=1 to Part_Nums loop
* n" Z) ?! B- X WH_var[1,i]:=chr(64+i);5 `# p. |1 ^4 M- y! p5 @% h
next;; ~+ N' U9 @ M. m2 q0 P% H! [. N0 C
end;
1 b* e, ^: p {" W出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 : z/ s* p0 g) Z* Z
( A( L0 u' U) H1 G |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|