/* called by: entrance ctrl of the object 'track'7 b& l! e( |4 L- A; N" O
*/
( M2 I0 U* w) a) @" V' cis
$ s, p$ A t* _/ l5 d' x8 F# t4 I8 D part, GlobalDistObj, assignLObj:object;row,Lan:integer;
. ?% ?, c4 x) E+ i# J8 _do
) v. w. l, _! y; O, {4 f" w Lan := rootfolder.Internal.Tools.AOLlanguage;* f% o" _* Q/ w! `6 n
if current = @.Destination -- else return
, D# j2 M' \/ E+ C+ G: p then
# ~5 k# A( |1 w5 S4 Q& ` @.Destination := void;
+ M- a( V4 E$ T( Z: y if @.occupied then
& w1 J, x5 i( C ? part := @.cont;0 T. X: M% J( C4 z- P9 g
@.transpOrder := void;4 @* H) o; d9 ^: H" f8 L
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
1 T! } K* P5 z @,root.eventcontroller.simTime);; W. X, j2 \& [7 x. C
@.HasOrder := false;* b% P1 g" N0 `/ C4 M* X3 Z
@.DrivingHome := true;
6 t8 k3 x* C6 H2 g. c4 n rgManager.tryToStartTransOrder;
5 R$ y1 H! v, W* ^" I5 [ if @.Destination = void% `; Y7 v! e6 ^
then -- no transport order for vehicle @- V$ H. n2 b! S- Q& a
@.Destination :=
; `! P+ k- h9 A: S& }! Q' h; n+ G rgManager.nearestFreeStation(@,track.~);: b1 A' y* {- i2 v
newDirection(@); . g% J- z8 A3 _7 _3 y
if @.Destination /= void then5 d! K1 B+ @; d( T" M
@.Destination.NumReservation :=6 X% M/ I3 V$ w w+ b
@.Destination.NumReservation + 1;5 u: T% G/ T- v5 n ^ T; K
end;
/ l! ] g3 x4 L1 W* ?1 E @.CurrIcon := "drivingHome";- y6 t4 A+ d, @
@.DrivingHome := true;. l5 P, }+ Y1 ^4 g" T$ k. c' F3 [5 ?
end;
) o( P% q% L) m. o3 N else -- the vehicle @ is empty, both vehicle and part are in the same dock station
A) n5 h# _5 O- a. a, ? part := @.transpOrder;1 M+ a( R6 k! M1 Q4 k! u3 ^
part.move(@);-- load part# z+ z' i) s6 Y2 S/ K! C
@.CurrIcon := "load";
6 _# |6 u; Z7 g9 e5 k GlobalDistObj := part.globDestination;9 i% N0 R4 L$ D
assignLObj := rgmanager.rgAssignL;
3 W# a" ?) n9 {+ v4 ? row := assignLObj.getRowNo(GlobalDistObj);
1 N H8 X5 P' x' Y: J if Row = -1 then -- since 70: ~4 o9 d/ o. `" V; V
if lan=1 then% o6 w' n1 Q0 ^' L9 P
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
9 _7 `& z( s9 X: } _- T; N3 m& a to_str("in der Andockstation: \"",?.~.name,"\""));
0 d' `2 F! q7 ~ B% b else: B2 ]2 P/ C: I( u6 P' ~
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
# m( y6 |$ `& |+ p- n- w1 p to_str("in docking station: \"",?.~.name,"\""));
( }' W* ^8 ~* |' Z' N end; |; C5 j2 y6 Y: c3 E8 |
else: U! @' i- o9 `
@.Destination := assignLObj[1,row];
& x8 o5 c7 _" i$ {7 l, o( t/ h end;
4 W' e, A' i l# M' Z newDirection(@);% z( E' b" y: s w
@.HasOrder := true;
5 ^7 o6 B8 N9 _7 W% ?* V o5 Q) R end;# x3 u2 H# g6 A: |* \
end;
( K4 |' b* c0 S" e+ } s5 V' Mend; -- of the method
( t& k, A% h; L" B+ u9 C p" | |