16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 13:59:19 +02:00

Better sound of retarder

This commit is contained in:
Królik Uszasty
2021-02-19 22:14:05 +01:00
committed by tmj-fstate
parent 84e800120c
commit 029a063970
3 changed files with 26 additions and 4 deletions

View File

@@ -7829,6 +7829,7 @@ double TMoverParameters::dizel_Momentum(double dizel_fill, double n, double dt)
double TMoverParameters::dizel_MomentumRetarder(double n, double dt)
{
double RetarderRequest = (Mains ? std::max(0.0, -eimic_real) : 0);
if (hydro_R_WithIndividual) RetarderRequest = LocalBrakeRatio();
if (Vel < hydro_R_MinVel)
RetarderRequest = 0;
if ((hydro_R_Placement == 2) && (enrot < dizel_nmin))
@@ -7836,7 +7837,21 @@ double TMoverParameters::dizel_MomentumRetarder(double n, double dt)
RetarderRequest = 0;
}
hydro_R_n = n * 60;
hydro_R_ClutchActive = (!hydro_R_Clutch) || (RetarderRequest > 0);
if ((!hydro_R_Clutch)
|| ((hydro_R_ClutchActive) && (hydro_R_ClutchSpeed == 0)))
{
hydro_R_n = n * 60;
}
else if (hydro_R_ClutchActive)
{
hydro_R_n = sign(n)*std::min(std::abs(hydro_R_n + hydro_R_ClutchSpeed * dt), std::abs(n * 60));
}
else
{
hydro_R_n = 0;
}
n = hydro_R_n / 60.f;
if (hydro_R_Fill < RetarderRequest) //gdy zadane hamowanie
{
@@ -7848,7 +7863,7 @@ double TMoverParameters::dizel_MomentumRetarder(double n, double dt)
}
double Moment = hydro_R_MaxTorque;
double pwr = Moment * n * M_PI * 2 * 0.001;
double pwr = Moment * std::abs(n) * M_PI * 2 * 0.001;
if (pwr > hydro_R_MaxPower)
Moment = Moment * hydro_R_MaxPower / pwr;
double moment_in = n*n*hydro_R_TorqueInIn;
@@ -10653,6 +10668,9 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
extract_value(hydro_R_FillRateDec, "R_FRD", Input, "");
extract_value(hydro_R_MinVel, "R_MinVel", Input, "");
extract_value(hydro_R_EngageVel, "R_EngageVel", Input, "");
extract_value(hydro_R_Clutch, "R_IsClutch", Input, "");
extract_value(hydro_R_ClutchSpeed, "R_ClutchSpeed", Input, "");
extract_value(hydro_R_WithIndividual, "R_WithIndividual", Input, "");
}
}
break;