/* called by: entrance ctrl of the object 'track') r9 N$ `' u9 j9 u% {; v' @ I
*/7 k. u# U, C! U8 `
is; O; r& `6 U F( k7 k' `* E
part, GlobalDistObj, assignLObj:object;row,Lan:integer; ^$ O( A1 X7 D/ l% K t
do, N/ h* {8 d: b* x I$ W9 b
Lan := rootfolder.Internal.Tools.AOLlanguage;$ |4 ?$ m5 [3 g0 ?
if current = @.Destination -- else return
( ]) q# y5 S. l0 Y# L( j7 v+ u then" }* j0 S7 I: l) ^) |6 `
@.Destination := void;
3 j# X1 r8 H7 v if @.occupied then. [- A3 i m7 p- S. R
part := @.cont;
; g1 m# L/ h% }" l5 d1 c @.transpOrder := void;
6 |. K4 E" y2 P' {" K! u8 @2 ~ part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
$ K. b, X+ T4 s. x( ?4 `+ H @,root.eventcontroller.simTime);7 P8 v( y8 ^) g( T% q* }/ K
@.HasOrder := false;. L6 @0 }8 E1 p
@.DrivingHome := true;# A5 l/ S8 A' ]* c4 F$ m
rgManager.tryToStartTransOrder;' ?6 `+ x, i3 a' l
if @.Destination = void1 I, p; K) U6 [! I1 y) r/ }0 Q. {( x
then -- no transport order for vehicle @/ w1 n# W$ _9 ]% P7 U; F/ g
@.Destination :=/ A& L+ H/ M& H
rgManager.nearestFreeStation(@,track.~);
/ ?/ u! _! c6 U7 f- Z& I3 s newDirection(@);
; _: v" A6 R; ~( z if @.Destination /= void then2 l: `# L& G" C9 O
@.Destination.NumReservation :=
+ y2 D- r% P9 D @.Destination.NumReservation + 1;5 U+ M4 O5 g" H; J
end;; l- R# y- h( |8 G% R% E
@.CurrIcon := "drivingHome";6 G$ ]/ q0 R& u# _6 n
@.DrivingHome := true;$ N. y M0 C8 j6 c, ?3 n" U
end;
$ e2 J# L$ |/ F0 ^ else -- the vehicle @ is empty, both vehicle and part are in the same dock station W8 n v- V6 D' N" }
part := @.transpOrder;9 e9 P, V2 E& v! Y6 P
part.move(@);-- load part
4 k3 N2 u* x C; u$ w8 E @.CurrIcon := "load";) r3 Y: h8 I# g# s2 H
GlobalDistObj := part.globDestination;
( G1 o4 T1 s( M4 h6 f7 F$ w( p assignLObj := rgmanager.rgAssignL;
' O$ i! a; U J# X. C9 I% K' s) ] row := assignLObj.getRowNo(GlobalDistObj);
2 W' Z/ u' n3 `9 K8 y6 a if Row = -1 then -- since 70 s# R! s. F+ D3 T) p
if lan=1 then
8 ~1 [6 P+ z# j9 w( X promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
4 h$ H: O/ j& ~ to_str("in der Andockstation: \"",?.~.name,"\""));; ^! g# j% D9 P7 j
else
/ V& [; S$ p; Y promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
4 b+ X/ H; r4 M: R0 z, B7 S2 u7 l to_str("in docking station: \"",?.~.name,"\""));
8 u1 G" @' E" L end;
) a% o; h- O- y5 r2 ~* _3 l else
" z) p' l" c* @5 X! p p @.Destination := assignLObj[1,row];, Y* }; i, b5 a% [+ X* h, q
end; 1 N6 @1 e# A8 g% S0 h% K
newDirection(@);
$ g7 x9 `7 t$ V2 D4 I @.HasOrder := true;
1 q, x9 ~; W% K3 ?$ o$ n end;
7 s4 g/ W. {7 q end;
. R( E% A F5 p" y0 Kend; -- of the method
: s' N$ A( [5 F: W( K3 u1 j |