|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
% R; ?( B- T3 a. w3 N- v: A1 p- D语句是这样的' o; O7 @$ Z7 P2 p% K& V" Q
is+ S: X: X6 M# l' Q; c$ u. P" s4 e5 a1 r4 p
i:integer;% z- R7 _$ k6 A9 |+ s
Res:string;" v$ X* }: L- `, V c6 ]( E# @
obj:object;
1 \9 p t& q" J7 S# Tdo
6 f! Y) M$ t3 b) a! j if existsObject("Status") then
* p9 G% ?. S( [5 e3 f5 i' T Status.deleteObject;
0 T- ~" K: d! r: O# M, f. r" _ end;
8 b" k0 n" O1 D8 q for i:=1 to 10 loop
% ~5 B/ {; r% c) ^3 h# n+ e Res:=sprint("Store_",i);
4 K) P: k7 o" ?& J if existsObject(Res) then/ ]) f+ C3 t6 `; f1 ] R. V; O# g
Obj:=str_to_obj(Res);
2 |6 \$ E1 K6 Q V$ V+ ^ Obj.deleteObject;
% X& V9 b9 \& h$ j end;
! ^# D: W' j, ~. |& I$ \# | next;
6 o2 `4 i7 V& g* F; ~* k --shengcheng Status:zimoxingceng
/ b8 L; v! [4 q- _4 K, p6 b: B Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");2 }* n9 o9 A$ I$ [( r- f
Obj.Label:="warehouse status";
; y, _( g$ W/ Z 5 D- t1 {3 q% I0 v& p/ i
for i:=1 to WH_nums loop
4 B. @( @1 G Z& U, m# U Res:=sprint("Store_",i);2 o$ [% j" O7 t5 c4 a2 z/ V/ Q9 [
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
; q0 g+ ~% {: V- z! k Obj.Label:=sprint("huojiaceng:",i);
' e: \( Q% v) }% S$ `+ Q* ? Obj.xDim:=WH_x;
3 q4 ^3 Y! L o. A! C+ m Obj.yDim:=WH_y;
0 A# ~, Z* m4 h W Res:=sprint("StoreData_",i);
- i v* t# [' ?+ P+ |* Q4 P
" T( B4 V7 z: S Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);+ y1 P L' U( [5 I8 \
Obj.Label:=sprint("huojiaceng:",i);
& x7 X: X) |- _' B; y: _( [: G) z Obj.inheritFormat:=false;
5 w6 G" X1 M; f/ \$ K+ H9 F Obj.maxxDim:=WH_x;
* r+ E) J8 \7 }8 [% c" W# I Obj.maxyDim:=WH_y;2 L* ~* u: v' s
Obj.ColumnWidth:=3;/ T) P9 m3 x, }7 f' p+ q9 _" f
next;- I& ?* u% D2 R
' S0 P" h) x6 d& e& a7 W5 }6 y, p
.Delivery.MUs.Forklift.speed:=2;
( S- s' o8 H: Y" i3 ^! i0 C9 i3 n WH_var.delete({1,Part_Nums+1}..{*,*});7 G# M: Q; ^" a+ Y$ ?
for i:=1 to Part_Nums loop
@" q5 h3 P0 u+ B! t& t, ?4 W WH_var[1,i]:=chr(64+i);$ ?8 ~9 \" e3 R. R0 Z
next;( t1 d, ^0 J5 [: L' I
end;2 i' ]: o+ o6 u6 U" |% w
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 * _1 t, h) C6 K/ y0 n0 P
# g$ s" P* ]1 b1 ?' S. x) Y |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|