|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
' P: T: ]! g( s, d- J% y- _语句是这样的
4 g, y, y! h4 k3 U/ Wis
# o6 c( R; Q( b/ j I$ [( P i:integer;
6 \( M% h8 w6 U( Q Res:string;
6 M' f. j1 K! x& @ obj:object;9 g; x l; `- Y7 ?8 N4 i' P
do
7 x; C5 {2 F- [# }6 [ if existsObject("Status") then
5 S- d0 H' r* _9 [3 o Status.deleteObject;: w2 |* e4 D* o/ c
end;
2 R" m9 u) R9 W; K2 y+ o* J1 ^ for i:=1 to 10 loop# k& x. [5 q! i+ i7 n
Res:=sprint("Store_",i);( X) |. s7 j+ e5 v; t0 ?" \
if existsObject(Res) then
- T; `, T6 U, o Obj:=str_to_obj(Res);4 D! l" a5 ?9 g, C6 q; }
Obj.deleteObject;
+ j7 e6 U- k+ V8 d* O end;
/ A0 V3 t# n" ^; z; f9 L next;
" S8 Q) t7 E& Y' ?6 l+ F* ^! O --shengcheng Status:zimoxingceng
3 G1 Q( V+ \ m9 v5 a Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status"); S) Q6 ?1 `. i: x
Obj.Label:="warehouse status";( H! s3 B7 H- ? t* K# l0 a$ V
0 f7 R7 [0 G1 X" z7 K
for i:=1 to WH_nums loop
+ T1 ^2 ?0 [, c. i* S `# e* _ Res:=sprint("Store_",i);7 w1 |! ]$ p7 l( g. F: P) ]# s
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);! d$ M% x4 K! Q% y* u
Obj.Label:=sprint("huojiaceng:",i);) u2 }7 _7 J* w/ _" Q
Obj.xDim:=WH_x;% Y& U' I- _+ h! E1 f
Obj.yDim:=WH_y;
+ c5 K3 J) ]; m Res:=sprint("StoreData_",i);
0 h- v7 |3 G9 D6 e
( x+ ]4 o( e/ t$ x' |1 P1 C) J Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
) u) Q7 R v) X- z Obj.Label:=sprint("huojiaceng:",i);; ^+ G. {- H- a9 Y: }# V; `7 I& o
Obj.inheritFormat:=false;, D0 g% Z3 g6 d7 R
Obj.maxxDim:=WH_x;
) @' {$ b$ {9 H+ G/ i/ E Obj.maxyDim:=WH_y;
+ K( P2 Y7 O" Y) Y9 _ Obj.ColumnWidth:=3;9 X7 A( S" M" j0 G3 P* y
next;
/ y2 f% }8 G& U' a% e4 ?1 i; w
# {+ E& T, d: _4 w .Delivery.MUs.Forklift.speed:=2;
_9 x$ h% k ^ WH_var.delete({1,Part_Nums+1}..{*,*});
# v% [& H: k7 s! y/ ?& V9 M' N9 @' a for i:=1 to Part_Nums loop5 f+ A4 G2 c+ W2 R( T/ H5 x
WH_var[1,i]:=chr(64+i);
+ D) v8 |9 r- @2 P next;& J. J: p) H* w+ q9 c& @9 u
end;* C1 t# T5 V& U8 q+ Q0 u" s
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
' ~. \* t2 e% b/ c$ i7 z5 ?
5 x$ i* q8 H* ]5 L! `+ j |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|