mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 09:19:18 +02:00
Small fix for Driver's calculation of med braking
This commit is contained in:
@@ -3105,8 +3105,8 @@ bool TController::IncBrakeEIM()
|
|||||||
case 0: {
|
case 0: {
|
||||||
if( mvOccupied->MED_amax != 9.81 ) {
|
if( mvOccupied->MED_amax != 9.81 ) {
|
||||||
auto const maxpos{mvOccupied->EIMCtrlEmergency ? 0.9 : 1.0 };
|
auto const maxpos{mvOccupied->EIMCtrlEmergency ? 0.9 : 1.0 };
|
||||||
auto const brakelimit{ -2.2 * AccDesired / mvOccupied->MED_amax - 1.0}; //additional limit when hinted is too low
|
auto const brakelimit{ -2.2 * AccDesired / fMedAmax - 1.0}; //additional limit when hinted is too low
|
||||||
auto const brakehinted{ -1.0 * mvOccupied->AIHintLocalBrakeAccFactor * AccDesired / mvOccupied->MED_amax }; //preffered by AI
|
auto const brakehinted{ -1.0 * mvOccupied->AIHintLocalBrakeAccFactor * AccDesired / fMedAmax }; //preffered by AI
|
||||||
auto const brakeposition{ maxpos * clamp(std::max(brakelimit, brakehinted), 0.0, 1.0)};
|
auto const brakeposition{ maxpos * clamp(std::max(brakelimit, brakehinted), 0.0, 1.0)};
|
||||||
OK = ( brakeposition != mvOccupied->LocalBrakePosA );
|
OK = ( brakeposition != mvOccupied->LocalBrakePosA );
|
||||||
mvOccupied->LocalBrakePosA = brakeposition;
|
mvOccupied->LocalBrakePosA = brakeposition;
|
||||||
|
|||||||
1
Driver.h
1
Driver.h
@@ -354,6 +354,7 @@ public:
|
|||||||
int UniversalBrakeButtons = 0.0; // flag of which universal buttons need to be pressed
|
int UniversalBrakeButtons = 0.0; // flag of which universal buttons need to be pressed
|
||||||
int DizelPercentage = 0; // oczekiwane procenty jazdy/hamowania szynobusem
|
int DizelPercentage = 0; // oczekiwane procenty jazdy/hamowania szynobusem
|
||||||
int DizelPercentage_Speed = 0; // oczekiwane procenty jazdy/hamowania szynobusem w związku z osiąganiem VelDesired
|
int DizelPercentage_Speed = 0; // oczekiwane procenty jazdy/hamowania szynobusem w związku z osiąganiem VelDesired
|
||||||
|
double fMedAmax = 0.8; //maximum decceleration when using ep/med brake
|
||||||
private:
|
private:
|
||||||
bool Psyche = false;
|
bool Psyche = false;
|
||||||
int HelperState = 0; //stan pomocnika maszynisty
|
int HelperState = 0; //stan pomocnika maszynisty
|
||||||
|
|||||||
@@ -3114,6 +3114,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
RapidMult = MoverParameters->RapidMult;
|
RapidMult = MoverParameters->RapidMult;
|
||||||
|
|
||||||
auto const amax = RapidMult * std::min(FmaxPN / masamax, MoverParameters->MED_amax);
|
auto const amax = RapidMult * std::min(FmaxPN / masamax, MoverParameters->MED_amax);
|
||||||
|
Mechanik->fMedAmax = amax;
|
||||||
auto doorisopen {
|
auto doorisopen {
|
||||||
( false == MoverParameters->Doors.instances[ side::left ].is_closed )
|
( false == MoverParameters->Doors.instances[ side::left ].is_closed )
|
||||||
|| ( false == MoverParameters->Doors.instances[ side::right ].is_closed )
|
|| ( false == MoverParameters->Doors.instances[ side::right ].is_closed )
|
||||||
|
|||||||
Reference in New Issue
Block a user