|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
, u) Y/ |) C- {. ^语句是这样的
3 ^: B% R' e) h1 y+ f) N6 @is
* R6 B5 ^9 P. ` i:integer;
3 n8 o7 P8 Y2 l: X! p; C0 J9 h7 [ Res:string;
2 T: t% ^& @( _" v8 n, \ obj:object;) d. d D/ [5 R' k$ L
do+ i3 ?. c" D k, ?$ D
if existsObject("Status") then7 k' w8 Z8 h# i6 i: y P- Q4 v
Status.deleteObject;; r2 M- q! u/ n) A
end;
1 c- z8 U" n- X4 X1 { for i:=1 to 10 loop" J8 S; {* s& U0 n
Res:=sprint("Store_",i);1 f! Y" ?" _) k- Q
if existsObject(Res) then
S, ~- y) G# v Obj:=str_to_obj(Res);, x& ~! ], h3 ~& I7 x0 \
Obj.deleteObject;
* ?" r1 |3 [4 n5 B end;) S8 B6 k( V0 Y! m. f( J6 z
next;% Y; }0 ?; x) e' y: X2 g
--shengcheng Status:zimoxingceng
8 h9 M. s2 t, l: l0 T1 m) e Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
i; J. \: }8 Z+ \, s Obj.Label:="warehouse status";3 u5 K) J( k' x6 p# n0 L/ G
( n& i( J/ y; _5 C9 | for i:=1 to WH_nums loop% f" o) {4 j" |4 V2 v" |* K7 p
Res:=sprint("Store_",i);
& f2 @2 j: ^% \8 B; {9 U* \ Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
6 v! A5 I) f1 ~4 z" v/ L Obj.Label:=sprint("huojiaceng:",i);
5 o9 h# ]4 e" S1 S Obj.xDim:=WH_x;4 u4 p* f. y5 f4 m: i% B
Obj.yDim:=WH_y;
, V1 D9 B, g" ?! w& o9 }/ T: t Res:=sprint("StoreData_",i);' y5 [8 c; k5 W" }5 ^$ I% Z/ t
# h) @' F+ H6 i8 R$ b
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
5 ~9 @7 k9 r2 e Obj.Label:=sprint("huojiaceng:",i);( c/ C |: B& _/ {- N
Obj.inheritFormat:=false;
' @( P1 F o2 F Obj.maxxDim:=WH_x;5 w! a, d0 H9 B/ p" T, s
Obj.maxyDim:=WH_y;9 q9 ]' s, b; \7 Y) r; j( V
Obj.ColumnWidth:=3; F6 J8 Y. c& z: u8 S i
next;3 Q2 N. Y2 o- ^( }2 H# A3 d
/ L' ^! |" r0 U. A
.Delivery.MUs.Forklift.speed:=2;
* E1 W0 @5 r& D* j: S WH_var.delete({1,Part_Nums+1}..{*,*});, R5 ^- b; \9 D8 m
for i:=1 to Part_Nums loop$ @3 Y$ A" V& F4 g1 h
WH_var[1,i]:=chr(64+i);( d) T$ l+ O7 u; Q1 I' B
next;! U# x& P0 j1 _9 s
end;
$ J) k; g2 N( T- L3 R出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
# b* k7 ?: E8 u, @, |) E9 C7 t' L' p! P a) q& [3 I
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|