/* called by: entrance ctrl of the object 'track'7 T" i }0 T& A3 a- T: n; h
*/+ m6 N: L, k7 p/ q& d
is$ w- ?; g4 d( T, [6 j
part, GlobalDistObj, assignLObj:object;row,Lan:integer;; ^6 A& d7 Q8 o4 p- a: z
do8 G" b F7 X, E' Z- |+ f
Lan := rootfolder.Internal.Tools.AOLlanguage;$ {* `9 E j( U% \$ y. k
if current = @.Destination -- else return
8 Y: H: @% m3 H8 X Y then
( K* t( D: ?% R% f @.Destination := void;& y$ D2 g& u' @' ?8 b% r- { |
if @.occupied then' x* F+ _9 W1 U# F0 \. Z9 A* ?
part := @.cont;$ }% ^4 N8 X) X6 T
@.transpOrder := void;
7 r2 M" l; R. | part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
! Z; c5 C) c9 c: c6 A @,root.eventcontroller.simTime);/ Z: T+ j4 m$ t7 N% I
@.HasOrder := false;/ {' {: R4 m e7 r1 k
@.DrivingHome := true;: M/ X: K* ^* y/ z8 n: N8 D
rgManager.tryToStartTransOrder;* {/ h% K: [: \# V
if @.Destination = void
& F, o% f. o) d" Q then -- no transport order for vehicle @
9 u! B0 O* H5 d5 y H; ^ @.Destination :=
# P( X* F! x( v, _) n9 M rgManager.nearestFreeStation(@,track.~);6 I) H) l8 s- x& ^% F
newDirection(@);
4 d( J) S2 p4 M9 ~ if @.Destination /= void then
! }2 W: M1 ~1 H1 J @.Destination.NumReservation :=8 j* L2 t) \$ r. e
@.Destination.NumReservation + 1;
' a3 r& T9 H5 d4 T4 Q. Z end;
+ b+ K% D1 Y6 h1 o @.CurrIcon := "drivingHome";
( C: r# q: z1 U" G& R8 G @.DrivingHome := true;* g8 Y! x$ w( `) X
end;
6 o/ B6 [' P% H% h else -- the vehicle @ is empty, both vehicle and part are in the same dock station2 }5 n8 o v- \! p8 \
part := @.transpOrder;
( D8 M$ ^4 Z! a/ l9 Z8 ?' x part.move(@);-- load part, H. R! _' {2 l+ d# v( N8 R
@.CurrIcon := "load";4 R+ ?5 X0 D# a; o( N5 u
GlobalDistObj := part.globDestination;1 O6 t( q2 P5 y* G
assignLObj := rgmanager.rgAssignL;% B! T# x- S% o
row := assignLObj.getRowNo(GlobalDistObj);
9 u% ]7 x0 q4 r& T if Row = -1 then -- since 70* t8 ]5 V9 k) `6 ^
if lan=1 then! I; d- z8 m2 q* w8 l
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),4 s1 r9 s- U5 V" _. x+ I# z' k
to_str("in der Andockstation: \"",?.~.name,"\""));3 | \. D- P# y, I
else2 n: v, z. z0 C) i% J; Q
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),: I3 E+ g) a: r0 H
to_str("in docking station: \"",?.~.name,"\"")); ! [' X4 x0 R* t: b& ?9 \: L
end;
, A% A% n6 x$ b7 N0 y( P else
; Z$ W. X8 A2 R6 N2 Z( ]# Q- J& S+ u2 G @.Destination := assignLObj[1,row];/ @0 B+ j. F9 L. Z
end; / X8 V _$ C7 X7 n8 ^
newDirection(@);
! U) y3 C8 z8 [/ n: y' U* c5 ? @.HasOrder := true;4 n9 A X3 d: m, I6 b( c1 h
end;" M! q% H1 f* u; T! j
end;
, C! E5 J+ Q8 p0 r& S2 D5 Kend; -- of the method1 ~* _* i3 y' `& Y+ |' y0 \
|