/* called by: entrance ctrl of the object 'track'1 a& |, l0 ]* r" Q# K9 Y
*/
/ T8 _2 I& w8 C& K2 V3 J0 ~% h! wis f2 E5 U& t* ?9 x- x
part, GlobalDistObj, assignLObj:object;row,Lan:integer;: e2 _; S, T4 ^; V/ U/ `
do! E3 o6 o& K0 P Q
Lan := rootfolder.Internal.Tools.AOLlanguage;& o- g4 y5 Z3 ?2 A% {
if current = @.Destination -- else return
3 [& K% I: z$ Q. @3 j then
$ G. g- M3 r% g1 F9 {% S C" g @.Destination := void;2 I" P! f& [/ F
if @.occupied then
4 a9 w! C- E/ V4 ^. x B+ \ part := @.cont;5 y8 Z5 `5 K) ^, y: f
@.transpOrder := void;* h2 K; X! o2 u2 H2 j: x; P/ j# l
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,: {4 C* n/ t& B' i0 I% }( P
@,root.eventcontroller.simTime);1 B+ V* s# D' ~9 y, ]
@.HasOrder := false;8 F- O7 A( g* l2 x
@.DrivingHome := true;
7 v; N" W: E8 w( Y/ k* R8 T rgManager.tryToStartTransOrder;
) i* o3 A) \% m% ~, F if @.Destination = void
0 a$ l# r( y5 F$ G9 A, L$ W then -- no transport order for vehicle @* Z1 y3 V; A9 ?
@.Destination :=3 ~' Q% H2 T8 [. @& I# }
rgManager.nearestFreeStation(@,track.~);
5 N$ X' f3 w- I r newDirection(@);
2 R& {/ h4 ~+ i, ~; a if @.Destination /= void then
2 ]6 F# p* D: ?3 K/ L, d @.Destination.NumReservation :=% p$ X' ~# i0 b: G R
@.Destination.NumReservation + 1;. ]$ Z. n/ ~/ w
end;
. c/ v& r, h/ Y5 ^+ } @.CurrIcon := "drivingHome"; U1 @4 l& K! k5 d+ `
@.DrivingHome := true;
1 K$ R `8 G! V! U; q' M end;
+ _! |, }0 T& [6 y1 m else -- the vehicle @ is empty, both vehicle and part are in the same dock station
6 q$ m& K) L4 b- a part := @.transpOrder;
9 k4 |1 `1 b F2 b part.move(@);-- load part4 T- z5 `6 Y& M3 B
@.CurrIcon := "load";; a8 N3 Y# _1 k: S3 P+ V/ q
GlobalDistObj := part.globDestination;* G5 Z( F+ H3 i' L5 t' n
assignLObj := rgmanager.rgAssignL;% |6 r; t' E: J" A
row := assignLObj.getRowNo(GlobalDistObj);: S" W; A3 B S# F% n5 o& ^: q
if Row = -1 then -- since 704 d$ F& j$ O0 y6 r! ^5 @* C
if lan=1 then! X6 c; d- u W1 F$ l7 {8 E1 f8 [* X
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),, T# |; {3 U# f2 Z- j' t6 Q
to_str("in der Andockstation: \"",?.~.name,"\"")); _8 }1 d+ T# ~7 x8 e; f* s0 ~
else9 B1 J) s# j( T' B6 J* U% Y: H. J
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),- H1 W+ B; n3 t7 Q0 ]5 c2 x9 o
to_str("in docking station: \"",?.~.name,"\"")); - U. {* M' g5 o4 j* ?% T
end;" T) Y/ v% k {0 P
else
+ R# P1 L& g( T" X! @2 [- ^4 j @.Destination := assignLObj[1,row];# u- l' h, \' \9 }) F% A! N
end; - _7 d0 ?# e. }; w( i( M$ x
newDirection(@);
1 I9 J+ Z9 } N+ V# x2 q' H) @5 D% B @.HasOrder := true;+ G! y0 C! d6 _; Z6 P: Y0 V$ h! H
end;7 s* _3 s# x9 a# X6 h9 g# x
end;$ d3 a. S; _% K! k
end; -- of the method
6 {$ i6 B% ?) g" m7 A" ]! E |