/* called by: entrance ctrl of the object 'track' {5 Z& ~9 I9 K0 O8 v
*/3 I: q9 Y, b( O% \- f, w
is
t; o7 n& F0 Y- f+ s4 M1 i" L% K) x part, GlobalDistObj, assignLObj:object;row,Lan:integer;# o9 v# U. M q% O1 {" w, m7 f% x
do# M" [' |4 Y* m- w q: n' ]' Q6 `
Lan := rootfolder.Internal.Tools.AOLlanguage; i J4 }9 e6 K) s& V$ a( Z* ]$ O
if current = @.Destination -- else return
; x% W, P% Z8 d* R' h/ `$ q then2 T4 p- u* [* {* ^3 w
@.Destination := void;
0 B# g g3 P! C# Y1 S if @.occupied then
$ v$ V* ]3 X& S8 S" a4 W, Y7 O part := @.cont;7 [8 ~( X5 _( f
@.transpOrder := void;
5 s$ A( F$ h2 H& w' n* v part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1, O1 Z9 t/ @3 s8 w& X2 k! B1 o
@,root.eventcontroller.simTime);
1 o+ n2 O: N9 z# Y/ f3 i @.HasOrder := false;9 \- H* E' ?6 v$ @0 Y/ }
@.DrivingHome := true;
5 v/ a: g) D9 G; j5 m. ?7 A rgManager.tryToStartTransOrder;7 d! S! A& E2 G$ w- s3 ^
if @.Destination = void) ^- j2 `1 r# H8 @! k8 {8 y/ g% X
then -- no transport order for vehicle @
+ u( a8 Z+ d7 y) ]4 |% x# e4 O0 A @.Destination :=
+ D1 d5 j& A5 Z8 k* _: v7 G rgManager.nearestFreeStation(@,track.~);% o7 Q( j1 ?: e6 `" T
newDirection(@); / G( p2 t/ n% V% m, x4 Q5 |
if @.Destination /= void then
+ u6 r( f9 w9 s! K* q @.Destination.NumReservation :=
, ]$ E. l5 `/ e& c6 H @.Destination.NumReservation + 1;- A( Z9 P0 k+ H7 W
end;
' [. q0 U- G! b1 P( _# R7 B1 c @.CurrIcon := "drivingHome";
7 _6 A% H, G4 o. L @.DrivingHome := true;
9 N$ _9 R+ ^) D7 f W end;
+ H- g0 J1 l2 i9 F4 }" t8 S2 k else -- the vehicle @ is empty, both vehicle and part are in the same dock station
P9 ?; B. f2 a* D) D* w# } part := @.transpOrder;
. ?/ }; l7 w! \% S* `% n part.move(@);-- load part) j" y9 x8 m5 T* ^2 K
@.CurrIcon := "load";1 J7 ?7 K+ I9 Q0 s) j! S
GlobalDistObj := part.globDestination;
) f7 X1 {3 Z, y9 Z# F/ \: ~9 v assignLObj := rgmanager.rgAssignL;
o$ H, ?* {9 w& H row := assignLObj.getRowNo(GlobalDistObj);
1 a r6 g2 I/ g0 v if Row = -1 then -- since 70: p. e& w1 Q j0 w: v( T+ n9 X% z: B
if lan=1 then8 s" o$ A) D# S
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),' \; C5 \& X2 x& K' b. o
to_str("in der Andockstation: \"",?.~.name,"\""));
7 l3 i$ S: q5 H6 ^( a, _ else& M3 V6 T6 e9 o
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),) v9 Y" X5 e- O
to_str("in docking station: \"",?.~.name,"\"")); ! L7 A. G q5 ~' P
end;
5 Z: M- F" h3 U+ K else$ h3 ^& W" V- z3 o/ V
@.Destination := assignLObj[1,row];
4 `. s L$ K# B4 A. h end;
3 `8 G3 p. G% F) y4 Z4 y+ x) k: g newDirection(@);
' L n8 g3 m$ [; y1 }. X1 _5 o @.HasOrder := true;
7 _6 m, h [) _ N# v1 V: f" P end;
) |; Y1 I9 D5 v end;
( y: V( S, L4 D+ h3 i3 I dend; -- of the method# ]" G( G/ P+ ^# [0 A
|