/* called by: entrance ctrl of the object 'track'" q% O2 P% @/ m. |, i
*/
% Y4 y9 n# W' \8 ?is$ T0 M+ X: I H0 Y1 _3 ?
part, GlobalDistObj, assignLObj:object;row,Lan:integer;2 ?" s1 P1 w5 S. o) i( @3 @
do5 u7 @6 o: \: Z+ z
Lan := rootfolder.Internal.Tools.AOLlanguage;( \& D& [! i# f& E- t
if current = @.Destination -- else return( g `8 W+ g5 W5 n5 I
then
2 b$ G; u5 W& d2 s F) k4 {3 I @.Destination := void;
1 @4 c# W: m% J2 P if @.occupied then9 n( G6 k/ _8 R3 R% Q( ^! u
part := @.cont;
, k; r! |8 e; A9 \1 n, ` @.transpOrder := void;
7 m& @0 d$ j$ \ L! a part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,: w3 [ _' D5 H3 J+ Y8 x7 U
@,root.eventcontroller.simTime);
7 y1 g% S) }6 T7 v& |7 I' Z5 z @.HasOrder := false;
+ P' A& O& e/ u: H. d4 o0 |/ ^ @.DrivingHome := true;8 O4 r3 K- z" ^/ L& ?; T/ y
rgManager.tryToStartTransOrder;
: {# ~, d. R% D& o |2 D* Y& W if @.Destination = void
8 [9 v$ k% f' Q+ B( J then -- no transport order for vehicle @& m, s/ k$ N- X
@.Destination :=# e5 B" q \$ L a# r7 @/ e
rgManager.nearestFreeStation(@,track.~);
/ v1 N: \6 ]5 r8 { newDirection(@); % L4 x- T4 m* G- y2 Z8 U
if @.Destination /= void then
9 E( T" v- e B/ R @.Destination.NumReservation :=8 D8 r* i7 z, {. Y0 z) {' A
@.Destination.NumReservation + 1; \% o! D( X% A! f$ ?1 _5 h% D9 d
end;
. N" r& u, G: y" ?" ` A @.CurrIcon := "drivingHome";
7 ~7 F. K) \1 ^# o, d @.DrivingHome := true;
. x8 t8 P1 I$ _& h) c end;+ `5 M4 r# f" s5 A5 x; l! ^3 j
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
1 |4 X, Y5 `$ N. y part := @.transpOrder;
% W" M, l; D) j- z+ F# j part.move(@);-- load part
( r6 v' W6 R+ |$ F' p% Y( z @.CurrIcon := "load";4 i/ [! a4 L$ W9 ]) N. X
GlobalDistObj := part.globDestination;6 E- s* t' i( Z& }
assignLObj := rgmanager.rgAssignL;) x6 u$ X& z- J6 B. J; A% }
row := assignLObj.getRowNo(GlobalDistObj);8 q' i0 y4 b- Y- `+ b
if Row = -1 then -- since 70
5 j8 H; ]1 G5 e' I' [: n5 ~ if lan=1 then7 H' D7 v; S2 S5 j
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
4 D$ a2 j) i; F% O+ ?/ z9 a# T2 V" T to_str("in der Andockstation: \"",?.~.name,"\""));9 b7 d) T, R# J1 S6 y
else6 U& e7 `/ h" r8 ^; h, J( S
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),! I6 e5 u+ @. w5 O6 q
to_str("in docking station: \"",?.~.name,"\""));
2 a, c) z: d) v end;5 n) e8 p# k9 W- k
else
C! C& P: L" ]6 e& w) E @.Destination := assignLObj[1,row];
8 t$ j$ ^6 [: ] }. ]7 j5 z+ V( { end; ! H% B/ d6 M, E7 \6 |9 ~
newDirection(@);
8 a: p+ i8 L! v5 y1 v @.HasOrder := true;
" w7 c( V4 o5 i" S; m end;3 t9 h' C6 f3 ]; i* @4 V3 S
end;
2 _- i9 Z; i4 j4 f! ]( kend; -- of the method7 i" }4 g! S8 d4 a; O$ d4 k" O
|