/* called by: entrance ctrl of the object 'track'
3 _/ X, Z2 e0 Y8 Z3 T$ Y$ ?*/9 Y; w8 z& W. `/ d% X
is
1 ^5 h2 m$ d1 u% @# h part, GlobalDistObj, assignLObj:object;row,Lan:integer;
/ Y, Z- X! H! |0 Y! s! m/ r8 Ado
3 }6 e+ O2 U( |5 ?1 a% p$ N& G# @* Q Lan := rootfolder.Internal.Tools.AOLlanguage;
: `- J# T4 {5 R4 }/ m) {& n1 a8 ? if current = @.Destination -- else return; `3 A& ?# [" z- |' |! L" }: _1 a
then
! i4 F P- n3 z1 b4 w# e @.Destination := void;; P/ t' J6 Q9 ]% a" G
if @.occupied then
$ w, Y+ K# P& G5 @; L0 d; e& _ part := @.cont;
, D8 n' a& o- T- e/ w) V @.transpOrder := void;# ?7 z! W* s" L8 V9 k& P* b
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
& j0 V1 s9 y4 W1 ^, [1 z @,root.eventcontroller.simTime);2 q0 J6 e( `/ q. d
@.HasOrder := false;
$ p4 T, @. H: m l( C @.DrivingHome := true;4 R) M! u) g; W2 ]/ k& ?. A
rgManager.tryToStartTransOrder;
/ G, `* }! m! P3 h- C8 ?1 n if @.Destination = void
( G1 v& {" z0 L then -- no transport order for vehicle @$ d6 l* j9 B' [2 x( O, {
@.Destination :=
( j" O: e) t- z; Y rgManager.nearestFreeStation(@,track.~);
4 ^* y) l ^* F) `9 a: ^7 }( r newDirection(@); % R1 t% f# H/ W" w& v7 Q: p s
if @.Destination /= void then ?* i8 f" b6 D9 _/ L. w
@.Destination.NumReservation :=# X: z1 M+ Y4 W" S; L( e2 U) ]
@.Destination.NumReservation + 1;8 `# g8 k# U- ?3 a! {- M4 M& u
end;
/ v+ {! w N1 e5 a* p' a8 ~ @.CurrIcon := "drivingHome";) R" b b& W3 {1 W: a( ?$ z9 L" V
@.DrivingHome := true;" w, t* t4 z) A& Y, p
end;
+ ~7 g* D/ D. @! `7 F1 ~ else -- the vehicle @ is empty, both vehicle and part are in the same dock station0 Z4 C2 }9 D$ y. g' X: O! V
part := @.transpOrder;
) y9 {" S+ ?& n4 C part.move(@);-- load part$ A* i9 O1 m5 w4 T+ ?0 T: R3 _/ R
@.CurrIcon := "load";
# _6 |, l G/ V# `" c GlobalDistObj := part.globDestination;- E$ Y/ i" Y- x( G4 Q
assignLObj := rgmanager.rgAssignL;7 k0 @; l* J3 y: k; |
row := assignLObj.getRowNo(GlobalDistObj);# {. M& L3 C+ k1 k- H% R
if Row = -1 then -- since 70* o$ l; P/ T: p. m8 \
if lan=1 then
0 _- I& S# i" g0 Q) w% g promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),* F: k7 b5 N4 N. C/ e
to_str("in der Andockstation: \"",?.~.name,"\""));
' i/ n/ y' w& `& F3 r else
/ V7 x4 M2 _ | promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
: ^) l1 X7 U( a9 O6 a0 Y to_str("in docking station: \"",?.~.name,"\"")); ; N. Z c# M. k2 g: }
end;* q% t# l k1 ?% K- f, U
else* j2 ]4 m2 [& L* L
@.Destination := assignLObj[1,row];, |2 c: x; K& _6 w) }
end; - h' k0 B6 K' f" U8 N
newDirection(@);, m+ n2 F( k( L5 o
@.HasOrder := true;% @5 i$ O3 X0 w- j( P
end;
9 e3 \; z! P/ d( ~$ d/ ` end;
! }/ g. S0 p% f/ `& I5 a) q% J" Iend; -- of the method0 M! b) Y# [3 y' Z4 }
|