/* called by: entrance ctrl of the object 'track', G+ N. g- g5 }' W
*/
) _- d! z# j V9 ?4 L6 qis: m& ?1 h4 d1 O, {: b; g. R
part, GlobalDistObj, assignLObj:object;row,Lan:integer;# `$ h. z- w5 v. H- f8 w1 w1 c! @
do$ i' T# i7 N$ ^* u) T9 v% i
Lan := rootfolder.Internal.Tools.AOLlanguage; X4 `1 F6 @+ v9 z% Z. [& A% Q
if current = @.Destination -- else return
`2 ~6 b/ @- ^- ?0 m then( v& h% j: f5 L! J
@.Destination := void;5 R4 m2 S# _, ~! P( ~. c1 d
if @.occupied then0 ` ]* k: x7 X2 \2 E
part := @.cont;4 w. n0 _' a' }' {! [
@.transpOrder := void;0 w. j8 U+ d# n4 f" J% K
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,7 m5 I3 D/ }/ k' {$ F' P" J
@,root.eventcontroller.simTime);, i5 w% |7 @# O8 L. ]
@.HasOrder := false;
7 f' }3 K+ I- g# H @.DrivingHome := true;+ J2 I, i* D5 p. T! B+ A; [
rgManager.tryToStartTransOrder;0 m/ W1 A2 Y$ A& ^$ [' \8 S, q
if @.Destination = void7 s3 a, ]2 D/ W
then -- no transport order for vehicle @3 a' U, }. m$ G1 I- j! w
@.Destination :=; e4 ^ k: |7 V1 V) ]
rgManager.nearestFreeStation(@,track.~);
+ j7 N% M& i' V/ d- L newDirection(@); 6 y2 F7 `) N! b& b
if @.Destination /= void then
5 M# V: }7 C) `- |% U @.Destination.NumReservation :=- |8 Q" w( a; y
@.Destination.NumReservation + 1;
3 c$ N- D' i$ x; }, E z5 ` end;$ u/ g+ S; V2 q
@.CurrIcon := "drivingHome";
5 y7 {9 W+ M* T @.DrivingHome := true;- x& V( c9 ^4 @$ h9 U
end;) @( U& }. @; v' D6 ^9 p
else -- the vehicle @ is empty, both vehicle and part are in the same dock station' U4 C" U# y: R1 }# e9 E% D
part := @.transpOrder;
$ _6 q+ q1 {9 b1 j: } part.move(@);-- load part
: U/ N f N& k" {( D. L C$ o @.CurrIcon := "load";
: K6 g1 x( V5 L1 E4 w7 D GlobalDistObj := part.globDestination;/ K5 N/ I5 d: b- V& i j" U Q
assignLObj := rgmanager.rgAssignL;0 m4 j9 `1 V7 L; O1 i1 P# O
row := assignLObj.getRowNo(GlobalDistObj);% K8 p4 C5 V6 ~' [' T Z2 I
if Row = -1 then -- since 703 H5 B( M8 ^2 N5 E7 i6 i" B
if lan=1 then
7 W5 p5 }; R5 z8 m! R# Q' k/ d promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
/ ?; E; \, S! ~ ?& K5 a8 b3 _ to_str("in der Andockstation: \"",?.~.name,"\""));) S6 V6 V+ b# I" ]5 e% }& V) A. X, }
else; ` N% j' f9 R5 t
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),. x6 W$ @5 e7 F! t. @
to_str("in docking station: \"",?.~.name,"\""));
0 S) f! C% |' v$ v; b! H% ] end;5 H6 `2 @! w7 m8 h5 n
else
/ D) i$ Z7 m4 M1 u" y/ ^8 b @.Destination := assignLObj[1,row];
4 ]4 k" T! {9 K' Q/ ~7 q4 s# b end;
0 H9 B' S: i. j) R8 P newDirection(@);( }) g# G+ S- n
@.HasOrder := true;$ Z4 }7 B6 ?) G; Y! a* H
end;1 l) \ w' d C/ u+ S; b
end;
, x5 S% c/ j! o( I" ~5 \end; -- of the method& a2 U7 Z+ E- K2 b$ T2 K; L
|