/* called by: entrance ctrl of the object 'track'5 d7 e: m- t. f4 J- s5 e! J R
*/
4 {' ^+ b4 @# \1 Ois9 y3 I O/ @' {# K) B7 O
part, GlobalDistObj, assignLObj:object;row,Lan:integer;- m% b+ m. ] F& R+ B+ W: U* e
do5 X* o- R% `: V' m9 b7 @9 s( ^
Lan := rootfolder.Internal.Tools.AOLlanguage;
9 }" }$ \. L Y+ N if current = @.Destination -- else return
! ]! ]" O+ y& T. x8 g! N then
! y- z& O" ]$ T, E. m0 X+ k9 x @.Destination := void;" c8 p- d' ]& ]) d) e, d; U* e$ P
if @.occupied then0 z" y4 H. J! H
part := @.cont;$ x; K5 O- {0 ]
@.transpOrder := void;
) l1 g) j5 i4 B, k. I part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,# g) _6 s4 o% V5 K' w7 @# }! y
@,root.eventcontroller.simTime);! H% x/ C, R2 ]% E) Z) k" L4 g* D; p
@.HasOrder := false;
1 M7 m. ~) K0 P4 C% u @.DrivingHome := true;0 U2 B3 F" w/ `1 N k
rgManager.tryToStartTransOrder;
2 U/ E0 e2 B) S% _3 ~7 D if @.Destination = void
R+ u/ {, ^, `0 s then -- no transport order for vehicle @
5 M" ]- L+ C8 ^! Q1 W( A @.Destination :=
! J' }- T1 m( g, o rgManager.nearestFreeStation(@,track.~);
% D; M* V! A; r: O newDirection(@);
( g4 \7 r1 a8 ?; } if @.Destination /= void then
/ W' d9 d$ ]* [3 A @.Destination.NumReservation :=- ^* z) C$ X3 }3 T* g
@.Destination.NumReservation + 1;0 e( K6 l. R2 D) N
end;
# n, x) u- c) b4 p4 X) m @.CurrIcon := "drivingHome";+ K+ O1 e; g- s
@.DrivingHome := true;7 j# N0 p8 B( A/ o" S7 Y
end;& D! q; `2 W/ ]+ s
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
N" Z% |6 A6 X! _5 q part := @.transpOrder;6 e0 g8 i n1 t
part.move(@);-- load part
0 O5 d+ K( h8 | @.CurrIcon := "load";" k9 K1 D% H2 ~
GlobalDistObj := part.globDestination;6 @+ z$ i$ Q' _6 O& s" X. w
assignLObj := rgmanager.rgAssignL;& q; R3 p* O9 c- B& Z3 o3 f
row := assignLObj.getRowNo(GlobalDistObj);5 z) A# T7 A6 u" l& ? `6 f% s* Z
if Row = -1 then -- since 702 Q5 e a" U2 r
if lan=1 then, q. Q! p- n( R" D
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
) N& l$ ?4 ~" a$ ~ to_str("in der Andockstation: \"",?.~.name,"\""));/ ^3 B: t6 E$ F& V2 M
else& m2 p, m( q a' L. n
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
. t: [8 N% D' e to_str("in docking station: \"",?.~.name,"\"")); # X% n& e5 c) H: C: x
end;
2 i% q* U* ^' E1 C5 z$ z2 J else
" {. X! r7 `3 U6 l @.Destination := assignLObj[1,row];
, _9 _* {2 A* B8 @- r end; * Q* g6 b9 t) x7 H0 w* q5 u4 c
newDirection(@);
: O1 R' [4 |, x5 t2 ` @.HasOrder := true;8 L/ B9 U9 J" I& S! O6 Z
end;0 t9 c: B Z4 p% P, F4 W! |/ s
end;
3 C$ z. |& s( C; M6 E# r1 ^: G Bend; -- of the method9 O4 H- L6 j6 v S8 z
|