/* called by: entrance ctrl of the object 'track'
$ B% w" M2 G4 T*/7 n. A- A5 n3 o, G" |, x0 H
is
j& Y! A- J8 J1 G! ?1 C part, GlobalDistObj, assignLObj:object;row,Lan:integer;/ n5 `/ G2 ]1 E- o- D
do
; C7 s9 \# n( h# Q3 ]( u- G Lan := rootfolder.Internal.Tools.AOLlanguage;8 ?) T, y, m( R# G" ]4 H
if current = @.Destination -- else return
% Y `' h! S" V; d8 J; K1 h- O4 O then/ t; [ N. m+ x4 O: C7 E
@.Destination := void;
8 }0 @% S- u) V/ h. ~ if @.occupied then' a$ L4 k6 d% S0 x9 ]* O
part := @.cont;
% t2 K0 O8 B# b( t7 g @.transpOrder := void;
+ Z2 K$ x q/ _5 }, _* B& Y( d! X part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,4 S8 i5 R/ Q! F( n1 O: X
@,root.eventcontroller.simTime);, F4 l- H k% `' J* t. G
@.HasOrder := false;
- ~5 r% L+ p6 ?) u1 s8 U @.DrivingHome := true;8 t0 U9 K6 U5 v! h2 z5 t
rgManager.tryToStartTransOrder;
1 B! B$ M( _/ p! c! m if @.Destination = void$ C* h3 w5 ]$ u& \$ k3 Z+ ^$ F. o+ |
then -- no transport order for vehicle @" W; _' r' C" p
@.Destination :=8 A1 q0 \" ~- ~' }4 u) h; b
rgManager.nearestFreeStation(@,track.~);
# d0 ]+ L! V, A, h newDirection(@); 2 i' d) J y+ s+ w! l* G
if @.Destination /= void then: Y A+ c& T1 X3 M5 j2 M7 F5 p
@.Destination.NumReservation :=
( } d4 N) h/ n; B4 U2 R @.Destination.NumReservation + 1;# q) D- n# A1 H: I4 b% p
end;- c* ?1 I9 d1 k8 v% U* {; F. N: @+ L
@.CurrIcon := "drivingHome";
1 o2 [! D3 h/ r @.DrivingHome := true;9 W3 a b9 O" y& `
end;
" n$ C3 g' }3 B1 k0 D8 @' O/ l else -- the vehicle @ is empty, both vehicle and part are in the same dock station7 u$ d( {& J7 r- v6 p; Q
part := @.transpOrder;
" v# |+ z: K9 }) `! l$ D part.move(@);-- load part
: }/ y2 F) B7 G( ^% s4 Q3 S1 A @.CurrIcon := "load";
) h: Q1 f E, r$ R7 q GlobalDistObj := part.globDestination;! |; b/ b1 l3 ?! H
assignLObj := rgmanager.rgAssignL;
+ ]* l5 t7 N2 R6 \* n5 d3 v row := assignLObj.getRowNo(GlobalDistObj);5 p( k1 \/ J3 G& S0 Y5 q' V7 A
if Row = -1 then -- since 70
3 Z# h* F: G7 f! ]% r0 b9 } if lan=1 then8 X1 l# q3 p+ e G" a, m+ d5 \% X
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
4 N4 N% H6 C8 ?# _. `' m to_str("in der Andockstation: \"",?.~.name,"\""));! D V- V& G* u7 G7 O5 ?
else% v9 O' g# ~0 w; H7 @1 X# P
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
$ x1 l9 g ~# w to_str("in docking station: \"",?.~.name,"\""));
) C) ?+ s: [( _- _5 Z end;2 H0 [2 y% P4 o, M
else3 N; l9 l" o J+ \! L' w. ^) Y
@.Destination := assignLObj[1,row];
5 h$ e1 ]& y! B end;
! T2 N: h+ S# H. L1 _. r* a3 j newDirection(@);
! J7 {5 E. [* S3 o @.HasOrder := true;; v8 i3 |; ^4 g% n2 b# `
end;
$ S% i8 \& P( c8 H end;
5 `8 r. j5 C) k2 B5 D) aend; -- of the method/ g( ?% Q4 |0 d, X R0 g
|