|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
8 E, \5 z! c+ k! I" g# E6 `语句是这样的; r+ b- b5 k2 N( h
is
* A+ ]) f m. O0 ~/ h2 p/ g/ L i:integer;
. d; V3 d/ o" g$ e" ~ Res:string;
; D+ f# |) D% S6 Q+ m obj:object;
8 |! X0 b: {* _do
7 y% F& d# \5 p! w if existsObject("Status") then
+ C% C& O# t& `1 [$ _: b Status.deleteObject;
( ^3 u+ Z& P# | end;& O7 R2 P; s; W9 a% d
for i:=1 to 10 loop
, c" {" ]5 J2 ? Res:=sprint("Store_",i);. o2 H4 ^8 E K9 c
if existsObject(Res) then- j4 F4 A/ n: Y8 \4 }3 \% a0 Q
Obj:=str_to_obj(Res);
" u5 M; j' }+ v$ z" {# | Obj.deleteObject;# E* S% v( A" [4 z; [
end;
2 O9 ^& b6 n6 m; a) m0 A$ A; q5 G next;
4 A, M. f1 S! \; v: n+ b3 e0 R --shengcheng Status:zimoxingceng& q$ [7 x" C6 C1 y8 @! s! W5 P0 R
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");. E; x6 O' Q8 L
Obj.Label:="warehouse status";
( \) `7 h& W* o& e: P' U; D$ p 9 R: Y6 H8 _! a+ b
for i:=1 to WH_nums loop
3 J) G1 Y& I% i Res:=sprint("Store_",i);
7 o I# G0 z2 {& i0 s) g5 a Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
# \! Q$ H6 |5 g( e; H Obj.Label:=sprint("huojiaceng:",i);5 T5 Q; Q' h. a9 g/ z
Obj.xDim:=WH_x;
4 U) x, w3 L! _; [ g* K) F Obj.yDim:=WH_y;" i* U8 ?& V/ ^0 m
Res:=sprint("StoreData_",i);6 s% F/ m( e# |( M- y1 J
( w* P% e$ Z4 B- b Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);0 V0 @5 x* y, a' h4 m; Y; \
Obj.Label:=sprint("huojiaceng:",i);
) J! ^ y/ _* F9 l: r Obj.inheritFormat:=false;' s4 g* c& n4 Y: Q' _5 D( a4 r
Obj.maxxDim:=WH_x;. ^7 p$ a* k j
Obj.maxyDim:=WH_y;
; ?# P o; k/ b2 ~7 H& n! u Obj.ColumnWidth:=3;
e$ j( ~7 F5 `4 m9 l next;8 b6 C8 ]: w- @ h8 U+ a
; z5 o; x& [% @; `9 f; \
.Delivery.MUs.Forklift.speed:=2;0 w. a+ H+ @$ R7 M2 Z# Y, Z
WH_var.delete({1,Part_Nums+1}..{*,*});3 ], n( M% L5 `5 h, I
for i:=1 to Part_Nums loop! I. \, w* Y; b0 I
WH_var[1,i]:=chr(64+i);0 h) H2 {4 I6 s! V) R
next;
( B" A: V; k) z' \; [5 Wend;+ L+ X. {1 ^7 R4 B3 F
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
V9 y I6 c: Q5 }% p3 u! P4 [& A _( V& y
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|