/* called by: entrance ctrl of the object 'track'$ u5 ^8 C2 x/ B" d" V2 z9 R% N
*/
9 \, j3 T! }9 @+ ~4 {! E# Jis
0 f. D5 w w# E k$ q9 z part, GlobalDistObj, assignLObj:object;row,Lan:integer;
# K& q# N! h: ? z' cdo2 I% g1 I3 b3 _( ^
Lan := rootfolder.Internal.Tools.AOLlanguage;8 D8 m0 M, `/ s# X* \
if current = @.Destination -- else return. U# R9 h& Y% R! y6 n
then8 G8 j0 ?- T7 m* A' b: [1 l
@.Destination := void;7 Z. t1 _% T B+ q
if @.occupied then4 I4 ^- b: v; k2 V# \& {% R
part := @.cont;
% K4 R, q3 U5 b+ Q! A! _7 W @.transpOrder := void;
! J- l/ N' e1 K' Q6 Z7 z part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,% u- n4 M9 u$ G7 X7 ~( Q1 |) I
@,root.eventcontroller.simTime);
/ v i6 y7 y N$ w8 d# \3 q; l @.HasOrder := false;
1 K0 a: z7 t' ^' d$ `$ b( x5 [ @.DrivingHome := true;2 n8 q; O- _- a4 X
rgManager.tryToStartTransOrder;
! p7 i. _6 u+ U if @.Destination = void/ i% ?. p- |( y0 p6 J6 c+ \0 J
then -- no transport order for vehicle @4 V" p6 }; P$ [5 q: L! z4 N [) o; _
@.Destination :=
; Q; v" m8 U+ p$ S rgManager.nearestFreeStation(@,track.~);
# o# q4 [$ A& g newDirection(@); 8 s2 k! [ c# I& Y9 P( y& j
if @.Destination /= void then/ _( h& ]9 T" |9 ?* G
@.Destination.NumReservation :=5 o. J/ e/ ~2 ^* F% l% M
@.Destination.NumReservation + 1;/ q0 ?% B- ]) J; Y( A
end;
5 \# W) w: M# h) T3 l3 e( f Y5 g2 ^ @.CurrIcon := "drivingHome";
) c9 B5 J; Z. } @.DrivingHome := true;1 z9 X5 W+ e N t7 G, C9 w7 ?4 O
end;
5 ^, ~4 ?1 T5 n2 H: | else -- the vehicle @ is empty, both vehicle and part are in the same dock station
( d& i9 g v: R4 E- s" Q part := @.transpOrder;
' L% b' ~; O6 A8 g7 B1 Y% u part.move(@);-- load part/ S* i7 t/ r4 V; R A: A- Z
@.CurrIcon := "load";2 L. d7 C& b( q$ z4 ~$ P
GlobalDistObj := part.globDestination;# k# g7 `* h+ Q6 n: T
assignLObj := rgmanager.rgAssignL;
" ~: g4 Z" @* M6 k2 F row := assignLObj.getRowNo(GlobalDistObj);
7 K6 B1 n D4 u3 H# P/ n |3 K if Row = -1 then -- since 70. a; r% a9 h# i- b9 f
if lan=1 then( u; ^4 _* k. X# x
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),) c9 Z8 R7 e8 q/ ^0 O. @
to_str("in der Andockstation: \"",?.~.name,"\""));
8 r6 x0 o$ Z, I- {9 j else) ^7 b$ ]1 n- S5 W
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
1 d/ O& [% A- I) d+ l to_str("in docking station: \"",?.~.name,"\""));
, w8 @- U' w' V9 r+ N end;
% E3 Z7 K3 B. N! ?$ B" Z8 E [ else6 |" i: \( u) `: d S
@.Destination := assignLObj[1,row];
% a% Q, P' X- O, h% N end;
5 X. b) f! N3 r: T newDirection(@);
: o8 ^$ e: l! U& P; _! L) Q. \ @.HasOrder := true;
- x& ]. D, ], H0 G end;& a2 q5 D9 U( s6 X- r) F: U
end;" r& ?4 d: ~; [$ S$ h: o
end; -- of the method Q+ a* K5 d' v. L0 s$ L6 u
|