/* called by: entrance ctrl of the object 'track'
) E2 l+ W; ~& y* ^. |*/
+ h( ]# D) a0 Zis r" p; w# N2 l, D: J
part, GlobalDistObj, assignLObj:object;row,Lan:integer;
) W* E5 q0 }0 _1 g7 _do4 |7 a# s& t" N: T$ a# q8 \! r L
Lan := rootfolder.Internal.Tools.AOLlanguage;
1 g! e2 f$ u7 \5 w d& z' M if current = @.Destination -- else return
5 ]% _* g2 v/ Y: f/ O' v- s0 G then2 W) T/ c1 @2 f+ }/ a" Z% G
@.Destination := void;% Z i9 T: d! T! y& |
if @.occupied then. [1 r* J+ E+ A
part := @.cont;" d6 k# `+ _) Z& {
@.transpOrder := void;
0 P/ U: ^; L* R' P part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,' x$ \. G, ^6 M* \+ t, p+ Z
@,root.eventcontroller.simTime);
, j7 @% `- C; Y8 n* D! Z @.HasOrder := false;& Z" i f4 j8 b! b N0 D% J9 X+ Z
@.DrivingHome := true;: ~' _/ Q1 f( t1 S' l+ l. r5 I
rgManager.tryToStartTransOrder;6 U' E# n) u) M9 H* L. c5 f) Q
if @.Destination = void" o3 t" `2 g/ D
then -- no transport order for vehicle @
) s z1 D) p% E5 j @.Destination :=
! J c# R: j! @" w# d rgManager.nearestFreeStation(@,track.~);
! S( v% G* S* W, x9 L" S newDirection(@);
% L2 X9 O$ F Z& C if @.Destination /= void then5 n8 M6 j6 u7 s( S! q
@.Destination.NumReservation :=8 b, U/ H) z/ ^2 {- h
@.Destination.NumReservation + 1;
& J c: I0 J3 P end;
6 H3 @, U' ?0 @: p! \( k/ h/ r' K @.CurrIcon := "drivingHome";9 s# E- b9 F& i! c" L1 ^
@.DrivingHome := true;2 J8 t0 Q- o0 x7 T4 T3 t- V* _# s
end;
Y. g) E8 p3 D: m" {2 @ else -- the vehicle @ is empty, both vehicle and part are in the same dock station1 @ ?" g: }3 F# }
part := @.transpOrder;$ C. \7 [! O' ]2 I B) C
part.move(@);-- load part: H" Q j" ]( B5 B: e% a1 W
@.CurrIcon := "load";# _7 X- b1 Z4 W; W5 W! i
GlobalDistObj := part.globDestination;% P* b, U; `' X7 z' p
assignLObj := rgmanager.rgAssignL;) n8 A# A" l! u, {7 D9 h# g
row := assignLObj.getRowNo(GlobalDistObj);
& r' E0 Z( f+ s if Row = -1 then -- since 70
) A# ^- P5 o9 T' Z if lan=1 then
D# e4 {3 @9 [0 E; e3 I promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\""),
5 X# W& s* x" A7 D( F to_str("in der Andockstation: \"",?.~.name,"\""));6 C: x3 }- i" w7 B
else
3 g( H3 c+ r8 G+ | promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
$ v- N% ]6 [" f! b to_str("in docking station: \"",?.~.name,"\""));
* q: Q/ ^, K/ l( x0 O0 g7 s* w* c end; f; s* {+ W% j' B# }# K
else
5 v1 }/ S1 H; a @.Destination := assignLObj[1,row];
* ~% V; k2 m9 }# K- J end; - y: P5 v' j; p K
newDirection(@);
9 M( ^5 f" S. \5 C+ X3 ~1 A! I @.HasOrder := true;
2 f, P; W: V: x end;0 {' F; Z+ ~' E2 `! D
end;: U2 x. w8 V% Z M0 q
end; -- of the method5 O7 B' l3 d$ W, k N7 L
|