/* called by: entrance ctrl of the object 'track'
# F% F2 }8 A6 X5 [+ J! n8 L9 Q*/3 `3 E1 O& ~" F/ k |% ~5 R" K
is1 q# P0 I! X) r" ]! [9 f1 e
part, GlobalDistObj, assignLObj:object;row,Lan:integer;5 x- y8 ~3 {5 R1 ~; l
do8 x, j; R3 d( r7 @
Lan := rootfolder.Internal.Tools.AOLlanguage;
( d; j5 W4 B5 F, o" k if current = @.Destination -- else return7 t* J; v, [$ n+ }/ \6 U3 a
then9 T0 r' e# W3 Y1 R1 f
@.Destination := void;# g$ h' \3 d! P' L* u0 N
if @.occupied then0 r. N& Y3 L- {- x0 G
part := @.cont;) V H/ W2 X: b5 {# x5 l) c4 A. ]
@.transpOrder := void;" g. N" @% {$ _* J2 e
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
; [; q5 ?7 V8 u! I, o. @ @,root.eventcontroller.simTime);
% u4 p$ X, a M; e: T! p @.HasOrder := false;+ H. ]0 O9 ^: Q# b% _8 t. S3 b U
@.DrivingHome := true;
- `# C6 W% y8 l) W rgManager.tryToStartTransOrder;
9 z8 W1 g: E2 T+ b if @.Destination = void2 N( E& E# @) {' d% O# a
then -- no transport order for vehicle @0 d: X9 T6 k* G3 O: y0 L) i8 m% }
@.Destination :=
- ~6 k Q0 V8 f* D' N* m rgManager.nearestFreeStation(@,track.~);8 L7 X i; ?7 y3 k
newDirection(@); 5 N* Z2 u2 f" I8 P) m; t
if @.Destination /= void then3 f3 r- j& L6 b' t' m$ G) E
@.Destination.NumReservation :=
, j* i6 s- s( u/ ~: x2 i' ? @.Destination.NumReservation + 1;
5 K2 d" u$ b1 q1 N0 A# } end;
; v n8 k0 S) L1 g9 p% y# g @.CurrIcon := "drivingHome";7 r' g0 c' Q7 N# w! N# Y9 Z# L' D8 @/ ~
@.DrivingHome := true;- x4 x1 C1 ?& A/ m& Y6 l- ~
end;
) g" G3 d3 N8 y1 j+ \( H else -- the vehicle @ is empty, both vehicle and part are in the same dock station
: N. k( P- W) S3 q( A0 y8 k part := @.transpOrder;( K( @3 h5 h* ?. S3 G% Q) {
part.move(@);-- load part
d8 a% y5 ?' A8 `& n6 O( |! o @.CurrIcon := "load";
1 E. p G: T7 l$ x, n$ i4 n1 B GlobalDistObj := part.globDestination;% P' D9 Y! L, j* C+ s* \1 ~, n
assignLObj := rgmanager.rgAssignL;
8 |+ N3 q+ r+ ^# ~' R; P; g$ i row := assignLObj.getRowNo(GlobalDistObj);
/ z4 S: U- h4 k7 v if Row = -1 then -- since 70
4 w" j0 M0 a; B# h | if lan=1 then
' m; R0 E! V% M& p* h5 \ promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),* S' W6 U! ]% w% \9 F
to_str("in der Andockstation: \"",?.~.name,"\""));
) u% k5 b. Z x3 {% V9 ] else4 {% K( E+ f6 \# Q
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),& _2 c4 r; Z1 a" X: u
to_str("in docking station: \"",?.~.name,"\""));
f. q: J) T; y end;- q9 U9 o5 h( V# L
else/ }7 C; ~; c% i
@.Destination := assignLObj[1,row];$ d+ U: Z9 t V3 V: p$ H4 {
end; # _4 M) J' p2 q4 o% a5 m& z
newDirection(@);* s% Q b, X I
@.HasOrder := true;
* `, X+ V6 b8 e: L" A# E `% U; ~3 s end;
4 `7 O' w. j, n4 r. ^ end;
1 ~8 L0 e3 E' k/ Aend; -- of the method5 C% M+ D* p& m
|