/* called by: entrance ctrl of the object 'track'# P% c5 C: z9 c2 Z& X! e# G7 X
*/
0 Q: H4 V% Z1 wis" B6 N4 b+ y" K+ K6 ~3 f
part, GlobalDistObj, assignLObj:object;row,Lan:integer;, C' \3 P8 I, x( S' {9 b& \0 A, R
do& n5 x5 d# K- s5 ~$ F
Lan := rootfolder.Internal.Tools.AOLlanguage;) a/ H& N4 r2 N6 V& K4 d% Q2 J
if current = @.Destination -- else return" n. S/ k- s2 b8 Q3 c
then7 Q {4 D7 d2 m6 p1 d& Q
@.Destination := void;
' \* K8 B: k) r if @.occupied then
- U+ s( L3 L5 V5 @; z. g5 W' F1 p part := @.cont;
m5 h$ a, M/ N: R* ]/ E1 ?$ f X @.transpOrder := void;
) W$ d' F3 O; E+ j9 S7 Z, ] part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,/ l- x6 C2 u% ]( [0 i5 \
@,root.eventcontroller.simTime);
! _: o7 A9 W: T5 W; H4 O7 X4 H5 m @.HasOrder := false;6 O+ _6 W( }1 ^) o
@.DrivingHome := true;# Q8 Q% {$ m$ ^9 T6 ~. V
rgManager.tryToStartTransOrder;: S; m. F" e; i/ ?5 v
if @.Destination = void. }& F6 H; R8 h' T! s; r5 |
then -- no transport order for vehicle @' m( E4 |0 s3 H) P6 |: T# H
@.Destination :=
& D, p) G) V: z rgManager.nearestFreeStation(@,track.~);/ g1 V, }; a; o# I# M2 J/ {
newDirection(@); ! N9 R+ _! R+ [1 w' D( W
if @.Destination /= void then& Z' l( @; }+ l6 F, @$ p6 S( {
@.Destination.NumReservation :=7 G! g5 w0 v, I2 {/ |
@.Destination.NumReservation + 1;
0 d0 A" G% i `7 ? end;
$ U1 B7 H6 R c( F @.CurrIcon := "drivingHome";' G& v' e) i/ O2 r4 d, Z
@.DrivingHome := true;
. n6 C; o3 ]) d+ e% N end;; ?. B* P+ P( S. A
else -- the vehicle @ is empty, both vehicle and part are in the same dock station3 D% Q9 l) d3 D$ X0 Z6 J1 W6 G
part := @.transpOrder;
' j* A8 L! H$ [. X$ c% `' L part.move(@);-- load part9 k7 C5 x& Z: G2 E) }) W
@.CurrIcon := "load";
1 U; f0 A) ~7 Y, y3 w7 O GlobalDistObj := part.globDestination;
$ K: a; S- @' i" }' l- \* f( l assignLObj := rgmanager.rgAssignL;# j$ z- p; T$ [( [, E1 u! b- J
row := assignLObj.getRowNo(GlobalDistObj);0 l- u. h3 X5 ^9 I8 E
if Row = -1 then -- since 70
# _5 \' N G. @4 y" | if lan=1 then4 `. q% _ ^1 u& C$ |& z) k" f) Y
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
& [5 a+ Z- s. t v" R) u. S to_str("in der Andockstation: \"",?.~.name,"\""));
; ~' a P# m9 f6 R else+ A7 @7 j) s) `/ ~" B n
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),! S7 C9 O4 R) m. C( _* F; t
to_str("in docking station: \"",?.~.name,"\"")); : f3 ?# a/ h3 u* e, @6 F0 b) q
end;2 [3 }0 T& }# [9 p9 O% D
else4 g+ p9 p' q" D& ]* W# ~
@.Destination := assignLObj[1,row];+ G! _) N4 b4 c9 e0 a- G
end;
4 r$ z C- B. T0 I y9 P newDirection(@);* D, C9 p" e% ]; e
@.HasOrder := true;
1 n& ~4 W4 \9 H0 {* b. h; Q- U6 I' a end;
; O# v/ Z2 ]! o2 n' G5 y end;* B& H. G" i! M
end; -- of the method0 z+ z& Y! a, n
|