|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
" u8 `7 K% V7 f# c h- b8 G* o0 Z语句是这样的
# F$ O) w5 L: Q) W, S% P; O. E; fis
8 y# B+ D; r/ b( p$ B; X" M i:integer;& z! ]& P1 Z: r1 m5 w/ q1 J
Res:string;- e: y1 L8 o; o, k! y6 W
obj:object;
; `, ?1 M3 ^" y4 w' A7 {, }do, ^; Q0 h" D5 M4 z6 Q* e
if existsObject("Status") then
5 P4 y( {# |2 X4 b! y! | Status.deleteObject;% }' b$ ~& Q* ~, ~3 u
end;5 Q1 v3 h' h6 n' x& G& G. U+ U
for i:=1 to 10 loop1 e, E) Q! U& u! n; f
Res:=sprint("Store_",i);
) Z Y C# \2 G8 K if existsObject(Res) then5 V$ ^; ?& M( K: [3 S
Obj:=str_to_obj(Res);$ Q2 V! ?4 U: r7 ?! R+ G/ g% b7 Q
Obj.deleteObject;! w( ]& E0 l( j
end;& `7 J8 s! e2 H9 A; s0 h5 R
next;
( [" v1 x1 J4 A- t G' k --shengcheng Status:zimoxingceng& q7 T2 |9 J$ J+ K. A5 i9 X0 x' o
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
# j1 k* l3 @: l E( b# Z Obj.Label:="warehouse status";
( z- I& @% g/ Z- r ) F$ ]3 W: A l+ `0 H5 G4 f! n+ b4 m( M
for i:=1 to WH_nums loop$ u& f0 |7 B. [- m0 g
Res:=sprint("Store_",i);
4 P" W) m4 L6 w9 O( W Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
: |' I5 j: m/ h# T Obj.Label:=sprint("huojiaceng:",i);& B7 i$ c7 \! K0 z! r7 l7 w
Obj.xDim:=WH_x;* Q4 C& {/ m( T2 d! T
Obj.yDim:=WH_y;
- n9 X. g1 P( Y' H6 _3 [ Res:=sprint("StoreData_",i);7 D1 g& U1 D& w! j# a1 R* v
, g# Q+ r* j/ {9 j
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);" A5 i( D/ r* G2 q/ O# f
Obj.Label:=sprint("huojiaceng:",i);: ^( j5 o7 h! k) \
Obj.inheritFormat:=false;# Q* N$ y0 X1 Z. C! S& I$ n
Obj.maxxDim:=WH_x;7 l( j2 H& e$ t& j9 T+ M' Q1 h
Obj.maxyDim:=WH_y;1 U! @# k! P" ]
Obj.ColumnWidth:=3;2 L# L: ?1 L/ @4 r; }0 ^2 Y& w
next;
" K4 X4 f$ e+ A) ]2 P : v5 |2 C% ?- g
.Delivery.MUs.Forklift.speed:=2;6 ]+ W7 h' a, T0 J7 H, w
WH_var.delete({1,Part_Nums+1}..{*,*});
1 q' K+ o( L4 x$ d, c5 f N for i:=1 to Part_Nums loop. g" c E( N/ V( U! N! H
WH_var[1,i]:=chr(64+i);
' i2 _( E" f- x) B; C. m3 m next;
' q* C9 `- R$ X) Jend;* K; k& v* n& U/ R' q, D8 {
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ( \* [5 T8 E6 Q% p
* m/ e) F/ ^/ K9 J0 C. P, Z2 A5 o
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|