/* called by: entrance ctrl of the object 'track'8 W. o8 v1 O+ d( b9 |
*/4 P7 M# i! B n
is
2 i- _, E9 t5 L6 e part, GlobalDistObj, assignLObj:object;row,Lan:integer;1 E- i6 v! H: c& W) Y# q
do$ ?6 L# T, j) Z$ a3 f& W
Lan := rootfolder.Internal.Tools.AOLlanguage;
" v2 i- _- k1 _ if current = @.Destination -- else return
, ^' c) F4 R8 B l6 O then$ P& H# M0 Q1 w. B' R+ Z, n7 G, i
@.Destination := void;# s/ | P& Y6 m M
if @.occupied then
9 }3 m( S" ~ j+ `9 p) z2 [5 g part := @.cont;
" ?2 n0 K" F1 e K" N1 P. @5 { @.transpOrder := void;& g% H& T1 R5 e/ f
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
7 P. W& T# z+ l. Y% P$ z f @,root.eventcontroller.simTime);
: ^+ o7 e: ]& ]0 s5 R# | @.HasOrder := false;( G8 v: s$ V# L( I
@.DrivingHome := true;0 l; o8 P7 N4 u9 Y+ t' J
rgManager.tryToStartTransOrder;
/ i; V, v8 r7 z/ E if @.Destination = void' a+ G' u" E0 t8 v3 Z: [0 u
then -- no transport order for vehicle @
# Z. J& j4 @) j/ ^ @.Destination :=
! m8 |. K, y5 m) B9 R& `0 S rgManager.nearestFreeStation(@,track.~);
* C" Z% H. d# L. ]- ? newDirection(@); 2 x0 K" R) @3 E7 R' U: x
if @.Destination /= void then) T/ k' G: _- e9 E g
@.Destination.NumReservation :=
* w M# @- q. o: Q @.Destination.NumReservation + 1;+ Z7 Q$ j7 }0 `, ^1 Z) w; C4 U
end;& @* K' O/ `% n
@.CurrIcon := "drivingHome";
- ^' C6 o P: f6 b3 G @.DrivingHome := true;
6 N+ o2 S. [9 Y! d$ E" d* G& h end;! @: e% R& B( D
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
8 j( D; H# M3 a: } part := @.transpOrder;
9 S4 K: g1 a7 E) @ part.move(@);-- load part9 P8 K1 J9 b: }9 A3 a1 A9 ~
@.CurrIcon := "load";
" ~+ Y. O" `; d4 L( E( J GlobalDistObj := part.globDestination;# J+ `# k8 C" g E/ o7 \% k
assignLObj := rgmanager.rgAssignL;
2 a7 c: [ V, V! z: d, W' h5 T+ w row := assignLObj.getRowNo(GlobalDistObj);
! V( E* t: m' H! P7 t if Row = -1 then -- since 70 H/ ^0 p5 N6 s }( M' P& p5 P
if lan=1 then l0 d$ B/ ]5 e) ]
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),! E$ e7 r6 R. @
to_str("in der Andockstation: \"",?.~.name,"\""));
# _1 H+ G% D E' z: v else
! o, X. g5 ~) H4 l; j promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
! c1 S2 W& L, D4 j h0 i9 l to_str("in docking station: \"",?.~.name,"\""));
! Y* D( k& U8 F" R: ] end;
( Z3 n8 j, K5 A, W+ i# T' y4 A else, B8 M# @ w- l C2 b! N
@.Destination := assignLObj[1,row];: M& x* b8 Z- D" J
end; 9 ^4 I6 p0 c# v2 D! l `
newDirection(@);
4 h8 O V; {7 I0 a6 C+ r; d @.HasOrder := true;. n& N" J) U, w
end;6 u( J! L% M' ~
end;; a2 I! |9 i8 q5 U
end; -- of the method
1 `) x. y8 w- S7 H" _/ V |