|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。% e8 f6 k( V O: Z4 k" Q3 U. D
语句是这样的
" Z$ b1 z' S, kis# D* j. f# P% ?
i:integer;
( b; t Z, N0 G0 v5 j Res:string;
& U- v: a5 ^$ X n" e% s+ ~ obj:object;
8 o; I4 P2 R* l. f+ Ydo) X2 b i; z8 r1 o5 g" ^
if existsObject("Status") then
7 f- O/ E$ K; ` Status.deleteObject;$ S* }7 r3 o7 x! Q) _4 ~! H
end;% V" c6 T) V( L! b
for i:=1 to 10 loop) L% m/ ~- ?7 ]- P1 j; z4 X
Res:=sprint("Store_",i);1 t0 |9 z5 D% J) q5 o
if existsObject(Res) then
- A* u: z0 k) @ V+ ]. X Obj:=str_to_obj(Res);
/ M6 \6 c4 y, X ?: r: _2 s Obj.deleteObject;, W8 p( A) Y9 {) j7 Z8 {
end;
h% v! l7 E' F- a+ t% G next;' L' T- @ O6 `' N3 j6 H
--shengcheng Status:zimoxingceng; k" z- ~- A& h8 u5 A# G% Z
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
& X( e2 P. n- f: ] g f3 \- t Obj.Label:="warehouse status";
s5 [% d7 c( V G$ q/ O3 p4 m6 M( V. V! w
for i:=1 to WH_nums loop& ^, ^1 H2 z0 X& V; c8 {! u$ ]
Res:=sprint("Store_",i);
& H" i! M/ x: M% F Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);( w8 G4 P8 [3 Z# O, y
Obj.Label:=sprint("huojiaceng:",i);" s. w) L3 ^3 K% j, A2 _; g
Obj.xDim:=WH_x;4 u3 F2 {7 H# ?# e% @6 M. O
Obj.yDim:=WH_y;
" y) f. K' r& t- }4 F Res:=sprint("StoreData_",i);9 t5 p, p3 D) c3 C0 Y6 R( M+ G
3 a! \- V* [4 |8 _- l
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);( a! U) U- T" x& L" b4 b
Obj.Label:=sprint("huojiaceng:",i);
! g2 A+ w# A. o1 G) Z l, u" X Obj.inheritFormat:=false;
0 X9 q# }# B$ H$ y! M6 B Obj.maxxDim:=WH_x;) `# |, [0 d Q' Q w" s# N4 e
Obj.maxyDim:=WH_y;
. }6 o' ^1 P1 v6 t, s; i Obj.ColumnWidth:=3;
! S$ V; G' }7 X. p0 E' E/ V next;
6 ] n* ?: H0 ]$ `3 q7 s2 ^ 6 S& f4 ~6 y' J4 N% A1 v. d
.Delivery.MUs.Forklift.speed:=2;
8 N( y% C! c) L3 }! M2 e( v WH_var.delete({1,Part_Nums+1}..{*,*});) X0 t$ w" L8 r* x
for i:=1 to Part_Nums loop6 |: @1 O5 D9 [ ^1 f
WH_var[1,i]:=chr(64+i);/ r, Q5 g% W& g- f8 h. R
next;/ Z% }8 h& G) ~, [$ M) l* c/ Y& Y9 M
end;
' m, F5 A+ p0 a: a* A出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 0 D2 j& F `6 a1 d% d
! ^# u0 u9 U5 O& {/ |
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|