/* called by: entrance ctrl of the object 'track'
. G2 c+ E* c( y& R9 n: s4 J7 v*/4 f% o! A, S! ^8 J7 Y
is6 Q2 H, G! {8 n$ L$ O* C; D4 x0 G
part, GlobalDistObj, assignLObj:object;row,Lan:integer;' W% u6 h" K& @& c9 V- n
do
7 q8 Z# `" ]9 q- H( F: N Lan := rootfolder.Internal.Tools.AOLlanguage;
6 i- u2 R/ S$ y4 s7 R if current = @.Destination -- else return
# ]7 Q' c' B/ x$ a4 W, C then
' I/ s0 z! Y* K0 p @.Destination := void;. ~: N# w+ M; @$ {2 d7 ]4 W
if @.occupied then
p7 G' f, A' b/ Y part := @.cont;
7 N# O3 S/ e) |6 {4 c @.transpOrder := void;
$ }# P8 Z5 a! G+ J, D; x part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
/ x2 p% ]; h* y8 W @,root.eventcontroller.simTime);
, a, z$ e! S! ^7 ?" d! P @.HasOrder := false;
0 T0 v1 {- O O @.DrivingHome := true;
4 t% _: O! b" g0 A- v! F0 T6 f rgManager.tryToStartTransOrder;
7 ?7 G3 ]& r5 K if @.Destination = void
3 h Q/ b4 B* N; k4 P9 A% ~ then -- no transport order for vehicle @$ ~# S8 b) Z% m5 e
@.Destination :=
: Z- s, {. P1 L% X rgManager.nearestFreeStation(@,track.~);* }; K+ w9 n7 r! E7 H
newDirection(@);
0 `1 n6 L6 k- k1 F5 ?7 _ if @.Destination /= void then! ]+ Y, W) N9 Q7 {0 C$ m
@.Destination.NumReservation :=2 \4 q6 ?/ g4 P* d( P0 c5 q
@.Destination.NumReservation + 1;
9 l: {( s: X4 [" S end;0 A2 m9 Y' ^2 M( A0 H1 F
@.CurrIcon := "drivingHome";
! Y( i0 W/ f: J. @( J2 T% n- I @.DrivingHome := true;$ S* p2 Z5 ?& L& U
end;
' \" ]% N K! F8 O: X+ {5 i# N else -- the vehicle @ is empty, both vehicle and part are in the same dock station
" `6 b5 x3 |2 ~0 p' j8 h! f part := @.transpOrder;( }4 `3 T1 p0 G% A' J F" n- |
part.move(@);-- load part4 o/ a8 h) N: l9 K7 l3 S8 O( E
@.CurrIcon := "load";
: q! V- v9 z2 U6 n. A+ n GlobalDistObj := part.globDestination;
9 i- a- Q% m) h3 L assignLObj := rgmanager.rgAssignL;0 `/ p( f# n2 E- x( L0 Y( |
row := assignLObj.getRowNo(GlobalDistObj);/ a% e$ K$ a: } n6 T% F! [
if Row = -1 then -- since 70
& a. m- B' P6 ~9 P% y( R& F* I if lan=1 then0 m" A! c5 w: f! Y# ~! D; G
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
7 Z+ c6 R+ ^: U8 o7 E7 ? to_str("in der Andockstation: \"",?.~.name,"\""));# _+ N& J1 O5 i* D7 d- ]
else( Q7 ~! R8 V$ ]1 q, h2 M
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
* e% ?% N$ p) H5 H- N to_str("in docking station: \"",?.~.name,"\"")); 4 H2 b& X6 R, N/ E, X1 b& e2 }
end;
. C! B8 l# X( p) s, f else! W7 H+ M$ V0 @* S" u2 b6 g
@.Destination := assignLObj[1,row];
9 q: O9 H3 ?( h4 V$ h end;
: [0 U3 y+ G" ]% R0 \ newDirection(@);
# `* D' r! J& c @.HasOrder := true;& x9 D. M# }- K3 Y
end; A7 q2 n. x" F e
end;
9 w$ W* R# F k9 [end; -- of the method9 M& m l- t) ^, p& B6 p. p
|