/* called by: entrance ctrl of the object 'track'
, A- b A' E, m9 G9 h9 b*/$ R2 o7 C* t& e C- ~1 ]
is! C: q+ E4 y4 Q3 K' w- L4 [
part, GlobalDistObj, assignLObj:object;row,Lan:integer;: _0 Z% e8 h& R" W0 X: n9 I
do
h% i0 y( @% {9 D& g" n0 k2 e. j Lan := rootfolder.Internal.Tools.AOLlanguage;# @& R h3 V2 c* o6 \/ d
if current = @.Destination -- else return
+ r: c' g9 k+ o: K% U then4 T. e* b; t: E/ x2 f4 |
@.Destination := void;+ I6 X' w; E! n: p# @
if @.occupied then( Q' R# L2 q( K" d: z" g
part := @.cont;
% k8 q3 e" ]% h" I& z. d; f @.transpOrder := void;
; G A( c0 D9 m( W. P5 D part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,4 L; c5 x8 N* h
@,root.eventcontroller.simTime);& T* X6 o4 {# f& Y1 z4 }( H1 |
@.HasOrder := false;
: d- O4 z& ?3 [3 u) R% n0 k @.DrivingHome := true;3 I+ ]: v) e* j
rgManager.tryToStartTransOrder;/ q/ g0 X. D! c4 e
if @.Destination = void! B% o7 E% ]$ ^' g
then -- no transport order for vehicle @
' M+ R/ ?8 c2 J& X" d, U @.Destination :=
/ o- ?; u; ^9 q: d, T rgManager.nearestFreeStation(@,track.~);& D5 u7 j: g. k/ g* |
newDirection(@); ' b1 y+ \" `: H [ T6 F( ]
if @.Destination /= void then% a5 O5 Q7 U3 P f& N6 v
@.Destination.NumReservation :=6 V7 e5 p: f7 a6 W( t
@.Destination.NumReservation + 1;
- n( p$ i! \ `/ E end;! k1 `6 J3 n6 Z
@.CurrIcon := "drivingHome";; k: ~# F8 u A0 Z. d; d5 b' H
@.DrivingHome := true;
4 ^" V* T% z* O! O! k- S end;# }, f7 m- e- Q' \: W3 ?# \2 i; R
else -- the vehicle @ is empty, both vehicle and part are in the same dock station
8 `8 m% i/ M. N part := @.transpOrder;9 c7 v ^/ t$ ?8 b3 }
part.move(@);-- load part
% b0 M2 h/ O5 I0 s% C' L @.CurrIcon := "load";
1 y& W. Y5 Z1 u2 { GlobalDistObj := part.globDestination;
9 u2 `3 m% z3 \+ k2 S: t% ` assignLObj := rgmanager.rgAssignL;* j" ~0 A& K6 d+ v: J- p# Z$ A
row := assignLObj.getRowNo(GlobalDistObj);
2 u' x: B; s. b4 n c7 R5 ? if Row = -1 then -- since 700 V' g: T+ [2 V5 c
if lan=1 then4 p) v. C9 ^4 _5 v
promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),+ V7 p7 _/ ~+ b9 Q% k
to_str("in der Andockstation: \"",?.~.name,"\""));
. P8 B6 T- D9 j/ D* ? else' S: i5 T# x& F( n) {1 y- j
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
! B8 r& J* P# n" q& i to_str("in docking station: \"",?.~.name,"\""));
9 Z4 D7 u0 x4 w& h end;
: m7 c Z/ h+ r z) j! U8 y else4 Q2 n, G, m& _$ n5 D) ~
@.Destination := assignLObj[1,row];
, D" X6 S' j, l2 G# ~% S `3 A# M end;
" d; ~! Z& H% l$ M newDirection(@);* t% ?* ?# e! I2 Y
@.HasOrder := true;1 M5 ~! ?: X& k
end;0 v; e/ \3 i# [6 J2 Y0 Z' S3 W7 W
end;
1 k3 B8 F |) nend; -- of the method
/ N8 Z5 }" }. F: h: u |