|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。
% k* I7 ^- o2 _: t语句是这样的
1 D- g" v, B3 F M$ r2 ]is J, \! F! x: ?3 |
i:integer;1 ~: O x6 X8 z5 l: g. q
Res:string;
1 ~6 n8 T3 Y' c2 k& A; I c; n0 p1 E obj:object; I B7 L3 V9 p1 |) e* n0 X% C
do
; O, M3 w$ B g5 n4 g4 V if existsObject("Status") then# [2 a7 K2 l: v/ _# N! n
Status.deleteObject;' c) W* H( w- _! _
end;: y( d7 C5 d6 b3 \
for i:=1 to 10 loop2 G$ c @& t" s e) C% S; L9 U
Res:=sprint("Store_",i);
. n8 R! v- i* N. A4 p7 E if existsObject(Res) then
4 T/ ^& z) Z% e# c; d/ Q Obj:=str_to_obj(Res);9 a( Y b! T0 u3 {* q r
Obj.deleteObject;
3 x& p F+ N2 |) l end;9 u& w5 ^* T* w
next;
- V% `. X) V8 [' Q; Z1 L& n --shengcheng Status:zimoxingceng; v& {2 |7 O. C2 G' d7 n% Q
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
; Z& n$ i$ Y+ b, E- y; q1 i2 e# { Obj.Label:="warehouse status";# b; d! U% j# q5 f! Q c; P8 {
9 \" e2 z3 X7 P( z2 i% u: W for i:=1 to WH_nums loop6 `4 J8 W. W. O/ X! r4 V- [
Res:=sprint("Store_",i);) g0 v% l7 D- W* w/ ^9 n! T
Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res); q' d$ e- y- C P" O6 [: p3 i
Obj.Label:=sprint("huojiaceng:",i);% ~- r, ?$ [' {1 o$ { `
Obj.xDim:=WH_x;
0 V/ x* W( ^- r Obj.yDim:=WH_y;$ ]) Y& G0 ~, ^/ w
Res:=sprint("StoreData_",i);
' X5 g9 `9 ^ u0 N- Z, C1 S2 X
$ q( H7 i" E. }7 h/ [ Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);6 x9 g0 d: }. `( [
Obj.Label:=sprint("huojiaceng:",i);
9 K$ Z- M/ L* \ V! ?/ `- K* n Obj.inheritFormat:=false;
3 Z1 n5 A& i. _) ^. a0 f Obj.maxxDim:=WH_x;
+ ]' v8 K2 q m Obj.maxyDim:=WH_y;
7 L. B; I: v: q+ _ Obj.ColumnWidth:=3;! ~: I; k3 M. h Q8 u
next;
! t+ f! }8 j4 m" {
3 i# @* | {6 h0 y1 ?+ ] .Delivery.MUs.Forklift.speed:=2;& Y( q4 n+ @" s, T3 `
WH_var.delete({1,Part_Nums+1}..{*,*});9 y1 s+ n% ]0 i' s
for i:=1 to Part_Nums loop
- {& m8 h8 T1 T. z( l: C# m WH_var[1,i]:=chr(64+i);
% D L) T: j* G8 u- A/ E5 P' U3 p next;
- q7 }& t& c- Pend;
: z- m. B& d9 R- H出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 ! Q% J0 h0 U& ^/ S9 N k
) C7 J; x: _9 {2 x% }. N1 E7 S |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|