|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
" M0 q8 l# B6 t- g语句是这样的- e, }2 |9 Q; O, b- Z4 r& T, k
is& R3 @' E$ B7 b2 E" @" Z+ P% B* c+ F
i:integer;9 ?9 z% M( Z+ _8 G
Res:string;
9 E5 J( H8 ?" M8 x2 n obj:object;1 B% _5 {4 B; i+ e" R3 ]! ?
do' t. @- R* {* ^3 \& n+ X
if existsObject("Status") then$ \" _8 k8 I: i2 c8 S$ g% d' [
Status.deleteObject;
2 a$ r! a( H( t: W9 r9 m' P end;
$ s: b. ~7 U6 D/ {9 q" X* s for i:=1 to 10 loop3 n$ `3 C3 f; V' X6 Q
Res:=sprint("Store_",i);
' T3 `3 O* J2 }4 e! E7 w1 u7 n if existsObject(Res) then" x- ^% Y2 d$ H \3 h. a
Obj:=str_to_obj(Res);
G C G1 Q( q Obj.deleteObject;
' S# ^% K4 ^4 R* _! x end;
8 v0 I3 M& N) w; T) |; A next;, y: w! Z: m7 ^* w; M0 V
--shengcheng Status:zimoxingceng
" W2 C# b; S! r& s: u5 D Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");5 A$ S3 [# O% S: S# d# |
Obj.Label:="warehouse status";
, s7 j1 U& n# t; n! ?) Q& \1 x G! x" g9 Z& i$ p
for i:=1 to WH_nums loop+ k7 u4 D9 |: A7 M3 O/ l5 S* v5 u
Res:=sprint("Store_",i);4 P' b+ z- U4 @& e
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);( A! D J7 W: ~ q
Obj.Label:=sprint("huojiaceng:",i);
7 g* s- \* z9 x* v5 ] Obj.xDim:=WH_x;
& \, g1 f' |+ m+ Q: m9 N$ t Obj.yDim:=WH_y;
/ l2 i" U* h! q* B' ?' C Res:=sprint("StoreData_",i);7 W3 v6 c _& b; j; ]5 Z, Y+ M
' v& d( e* S4 V9 X Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);1 B3 W0 j3 K5 Q: K `
Obj.Label:=sprint("huojiaceng:",i);2 [! q" j0 {6 x" g( p: t/ N2 R1 r
Obj.inheritFormat:=false;& Q4 w1 i# v3 I+ N# m& A
Obj.maxxDim:=WH_x;- |) U7 O. j# V' G8 Q% N& L$ u/ {% Z
Obj.maxyDim:=WH_y;
7 j( I! J$ a4 G9 H Obj.ColumnWidth:=3;
6 q% a0 h2 g4 [; @ next;
: d# N$ B; Q R' o# b$ d 6 K5 a3 P, j; O% x+ o
.Delivery.MUs.Forklift.speed:=2;
" \$ a3 V: k) N8 W2 J WH_var.delete({1,Part_Nums+1}..{*,*});( g% p7 C5 R7 O. P; k& A
for i:=1 to Part_Nums loop4 J7 C, q5 s/ A8 |$ @
WH_var[1,i]:=chr(64+i);
4 l' j/ C% V/ e9 ]# e next;+ w# U9 f( I B/ q3 E/ v, g, V1 U8 ?
end;
# k3 N+ N+ j+ c" s/ H0 W! ~出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
6 p2 f: j8 f7 ~ h- E
& d3 G5 B4 |& z9 N `' w |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|