/* called by: entrance ctrl of the object 'track'
1 R# f1 J3 k: g0 H8 w+ E*// l* j+ f, m& }: E
is( m1 ~! E* `8 e
part, GlobalDistObj, assignLObj:object;row,Lan:integer;5 B V; @/ x" ^+ o4 J
do* S4 O0 `9 m/ X
Lan := rootfolder.Internal.Tools.AOLlanguage;
S: y" P8 R+ H. l; i if current = @.Destination -- else return
7 h9 k C* ^3 T u _$ w/ A9 _, K' Z then
2 c; t/ S d6 Y3 H& m7 j @.Destination := void;
+ l: i$ B% u8 L ?& W% K if @.occupied then0 S3 U; W9 D5 n0 d0 B5 M
part := @.cont;
( N# G5 D. N; c3 u7 R$ b2 f( `4 | @.transpOrder := void;
( Z3 ?4 _) ~/ e7 X part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
# b% V6 C: J- V9 t9 k @,root.eventcontroller.simTime);
/ a4 C/ W" h, l @.HasOrder := false;
( u+ o. a2 l. G/ ? @.DrivingHome := true;" R7 r/ r; ~4 [; z& X
rgManager.tryToStartTransOrder;
2 m% C! \" T6 t6 O0 P o1 w if @.Destination = void
. B) Y: H0 L/ e% v then -- no transport order for vehicle @# u2 y) [; `5 v" L- s. h
@.Destination :=
, K% W) o2 R# }. i4 T' k rgManager.nearestFreeStation(@,track.~);. w! ^& @, q% d1 Q7 Y
newDirection(@); : j. z9 Y# z o1 W' C/ n+ \ z
if @.Destination /= void then
& ]7 p$ D* u, M4 H T9 b @.Destination.NumReservation :=. U1 {' Z6 C3 s! y d4 ]
@.Destination.NumReservation + 1;
" |7 m8 s4 ]% y& F& h9 K end;
: q& Z1 E3 }8 K# [+ R @.CurrIcon := "drivingHome";+ y$ J* z: |5 f# C' O- w+ @
@.DrivingHome := true;
- x& `! E) ?4 f2 J end;1 ?3 i2 p7 G0 G; s6 l" a
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
" O/ c' y2 J S0 M# B2 t0 m5 H4 N part := @.transpOrder;7 B$ W, V. M) s+ W& V9 k$ o
part.move(@);-- load part# _# B3 S1 i n# k# M- a& J
@.CurrIcon := "load";3 I( @5 D8 o8 V: R+ J3 H
GlobalDistObj := part.globDestination;1 ?6 a+ p: E" S# a3 L& r
assignLObj := rgmanager.rgAssignL;- t# F, U) {7 Q9 M% K
row := assignLObj.getRowNo(GlobalDistObj);3 W1 r! o& _ w7 T9 H
if Row = -1 then -- since 70
5 d1 `! i, f' n, W+ i; ] if lan=1 then: q/ }5 m6 B3 J) {
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
( V/ t6 W! ?0 v' t( K to_str("in der Andockstation: \"",?.~.name,"\""));4 ?/ G( J, z s' V" v- A; L: K0 b
else
5 J8 x, B# e8 Z% ] promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),7 g4 g, c! N4 `& C! D7 X
to_str("in docking station: \"",?.~.name,"\"")); & C0 A6 ] X/ y, ?+ g" j
end;# p t E" M% d0 \% l- A
else
& a/ m# l; n; z7 O/ T @.Destination := assignLObj[1,row];, v" ~3 c, _: R% X, B
end;
1 l. V+ }8 J& Y2 [8 \$ i newDirection(@);
4 B6 Q! e; v" R$ `. |) q+ l9 a @.HasOrder := true;3 w& q+ y6 A: E9 D' s. J0 G* H
end;
( x |, A" i( r end;% `' C( H+ @; ^$ F
end; -- of the method3 A H9 v2 {7 i4 B/ j" n8 b3 `% B! A
|