|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。: y. h: @ S" S) U& K
语句是这样的
! ^/ R* _3 N gis
5 `. [* p. W& _8 H7 `" } i:integer;8 |" ^# A! Y. \* F5 B$ O
Res:string;
" Y1 N9 l7 h) O. O# u# w& c obj:object;" x. S; V l$ N5 q/ U9 E
do, W8 l7 ?# Y; Q7 e, b
if existsObject("Status") then
. M8 J$ {7 U R- f: a O. W( @ Status.deleteObject;- f' g1 g5 ^6 Z1 P# D
end;$ @5 ~: T4 h- t4 q
for i:=1 to 10 loop0 l/ Y/ x: Y( ]* \0 T
Res:=sprint("Store_",i);
/ R; `! }( j) e& Q if existsObject(Res) then
' V5 g+ d# i* M9 p Obj:=str_to_obj(Res);
' i: _9 G/ W" w% b# L. P' z" e Obj.deleteObject;
, f; T# s) V( A# R$ J end;! S$ _# b) u9 N' F) A9 ]
next;1 s1 X J% ^/ } o `
--shengcheng Status:zimoxingceng
" }+ T5 L v! h2 C Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");' x0 k9 n3 _7 _" `
Obj.Label:="warehouse status";9 [; F8 w9 x6 ~! G* u! M
& x8 e( n' z9 | for i:=1 to WH_nums loop0 T. J2 Y2 b( P8 X
Res:=sprint("Store_",i);
3 Y$ e& O8 [$ r! w5 W& D7 h' g Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);! T% i" X# U0 b5 ]/ t2 D
Obj.Label:=sprint("huojiaceng:",i);
( ?- F( y9 W3 v: T" G8 @ Obj.xDim:=WH_x;1 j2 v2 l' |9 {5 Y! C V. X, j
Obj.yDim:=WH_y;% ~5 r$ s# Q$ Q, w$ a8 v! N
Res:=sprint("StoreData_",i);
; \$ t: g+ q( `( v) B + c* E2 C- a# B/ A q$ w
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);/ i3 o9 i; F6 A& O) v. X" _
Obj.Label:=sprint("huojiaceng:",i);% q5 P [* \% i: X9 E2 n% |& `
Obj.inheritFormat:=false;
+ j; T7 }% l- b2 d4 T: d+ _ Obj.maxxDim:=WH_x;
5 L. W- P g# G6 j; i& \5 u Obj.maxyDim:=WH_y;% Q J% I) d1 D
Obj.ColumnWidth:=3;
) v/ B. L. K% D" n next;' S* }2 H. Y1 X- _
6 g# H8 }" I% {0 ]1 a( ^1 q .Delivery.MUs.Forklift.speed:=2;
4 X# ~3 K4 F2 |2 Y" G3 H WH_var.delete({1,Part_Nums+1}..{*,*});
7 S( i/ s! ^6 a. K for i:=1 to Part_Nums loop* x2 I4 s! X. F) X
WH_var[1,i]:=chr(64+i);5 i X1 ]4 m8 p- e
next;
. e- @: T& N6 Pend;- \% {6 N0 I4 w% \
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
( [( ]7 b6 ^4 Y& o' o" w0 Z
9 }# p' J) Q; y# g B6 M6 ~ |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|