/* called by: entrance ctrl of the object 'track'
' w, F! ~% T2 v* J% M0 C/ z' J9 A8 U*/
/ x8 d/ i" Z ?% T" o) W/ p, Jis
/ j4 Z5 a" I1 M) n% A9 F part, GlobalDistObj, assignLObj:object;row,Lan:integer;
) E, ?4 q. m5 zdo. s. y8 \6 _) r9 y7 e0 _3 D ^- e3 {) K
Lan := rootfolder.Internal.Tools.AOLlanguage;* T8 w7 b& h! x
if current = @.Destination -- else return, }7 e/ m' M' ^: |/ I) J0 h8 l
then9 @- X. A+ D& X9 E5 }* d
@.Destination := void;
& I9 T# E+ Z. i if @.occupied then
1 W6 \ w9 C% o- g& i part := @.cont;! v9 v/ J+ R& u0 |7 ]
@.transpOrder := void;
+ _& Q6 y9 K* Z9 I; G+ I6 u part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
$ u" m/ ^+ F+ a0 D$ x @,root.eventcontroller.simTime);7 g' O9 Q; d( B% ^
@.HasOrder := false;' E8 ~3 o; J: ~
@.DrivingHome := true; H( J Q. S- x8 ~: o, |2 V
rgManager.tryToStartTransOrder;
' A& u& V- ^ a1 r if @.Destination = void6 o7 e- k- [! k6 l- X1 `# _. [+ Q
then -- no transport order for vehicle @3 H C* P2 d2 ^, Z' w+ D
@.Destination :=; L3 m& u8 f( P
rgManager.nearestFreeStation(@,track.~);
6 c1 L+ \: R) t5 R5 ]4 T4 P$ s newDirection(@);
, e; S1 n' ]- s w9 \8 E+ e4 ] if @.Destination /= void then9 @5 n: c9 s; [/ A7 d
@.Destination.NumReservation :=
) s+ ?0 N6 o/ W7 E0 E4 J0 C @.Destination.NumReservation + 1;$ }' A9 x3 f i
end;
, \* R" a% d. j/ G8 o @.CurrIcon := "drivingHome";
* o9 ]( N! p4 q! q2 E/ h+ d @.DrivingHome := true;& _; J7 I% @& O) N$ H7 V& O
end;
' |: R" u* d$ u. x& x E2 U else -- the vehicle @ is empty, both vehicle and part are in the same dock station+ F u* w6 z( Z
part := @.transpOrder;! z6 B. E, J0 I F4 V$ t9 B3 U# h
part.move(@);-- load part
) b- T8 M; [3 ~ T% a @.CurrIcon := "load";: O1 [0 g( [9 `; E# \9 w( q1 \
GlobalDistObj := part.globDestination;
, ]- l9 F' ]) ?1 K q assignLObj := rgmanager.rgAssignL;
' Y8 M/ a; k4 [0 L/ i row := assignLObj.getRowNo(GlobalDistObj);
/ W5 L+ t2 Q; y/ a5 a" c! n6 c if Row = -1 then -- since 707 Q# Z/ P: K: v- s+ R
if lan=1 then( p6 T$ `( Q: ]. G0 }; q2 n
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
$ T6 i7 x0 L/ @/ ?0 v to_str("in der Andockstation: \"",?.~.name,"\""));. j! N. ], R1 s7 N9 B8 G
else) k$ g, i+ Q! O9 ?
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
3 j. H" F% X% g6 G to_str("in docking station: \"",?.~.name,"\""));
! g; a) s9 N* _6 M end;9 M2 A: m) y0 v8 J, s2 }' d
else& r1 F# ?1 o0 l2 G
@.Destination := assignLObj[1,row];
( |( Y/ B2 ~0 R" t end;
9 s" O5 ^6 k+ q) m" I7 k/ i: W newDirection(@);
/ Z5 H0 q0 B* B7 i" T @.HasOrder := true;
, N. [2 l4 B& C0 x end;% N% a, E& [8 n
end;
2 s) ], v! [! i3 T( i9 Eend; -- of the method
0 i' S: P& [" j) \/ J |