16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

Merge remote-tracking branch 'youby/master' into sim

This commit is contained in:
milek7
2022-01-14 16:39:20 +01:00
4 changed files with 38 additions and 14 deletions

View File

@@ -2203,8 +2203,8 @@ void TMoverParameters::MotorBlowersCheck( double const Timestep ) {
// activation check
for( auto &blower : MotorBlowers ) {
auto disable = blower.is_disabled;
auto const start { ( Vel >= blower.min_start_velocity && Im > 0.5 ) };
auto const stop { ( Vel < 0.5 && Im < 0.5 ) };
auto const start { ( Vel >= blower.min_start_velocity && std::abs(Im) > 0.5 ) };
auto const stop { ( Vel < 0.5 && std::abs(Im) < 0.5 ) };
if (blower.min_start_velocity >= 0)
{
if ( stop )

View File

@@ -2800,6 +2800,19 @@ double TMHZ_K5P::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
dpPipe = Min0R(HP, CP + TP + RedAdj);
if (EQ(i_bcp, -1))
{
if (Fala)
{
dpPipe = 5.0 + TP + RedAdj + uop;
ActFlowSpeed = 12;
}
else
{
ActFlowSpeed *= FillingStrokeFactor;
}
}
if (dpPipe > PP)
dpMainValve = -PFVa(HP, PP, ActFlowSpeed / LBDelay, dpPipe, 0.4);
else
@@ -2866,7 +2879,7 @@ double TMHZ_K5P::GetRP()
return 5.0 + TP + RedAdj;
}
void TMHZ_K5P::SetParams(bool AO, bool MO, double OverP, double, double OMP, double OPD)
void TMHZ_K5P::SetParams(bool AO, bool MO, double OverP, double FSF, double OMP, double OPD)
{
AutoOvrld = AO;
ManualOvrld = MO;
@@ -2874,6 +2887,7 @@ void TMHZ_K5P::SetParams(bool AO, bool MO, double OverP, double, double OMP, dou
Fala = (OverP > 0.01);
OverloadMaxPressure = OMP;
OverloadPressureDecrease = OPD;
FillingStrokeFactor = 1 + FSF;
}
@@ -2935,10 +2949,17 @@ double TMHZ_6P::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
if (ManualOvrld && !ManualOvrldActive) //no overpressure for not pressed button if it does not exists
uop = 0;
if (Fala && EQ(i_bcp, -1))
if (EQ(i_bcp, -1))
{
dpPipe = 5.0 + TP + RedAdj + uop;
ActFlowSpeed = 12;
if (Fala)
{
dpPipe = 5.0 + TP + RedAdj + uop;
ActFlowSpeed = 12;
}
else
{
ActFlowSpeed *= FillingStrokeFactor;
}
}
if (dpPipe > PP)
@@ -3007,7 +3028,7 @@ double TMHZ_6P::GetRP()
return 5.0 + TP + RedAdj;
}
void TMHZ_6P::SetParams(bool AO, bool MO, double OverP, double, double OMP, double OPD)
void TMHZ_6P::SetParams(bool AO, bool MO, double OverP, double FSF, double OMP, double OPD)
{
AutoOvrld = AO;
ManualOvrld = MO;
@@ -3015,6 +3036,7 @@ void TMHZ_6P::SetParams(bool AO, bool MO, double OverP, double, double OMP, doub
Fala = (OverP > 0.01);
OverloadMaxPressure = OMP;
OverloadPressureDecrease = OPD;
FillingStrokeFactor = 1 + FSF;
}

View File

@@ -639,6 +639,7 @@ private:
double UnbrakeOverPressure = 0.0;
double OverloadMaxPressure = 1.0; //maksymalne zwiekszenie cisnienia przy asymilacji
double OverloadPressureDecrease = 0.002; //predkosc spadku cisnienia przy asymilacji
double FillingStrokeFactor = 1.0; //mnożnik otwarcia zaworu przy uderzeniowym (bez fali)
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
bool EQ(double pos, double i_pos);
@@ -669,6 +670,7 @@ private:
double UnbrakeOverPressure = 0.0; //wartosc napelniania uderzeniowego
double OverloadMaxPressure = 1.0; //maksymalne zwiekszenie cisnienia przy asymilacji
double OverloadPressureDecrease = 0.002; //predkosc spadku cisnienia przy asymilacji
double FillingStrokeFactor = 1.0; //mnożnik otwarcia zaworu przy uderzeniowym (bez fali)
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
bool EQ(double pos, double i_pos);

View File

@@ -7522,7 +7522,7 @@ TTrain::update_sounds( double const Deltatime ) {
fPPress = interpolate( fPPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_b ) ), 0.05f );
volume = (
fPPress > 0 ?
rsHiss->m_amplitudefactor * fPPress * 0.25 :
rsHiss->m_amplitudefactor * fPPress * 0.25 + rsHiss->m_amplitudeoffset :
0 );
if( volume * brakevolumescale > 0.05 ) {
rsHiss->gain( volume * brakevolumescale );
@@ -7537,7 +7537,7 @@ TTrain::update_sounds( double const Deltatime ) {
fNPress = interpolate( fNPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_u ) ), 0.25f );
volume = (
fNPress > 0 ?
rsHissU->m_amplitudefactor * fNPress :
rsHissU->m_amplitudefactor * fNPress + rsHissU->m_amplitudeoffset :
0 );
if( volume * brakevolumescale > 0.05 ) {
rsHissU->gain( volume * brakevolumescale );
@@ -7549,7 +7549,7 @@ TTrain::update_sounds( double const Deltatime ) {
}
// upuszczanie przy naglym
if( rsHissE ) {
volume = mvOccupied->Handle->GetSound( s_fv4a_e ) * rsHissE->m_amplitudefactor;
volume = mvOccupied->Handle->GetSound( s_fv4a_e ) * rsHissE->m_amplitudefactor + rsHissE->m_amplitudeoffset;
if( volume * brakevolumescale > 0.05 ) {
rsHissE->gain( volume * brakevolumescale );
rsHissE->play( sound_flags::exclusive | sound_flags::looping );
@@ -7560,7 +7560,7 @@ TTrain::update_sounds( double const Deltatime ) {
}
// upuszczanie sterujacego fala
if( rsHissX ) {
volume = mvOccupied->Handle->GetSound( s_fv4a_x ) * rsHissX->m_amplitudefactor;
volume = mvOccupied->Handle->GetSound( s_fv4a_x ) * rsHissX->m_amplitudefactor + rsHissX->m_amplitudeoffset;
if( volume * brakevolumescale > 0.05 ) {
rsHissX->gain( volume * brakevolumescale );
rsHissX->play( sound_flags::exclusive | sound_flags::looping );
@@ -7571,7 +7571,7 @@ TTrain::update_sounds( double const Deltatime ) {
}
// upuszczanie z czasowego
if( rsHissT ) {
volume = mvOccupied->Handle->GetSound( s_fv4a_t ) * rsHissT->m_amplitudefactor;
volume = mvOccupied->Handle->GetSound( s_fv4a_t ) * rsHissT->m_amplitudefactor + +rsHissT->m_amplitudeoffset;
if( volume * brakevolumescale > 0.05 ) {
rsHissT->gain( volume * brakevolumescale );
rsHissT->play( sound_flags::exclusive | sound_flags::looping );
@@ -7588,7 +7588,7 @@ TTrain::update_sounds( double const Deltatime ) {
fPPress = ( 4.0f * fPPress + std::max( 0.0, mvOccupied->dpMainValve ) ) / ( 4.0f + 1.0f );
volume = (
fPPress > 0.0f ?
2.0 * rsHiss->m_amplitudefactor * fPPress :
2.0 * rsHiss->m_amplitudefactor * fPPress + rsHiss->m_amplitudeoffset :
0.0 );
if( volume > 0.05 ) {
rsHiss->gain( volume );
@@ -7603,7 +7603,7 @@ TTrain::update_sounds( double const Deltatime ) {
fNPress = ( 4.0f * fNPress + Min0R( 0.0, mvOccupied->dpMainValve ) ) / ( 4.0f + 1.0f );
volume = (
fNPress < 0.0f ?
-1.0 * rsHissU->m_amplitudefactor * fNPress :
-1.0 * rsHissU->m_amplitudefactor * fNPress + rsHissU->m_amplitudeoffset :
0.0 );
if( volume > 0.01 ) {
rsHissU->gain( volume );