/* called by: entrance ctrl of the object 'track': X, l' d" x/ a% m* U' |7 @+ s1 P, v
*/ }% L2 ~+ J+ y! w. k6 ?: Z; i
is9 a8 A3 S& I- `, e3 P' N7 ^ b- \% H. r
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
a: M( k& S3 d+ T) F9 E0 Kdo
! B U& v9 W0 T7 q _ Lan := rootfolder.Internal.Tools.AOLlanguage;$ W% F5 I- O, Q. p* Z7 G1 e
if current = @.Destination -- else return: C/ W; f& W' H- d! Q% l/ q
then
) v b8 }% p% z' P1 L9 P$ A/ m y @.Destination := void;3 H+ Y8 T( F3 ?1 W8 i* P( J
if @.occupied then4 G g- s7 i5 G8 h) J/ d$ `( g
part := @.cont;. h3 f+ H9 \9 x U' ]
@.transpOrder := void;
3 o. g! V- [! h( B part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1, X; n1 }( k: h* @+ a: j
@,root.eventcontroller.simTime);
' ]. R* ~& }2 W: e% q4 M0 ] u& ^ @.HasOrder := false;
) x3 v( [* {5 t! [9 M: K; M @.DrivingHome := true;5 C# N1 ^5 i3 U$ k& ~9 w
rgManager.tryToStartTransOrder;
, p0 i# _! [; B5 ^" K( k if @.Destination = void
7 t* W/ L2 n. _ z# ?4 ^8 v then -- no transport order for vehicle @5 ~; L6 z+ e) I2 x/ |( {7 f
@.Destination :=
$ b6 e; J: j& Z- L( Y rgManager.nearestFreeStation(@,track.~);7 ^, N# L: `' w5 D2 \
newDirection(@); 0 K4 Z' K8 S' W B' l( ]+ l
if @.Destination /= void then, X2 C9 K( w ?! Z- g0 K
@.Destination.NumReservation :=! `5 ?4 ?7 f$ c1 l' M a; M; v$ D+ |
@.Destination.NumReservation + 1;) f! p L' U: o" Y* p
end;
0 n& e# T& t2 @9 C5 F4 K @.CurrIcon := "drivingHome";
2 |9 F+ [- O! F4 U$ b% T- d5 u @.DrivingHome := true;
/ B, H1 X7 Q0 R$ ^ K end;: s( |& E( q7 \" t5 D' J6 B
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
: F4 K& u) j7 B4 ^ part := @.transpOrder;
. ~* H+ }$ L/ _ x" @ part.move(@);-- load part9 m$ Y8 U, o: M3 D4 W6 Z4 z5 m3 y
@.CurrIcon := "load";: ?) V1 _- ]% B4 W8 i+ _
GlobalDistObj := part.globDestination;6 s2 [, c4 A! I. L3 t
assignLObj := rgmanager.rgAssignL;
' J4 |5 X$ z. Q8 e9 J5 T- C0 R7 ? row := assignLObj.getRowNo(GlobalDistObj);
2 x& a6 l, X& n# }3 N) i if Row = -1 then -- since 703 r M0 d% G2 J1 h7 Q5 b
if lan=1 then& s9 u' a# V; ]2 I. K5 X" U. \
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),4 y T8 {/ g$ J$ `( D
to_str("in der Andockstation: \"",?.~.name,"\""));
. q- l' V- `1 O. G- r+ O else( d% W3 E; Y4 T3 `$ `* ?
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
; q: N4 j3 l7 {- m- W M9 R to_str("in docking station: \"",?.~.name,"\"")); & `( {; H# z; G8 T8 e
end;* ?* A, Q- h8 W
else7 @: y, Y; G- Q7 S7 U8 ^, u9 D5 @" ~
@.Destination := assignLObj[1,row];
& n, u+ v$ o% F: Q end; 3 r& \& h9 h( ^* T, Y- X
newDirection(@);
9 I6 A4 M+ \( i3 C5 T& V @.HasOrder := true;
& h9 O7 t# A& Z. O% t end;
: ~! {3 a+ D- u& Q( ` end;! o, @. E) @2 e. l5 H* _
end; -- of the method/ L |3 y0 t$ ]% {* C
|