|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
6 a" L, n' E# h' i3 \% r语句是这样的
1 B m! f; a& Y* z9 cis, E& L( d% f, a' s
i:integer;" |# d. j- o6 }% t) c- b
Res:string;
: R$ `. Z% b! h- N obj:object;
- C5 p" E( B ?" W$ ^do+ T7 c- K9 _. U% _, D) X
if existsObject("Status") then
, K- ~9 n( q, i5 } Status.deleteObject;" P! P6 D5 Q% {
end;: i8 ` ?/ u# q2 }* w1 W
for i:=1 to 10 loop
( R9 W1 S n3 W" N) g Res:=sprint("Store_",i);8 J0 R. K8 f( V# t" t) n
if existsObject(Res) then6 Z1 u, F% U1 F4 Q4 o
Obj:=str_to_obj(Res);
- E& p5 B: \" Z7 j/ X Obj.deleteObject;
$ L/ ]; b/ q! m7 n! Y2 |$ E end;) K( _+ n/ J4 l6 u
next;: ?, F. D' C4 |2 ]7 c
--shengcheng Status:zimoxingceng
5 h+ h4 ^0 l9 S9 J' I+ S Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");: K v# t! c i' m, A( M2 ^' i
Obj.Label:="warehouse status";+ z9 k. c/ A8 a, G" j
& y% L' y( a6 d- [" u0 R
for i:=1 to WH_nums loop
% Y `# r& P' [4 O- P; m# r3 j# O Res:=sprint("Store_",i);
! w9 `$ e+ I% x3 N Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res); \8 k9 M) g2 y1 j5 J6 K
Obj.Label:=sprint("huojiaceng:",i);! n. k4 ]/ X, R" E& M+ k2 O
Obj.xDim:=WH_x;
! p/ h- J0 c& l Obj.yDim:=WH_y;
# C) }4 |3 L7 \ Res:=sprint("StoreData_",i);0 {, t, ?( A% O7 ^2 W& C
1 @# J" ]' W; W( L Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);( l0 T% j/ g% }' d- Y
Obj.Label:=sprint("huojiaceng:",i);
7 C9 s* m9 G/ T* L Obj.inheritFormat:=false;' D$ R/ y/ D' q0 {; [
Obj.maxxDim:=WH_x;4 j7 G |/ G4 l' ^9 L' S
Obj.maxyDim:=WH_y;2 c/ ~5 t4 ~6 U
Obj.ColumnWidth:=3;
! f3 _0 A7 {4 ~$ } P1 ? L% M( N+ i next;
/ w/ C8 K& a# S* s* w* J6 o# N 6 ]" \3 A0 b. C# {% o( B
.Delivery.MUs.Forklift.speed:=2;" y( ^, j0 A, C* B+ p, e4 X4 c7 Z
WH_var.delete({1,Part_Nums+1}..{*,*});
! {5 J% K9 Q4 w3 n for i:=1 to Part_Nums loop8 ~* u4 d# m& j, ~& C
WH_var[1,i]:=chr(64+i);: Z% u! ]2 Y5 q
next;! J- s! J a: u# f$ J
end;
" Z4 f) _+ a1 O/ y4 Z0 a8 n% h! s出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 & G; i/ D8 x3 i. i9 y+ i. X4 J
) u- h# d* ^$ X. D. M" M& i
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|