/* called by: entrance ctrl of the object 'track'
: X' B6 k! r7 X4 ?: W( A! {- K*/) w( c% O/ `8 k5 X# `
is N2 p# U/ ]9 \, ]: ~( w
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
! U5 U! p. L2 Y) u0 Odo9 i5 G( H) e- M( j
Lan := rootfolder.Internal.Tools.AOLlanguage;1 z3 {6 F" l4 [' E! H
if current = @.Destination -- else return
+ E! }) `# I2 q$ m/ P then
0 N, S. Z+ W( ?, r4 t' J @.Destination := void;8 n; T8 E# X5 p: w7 L6 ^
if @.occupied then1 V% I, q# R" j- { ]
part := @.cont;0 y! P4 I: U+ F2 _
@.transpOrder := void;, Y9 F' b2 [: M' J4 e( L
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,3 P) b! T; D1 J9 H) p
@,root.eventcontroller.simTime);
, l0 k) m: l+ F% y+ R @.HasOrder := false;- }$ z: o& Z1 ~- c' d9 Y. A
@.DrivingHome := true;
2 h0 P5 K6 C$ O1 L$ `( r- ? rgManager.tryToStartTransOrder;& \( h( X! s) c2 A4 X9 `
if @.Destination = void/ N3 n$ P, e2 |- c: H0 S' G1 M
then -- no transport order for vehicle @2 i( c, e( ?" {. K% ` J
@.Destination :=! ]+ M1 h ]+ [7 y* j1 Q% H
rgManager.nearestFreeStation(@,track.~);
/ v: G& b: x$ a- s. L( H5 s newDirection(@); . h* F Z/ U6 \, M, h6 X0 k/ @
if @.Destination /= void then- R$ X6 P- G" s' j3 o7 T1 |% k
@.Destination.NumReservation :=
1 X) Z2 Y( D! a/ R9 Y @.Destination.NumReservation + 1;; F& P. O$ F* E* d
end;( s! w' P$ E9 }3 ]! [- Z
@.CurrIcon := "drivingHome";; N9 h' U2 Y Y7 ?) I
@.DrivingHome := true;
. o: o+ }" D2 q1 n$ }+ y# d end;6 X- E+ u( s( ^
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
* g7 @' L! S8 W8 j8 ?/ n: u9 J' }. [ part := @.transpOrder;
4 H. ~" \8 [* O4 C part.move(@);-- load part8 X, V- R' H# A! g
@.CurrIcon := "load";8 W+ o6 k' D2 R$ h4 @
GlobalDistObj := part.globDestination;" l/ B& g& j* ?! T& Z" X
assignLObj := rgmanager.rgAssignL;# R, L. C! L, A& e+ @
row := assignLObj.getRowNo(GlobalDistObj);
' B/ W4 ` d8 p4 n( q1 ` if Row = -1 then -- since 701 o, [: T% o$ O9 X, m7 G" I
if lan=1 then
( k) {- B1 E1 j% ]0 ` promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
z2 Y$ P, n5 B+ a; \ to_str("in der Andockstation: \"",?.~.name,"\""));& L- L3 H* l/ l
else( ^+ U0 T: I2 A2 K, ?$ m8 A
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
) a' S6 P7 I( s+ m/ b to_str("in docking station: \"",?.~.name,"\""));
3 }0 Z8 ^ s M/ K& s end;+ I+ j/ k# i# D8 A& V
else
; J9 r5 U7 M1 S: f# }( S( R0 x$ N @.Destination := assignLObj[1,row];
8 H% y1 x; h- b end;
! d: f. L; _9 X H# @+ x newDirection(@);
, t8 m( o8 l) h* w, N- c5 s @.HasOrder := true;
x& U+ {, r% M# N1 C end;1 {7 `4 m. F" V4 w1 F
end;$ k: u) `1 p) M% n' D5 o
end; -- of the method6 D3 {% j) P2 \! q e
|