/* called by: entrance ctrl of the object 'track'
U$ u& S1 l8 _4 u; s$ G ]*/5 ?" m. C x+ A# U9 X% {
is2 p; b9 E( ?+ [* D% F, d" x
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
4 C9 y. |1 `( w5 Cdo/ K0 P) d J8 o8 a, s5 W% |
Lan := rootfolder.Internal.Tools.AOLlanguage;
7 q& J0 `! U$ s/ F# }, l. w3 ?! S4 M if current = @.Destination -- else return
3 b) F9 p! c+ i r then& q) Z& O) P x
@.Destination := void;
& M# l; g/ Z! i( R* e, B if @.occupied then+ \0 b" C3 |9 i3 ~1 C( ^4 k
part := @.cont;7 f% j3 _0 H$ D6 C' l
@.transpOrder := void;
7 E* B$ l9 W! J" d4 D4 n# Z# M u$ \9 u part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
; ]) v! g* a% N9 N: k1 q @,root.eventcontroller.simTime);5 y0 Y' D: t2 ^5 y; _& t' {. C
@.HasOrder := false;! q+ W- g9 D5 V/ ]' W
@.DrivingHome := true;
# X# N' I0 \4 ?! M! l2 o rgManager.tryToStartTransOrder;. J3 y' l; m. ?$ \
if @.Destination = void
6 E. d i' h2 n: _) J/ a then -- no transport order for vehicle @
: S7 p& W6 M8 K @.Destination :=
, g, |5 ?# }6 S* y" g0 p5 F! A rgManager.nearestFreeStation(@,track.~);
$ e, O0 q" Q$ ]3 S b8 U- w/ s newDirection(@); 6 g2 S! N( T# k+ x/ t S- U
if @.Destination /= void then
* N6 P" }$ v6 j4 {' _ @.Destination.NumReservation :=9 d7 t- x6 E# I( Y# t
@.Destination.NumReservation + 1;* L! F: r- p' I' O" f1 b
end;9 s- ]4 W8 L- z& X6 p
@.CurrIcon := "drivingHome";
) t8 Q" W5 L1 w4 C @.DrivingHome := true;8 K, b( F' s% H; I
end;+ J3 M/ x2 w1 ]* b2 i
else -- the vehicle @ is empty, both vehicle and part are in the same dock station9 j, \9 s* @4 w' m' F8 E
part := @.transpOrder;- q! M$ s1 W. A, T m# t
part.move(@);-- load part
+ v" `. W Y5 ~% c @.CurrIcon := "load";
/ ~# ]3 p, e4 F' U GlobalDistObj := part.globDestination;
- E8 t# _% _7 E8 x# d/ s assignLObj := rgmanager.rgAssignL;6 ]' O9 b* s; l3 \8 V9 ?, P" s
row := assignLObj.getRowNo(GlobalDistObj);
3 {& p1 @) E- Y+ B# s: h3 q Z0 d if Row = -1 then -- since 70% [1 f+ l: q6 X
if lan=1 then
+ _+ q2 D- n2 l3 W, h+ j promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\"")," P1 Z' u+ t% @5 E: U; @# v* E4 z
to_str("in der Andockstation: \"",?.~.name,"\""));
9 L, L6 I% d6 S else
. m5 c; T' K$ O promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),$ Z2 E+ W$ T' w. ~0 M
to_str("in docking station: \"",?.~.name,"\""));
! I' _8 _4 Z) @; s; o9 Y end;
7 T: y2 N/ ^ V4 Q else
3 D2 H4 r0 v. w. } @.Destination := assignLObj[1,row];% K; K; q8 p- x0 A$ R
end; + u* v0 L: x. E' O: [7 X
newDirection(@);# W4 u1 _# g, R
@.HasOrder := true;
2 R: h- H |9 J5 K5 H end;. |' d- I k5 q, P7 W2 r$ \) _
end;
1 R1 |8 S8 N. r$ Y1 y' v: ~end; -- of the method1 l" P! ~- N/ g) ^( w
|