/* called by: entrance ctrl of the object 'track'* C7 q% x5 l4 i- w% j; {
*/4 A' Q# I4 Z! t6 r( I
is2 p) @, `2 i, u$ h* [5 y4 J$ {
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
' W" \5 ~# n. ^# X2 }3 k4 Y) C& bdo0 z$ c3 ]7 U; c3 T! N$ @0 ~8 ^& [
Lan := rootfolder.Internal.Tools.AOLlanguage;, m& o, j' A; Y: I' a" F
if current = @.Destination -- else return: @+ U% ?2 l) k' O
then
8 ? ~. D. c. Y, f @.Destination := void;
5 }4 Y" O0 ?9 z s if @.occupied then% G+ S; ^; H/ j* C7 r8 s
part := @.cont;
s( f4 x6 X+ |9 z) m @.transpOrder := void;
2 H6 _8 q' e; M. N) X" e$ v part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,6 S, }4 X5 ]' z
@,root.eventcontroller.simTime);
7 C0 t, w1 U, t) R. T+ ` @.HasOrder := false;" P$ l8 w! T( w2 u& \
@.DrivingHome := true;: J, h: j3 }/ ?% D. x4 C
rgManager.tryToStartTransOrder;
! l! M4 e( u3 T* j) Y! T/ t if @.Destination = void0 _7 P' ]$ x9 M! D _
then -- no transport order for vehicle @
, H6 o' G5 {2 o# @- l+ n @.Destination :=
6 B$ a: R( w/ F) M0 t' |# W rgManager.nearestFreeStation(@,track.~);2 I; H: u3 j; s/ r B+ Q3 K
newDirection(@); 4 E" k9 h$ }8 ]+ }$ R& Y
if @.Destination /= void then: \2 P3 d2 ^2 j/ C& o7 G' G
@.Destination.NumReservation :=1 j( M# C7 T. V7 T; ^1 k
@.Destination.NumReservation + 1;
) g' t' L$ l% |8 y8 k& a end;
" ~1 J8 ~* L) I' g& Z @.CurrIcon := "drivingHome";$ i2 T" b# U; R" {1 z: W' }- b+ w1 `
@.DrivingHome := true;* d* @( a0 ^4 B
end;
8 J u, `: v3 ?9 f3 @ else -- the vehicle @ is empty, both vehicle and part are in the same dock station: p9 a c* E1 A) U6 O) D" z+ h
part := @.transpOrder;9 |" Z$ m& P- t
part.move(@);-- load part0 I7 n9 }' a" L. d6 k
@.CurrIcon := "load";
7 P. M# t- M& ?- X9 L" A7 ^ GlobalDistObj := part.globDestination;; k/ x' B; s* a9 W
assignLObj := rgmanager.rgAssignL;
k0 l& e! c- Y" R# s row := assignLObj.getRowNo(GlobalDistObj);
# C. {; U6 o( t! j3 c if Row = -1 then -- since 701 k) J! m, h4 Q# }4 p
if lan=1 then
) g6 u! J) B" R$ D promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),1 F4 P$ n- D; M8 ~2 A* Q# T
to_str("in der Andockstation: \"",?.~.name,"\""));
: v- t% \. O/ E. P1 Z9 ^) h1 c else$ o1 V9 V! G x, F! O% H
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),7 q1 I% p6 @# y
to_str("in docking station: \"",?.~.name,"\"")); ) x, [* M& E* J- ?$ v1 Q; X3 r `& o
end;
6 z5 F$ I2 c# n+ w else$ [2 s! B& k3 |# o: I7 |
@.Destination := assignLObj[1,row];
' i u) w, V7 E q9 C2 L* ? end; * s8 O+ ]& T- t) T
newDirection(@);
- k" z4 l( {% y- T5 z2 Z @.HasOrder := true;
o9 I6 B$ H- d& S end;
1 t# X9 T3 _- G l( d9 ^# D end;
9 `1 D7 d7 b5 Xend; -- of the method5 J5 e8 p' [- E- h/ i$ c# {( G
|