/* called by: entrance ctrl of the object 'track'
& M3 i2 L C+ i1 F; l2 i% T*/4 O# d, l$ b1 y6 y1 B* `
is7 n3 @& d2 o5 \+ l; S
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
1 ]; T. W/ N k$ V5 r* f$ ndo- X7 P; Q2 b( T a8 }4 B4 P, e
Lan := rootfolder.Internal.Tools.AOLlanguage;) y- c6 ?" d! b. [# ?, h, {7 q
if current = @.Destination -- else return
( w6 x( }) N7 R1 R2 R( j! S6 N then
6 Y: F$ ~' e/ V2 j! m+ ~ @.Destination := void;
+ o7 ]& w9 W0 K0 ?4 g2 |4 u6 m if @.occupied then! L& A2 v8 r+ v6 H$ j# r
part := @.cont;) w$ J! h* R8 f+ z. m4 ]" ?; y2 e
@.transpOrder := void;: H! C9 i1 q! D
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
: q+ o. ^2 ^+ c6 m4 b7 ` @,root.eventcontroller.simTime);
/ W6 a! a% g5 V7 a! ~! ^4 w- @. N @.HasOrder := false;
1 G" e# l- u4 J4 M5 N; P0 r8 A3 I @.DrivingHome := true;& Q# ~- F, M$ g
rgManager.tryToStartTransOrder;. w' u! x( a* l+ W
if @.Destination = void
# L$ W0 i2 R2 P0 A# p4 K then -- no transport order for vehicle @
" r$ x; A! U+ q4 j3 r @.Destination :=
: E2 g4 P. K6 X8 h rgManager.nearestFreeStation(@,track.~);
& D1 D* l8 I* \9 | newDirection(@); 0 b0 T- p( S( ^+ D
if @.Destination /= void then- F, \2 T) z* H8 P: }
@.Destination.NumReservation :=9 a3 m+ E' p: X5 w z
@.Destination.NumReservation + 1;
- C0 M" ~9 T [5 G$ ` end;5 b- B+ e( D- Q4 \
@.CurrIcon := "drivingHome";
' `5 |+ D1 A# P g( i5 l5 d) z @.DrivingHome := true;
, R& t; _2 h6 B) ?; t K( i end;
6 N- }7 V( B U* W+ x2 t2 a else -- the vehicle @ is empty, both vehicle and part are in the same dock station
& Y% q4 l% h0 A. j s' y/ R part := @.transpOrder;4 c: w& B1 H$ T6 Q1 M2 u
part.move(@);-- load part+ ~8 d! d/ K9 S7 i; a" {$ b
@.CurrIcon := "load";
) `* v$ i$ c5 ^( K3 q& o GlobalDistObj := part.globDestination;6 t) l' b2 U5 H! U
assignLObj := rgmanager.rgAssignL;# @2 R8 ]1 o* H) U' j* i0 O) P
row := assignLObj.getRowNo(GlobalDistObj);
: p: e0 a9 s0 c1 Q if Row = -1 then -- since 70
6 Y* T1 p1 u" J2 \ ?0 A; Q- } if lan=1 then( {$ b% ^. d0 a4 R& s5 ^
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
; w2 _+ D* {8 w+ z: X" A to_str("in der Andockstation: \"",?.~.name,"\""));
8 R2 K/ ?( `, `3 b; N else: [$ x: o6 G% _2 }: ?
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
) i, [8 Y7 h$ j- h to_str("in docking station: \"",?.~.name,"\"")); / H7 ~" H9 i2 ?3 j# m
end;
! A/ b/ k4 Z C3 c3 y! n else0 C" u2 P0 h- B' t3 f# p
@.Destination := assignLObj[1,row]; Z$ c, P9 A4 T5 j, `' {! }3 R
end; + S( C9 I# V, B" U y3 y; C
newDirection(@); z% ^) Q0 w& {! m$ z7 F' Q( _
@.HasOrder := true;
[8 _4 h1 g% h! R end;
8 x8 _& |! Q+ H7 v( T6 H end;
& A: z8 [- e' t# Rend; -- of the method- l* C5 E- ^. N; e: _
|