/* called by: entrance ctrl of the object 'track'0 \+ \6 f6 d9 h8 X) n9 V* l
*/+ m0 h+ `7 D; t" m" V# r
is5 G9 z! c& k( h3 h0 c
part, GlobalDistObj, assignLObj:object;row,Lan:integer;: E5 Z+ @. q2 B3 d: Q" |& O
do
7 T: t7 q; i4 U8 \ Lan := rootfolder.Internal.Tools.AOLlanguage;+ G. y0 U% R/ F/ P: q. K) g
if current = @.Destination -- else return+ I) G3 v. K0 i# O- U' ?* V; u
then) Q- u" I7 e: `$ S2 d+ x# p' b
@.Destination := void;
5 @6 r/ N8 n- e4 ~5 N# R if @.occupied then" A8 X0 H$ D8 h1 f) A( m
part := @.cont;
5 r5 r: }' v& ` @.transpOrder := void;- r9 b) L. t7 g: H
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,8 M. {7 I; b1 j% z F/ ]
@,root.eventcontroller.simTime);( J# r. O" @, o- ]5 i4 T `
@.HasOrder := false;
) D j$ s; v/ ]- U: k' W$ M @.DrivingHome := true;8 C; W1 |% |: w, L$ g$ U0 v' `
rgManager.tryToStartTransOrder;; o; B8 u$ I. M3 {: h0 y
if @.Destination = void. f+ `; F" l9 p) h1 ^% E0 @) c$ R
then -- no transport order for vehicle @
/ p' @* Z& K# \! h @.Destination :=
( I [1 M- Y: a# J' G rgManager.nearestFreeStation(@,track.~);
) h3 S6 r: \( s& r8 Z* N" A newDirection(@);
$ n- W, T* M/ F/ }; j) g# s( s" k if @.Destination /= void then
3 e7 Y9 A' {2 e3 C% l) u" u @.Destination.NumReservation :=4 Q1 X- E8 g2 z, R! z$ X
@.Destination.NumReservation + 1;$ \6 K% Y- l' t3 A
end;
. z# k, V' P' O3 r5 S* r @.CurrIcon := "drivingHome";
/ ~3 L! H h5 q; Y) ?1 M @.DrivingHome := true;
$ h, ~: @0 s F- W end;# ?' D5 n( N* a3 C e# n
else -- the vehicle @ is empty, both vehicle and part are in the same dock station5 q2 _! T& Y% D: w' r6 Y
part := @.transpOrder;
- V3 `7 P$ |! N part.move(@);-- load part' C- ?$ `' a6 b3 t1 h$ ~4 g; a H
@.CurrIcon := "load";" ^: ^0 G- i* b( M! [7 }, Z
GlobalDistObj := part.globDestination;0 ?2 s4 P/ x2 P# o! C& ^% Z7 w, u
assignLObj := rgmanager.rgAssignL;
! s3 G" l0 N+ o. n- S row := assignLObj.getRowNo(GlobalDistObj);: U5 [6 a) O7 O2 G* M
if Row = -1 then -- since 70* k1 h3 m) K' E4 g/ M6 w
if lan=1 then( ~2 \6 @4 b& X# r
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),9 \+ u5 @$ k% J: c- h Y
to_str("in der Andockstation: \"",?.~.name,"\""));; y, U9 D- S& c- U9 `
else' c! D4 S5 O- t7 r3 m
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
! f% Z% a' K& ]! j, C" m to_str("in docking station: \"",?.~.name,"\"")); ' {7 ?/ H; \2 q6 [5 h7 ?2 f( D
end;9 n: ^7 e. Z. u. \
else
. N8 [+ v9 M; q @.Destination := assignLObj[1,row];
2 K( |. I7 I$ g end; ) E3 T+ F: ^) A- f
newDirection(@);' O8 }- F. ]. A) ^$ O! f H
@.HasOrder := true;$ \1 B& p% [! Q. _
end;
# G- W0 V& j3 s# I, Y. r end;
0 _0 z. N8 \ `8 O0 r2 z$ N; ~end; -- of the method
# Q3 C. Y- g1 ?. _6 J1 n |