|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
3 d6 B* N2 H1 l语句是这样的
# @, o, B U/ ^( `# A! P9 Q: ais: o9 w4 [0 t' X& s
i:integer;
+ f1 s2 c9 u+ O9 I% P$ C Res:string;
4 i& C# V: y2 U( b7 {+ b6 U% N! V obj:object;
! C/ ^6 G3 c0 u% o8 v9 D: N2 ~do
7 O; u7 {4 ]: U, U; q' @4 {* V1 K if existsObject("Status") then
) r. E* x# d/ R: u* p Status.deleteObject;' J/ u/ s+ q8 K0 b- t' W
end;
$ s1 @& S" g9 P: K+ A& h' j for i:=1 to 10 loop
" a6 U: c$ s" w& {' ^! O Res:=sprint("Store_",i);
; Q; N. ^& `, X. ~3 |4 i if existsObject(Res) then+ }6 B$ ?# y5 w( F5 E1 g3 v
Obj:=str_to_obj(Res);
) U5 Z0 A( v1 E! @1 k: X: _* n. H Obj.deleteObject;
; a/ X' i8 u; _: j- U# l# x( S end;, \- |" J) ]( X
next;8 ]# ^: |: d+ }5 U3 ?
--shengcheng Status:zimoxingceng
& Z, \; b2 J# z- V Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
; ]5 [9 o6 f" b! p Obj.Label:="warehouse status";3 T" A5 ~3 u9 O
2 U' w% g( w8 w
for i:=1 to WH_nums loop2 I# L+ q: [5 D% T" u
Res:=sprint("Store_",i);
! x* S6 l% m! y- J Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
" N) L0 O" z( z8 c. w$ R; q2 P# [( G Obj.Label:=sprint("huojiaceng:",i);
% l. R* o% d' d; ? Obj.xDim:=WH_x;
# b* ?6 t4 F( F Obj.yDim:=WH_y;
5 N9 B$ B) S2 p0 f Res:=sprint("StoreData_",i);
! o; s* e4 n- N . l$ l! \7 ~3 f8 N' _: a1 ?$ u
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);- A9 `5 ^* X/ D% `8 j5 X* ]
Obj.Label:=sprint("huojiaceng:",i);
# H+ ?- g0 w' `+ K4 A3 i( \ Obj.inheritFormat:=false;* o$ G# W1 N- D* S+ L8 ?
Obj.maxxDim:=WH_x;# U% Q* x/ U9 d+ ]5 t8 i
Obj.maxyDim:=WH_y;4 N9 M3 [2 ~! ^& R
Obj.ColumnWidth:=3;) _5 L; R& P: a0 w' j7 h) Z
next;& M8 }5 X5 P6 f! W+ A0 K. f
( Z$ K' K2 o' O2 G. |6 V( w ~4 r .Delivery.MUs.Forklift.speed:=2;2 q/ W$ J" \7 K. z6 [
WH_var.delete({1,Part_Nums+1}..{*,*});( c5 s2 \6 |, q. S9 f
for i:=1 to Part_Nums loop
, d6 d/ ?4 g1 I6 b3 X WH_var[1,i]:=chr(64+i);5 y% I" {, v) u+ @- Y4 q8 k. }
next;/ v! l# d! U8 K n+ r8 R2 Z
end;
: L7 X. U! P l1 s3 V/ B4 f2 c/ A7 Y出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 " \: h* r6 z8 l, E
2 e2 `6 F! Y" N1 b; r
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|