/* called by: entrance ctrl of the object 'track'
# x7 D1 g1 H4 V) A*/' V! \6 R6 O% g1 {5 j
is5 b3 j7 e+ x5 Q9 ?5 f
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
1 j) |8 ~3 u( c8 Sdo
x7 s8 l6 e, l- f* v: l2 ^) n& { \, f; t Lan := rootfolder.Internal.Tools.AOLlanguage;
) V5 p4 n, s4 _9 Z if current = @.Destination -- else return
* T j: V# F2 q# R2 G* R4 m6 b then
* r' h, G+ n2 Y0 ?- F4 G3 h- E @.Destination := void;/ [) h# _& x6 v3 g; U( [0 X
if @.occupied then1 I; p. I4 p: B. M; s+ l( L7 H% |
part := @.cont;* n" u3 v4 o% c. P0 Y1 }* a
@.transpOrder := void;
9 [6 Y8 T! e( h/ ] part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1, j: m& [4 T9 K/ d9 h7 c# v O
@,root.eventcontroller.simTime);
% Y6 Q i' J" G @.HasOrder := false;2 {6 c8 k# M: b% l
@.DrivingHome := true;
( _% a" n5 r! `5 n9 \7 v& I rgManager.tryToStartTransOrder;
3 q5 W. q, ^! k. @9 W if @.Destination = void
0 A: }% L& q) | l then -- no transport order for vehicle @0 p6 A2 j, V# h; ^$ z8 J9 t
@.Destination :=
8 U5 I; I# p! g: V, ]. r rgManager.nearestFreeStation(@,track.~);) z' {+ b+ p3 Q8 v% c; k# I+ H
newDirection(@); ( y; ~6 `) e" Y& r5 r
if @.Destination /= void then
' s" S5 B! S' j! I8 I @.Destination.NumReservation :=
! E" K% o& N9 z3 R @.Destination.NumReservation + 1;/ m, y m: R, A2 D2 x$ H9 N
end;$ f, f# c1 ^% @5 h2 @; Q
@.CurrIcon := "drivingHome";
: E. g3 @9 E4 S5 | @.DrivingHome := true;
8 G& J4 K- f2 @1 B3 H; t end;! C c& b; ] T5 t: x
else -- the vehicle @ is empty, both vehicle and part are in the same dock station) a; O: m) `5 ^ B* y7 s
part := @.transpOrder;% s3 E1 @) I! w( g6 d& k. ?
part.move(@);-- load part
' I( ^% _, \8 Q4 y8 b @.CurrIcon := "load";
; n% E, ]! ~/ ^) K5 e GlobalDistObj := part.globDestination;
8 `1 ?! r/ D" k/ G# c, }( t assignLObj := rgmanager.rgAssignL;8 M7 o' H$ z" R" E
row := assignLObj.getRowNo(GlobalDistObj);* Z% P3 X+ P) `7 a
if Row = -1 then -- since 70
+ _; j- J _: Y9 d1 |1 m( J if lan=1 then
9 F) J; K( e8 M, d7 b' R8 o promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
8 S# R# V1 U: A0 ^ to_str("in der Andockstation: \"",?.~.name,"\""));
) i- C5 U2 u" s0 c$ ?5 [ else# W M, m9 M, }7 D% v' ]1 |
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
; N$ C! |+ U) p, u) W to_str("in docking station: \"",?.~.name,"\"")); - t( M& ~% S; ]) z1 n
end;8 [4 k9 y$ x/ k# x0 e, R
else
. U8 n5 J' X8 f8 L2 y# o6 }& B2 X @.Destination := assignLObj[1,row];
( x& S/ K: w. k end;
J0 ~9 g% Q; W% ~, |" ^ newDirection(@);. m. U) p+ U. O* ^- ^0 T& ^9 x
@.HasOrder := true; o! G; I+ s1 ?, t. a: \
end; @4 ^! R* O+ |( `( h
end;1 x6 v# |4 X9 l5 F; N7 R3 I5 ~
end; -- of the method4 q0 L [8 k) D+ B, l
|