/* called by: entrance ctrl of the object 'track'
2 A& B: P6 _% U5 v8 {*/+ H+ \9 i4 Q( \7 x2 a4 F# A
is* T7 E! x1 y. ^. s l) O, a) T% T3 w
part, GlobalDistObj, assignLObj:object;row,Lan:integer;/ z( q; X9 m' E- C8 ^) l; e6 f! R. e" S' `
do
( O" q/ ~4 @8 r0 J; | Lan := rootfolder.Internal.Tools.AOLlanguage;
' {- N$ H; w$ ]$ D% r7 \7 a9 @! r9 d if current = @.Destination -- else return
( [/ \2 m5 M* i( _% H then
2 p9 U9 A b/ A# B$ g @.Destination := void;
% R0 V- O: w; y d4 I( [ if @.occupied then; C6 l C( |7 n2 s! m4 d6 c
part := @.cont;7 m# E$ f1 M# c, H4 h1 m1 Y$ }
@.transpOrder := void;
1 U+ C7 M- L T& T: Y/ h part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,/ X1 W- i7 m' y" \' F6 E, J
@,root.eventcontroller.simTime);! O% X5 m6 x8 v' S! w# n* m+ I$ d, z
@.HasOrder := false;1 z$ f8 N* @! g2 `/ z* n4 a/ _& m
@.DrivingHome := true;
8 `' R& t* |' h; x( G rgManager.tryToStartTransOrder;; u5 V' r4 }% B' r3 A1 V
if @.Destination = void
$ G' T! _7 T2 n- P4 c8 j6 [ then -- no transport order for vehicle @3 E5 `0 ~& Z. z7 H) n0 a
@.Destination :=2 l0 Q8 o# T; G+ O
rgManager.nearestFreeStation(@,track.~);
0 ?/ q2 t0 z' ~* U newDirection(@); # F {& p+ h1 C: C0 Y% g: [+ c! ?/ v! N
if @.Destination /= void then4 d: z3 N- B! a% X$ I; G1 J
@.Destination.NumReservation :=
1 c7 X+ \' i7 D8 _' F, J @.Destination.NumReservation + 1;
5 R6 k6 S( A2 b4 T" X end;: E8 ]* n! s3 q; J
@.CurrIcon := "drivingHome";
! L% J7 H# q/ H/ ?2 I2 `' F9 q: r @.DrivingHome := true;/ e2 o: D8 {* A& M5 E- v
end;& d! g4 V9 K4 z a9 C3 m
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
; N$ ?! }0 G3 K+ F5 @% a# W part := @.transpOrder;
- d# B) j$ {6 q9 ]" G- M! p, g part.move(@);-- load part4 |- v- s- d0 z3 [) R+ X _
@.CurrIcon := "load";
# n7 a4 F% D1 E* @ w/ B u GlobalDistObj := part.globDestination;
) G( E. Z2 u) }1 C( x6 T assignLObj := rgmanager.rgAssignL;
K. F1 v" K2 p: k; B row := assignLObj.getRowNo(GlobalDistObj);
( |6 X) v, A; o7 s4 A if Row = -1 then -- since 70" h% [- N( ~& F8 D, c
if lan=1 then: U8 L4 ~; Z$ a4 V3 M1 n8 R+ O
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),; w7 `! s1 _1 W* X1 c& R! o+ }6 E& u
to_str("in der Andockstation: \"",?.~.name,"\"")); }9 X Y" g# P; o
else
: v# b, J0 I3 N+ b* z+ R7 Z promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),1 d+ W3 t1 a- R, S8 O
to_str("in docking station: \"",?.~.name,"\""));
! N6 q" t8 \/ b" Z, ^ end;
! w: e& m0 _! Y3 U# Q$ Y/ c! R$ b {& d else
* T6 R# _4 j8 g @.Destination := assignLObj[1,row];
, ?% h: d1 h7 n5 ~ end;
: J3 k& L4 y5 M- w newDirection(@);3 u5 `2 j) d2 L6 _
@.HasOrder := true;
' W4 \2 L2 U l9 K: b: ? end;
: v3 w$ H# S- z/ Z, a$ E! f5 P8 Y end;
3 W( j# M: i H" I& T2 Jend; -- of the method- y( y: p! t) g# r3 I, Z
|