/* called by: entrance ctrl of the object 'track'
/ n- C! T: X8 n2 _; {6 I+ d/ T6 q*/
0 N1 }: Z* y5 a& _" r+ ]" Fis/ N7 R/ z e. O0 O6 c* f/ x
part, GlobalDistObj, assignLObj:object;row,Lan:integer;4 ^! L4 Z7 p5 j6 V' _
do! J' [* d; E7 {* Z' p" g9 t
Lan := rootfolder.Internal.Tools.AOLlanguage;# S7 `+ l |6 i
if current = @.Destination -- else return- ]0 a" F3 x' w2 K" U. \
then
8 V( |' O% {0 U @.Destination := void;! }# @+ s) h" b& }
if @.occupied then, N9 l1 @8 O. d4 X
part := @.cont;2 N( t: M5 r7 x5 K* @& i
@.transpOrder := void;8 P- P" V+ j; r# B5 G
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
! m5 d: l7 m* v: V+ F' w7 o0 w2 F @,root.eventcontroller.simTime);
7 o1 {- ~" f5 m @.HasOrder := false;( M( m, C$ W/ i1 g* P
@.DrivingHome := true;
$ j0 L) X0 v' K; g& B# Z$ q& z rgManager.tryToStartTransOrder;
+ v/ _, T, S. L( h0 v6 F if @.Destination = void8 p9 ?' v7 n3 |9 `0 m
then -- no transport order for vehicle @8 e; X& l7 J. C: O3 r) |
@.Destination :=
0 Z, F$ P! _" d$ l3 s. f7 `! M rgManager.nearestFreeStation(@,track.~);
& I2 _/ G+ t# i9 s5 F, [ newDirection(@); . j6 L$ ~ p1 V* h, B7 Q- f: |1 r# S
if @.Destination /= void then
3 w5 N5 U+ K+ k9 ~+ @) s3 x @.Destination.NumReservation :=0 ]3 A: h$ L* C! x2 t
@.Destination.NumReservation + 1;4 x+ e8 E0 O* D' g
end;+ {# \$ Z+ A% [ i
@.CurrIcon := "drivingHome";
0 Z) D: T4 g4 i* W @.DrivingHome := true;5 ^! Z0 }( | G- H) `! a
end;2 \7 n- C: L0 {. ~# |4 U6 i* Q
else -- the vehicle @ is empty, both vehicle and part are in the same dock station0 y+ m. { ]" A- y/ x- M
part := @.transpOrder;6 r( M6 e7 R% I& j) a
part.move(@);-- load part7 c& h% ^% ?& J+ r& t5 m2 |
@.CurrIcon := "load";
+ i) d5 i) v1 [ GlobalDistObj := part.globDestination;
7 R. H# l" }' Q7 }# W, ~. ?3 ]! N assignLObj := rgmanager.rgAssignL;- U& W+ ^3 V- i3 ?! s
row := assignLObj.getRowNo(GlobalDistObj);8 H, v% _3 [$ m' J/ Q0 ^6 A
if Row = -1 then -- since 708 l- H2 {! {2 C/ h! L+ \$ G
if lan=1 then" b, Z/ P. Z. B9 a3 G/ ~
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
! Q1 i2 F* d0 D' L) e to_str("in der Andockstation: \"",?.~.name,"\""));- P; n0 z+ [# D: R% P' D
else9 q" G) P( F! w0 U4 i$ ~1 N f
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
. f; `) n( q5 G- q to_str("in docking station: \"",?.~.name,"\"")); / ]* V1 g/ n8 S
end;
' q8 O! t! r" c6 v7 w. B else+ }* a3 {4 r* t1 U
@.Destination := assignLObj[1,row];" K' q8 k4 ~+ v7 K; h# g
end; + C) I+ O( o: [% T
newDirection(@);
u% i; q5 t% D3 k% c! T7 t0 ] @.HasOrder := true;
) y A8 F) Y% I9 |# y0 K end;( z- a6 X# E* T; k
end;
2 W7 C; h3 W( X& o2 P# v/ ^) Oend; -- of the method
* S+ n; x0 E" r; P+ ? |