/* called by: entrance ctrl of the object 'track'
# j8 X" j8 X+ o& n- T*/$ F: R* D; `& U _: ~3 A9 t8 c
is G0 O7 w/ ^, ?: C
part, GlobalDistObj, assignLObj:object;row,Lan:integer;: B: a* x% ^9 |4 j
do% P8 `: ?9 d2 H& L7 V* c6 ~9 j z
Lan := rootfolder.Internal.Tools.AOLlanguage;1 M3 }) B2 P, R7 S* ?
if current = @.Destination -- else return
# b5 W5 c, T$ N8 y3 K! H then
. c) q9 K% O9 Y/ h( Q' {% ]* Z% z. ~ @.Destination := void;: K! a K( j3 N" Y: x2 r( ~
if @.occupied then3 i8 J1 N! H- k; e& w
part := @.cont;( f. C/ ^: a' `$ N: s, E$ V
@.transpOrder := void;9 h4 L1 I2 h8 q" @$ }) b7 V
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
* k2 `% s$ {( E) G, f* {2 r @,root.eventcontroller.simTime);8 s I9 d/ _9 z4 {- T
@.HasOrder := false;" Y* G" e! V* x9 b0 [
@.DrivingHome := true;/ X5 p6 n" x% T+ m
rgManager.tryToStartTransOrder;
% `! v" T. @' H" H4 F* Q) ^ if @.Destination = void
% O) L! ?/ {) M. M then -- no transport order for vehicle @
: u9 Y( ]% h& T+ E' y* p, C @.Destination :=
2 C7 Y+ N" a) l$ D2 L rgManager.nearestFreeStation(@,track.~);& N+ ^ ?5 b/ T3 U* `
newDirection(@);
- k+ g7 Z6 `3 C( Q if @.Destination /= void then
- M- T$ b5 D' ~, y- D @.Destination.NumReservation :=
; u5 I$ O) a$ X! G @.Destination.NumReservation + 1;
0 ]; x! _+ g3 |, \' J8 d) v end;
j0 Q+ k2 B5 T( } @.CurrIcon := "drivingHome";9 T( k- W& g. r2 ?7 A
@.DrivingHome := true;5 U% Y3 w! v7 |) w
end; ~, ]) B5 J, I$ t5 I
else -- the vehicle @ is empty, both vehicle and part are in the same dock station3 V1 O+ y6 i' M. t( o
part := @.transpOrder;# Y0 H/ U2 w9 P# T$ I/ W& m1 e. g3 h
part.move(@);-- load part
- J! A' o3 Y3 g3 q @.CurrIcon := "load";
) j5 d/ I; C: W! U* s1 O8 w GlobalDistObj := part.globDestination;7 r3 a% J% k8 ]+ ~5 x1 ~
assignLObj := rgmanager.rgAssignL;+ ]( p) i$ j' Q" S4 o) C
row := assignLObj.getRowNo(GlobalDistObj);
& l) I2 ]2 N4 g) m# X8 i% o7 l if Row = -1 then -- since 70& ~, O* \! S7 L0 T9 ]$ T
if lan=1 then) t/ z+ Z! t9 ^, P M
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""), R# C# s/ E+ z% H) K
to_str("in der Andockstation: \"",?.~.name,"\""));
- e9 U& e0 `4 `/ ]6 U7 q else
- a9 n2 u1 r. L% G8 Z promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
5 \5 P$ u5 p% n9 `3 ~& }9 ^$ n& T7 R to_str("in docking station: \"",?.~.name,"\""));
1 f- k4 W+ r- y# O6 e# Z end;
4 w8 ^! s9 C+ [$ R else
( N A4 C( s. ` @.Destination := assignLObj[1,row];6 @: _# p* }5 ^. G
end;
, x( D; b/ K. c" J% q7 @ newDirection(@);/ B' l# k/ w9 D$ z9 s% u
@.HasOrder := true;
2 r; b8 w' ^. ?9 W3 L: F end;/ R% v- j9 ]8 s
end;6 T$ H [8 d) p
end; -- of the method0 o; l0 W, e% g& ? O: s0 L+ w
|