|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
- T: c& l2 `. P# W7 C语句是这样的! d% j0 A$ p$ O: j# H! F3 \
is1 ]& B: E* J" Y- Q0 ~% P, g' k. B B
i:integer;
# I1 n# T/ |: b3 ] Res:string;& t/ c! n) V4 P" [
obj:object;& y' F# W$ u6 V, X: O
do
! }. O1 p7 ?, x2 W if existsObject("Status") then- k6 {; H' f8 c! ?4 L9 q5 K
Status.deleteObject;3 M9 J0 X6 S8 _2 N' n2 z9 s- `7 Q) N, t
end;5 u/ B3 F& w( j* w, x
for i:=1 to 10 loop
w% Q, P. a: {# g, n) p2 N* O Res:=sprint("Store_",i);
# _5 G1 ?9 }/ o, p! u- N if existsObject(Res) then
( ^# { j$ F8 C8 D$ e' v8 Z) Y* g1 X Obj:=str_to_obj(Res);
/ T2 [) z/ m( y1 o W. ?5 _! S Obj.deleteObject;
* ~$ Z( \( J& F' c3 M: W end;8 _2 r/ K* z" F6 k: V6 C% Y) {
next;
3 c: g2 `( w% n/ j7 S3 K --shengcheng Status:zimoxingceng0 Y; G) n1 A$ o) b
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
; j" q7 S) h( L8 b6 U( Q Obj.Label:="warehouse status";, A% @, W: l* q2 \* s: W
8 l1 K4 F, \( c) n2 G
for i:=1 to WH_nums loop
9 T$ S/ ^9 m' d$ w Res:=sprint("Store_",i);) }8 `6 U; Z& a: Y/ K- ?% p
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
9 s* Y" \2 U% s, }, M Obj.Label:=sprint("huojiaceng:",i);! _, _5 X; k' U$ X2 o, z9 ^1 b
Obj.xDim:=WH_x;: c5 v. H" B3 N$ W' x
Obj.yDim:=WH_y;
- V" o! C+ ~% A- V Res:=sprint("StoreData_",i);
* H" Y7 X& ?& a z3 ~( ] , r" j% J, q/ m8 M$ P% ]& q
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
, d9 J1 I: r. q Obj.Label:=sprint("huojiaceng:",i);$ ?$ T0 C6 t, E& l& i1 q7 F
Obj.inheritFormat:=false;
, C# q5 |7 z% c% P" Z0 |0 h Obj.maxxDim:=WH_x;
" s2 |1 ?# }4 m+ C/ j. R7 @% j% h+ q' {$ z Obj.maxyDim:=WH_y;0 L8 t" b# h! M
Obj.ColumnWidth:=3;
% a5 \3 a: B# { next;/ F' f* s% Y8 l* T# }. b
, a% T. x$ f/ d d
.Delivery.MUs.Forklift.speed:=2;
9 F" v9 e" s8 k2 _4 t8 Q WH_var.delete({1,Part_Nums+1}..{*,*});5 y9 r% n4 [) h% G
for i:=1 to Part_Nums loop1 t( S! X: A, f- z8 b# b# \6 w
WH_var[1,i]:=chr(64+i);
+ e, [# G. G' F0 r& S& y$ N1 ` next;
% T) Y& u9 G' _4 O8 K. nend;
+ q% j0 ^) l# d$ w1 _出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了
9 b3 c# F" a$ e' Y* f- T5 Z6 S& B q4 S" F
8 D6 P: x5 y% W* h( h/ V |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|