/* called by: entrance ctrl of the object 'track': h6 G$ S! h$ P8 E; `) d y
*/( G- A9 T' H! W
is
# M3 a, B8 \3 a+ L part, GlobalDistObj, assignLObj:object;row,Lan:integer;
9 q3 [( b8 L! r1 \$ ~# l5 {do
7 }' ]0 M$ K8 w7 t* T# [# N9 m Lan := rootfolder.Internal.Tools.AOLlanguage;
8 }6 O! z7 y+ E9 |% i* r if current = @.Destination -- else return- U9 O9 v. @- ]: A2 T( G L
then0 j O( `: u& ]: j
@.Destination := void;
, _8 D% b. `* F" k3 x% q) S if @.occupied then3 J4 Y: W! w {+ N( e' R- c* p
part := @.cont;
6 X4 T4 ~: u. G& {7 [& _7 c1 G @.transpOrder := void;
4 q* {5 {" ~# A- C# |4 \' A part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
& K5 U: w% C1 \6 `; Y9 z& F @,root.eventcontroller.simTime);
% L S, b7 N1 O, {& B) A# f. K/ X @.HasOrder := false;
6 X. C* E5 P" g% a @.DrivingHome := true;
3 o8 b6 N5 S: E: l& t rgManager.tryToStartTransOrder;
+ U" n- G+ A5 D) q if @.Destination = void
* v% }/ z2 n0 @8 Y) V then -- no transport order for vehicle @
1 a% W* u2 |& e, `6 M. T @.Destination :=
; H2 L7 W" K9 H0 O8 V& O rgManager.nearestFreeStation(@,track.~);# K( ^+ \- V, P
newDirection(@);
5 |& O& N7 K \8 N! _4 E, e if @.Destination /= void then
% D7 a! A5 o- m$ F+ b/ t S @.Destination.NumReservation :=" h. s3 w$ O, m! I. V+ B
@.Destination.NumReservation + 1;
" I4 j- I: a J! }3 R" i end;
8 j: B2 g* y4 L- f* w @.CurrIcon := "drivingHome";
0 ^- X3 K9 }# X: \9 x2 c* Y @.DrivingHome := true;
" B; X8 H0 v" q' w% i6 t end;% h0 C: K+ o) G8 m$ o
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
9 k) g& \& M) c" m/ w f8 x( y, k part := @.transpOrder;
$ A! P4 d- D4 y5 A: s, g part.move(@);-- load part, z& @2 c+ m6 W& X* K2 p
@.CurrIcon := "load";
5 {2 V% h2 V' e. p$ j3 ` GlobalDistObj := part.globDestination;
3 P; f; q0 z% ~/ b8 f assignLObj := rgmanager.rgAssignL;+ b9 B& E6 [6 J$ L$ b
row := assignLObj.getRowNo(GlobalDistObj);2 V5 e3 C0 I7 {" q& `
if Row = -1 then -- since 709 T9 i) d5 D8 a
if lan=1 then
A9 e& Z* }$ l* R, S9 N7 K promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),0 m {) Q4 W. o4 g! w8 P
to_str("in der Andockstation: \"",?.~.name,"\""));
! c0 s+ c7 \: x, q5 O/ N" j else- ~1 U" v! X' f9 f' q
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
3 m8 g, I/ T0 V5 l0 Q0 T7 D5 o to_str("in docking station: \"",?.~.name,"\"")); 3 N. `! F8 U: B+ r3 N
end;3 q: h" K! f8 i9 }1 J
else4 [7 [9 t& f6 D; ~! t* L- ?3 u
@.Destination := assignLObj[1,row];
8 l4 x- K' ?3 b. m end; e, {% D2 m* ?9 U! q4 V6 w' ?
newDirection(@);' w' B% y( `5 X; i
@.HasOrder := true;
' E; @$ S3 e6 K. L4 P6 e0 P' Y& I end;% V, f- ~' j) [$ y s$ A: }6 N
end;0 e. @) g4 w0 ^3 }. d; {
end; -- of the method# a; q. `' U5 y4 j
|