/* called by: entrance ctrl of the object 'track'
* ]8 @" k9 {# E. n* E, F6 L3 m*/5 I8 _3 o* U+ b7 ]7 u
is. M; h! \+ M3 s5 |
part, GlobalDistObj, assignLObj:object;row,Lan:integer;" q4 d9 l$ u* F- P3 F2 D
do; p% H! j$ C9 e3 [7 V1 {
Lan := rootfolder.Internal.Tools.AOLlanguage;( m6 R; P: o; I: s, }
if current = @.Destination -- else return* b* d& ^) F" t/ t2 p# j; l
then' t" d; m2 @* F g+ G, h4 f
@.Destination := void;
4 U, q, ~! ^4 A$ k( C: S0 p+ L4 u3 F( I if @.occupied then
, }- B% @ D d8 O part := @.cont;9 w: x2 k2 m5 m$ j( q6 l( M4 e
@.transpOrder := void;3 i) Z! R3 B7 W5 C
part.move(partExit);-- unload is already possible rgManager.freeVehL.writeRow(0,rgManager.freeVehL.yDim + 1,
# I5 j+ \7 s+ ]" O; z* O5 j! ~0 L1 v @,root.eventcontroller.simTime);
1 p1 A' F& v$ _, S @.HasOrder := false;
( s/ ~& T; w: S; s @.DrivingHome := true;; Y; r# p+ N9 V6 N9 k$ T
rgManager.tryToStartTransOrder;( X; y4 Z) _" i- }% `. g
if @.Destination = void2 T8 y% y. }" m/ ^: F1 G7 F
then -- no transport order for vehicle @ Y8 D6 H: i9 k* x
@.Destination :=& c5 G @& _9 g* O( ?
rgManager.nearestFreeStation(@,track.~);/ N1 J# @! R. E0 K( ~- ]
newDirection(@); 2 o$ h2 H4 h: o; j/ n2 u
if @.Destination /= void then
- r* o( A! U" N6 @. x# [ @.Destination.NumReservation :=
* {8 t( b, n+ S: v @.Destination.NumReservation + 1;& t# F1 U k; B/ `
end;) P! c) u P% t9 w
@.CurrIcon := "drivingHome";) c2 ?9 V: |8 d# x
@.DrivingHome := true;4 A% ]( K+ Q/ n4 ~ @ _
end;
$ h: d3 v1 P" c8 Z% t. V' { else -- the vehicle @ is empty, both vehicle and part are in the same dock station' u5 O" L+ q+ G4 Y( k5 X- v0 L
part := @.transpOrder;
; r1 Y3 c! K+ H! e% z6 B' S) K part.move(@);-- load part
4 J" ], r/ a2 B# q$ I; C' I8 O) m @.CurrIcon := "load";7 |7 o$ A1 ]/ i; m# @
GlobalDistObj := part.globDestination;' y: }. g* u. K4 u: C' C/ L) D
assignLObj := rgmanager.rgAssignL;1 m4 @$ Q' b& a/ c
row := assignLObj.getRowNo(GlobalDistObj);
1 b" E4 C3 ^8 P) X6 p if Row = -1 then -- since 70. S9 h" f6 l; U6 d B( }
if lan=1 then
) b; b& `8 L) o( s: U( z, Q promptmessage(to_str("Unbekanntes Ziel: \"",GlobalDistObj,"\"")," r: ]& n: c8 G6 }! J8 ~1 N* f/ E( S
to_str("in der Andockstation: \"",?.~.name,"\""));/ i, i# H; f+ f8 C* u
else; f. u( Y/ W, ^. _
promptmessage(to_str("Unknown destination: \"",GlobalDistObj,"\""),
1 W* O1 h5 l/ p, Y to_str("in docking station: \"",?.~.name,"\"")); ( x4 X; p6 H4 w
end;
c: G; y1 ?" o, P4 J1 T, S0 ? else
) S4 x& @' b" C$ M- i9 Y: ^ @.Destination := assignLObj[1,row];' B3 i7 }0 G9 e6 m9 |
end;
3 j5 S: G' d1 X$ a7 l newDirection(@);
. D" v2 B+ ]7 H8 J( Y @.HasOrder := true;8 k- b" | ^* Q& W; F
end;
& r+ G) o. ]! u+ N end;
4 y( i, F( Y3 j( ~6 vend; -- of the method8 k$ A1 t3 ^' \( Y; C
|