/* called by: entrance ctrl of the object 'track'# u+ e' L# n* |3 |6 {
*/+ c( I$ q* ^9 F3 p) T7 q+ c
is
8 Y' U% x/ d2 J1 y6 |& O8 b2 t part, GlobalDistObj, assignLObj:object;row,Lan:integer;5 k" {0 ^# w$ p; A9 X2 [# |" r
do( C1 O6 s4 w" e1 |0 ~# O
Lan := rootfolder.Internal.Tools.AOLlanguage;
) F0 l! U$ ], ?$ v if current = @.Destination -- else return# L, H) U V6 ~" w3 t
then
0 f) p( J; F* F @.Destination := void;2 d+ F! T& G5 m H* v
if @.occupied then
4 L% Y! J4 Q6 X( _. b8 h part := @.cont;
6 Z" a: m3 K! t. {8 s. \* B @.transpOrder := void;
1 W/ Q0 J2 c. F" S part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
6 L( Y2 c0 ?/ m+ O, F( q @,root.eventcontroller.simTime);
7 ]* Q; C6 S2 @0 D3 \9 h- a @.HasOrder := false;) |: @6 L: ~! u, o( I0 X6 Z; h
@.DrivingHome := true;* ~4 } P0 ~$ T+ S
rgManager.tryToStartTransOrder;6 I9 x2 o1 I, U, E
if @.Destination = void! B- }9 a, A8 J: W) S0 f
then -- no transport order for vehicle @
z& Q7 w6 L+ D, f0 s, U& Q @.Destination :=2 t% i! N8 Q3 I5 `8 q
rgManager.nearestFreeStation(@,track.~);
$ }1 `! \4 z+ c newDirection(@);
$ R- G; O5 Z1 i; ]* G if @.Destination /= void then
$ k" A6 a+ |( h1 w- _" d% w6 [( ^ @.Destination.NumReservation :=+ x( s0 J5 y: O% W% @! b
@.Destination.NumReservation + 1;
- t; r4 Z8 I" r) t& {2 l9 K end;
4 o9 t- o$ A3 e; |6 ~5 @5 J @.CurrIcon := "drivingHome";7 L$ M6 }( e8 ~3 b9 Q1 h9 x" {, h4 P
@.DrivingHome := true;
7 R5 C& A t% N! F" b% e end;( ]3 o: T1 L- e4 A9 I- \# Q
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
% y' m/ Y6 Z9 R. w7 @% ~$ x part := @.transpOrder;3 q' M! r+ d) r- _, f* M7 M
part.move(@);-- load part7 x+ u' [( Q, y" o3 E
@.CurrIcon := "load";9 b. u9 q: K3 b- L
GlobalDistObj := part.globDestination;
, B5 d# Q8 m7 `+ _+ F2 i% H7 L: Q assignLObj := rgmanager.rgAssignL;
! _9 ~6 B/ D2 x4 q; S row := assignLObj.getRowNo(GlobalDistObj);& q; i- y6 p2 n. L* @7 u
if Row = -1 then -- since 70
% x$ F4 k. e8 s0 ~6 h9 ~( u% s if lan=1 then3 Y2 X! E$ }8 [' N
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
# Y7 L# G$ Q& p4 l9 i5 J- T- L4 l to_str("in der Andockstation: \"",?.~.name,"\""));
6 S! U: a4 h. Z. |" x9 K else+ v, y- n2 m5 R% q4 e
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),3 @+ D$ R- D8 e
to_str("in docking station: \"",?.~.name,"\"")); / d+ q; F. @4 ~' C* G4 t
end;
# v4 k5 S' E9 b$ r) k; Q else
4 P! a, a% R: R/ q @.Destination := assignLObj[1,row];! C# M3 j" ]9 y F
end; 8 q5 @ `6 n: C9 ~
newDirection(@);
; G7 e1 ]" t0 t( B- Y* u7 D @.HasOrder := true;+ A0 ^2 z. b7 U- r
end;
! ^! j9 P' v h end;; V* Y& d! A& f# b
end; -- of the method, U- x6 u4 D9 [- t1 q$ ^5 o* X
|