/* called by: entrance ctrl of the object 'track') q# k( {9 H: T6 Y; U
*/4 Z! O! R2 m$ x: h) Y$ ~
is3 w7 x4 J2 W- r% h
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
2 r y1 j/ j5 K1 y' Q" V, tdo. d8 K/ G1 o- g3 P
Lan := rootfolder.Internal.Tools.AOLlanguage;
7 e5 P2 H% U8 A& @) q if current = @.Destination -- else return( {) N* k2 s7 |- V
then4 C: u" a7 o9 ~- E
@.Destination := void;
; e! z8 l; l- H: P1 m3 } if @.occupied then
' }% U/ }1 w' _ part := @.cont;& t3 L( h: W. P1 U4 f5 v
@.transpOrder := void;
! Z! r1 H. D3 y part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,4 F! O9 I) @3 }) F+ t1 p
@,root.eventcontroller.simTime);1 X' a6 k* Z) G
@.HasOrder := false;
+ P5 `" G$ v* ]1 D" h* ` @.DrivingHome := true;
* O5 @8 F% J1 M: u/ f- ^* N/ e" n7 @6 a rgManager.tryToStartTransOrder;
+ T: g- R4 Y7 `) J2 p9 I) _ g if @.Destination = void! t+ o& T5 S; B
then -- no transport order for vehicle @' ^; d) Q, \+ d0 d; l# q7 M7 m7 ?
@.Destination :=
+ [$ d2 a0 I K& E rgManager.nearestFreeStation(@,track.~);0 _& ~% B8 x' N3 k
newDirection(@); # H" ^; z/ k( h5 F' ~/ ?! e
if @.Destination /= void then& V0 f2 S7 w* `) ]1 H
@.Destination.NumReservation :=
5 h; {; ~+ P# o; y @.Destination.NumReservation + 1;
: T& W2 y- ~2 U$ g end;
, J% H) O! m9 v; G. ^ @.CurrIcon := "drivingHome";
$ v5 X6 z% [; w* H W2 G# x) l @.DrivingHome := true;
* B1 @, I; C$ Q8 w( S end;7 V% w0 V1 K$ i( Y
else -- the vehicle @ is empty, both vehicle and part are in the same dock station% ]9 d, ^; I# b, X
part := @.transpOrder;9 G4 ?5 j" I( n- g
part.move(@);-- load part
; \9 p* `) i- Z% f0 I5 r @.CurrIcon := "load";& D8 @" z* Q6 u* [, T
GlobalDistObj := part.globDestination;! o1 e, w2 T, K0 q& L
assignLObj := rgmanager.rgAssignL;3 c N5 d3 M" ]" ]6 K
row := assignLObj.getRowNo(GlobalDistObj);
' W. x6 E& E4 F if Row = -1 then -- since 70
5 [/ e, j6 w" M$ `. v! P if lan=1 then
1 G2 j+ e: J) J; ] promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),3 @) m8 L9 h6 B/ ]9 }
to_str("in der Andockstation: \"",?.~.name,"\""));
& T; r9 q: ? D: [ R; ~ else; q0 _$ l, P9 @8 t
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
, {$ M( X) r1 H# B7 D to_str("in docking station: \"",?.~.name,"\""));
/ t4 |6 H3 O( S end;6 y5 f# l1 ~; m1 {, t
else. }5 g' _' w# ~( m6 V
@.Destination := assignLObj[1,row];& w3 W) a* S% G, K$ y
end; # F% x! ~, ]8 {: G* l# a& ?- U/ J/ r
newDirection(@);
7 A4 P# x) I( J+ \- q( f( _ @.HasOrder := true;9 _. b$ P3 l% C/ g; c
end;6 k4 f( E' _' a, F6 ?7 {! U. Y( G
end; y8 Y J; F1 b9 y
end; -- of the method0 m) L, p. M% X6 L' S: Z. o
|