mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-06 15:08:36 +01:00
Let a command cell reach a shut down driver
A dormant driver scans, but bailed out before anything could act on the table. Signals stay out of it - only cm_Command is dispatched, so a memory cell put in front of a parked consist can hand it Prepare_engine.
This commit is contained in:
@@ -7524,6 +7524,7 @@ TController::pick_optimal_speed( double const Range ) {
|
|||||||
|
|
||||||
// if we're idling bail out early
|
// if we're idling bail out early
|
||||||
if( false == is_active() ) {
|
if( false == is_active() ) {
|
||||||
|
check_cell_ahead();
|
||||||
VelDesired = 0.0;
|
VelDesired = 0.0;
|
||||||
VelNext = 0.0;
|
VelNext = 0.0;
|
||||||
AccDesired = std::min( AccDesired, EU07_AI_NOACCELERATION );
|
AccDesired = std::min( AccDesired, EU07_AI_NOACCELERATION );
|
||||||
@@ -8550,6 +8551,17 @@ TController::check_route_ahead( double const Range ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TController::check_cell_ahead() {
|
||||||
|
// shut down, so no signal is acted upon; a command cell is the only way to reach us
|
||||||
|
if( false == AIControllFlag ) { return; }
|
||||||
|
if( ( OrderCurrentGet() & ~( Shunt | Loose_shunt | Obey_train | Bank ) ) != 0 ) { return; }
|
||||||
|
if( mvOccupied->Vel >= 0.1 ) { return; }
|
||||||
|
if( TableUpdate( VelDesired, ActualProximityDist, VelNext, AccDesired ) != TCommandType::cm_Command ) { return; }
|
||||||
|
if( eSignNext == nullptr ) { return; }
|
||||||
|
eSignNext->send_command( *this );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TController::check_route_behind( double const Range ) {
|
TController::check_route_behind( double const Range ) {
|
||||||
|
|
||||||
|
|||||||
@@ -387,6 +387,7 @@ private:
|
|||||||
void control_braking_force();
|
void control_braking_force();
|
||||||
void apply_independent_brake_only();
|
void apply_independent_brake_only();
|
||||||
void check_route_ahead( double const Range );
|
void check_route_ahead( double const Range );
|
||||||
|
void check_cell_ahead(); // shut down driver: only a command cell can reach it
|
||||||
// false when the permission at the nearest signal was given to another consist
|
// false when the permission at the nearest signal was given to another consist
|
||||||
bool SignalPermissionIsOurs( bool const Signalgivesgo ) const;
|
bool SignalPermissionIsOurs( bool const Signalgivesgo ) const;
|
||||||
bool OtherConsistAtSignal() const; // another consist in front of the signal = the addressee of the permission
|
bool OtherConsistAtSignal() const; // another consist in front of the signal = the addressee of the permission
|
||||||
|
|||||||
Reference in New Issue
Block a user