|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
! S. a) {! h" f/ p1 E语句是这样的
9 R" x) u& a: E" v; V8 yis
) y% r8 J% \7 Z. M5 H" q i:integer;
) {! g* P7 Z# g; P Res:string;
; N3 F, ~' G& @: e) A obj:object;
5 A* P+ t5 o: c, o! zdo: l: ?. b! n! A, v# t. Q4 J; t
if existsObject("Status") then
# V. j, _ R+ A8 J z4 G* e Status.deleteObject;) {) {5 P: G2 }/ Z' ?5 ?6 u2 }
end;
5 G4 m7 W8 G6 I4 @ for i:=1 to 10 loop
9 B( v* |$ J7 |; i( o X8 k7 o Res:=sprint("Store_",i);
) t+ l9 z2 Z9 \4 Q1 f- Y if existsObject(Res) then5 ]8 C# E: u& _3 m9 W7 V
Obj:=str_to_obj(Res);+ ~+ j, s( ^$ `& T4 X+ L: d$ B
Obj.deleteObject;
- ~5 ~4 |% P! h* H1 S0 Y end;$ A& {6 n$ B5 C( U6 j0 D
next;$ H J8 [1 Y6 N+ Q7 v
--shengcheng Status:zimoxingceng# a! w7 h- r( T, ]
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
6 D* |: z/ `8 t( {2 F2 s. s Obj.Label:="warehouse status";# B. M, F7 O% X
, o7 K+ ]( g8 S" }
for i:=1 to WH_nums loop
$ K4 S5 w# x4 ?2 b- x. V/ G Res:=sprint("Store_",i);8 _% |/ t4 R, V/ }
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);
+ ~# O, q5 m) {. F Obj.Label:=sprint("huojiaceng:",i);1 S+ x; k$ ^" j# X y$ O
Obj.xDim:=WH_x;
m7 l3 y* \; Q" O+ ?$ g* h Obj.yDim:=WH_y;' c3 [# r3 M: d# M. Z
Res:=sprint("StoreData_",i);
6 J V9 d5 U9 D# d" F( O$ S+ L, _5 X( g
s4 H" P/ k$ J2 A3 g2 [1 e7 v7 R. U Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);
8 V0 s f3 ]. F( d2 r$ s3 G( v3 t Obj.Label:=sprint("huojiaceng:",i);
$ p5 r$ i. X" o0 E6 k Obj.inheritFormat:=false;
7 ~1 `9 Q u' {% a6 E# \ Obj.maxxDim:=WH_x;
$ K( k5 F! z4 ]: U& N Obj.maxyDim:=WH_y;
* }* H3 i) J" c+ d$ l Obj.ColumnWidth:=3;
0 {7 y% h* q) c next;
, E3 ?7 t! Y: y. G6 M1 p8 C
0 s0 [2 M' n4 V6 E# u0 A1 A8 ^3 o% h .Delivery.MUs.Forklift.speed:=2;% J+ w @& v7 H" I8 n8 n
WH_var.delete({1,Part_Nums+1}..{*,*});
0 c% d! J) E( @/ h8 N: O0 y for i:=1 to Part_Nums loop
% h0 n" T' t9 s2 Y! l& i WH_var[1,i]:=chr(64+i);% o* T# N6 a# c; \5 H5 s, ]
next;
+ m8 h- S5 H) Q' `7 m4 s- Tend;
# V1 H% o9 c2 j3 }( l& U* P出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 7 O$ u% ? _$ B/ T" b1 u" e% K
& X) ~4 R4 [# U: y |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|