/* called by: entrance ctrl of the object 'track'
! n! K1 w, h3 W*/
: f2 d- V) p. I5 `is; w" p; z9 a6 J& l) y
part, GlobalDistObj, assignLObj:object;row,Lan:integer;5 _& _& H% x8 q: M6 X+ X! }# z
do4 @7 M* {4 b' [7 A/ a* n( s
Lan := rootfolder.Internal.Tools.AOLlanguage;
7 R6 G1 g6 `3 _0 x if current = @.Destination -- else return0 I5 T: \/ n$ k$ j1 }: w s
then
' Z Z( M5 T1 N% q1 s. F @.Destination := void;; h# {6 i3 l& J" w5 Z% X
if @.occupied then
* h( Z4 V% L* ?( `) L* C part := @.cont;6 ~ M3 f, E8 o; Z% [+ x) K, K+ j
@.transpOrder := void;+ C' i# F6 e8 e: {' _ ^$ o% X
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
- i8 n% q6 _! g# f3 B% l @,root.eventcontroller.simTime);$ z/ P" n: I+ L, ^0 _3 ?
@.HasOrder := false;
5 h d5 H9 s. N! S' X @.DrivingHome := true;( z( c Q' |/ q! m4 s3 }* \
rgManager.tryToStartTransOrder;
6 t' \# u' v l" I: n+ d) z8 W if @.Destination = void
+ p1 }: B6 ~2 K$ O. K7 Z then -- no transport order for vehicle @
1 [$ Y0 t+ v0 ? @.Destination :=
) i- g+ d+ ?9 E$ N6 p rgManager.nearestFreeStation(@,track.~);4 r" n, \& w! R
newDirection(@); 3 j4 H2 I2 r; c# \- O) O2 d
if @.Destination /= void then8 z* J$ n$ K9 F8 l0 C( p0 R
@.Destination.NumReservation :=
7 ?# E; {' `3 d+ e, v" d8 m @.Destination.NumReservation + 1;
. o+ [( W) P' F' L end;
( s" `, H$ `! o0 C4 g @.CurrIcon := "drivingHome";2 d# u- M7 Q/ Y' g
@.DrivingHome := true;
; g$ F6 `! y F* E% A. {; G7 @ end;
, Y0 I E; J1 _+ O0 ] else -- the vehicle @ is empty, both vehicle and part are in the same dock station
; g0 c0 D* T0 V" e& f8 T7 k part := @.transpOrder;
2 N7 u# R8 n$ O L% e4 h part.move(@);-- load part4 P. b6 Y N, D Q& c2 `
@.CurrIcon := "load";0 W7 R2 A- ?! y" r# [- z5 _) b
GlobalDistObj := part.globDestination;% j( Q4 D3 _, V: ^( H
assignLObj := rgmanager.rgAssignL;
2 C8 p+ N! W7 r6 X4 D2 w" o row := assignLObj.getRowNo(GlobalDistObj);
, b7 H! f% \4 T if Row = -1 then -- since 70+ ~0 z6 F" a3 I: u, }
if lan=1 then
; Y w3 N, ^# q, u& { promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
9 v! V% ~. `1 ~6 y# n to_str("in der Andockstation: \"",?.~.name,"\""));
8 ^( @* |) N) ] else
# b( \& @% ]2 W% ] promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
9 o% Z( u& M8 |( g, w& g to_str("in docking station: \"",?.~.name,"\"")); ) E3 l8 j2 x' _( \+ `* E
end;* G" K* Z1 i! d0 M
else
+ ]# n* y( n4 P3 I' c6 n- t: ^ @.Destination := assignLObj[1,row];
: ]2 U2 P* u4 ~. {4 r end; ' L; \4 _" U* s( U
newDirection(@);
8 a* R5 K' \5 \: K# H8 s @.HasOrder := true;5 g3 u" }3 F2 }5 @
end;; T; z& R4 y% e/ v
end;
+ A& j/ D2 a/ Hend; -- of the method
* K* h/ s( H# D1 v |