/* called by: entrance ctrl of the object 'track'& I, o) l. Y+ y; R
*/
" @3 }# q+ _3 }3 T4 _is
# q" R. {4 ]" t part, GlobalDistObj, assignLObj:object;row,Lan:integer; _/ T- c0 b( y( ]4 k q
do
* c( P |$ g6 p$ } D/ l7 |+ z Lan := rootfolder.Internal.Tools.AOLlanguage;
9 H" b1 _& ?' B if current = @.Destination -- else return
4 w6 U* k; g& u' Y, V then: w0 H5 F/ ^! l% i# S
@.Destination := void;4 G: Z" A: n4 v
if @.occupied then# _: b @/ p" C+ _
part := @.cont;
3 p' ~/ {6 w8 p3 r( _* n @.transpOrder := void;' d4 ^* L x: X% f) W6 V. S9 H6 P
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
+ T' a0 _8 k. T! i$ I3 m: \ @,root.eventcontroller.simTime);, K- }( Y8 t" d! m' N. N9 f4 L( e0 c
@.HasOrder := false;
5 q; ^5 f$ d; l5 G- G! j @.DrivingHome := true;7 F1 a8 n5 P6 I5 H; ]
rgManager.tryToStartTransOrder;
2 j- T9 V9 @. E if @.Destination = void: n6 q- H5 X8 ]( }/ ?+ W, o! r' j& x/ X
then -- no transport order for vehicle @' o! x' \, @( G4 u: A
@.Destination :=
; c; B( T$ I& \4 r rgManager.nearestFreeStation(@,track.~);" E0 u% m5 x( \
newDirection(@);
+ Q$ g2 B7 [: A* M1 t if @.Destination /= void then \. K* ^3 l6 C% [" g7 v
@.Destination.NumReservation :=
7 j3 _" @; V3 J( q5 R+ J$ Z% d @.Destination.NumReservation + 1;
7 h% _! V; o) P; T end;6 v& q: }' d# b6 Z1 Q
@.CurrIcon := "drivingHome";; X8 j2 `+ z" o( S, d0 i
@.DrivingHome := true;. E5 u* V* H4 c$ e
end;
) p( Q5 w0 X0 ~$ e9 P else -- the vehicle @ is empty, both vehicle and part are in the same dock station
5 R/ I$ g/ y6 }/ u$ P2 a8 K2 | part := @.transpOrder;
* h2 x! f a5 S0 ` part.move(@);-- load part9 Y3 G |# B- P: u. j
@.CurrIcon := "load";- ~8 a) {4 I9 X0 J
GlobalDistObj := part.globDestination;
1 R$ r" _9 L, c5 [5 K& p. q assignLObj := rgmanager.rgAssignL;
3 {$ ` K* J; Y( X+ b1 S) Z row := assignLObj.getRowNo(GlobalDistObj);( O: L8 K: K9 U3 l- W7 U
if Row = -1 then -- since 70
6 o8 r& _1 m/ B' m% Q. d; Q$ _, | if lan=1 then
, f" o; E& s- ?7 \1 C3 O promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),7 X: q( S: U6 {; ^4 K# | ~
to_str("in der Andockstation: \"",?.~.name,"\""));! F& k: a* n2 F
else
1 l; f" _: }; H4 i( |) |3 d* T promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
4 r9 L$ U, A i- X! |0 B6 p3 R to_str("in docking station: \"",?.~.name,"\"")); . c- g# k' W) `
end;
1 k! k, J( B5 d0 [1 p" e$ W& _ else4 @6 | ~4 e7 `" G1 q
@.Destination := assignLObj[1,row];
( m2 z" m# S4 D! s end;
* g0 ~" m& O& v2 _* c1 _ newDirection(@);
% c, B: e/ n7 a @.HasOrder := true;5 A3 z( g" e9 k$ O* E
end; A/ [" ^" I u# b4 @$ j
end;
) z! O3 }; h; E' P$ V8 G) \1 Z6 h6 Hend; -- of the method5 e1 m3 { N! _+ E2 l
|