/* called by: entrance ctrl of the object 'track'# N! ? L `( Q7 H7 c& e% W& n6 s
*/2 z" p0 {# v5 u
is4 }( c: A! R1 e) R8 u1 E( Z- [
part, GlobalDistObj, assignLObj:object;row,Lan:integer;. h4 `/ I4 W. @+ `$ ^
do( v) D+ e% E' \7 Q
Lan := rootfolder.Internal.Tools.AOLlanguage;) J# ]6 n& R# A' K* ?3 Q+ G' ~0 I
if current = @.Destination -- else return, b2 B! p% f( N3 D e Y- v( h
then
3 B7 I8 Z5 j$ r2 V4 T, S @.Destination := void;
: U& Q" M" G2 {* d4 v9 t if @.occupied then
6 y& o6 V. m; z# F* D) N6 s part := @.cont;
& m$ f7 B! q: z/ u/ H# @. A5 r @.transpOrder := void;
' `. \) Q$ z Z( H part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
p/ A* P) ]3 Y( n; `( Q @,root.eventcontroller.simTime);+ p' V1 f% G8 M4 J9 H
@.HasOrder := false;3 X. H! V5 X/ |% W4 O' |" W
@.DrivingHome := true;
u9 P( |( A5 d: Q rgManager.tryToStartTransOrder;- L! w# X, M2 V) t! u% a5 w5 f
if @.Destination = void
5 L& X: [# s: S: l5 L. G then -- no transport order for vehicle @
& k$ \ d! K0 Z3 L! n) \1 C @.Destination :=
( g5 @* d" y( w& v. P rgManager.nearestFreeStation(@,track.~);6 J" x- S5 s# L3 o: Y
newDirection(@);
4 c' f U0 o; `: j2 a* @7 m if @.Destination /= void then
$ Z: O! T ]- h @.Destination.NumReservation :=
( M- E8 k8 D) x" @+ B @.Destination.NumReservation + 1;
: m) h8 E' W9 J0 u J7 a; | end;
" J. r6 m. J% M! Y2 B3 i D* D @.CurrIcon := "drivingHome";
/ {) |2 U) |3 a( p. H' Y. w @.DrivingHome := true;$ B J8 g1 }8 @" j i
end;
% A6 o: f/ n; K else -- the vehicle @ is empty, both vehicle and part are in the same dock station
: N# R( ~1 n( {. y! n part := @.transpOrder;
0 F1 |5 E. U$ l$ r- ? part.move(@);-- load part
$ V6 p5 v! E. y. b @.CurrIcon := "load";
/ R* P% t( r* N GlobalDistObj := part.globDestination;
' K! q' }: _" [ assignLObj := rgmanager.rgAssignL;* W7 {% A7 k' Q9 K% v/ d/ y# @
row := assignLObj.getRowNo(GlobalDistObj);
% p `$ w# G8 x& D if Row = -1 then -- since 70& q( O* C; q3 t, z0 [1 N' k
if lan=1 then
, z5 F5 @9 ~2 S; E% y- d. ~6 l+ j promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),+ J ]- A& P3 P. B
to_str("in der Andockstation: \"",?.~.name,"\""));
w. _, u- F1 H) r7 R" A& p else
5 Y w9 `/ M3 C promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),. x. v2 v5 Q3 O& H
to_str("in docking station: \"",?.~.name,"\"")); / o: @5 n" `) E. b& g; H. }
end;
2 C4 W2 g: ~6 O0 |' N else7 M1 i: C$ z- C$ [* I
@.Destination := assignLObj[1,row];
$ j' R# u; M, `5 Q3 A end;
0 b) g, G! k1 W F) L; y! U3 { newDirection(@);
8 [8 I. f1 C5 V @.HasOrder := true;
5 @! O3 M; r( V- E- \ ]& h end;, S8 ~8 e1 g# |. ~! m |+ v
end;& \. I8 ^ A8 U( w+ d+ O3 v3 P- h
end; -- of the method8 Y5 a5 D$ n$ L i) g
|