/* called by: entrance ctrl of the object 'track'3 V& ~; M3 z. r; s2 J
*/: l o) r2 U% p( }! ?8 |. O: J
is3 ?$ D) m( w$ U% \' @
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
" n" @/ a, a7 F2 Z* Wdo
g. I( E0 i9 t Lan := rootfolder.Internal.Tools.AOLlanguage;
8 ]9 B. H9 i& S9 c2 Y& e3 f; }1 z if current = @.Destination -- else return$ f+ b* R( ^2 [6 p; w* h( v- D) V
then- @& m+ f3 g0 [9 S
@.Destination := void;
* G! T8 t; `1 Y! A6 t( |# O if @.occupied then# J! B3 T: S/ T# ]" [ n
part := @.cont;
4 c- w% [, ^1 U6 U @.transpOrder := void;
. e5 ~8 p/ [) h: _ part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,$ v6 ]4 d- Q2 R0 [0 R
@,root.eventcontroller.simTime);
5 b# C* [5 ?; A% e @.HasOrder := false;
2 c( l1 X/ c1 l# y# C5 } @.DrivingHome := true;1 j& U/ S7 c8 Y! Z9 H
rgManager.tryToStartTransOrder;! U+ h+ ^" m1 L& H" s* R8 h* X
if @.Destination = void, V6 K I. v6 `" x
then -- no transport order for vehicle @- E" f8 `) u7 W2 `2 Z3 O
@.Destination :=
1 E& O2 J+ d: i& g' r: d rgManager.nearestFreeStation(@,track.~);+ u9 Q4 p7 K4 L; W
newDirection(@); 7 c" Q' R/ @' ?
if @.Destination /= void then& m- w& o0 T: H1 @! c8 G" K
@.Destination.NumReservation :=
" i, u$ K' w- W& ~2 f# n @.Destination.NumReservation + 1;
" e3 B. r6 O$ j- ~( ^7 F% A# R end;
7 P$ i+ u" E) F# j# | @.CurrIcon := "drivingHome";
9 D9 e9 l q1 A. _! g; f2 W$ S @.DrivingHome := true;/ u( U7 E* a0 S/ C. Y0 n
end;9 L& ~% n, W/ F
else -- the vehicle @ is empty, both vehicle and part are in the same dock station A2 ~* q* d5 T: W
part := @.transpOrder;' M! D6 g' d' H9 f) ^
part.move(@);-- load part
; [% A( X4 S2 I% l3 C$ N @.CurrIcon := "load";: H1 A# G# t4 C1 u! ^3 n
GlobalDistObj := part.globDestination;
$ X/ F2 p( A9 c( Z; n% d g0 O assignLObj := rgmanager.rgAssignL;
& K+ F- z: U, t* _0 G- m5 ^ row := assignLObj.getRowNo(GlobalDistObj);6 j' g$ U3 G0 u( q+ ?# A; s
if Row = -1 then -- since 702 T( F D) j, `$ l0 }3 L
if lan=1 then, A; @' p0 i9 o, I3 C
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),. W- D3 ~6 m+ G# h7 _& A
to_str("in der Andockstation: \"",?.~.name,"\""));
: ~, g0 H( K/ P, O t2 r else
* }$ ~0 s! P" G4 F( i promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
7 q, p$ u5 r# l: ?: F/ q to_str("in docking station: \"",?.~.name,"\""));
! J7 @' O# n/ k3 A5 [7 f7 T: M end;( S' U* W! `0 z! r8 I
else! W! O/ t2 H1 d6 {( Y% J! Y
@.Destination := assignLObj[1,row];1 N! o y' W- b
end; + I% J" h; P4 G* j8 }* F) [( j( k& b" x
newDirection(@);
8 r) p2 r+ M8 C% R, Q @.HasOrder := true;
7 q* R/ O: V' e J& c; u- B end;
: o% t, F# K& l& F# `) y6 ~4 Y" S; ^ end;! M! L( q0 ~: P6 i) [' o- Q
end; -- of the method0 H: n! T- ]# o" w$ G- e! w$ H
|