/* called by: entrance ctrl of the object 'track'
& l1 D8 w3 V% D*/2 S( ? H/ C; Q# S
is& |; S! b" b# p/ q
part, GlobalDistObj, assignLObj:object;row,Lan:integer;4 s' N/ J" y1 Y8 N1 ^: G8 u
do
5 R3 d* a+ i( O0 f3 U' d6 E( D$ Q Lan := rootfolder.Internal.Tools.AOLlanguage;; \4 i/ r' B, z9 N5 K1 g
if current = @.Destination -- else return
: o; z8 \" H& l. t then t( m2 r; o$ l, |' l
@.Destination := void;" r5 o1 C* ~! ?$ n; } R8 m( q8 I
if @.occupied then3 H+ Z- ?" o# G4 W6 V. Y
part := @.cont;4 Q, k* F T$ N$ `( u- t0 R8 }) f# {
@.transpOrder := void;! `- Q6 h! j2 G6 a
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
% r: M5 _, w# |. k. [$ |+ ~ @,root.eventcontroller.simTime);
' a8 K/ \# Q$ V5 M/ H' ` @.HasOrder := false;
* t. s6 t7 q4 E8 J; n5 g @.DrivingHome := true;
$ B2 y: b, \7 @1 M/ W rgManager.tryToStartTransOrder;
4 q- D$ c5 v2 Z% O( C% i" ? if @.Destination = void
# D* \! Z4 `% @ then -- no transport order for vehicle @% | Y; @( M/ m$ \% N4 f
@.Destination :=
% h9 z! F5 P2 v& k1 { rgManager.nearestFreeStation(@,track.~);
, g; w) }, U1 e& g newDirection(@); & L* r( [0 |$ P' B; u
if @.Destination /= void then1 m9 q% k+ E& p e" ^; c0 V" @/ |
@.Destination.NumReservation :=
; u. q: y" b! A0 C5 M @.Destination.NumReservation + 1;) d) o; R! o6 h( b" f! W
end;, s4 y5 z) E; ^
@.CurrIcon := "drivingHome";
4 }1 M6 j2 m7 N5 H3 b9 R @.DrivingHome := true;& h; J- S( L# J+ a$ ^" g6 U$ [
end;/ S' W7 d. g) A8 s+ w' ?
else -- the vehicle @ is empty, both vehicle and part are in the same dock station9 d1 X" M" l! |2 n
part := @.transpOrder;3 \& I, c, A0 k
part.move(@);-- load part
' V. j! E9 D' ~+ c @.CurrIcon := "load";
/ u0 Z! t' {' i% _4 ^ GlobalDistObj := part.globDestination;" v$ u4 w+ L& q; Z, G5 N3 K
assignLObj := rgmanager.rgAssignL;
2 k% ^% O5 V4 f$ w/ y% b$ O row := assignLObj.getRowNo(GlobalDistObj);
+ _) V! a! Q" X# @3 _ if Row = -1 then -- since 70& C1 J" b L& U; ?6 c2 u
if lan=1 then9 n9 [+ H6 u6 b( s8 k* @, y
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),7 t1 f, Q3 L' N$ S+ r+ M% S6 X
to_str("in der Andockstation: \"",?.~.name,"\""));
6 x2 _) G+ n( Y else
z- f; y! ^) `$ R9 m7 C promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
! Q" ~* }# \, `& ^# z5 `7 [ to_str("in docking station: \"",?.~.name,"\""));
5 |) E! ~( t+ C8 E% f+ O end;
0 a K) \4 r2 Z+ T5 `8 a! }+ S else5 [- e+ S) b' s, t j L0 C
@.Destination := assignLObj[1,row];
* q# P% P6 r9 P* ^% k/ c end; X E3 e D$ h4 v: C
newDirection(@);
5 \! }( a' X# `0 z @.HasOrder := true;7 }7 D1 k. M2 r2 S: P# Y
end;( B0 W& r( a+ z: u' O1 o/ }# D; a
end;9 k* z8 N; g3 [! i& Y
end; -- of the method* s4 G+ c: k# w+ }$ j! J
|