|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
% p2 B6 U+ D# z Y语句是这样的* k. n9 x+ r3 T5 p( `5 _
is7 |) ^/ E v* @) y9 R, a
i:integer;
. L0 \4 E& r' Q2 d) s3 Y Res:string;
" V5 }5 r0 @4 _: V8 R& A obj:object;
/ w# i _) r" odo+ B% h: |8 N9 o) s' B# L
if existsObject("Status") then
: u! a( P5 ^5 U. C) e! I Status.deleteObject;
& C2 I& ^) U5 L' {, n end;8 c( }) v% W" M1 \& a% b% D7 X0 a7 H
for i:=1 to 10 loop
$ e$ T6 N" v. {( B6 {: Z Res:=sprint("Store_",i);! q' \7 [5 B/ k! d3 M- n7 J
if existsObject(Res) then
% c1 ` S4 A, a6 c; H Obj:=str_to_obj(Res);" q7 c' l5 @, ~5 l6 e+ \
Obj.deleteObject;. W! N" o8 U- G
end;
- G+ D! L0 ?. Q4 E' \6 _# y next;: [% a( {; _. B( T
--shengcheng Status:zimoxingceng; z8 s) ^ I ^2 S% N2 s
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");, c1 h. c! ~5 p0 O' Y) Q# e- ~
Obj.Label:="warehouse status";0 b+ G9 Y. v8 s
7 r2 A$ @- |3 Z$ j# {6 z3 E0 F for i:=1 to WH_nums loop
' c! |+ N5 Z+ K# G5 P4 Y Res:=sprint("Store_",i);& L* h2 P7 p3 i1 D. `+ T
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);* M' x5 o7 r, E/ U0 P
Obj.Label:=sprint("huojiaceng:",i);. e! [8 o" j. y4 P4 ~: a z
Obj.xDim:=WH_x;" g6 V9 z/ E# {8 _' E8 V
Obj.yDim:=WH_y;0 U" [) j- w3 O7 @, M
Res:=sprint("StoreData_",i);1 w- ] ]8 ^( q' E. @" s
0 O" X) f, Q' ]3 ?0 f* T
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
( q* e* {- i( K8 O& j" N Obj.Label:=sprint("huojiaceng:",i);6 H) p' s$ J& L0 x* B
Obj.inheritFormat:=false;- b8 s3 F0 b# w5 M
Obj.maxxDim:=WH_x;4 ^4 s8 |: V* @
Obj.maxyDim:=WH_y;& z: L1 g3 S2 R! G8 ]
Obj.ColumnWidth:=3; F) f) K: S+ U5 c' {! M
next;
5 N& b" F0 z& p3 |8 E
/ E0 p, S0 t5 T% K( X* D .Delivery.MUs.Forklift.speed:=2;% \( \/ ^ @. |0 j6 |! | K
WH_var.delete({1,Part_Nums+1}..{*,*});
9 ^8 M7 W i P; r for i:=1 to Part_Nums loop$ }2 e2 y) C7 e! B
WH_var[1,i]:=chr(64+i);1 b& P& q7 p& ?/ `( Q0 w0 |
next;1 J9 E$ c- ?& [. ~" A# `; w
end;5 b- y) i( H( ?- _
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ; l5 ^; ?. m5 p
U- q- k4 a S9 e5 H$ c |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|