|
|
我在做《生产系统仿真——plant simulation应用教程》第八章的仓储案例,在8.2.2里需要生成仓储货架层,我按照书上的语句输进去之后结果在22行出错了。5 }$ _' T9 n# b* |1 l# H- [ N
语句是这样的
7 N8 ?* ^& w8 N( F& P: d1 V7 Dis
$ i- N6 `, k- g5 f5 M7 e) ~ i:integer;7 ?# e1 X2 L+ l; q9 R2 m$ t0 s0 W
Res:string;
3 M m( t3 i+ j obj:object;$ x4 N) m' S1 }- ~/ J) ?
do
* {) ~) d" D" O5 U% ^ if existsObject("Status") then1 t5 v/ t) J4 G. `% Y1 S) c' K) {
Status.deleteObject;
- {! b& a: F; }# }% t/ i6 t end;* @. h( s% v& q7 w4 s
for i:=1 to 10 loop6 s4 p2 v$ R. j7 n# W( ]6 U
Res:=sprint("Store_",i);+ S% t; Y2 n& `& b, e! U. S
if existsObject(Res) then
. w9 ~0 w9 q+ J Obj:=str_to_obj(Res);8 B8 `5 S0 N1 ]1 K
Obj.deleteObject;; x0 p: J9 @# J) T) x" R# N+ k
end;
7 a7 v: H9 J8 ~' C/ X next;7 ?) P0 K! v2 m, U! D6 e
--shengcheng Status:zimoxingceng9 P/ S( T9 J" E# |, V
Obj:=.MaterialFlow.Frame.createObject(current,160,140,"Status");
7 U ^! E1 h% @4 J+ [3 t" M Obj.Label:="warehouse status";
: T8 C2 r# n7 h! ]$ A0 \ 9 x0 W" i2 P" ~! t* h C2 d
for i:=1 to WH_nums loop
* R' c) J5 I) N4 E Res:=sprint("Store_",i);
& s9 _5 _. `7 D' F Obj:=.Delivery.Res.store.createObject(current,400,i*80,Res);9 y# Z+ `- I4 ]. F" P! U; r
Obj.Label:=sprint("huojiaceng:",i); X7 C2 n& R R! _7 l: `
Obj.xDim:=WH_x;
. f3 w& D* h3 ~+ E Obj.yDim:=WH_y;* ?! X6 _' H" l; y3 s0 M) I0 t
Res:=sprint("StoreData_",i);* r& s$ _: L0 e) w: K
0 y' Q- |' T9 T" I, @0 t5 P& S8 C
Obj:=.InformationFlow.TableFile.createObject(current.Status,i*120-60,40,Res);+ d+ }, O* F' o$ s
Obj.Label:=sprint("huojiaceng:",i);
* g% L" @. v6 B Obj.inheritFormat:=false;& ^% w4 H, I! ?7 \% a: P
Obj.maxxDim:=WH_x;& W8 U) o9 A8 y2 m/ _
Obj.maxyDim:=WH_y;8 x& g; l: U! {, j- A) O7 f2 k
Obj.ColumnWidth:=3;" F' B; Y% B1 u: a
next;6 R9 _; q8 o8 ^" E* ~5 X
9 h* j6 \/ M0 j2 w2 t& k, { .Delivery.MUs.Forklift.speed:=2;, L9 Q% i2 c9 z4 Y9 _/ i& O
WH_var.delete({1,Part_Nums+1}..{*,*});
5 z! P. ]! t# _& E for i:=1 to Part_Nums loop# V6 o% H$ G1 I* W+ q/ Y5 U& q
WH_var[1,i]:=chr(64+i);
; j! O2 i7 i c8 p next;" T' q' z' o. v/ d3 B S# @$ l$ e9 E
end;3 o9 v2 ], X, ?: X( X; `0 |
出错的截图在这里。这些语句可以生成出来子模型层Status,但是生成不了货架层,错误显示说是unknown identifer res.求大神帮忙看看!!!多谢了 9 c" N+ r, Z2 [# g
1 F+ j5 U! i3 K/ D) d
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|