/* called by: entrance ctrl of the object 'track'( j# l( Y. ~% C& S7 d2 u6 Q$ k9 F
*/, h1 n! L# K, n6 z' F$ k
is
( a' A1 R) M, S" @ part, GlobalDistObj, assignLObj:object;row,Lan:integer;$ U7 r* ~7 H5 y
do# C4 V& j( g' T9 D
Lan := rootfolder.Internal.Tools.AOLlanguage;" j/ p. u/ ~% o0 J/ P) _
if current = @.Destination -- else return" Y i0 [& }$ H
then
3 ?. f q9 f! \5 O3 o @.Destination := void;
1 y P8 W! Z* S) X4 z# H7 S% f if @.occupied then
, s- k% }9 B7 O9 G! F/ Q part := @.cont;
2 R, Q8 ?& a! \8 v3 h# b/ m5 V @.transpOrder := void;
; n1 N/ }+ B! k part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,/ m/ n( Y, j) j; i3 J; i, ]1 f
@,root.eventcontroller.simTime);
/ }8 ? z. x0 D R7 G& ^+ n @.HasOrder := false;8 D. o) k+ _3 l) A' }8 y5 o3 w
@.DrivingHome := true;
0 a/ ~8 z4 J, B' c- l8 y. }0 U; T' } rgManager.tryToStartTransOrder;0 `& d( |; ]6 d0 Q, \8 W
if @.Destination = void
' w; m' v6 ]& t4 N then -- no transport order for vehicle @& ?" {7 L5 K$ d4 a8 }
@.Destination :=# T* r: T' h1 m
rgManager.nearestFreeStation(@,track.~);7 G- B) m4 w3 `
newDirection(@);
6 X5 b# u9 A5 i8 L8 E1 f0 \ if @.Destination /= void then
* O& o5 q, F! f5 Z2 \5 u* e @.Destination.NumReservation :=
# Z5 D0 q' Z$ v6 V+ [ k4 ? @.Destination.NumReservation + 1;% U6 c5 @" [: N, [+ U5 M* G8 [( e: u
end;1 ] T( [, N; G; [/ h7 u
@.CurrIcon := "drivingHome";; V: J1 Y2 T7 T b% j2 H
@.DrivingHome := true;' F2 G* _) g1 P6 s6 o8 O. J& v' f( o% |; P
end;2 J1 [* d$ C9 d2 ~" S( F
else -- the vehicle @ is empty, both vehicle and part are in the same dock station5 q# r7 a4 R- X# K# f
part := @.transpOrder;
- A$ M8 S( T. L7 k5 X. V% U+ ?) S% m part.move(@);-- load part0 O) o2 l$ K: p2 M' L& I
@.CurrIcon := "load";2 R' v: }8 A7 x! ?, L# ]5 k# |
GlobalDistObj := part.globDestination;' }! Y8 V) z& `" a. N/ J: T7 T
assignLObj := rgmanager.rgAssignL;; q0 z8 `2 M2 E8 m" a
row := assignLObj.getRowNo(GlobalDistObj);1 E8 x- K1 z% c6 X
if Row = -1 then -- since 70& d- G0 b6 B) |+ m# M$ B) x$ M# A
if lan=1 then
& ? K6 S" |; p' ^, } promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),8 o& K- }0 Z+ z- f$ E
to_str("in der Andockstation: \"",?.~.name,"\""));
8 G X8 o+ q% M& v else
: J* p, s- P0 _. C promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),1 p v- S; J A9 E7 H, l5 S
to_str("in docking station: \"",?.~.name,"\""));
; V# Q) f* Y% z' V2 l. X6 K: T end;# L S# [0 \/ D! h
else
9 R" q5 R3 u2 \( u/ `6 @% ]6 i @.Destination := assignLObj[1,row];
* a8 p5 x& M! }/ L5 X8 m, t+ O! t4 E' i end; 3 q; N' ^8 _* A0 i; C) ?( B/ J
newDirection(@);
( J2 e3 K/ h% ]7 { @.HasOrder := true;
) ]& Q7 h8 p, p; ]6 [ end;
& H! H; R) q% Y; N. A: |/ X6 I- M end;
2 `4 q+ B6 d9 l2 Qend; -- of the method. y, e+ Q( ` ~% g7 ?
|