|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
3 C" X' s1 m/ y( q8 ]语句是这样的
8 d. ^; u4 f6 w% t4 Eis' R& V% P9 K; H
i:integer;
, D, x( N* L# W6 b7 @ Res:string;
& {" z9 p& @6 W& E8 O- Z obj:object;
" Z5 t9 N% W8 tdo
P4 z# x! U( t* @- | E! B6 y. S if existsObject("Status") then
: G3 f$ O/ h5 I7 d4 R- `- X; v ^8 U9 o e3 ` Status.deleteObject;+ i2 D# X& J2 q: P( _* j
end;
) @+ _4 g. w! I" d4 G/ w! N for i:=1 to 10 loop( ]7 |& h1 s1 k4 X, [2 F
Res:=sprint("Store_",i);- y0 Q o" _0 Z. x
if existsObject(Res) then
8 P; q8 ^8 B/ t3 A/ j# A! ^ Obj:=str_to_obj(Res);/ z; _' h5 b# l4 s) q
Obj.deleteObject;
) Y+ y6 b: t" ?1 T end;
. y/ W( ]& f& L- m5 ~# T _ next;
* a3 j) c/ L* T* y --shengcheng Status:zimoxingceng( V, R* I. N( C& F! m* ^9 K
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");' z) Q# g2 {- o, p
Obj.Label:="warehouse status";# z g, U& B9 I+ f2 s
5 k2 L! y" h5 f) r& v for i:=1 to WH_nums loop
/ y0 r1 c3 M ?1 z$ R5 ?" \ Res:=sprint("Store_",i);2 p: o8 G- M& H- v0 [' E0 C% e
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);( ~7 J# J) D2 O7 y i6 Z* L
Obj.Label:=sprint("huojiaceng:",i);4 ^$ d5 ^6 w1 [) y4 i7 N& h7 b
Obj.xDim:=WH_x;
& v/ |: F# _0 q5 V3 m0 B6 ` Obj.yDim:=WH_y;- g" H9 r) X1 U7 }1 y7 E
Res:=sprint("StoreData_",i);
9 U# a+ L/ s0 D* _1 V 7 T7 d/ D( d, H2 y$ h1 A: w1 @- S
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);6 s! e# G3 w# H: H) |+ k
Obj.Label:=sprint("huojiaceng:",i);
2 M2 d1 E; z1 j+ |$ K# G1 W6 e! Z Obj.inheritFormat:=false;
: I( M. v$ Z1 [# p$ H- { Obj.maxxDim:=WH_x;
: v7 q7 a$ P0 F( T Obj.maxyDim:=WH_y;( K% I5 A+ u- k% V# ?
Obj.ColumnWidth:=3;4 F$ d$ W/ W- c8 P7 R x* V' A
next; ?$ C' k& o0 P# Z
1 j5 V) v$ ?, V! |* [' i .Delivery.MUs.Forklift.speed:=2;
) J9 D3 s2 U% O( P! N4 {- Q; k WH_var.delete({1,Part_Nums+1}..{*,*});
{# y; @' f- l; G1 s5 H! ^0 x1 a$ h' \ for i:=1 to Part_Nums loop$ G# E2 X* n1 f
WH_var[1,i]:=chr(64+i);% q# p7 n( R9 T- N
next;
9 ^/ A, Y2 v" ^$ D9 ?0 E- Pend;# l0 g! F3 ]5 j6 C/ z* q$ }5 P
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
* y% y ?; W3 I( Z: \' i- Y# ]1 u' a( j# w) y7 G
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|