mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 06:59:18 +02:00
Merge remote-tracking branch 'youby/master' into sim
This commit is contained in:
@@ -2203,8 +2203,8 @@ void TMoverParameters::MotorBlowersCheck( double const Timestep ) {
|
|||||||
// activation check
|
// activation check
|
||||||
for( auto &blower : MotorBlowers ) {
|
for( auto &blower : MotorBlowers ) {
|
||||||
auto disable = blower.is_disabled;
|
auto disable = blower.is_disabled;
|
||||||
auto const start { ( Vel >= blower.min_start_velocity && Im > 0.5 ) };
|
auto const start { ( Vel >= blower.min_start_velocity && std::abs(Im) > 0.5 ) };
|
||||||
auto const stop { ( Vel < 0.5 && Im < 0.5 ) };
|
auto const stop { ( Vel < 0.5 && std::abs(Im) < 0.5 ) };
|
||||||
if (blower.min_start_velocity >= 0)
|
if (blower.min_start_velocity >= 0)
|
||||||
{
|
{
|
||||||
if ( stop )
|
if ( stop )
|
||||||
|
|||||||
@@ -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);
|
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)
|
if (dpPipe > PP)
|
||||||
dpMainValve = -PFVa(HP, PP, ActFlowSpeed / LBDelay, dpPipe, 0.4);
|
dpMainValve = -PFVa(HP, PP, ActFlowSpeed / LBDelay, dpPipe, 0.4);
|
||||||
else
|
else
|
||||||
@@ -2866,7 +2879,7 @@ double TMHZ_K5P::GetRP()
|
|||||||
return 5.0 + TP + RedAdj;
|
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;
|
AutoOvrld = AO;
|
||||||
ManualOvrld = MO;
|
ManualOvrld = MO;
|
||||||
@@ -2874,6 +2887,7 @@ void TMHZ_K5P::SetParams(bool AO, bool MO, double OverP, double, double OMP, dou
|
|||||||
Fala = (OverP > 0.01);
|
Fala = (OverP > 0.01);
|
||||||
OverloadMaxPressure = OMP;
|
OverloadMaxPressure = OMP;
|
||||||
OverloadPressureDecrease = OPD;
|
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
|
if (ManualOvrld && !ManualOvrldActive) //no overpressure for not pressed button if it does not exists
|
||||||
uop = 0;
|
uop = 0;
|
||||||
|
|
||||||
if (Fala && EQ(i_bcp, -1))
|
if (EQ(i_bcp, -1))
|
||||||
{
|
{
|
||||||
dpPipe = 5.0 + TP + RedAdj + uop;
|
if (Fala)
|
||||||
ActFlowSpeed = 12;
|
{
|
||||||
|
dpPipe = 5.0 + TP + RedAdj + uop;
|
||||||
|
ActFlowSpeed = 12;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ActFlowSpeed *= FillingStrokeFactor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dpPipe > PP)
|
if (dpPipe > PP)
|
||||||
@@ -3007,7 +3028,7 @@ double TMHZ_6P::GetRP()
|
|||||||
return 5.0 + TP + RedAdj;
|
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;
|
AutoOvrld = AO;
|
||||||
ManualOvrld = MO;
|
ManualOvrld = MO;
|
||||||
@@ -3015,6 +3036,7 @@ void TMHZ_6P::SetParams(bool AO, bool MO, double OverP, double, double OMP, doub
|
|||||||
Fala = (OverP > 0.01);
|
Fala = (OverP > 0.01);
|
||||||
OverloadMaxPressure = OMP;
|
OverloadMaxPressure = OMP;
|
||||||
OverloadPressureDecrease = OPD;
|
OverloadPressureDecrease = OPD;
|
||||||
|
FillingStrokeFactor = 1 + FSF;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -639,6 +639,7 @@ private:
|
|||||||
double UnbrakeOverPressure = 0.0;
|
double UnbrakeOverPressure = 0.0;
|
||||||
double OverloadMaxPressure = 1.0; //maksymalne zwiekszenie cisnienia przy asymilacji
|
double OverloadMaxPressure = 1.0; //maksymalne zwiekszenie cisnienia przy asymilacji
|
||||||
double OverloadPressureDecrease = 0.002; //predkosc spadku 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 };
|
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
||||||
|
|
||||||
bool EQ(double pos, double i_pos);
|
bool EQ(double pos, double i_pos);
|
||||||
@@ -669,6 +670,7 @@ private:
|
|||||||
double UnbrakeOverPressure = 0.0; //wartosc napelniania uderzeniowego
|
double UnbrakeOverPressure = 0.0; //wartosc napelniania uderzeniowego
|
||||||
double OverloadMaxPressure = 1.0; //maksymalne zwiekszenie cisnienia przy asymilacji
|
double OverloadMaxPressure = 1.0; //maksymalne zwiekszenie cisnienia przy asymilacji
|
||||||
double OverloadPressureDecrease = 0.002; //predkosc spadku 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 };
|
static double const pos_table[11]; //= { -2, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0 };
|
||||||
|
|
||||||
bool EQ(double pos, double i_pos);
|
bool EQ(double pos, double i_pos);
|
||||||
|
|||||||
14
Train.cpp
14
Train.cpp
@@ -7522,7 +7522,7 @@ TTrain::update_sounds( double const Deltatime ) {
|
|||||||
fPPress = interpolate( fPPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_b ) ), 0.05f );
|
fPPress = interpolate( fPPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_b ) ), 0.05f );
|
||||||
volume = (
|
volume = (
|
||||||
fPPress > 0 ?
|
fPPress > 0 ?
|
||||||
rsHiss->m_amplitudefactor * fPPress * 0.25 :
|
rsHiss->m_amplitudefactor * fPPress * 0.25 + rsHiss->m_amplitudeoffset :
|
||||||
0 );
|
0 );
|
||||||
if( volume * brakevolumescale > 0.05 ) {
|
if( volume * brakevolumescale > 0.05 ) {
|
||||||
rsHiss->gain( volume * brakevolumescale );
|
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 );
|
fNPress = interpolate( fNPress, static_cast<float>( mvOccupied->Handle->GetSound( s_fv4a_u ) ), 0.25f );
|
||||||
volume = (
|
volume = (
|
||||||
fNPress > 0 ?
|
fNPress > 0 ?
|
||||||
rsHissU->m_amplitudefactor * fNPress :
|
rsHissU->m_amplitudefactor * fNPress + rsHissU->m_amplitudeoffset :
|
||||||
0 );
|
0 );
|
||||||
if( volume * brakevolumescale > 0.05 ) {
|
if( volume * brakevolumescale > 0.05 ) {
|
||||||
rsHissU->gain( volume * brakevolumescale );
|
rsHissU->gain( volume * brakevolumescale );
|
||||||
@@ -7549,7 +7549,7 @@ TTrain::update_sounds( double const Deltatime ) {
|
|||||||
}
|
}
|
||||||
// upuszczanie przy naglym
|
// upuszczanie przy naglym
|
||||||
if( rsHissE ) {
|
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 ) {
|
if( volume * brakevolumescale > 0.05 ) {
|
||||||
rsHissE->gain( volume * brakevolumescale );
|
rsHissE->gain( volume * brakevolumescale );
|
||||||
rsHissE->play( sound_flags::exclusive | sound_flags::looping );
|
rsHissE->play( sound_flags::exclusive | sound_flags::looping );
|
||||||
@@ -7560,7 +7560,7 @@ TTrain::update_sounds( double const Deltatime ) {
|
|||||||
}
|
}
|
||||||
// upuszczanie sterujacego fala
|
// upuszczanie sterujacego fala
|
||||||
if( rsHissX ) {
|
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 ) {
|
if( volume * brakevolumescale > 0.05 ) {
|
||||||
rsHissX->gain( volume * brakevolumescale );
|
rsHissX->gain( volume * brakevolumescale );
|
||||||
rsHissX->play( sound_flags::exclusive | sound_flags::looping );
|
rsHissX->play( sound_flags::exclusive | sound_flags::looping );
|
||||||
@@ -7571,7 +7571,7 @@ TTrain::update_sounds( double const Deltatime ) {
|
|||||||
}
|
}
|
||||||
// upuszczanie z czasowego
|
// upuszczanie z czasowego
|
||||||
if( rsHissT ) {
|
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 ) {
|
if( volume * brakevolumescale > 0.05 ) {
|
||||||
rsHissT->gain( volume * brakevolumescale );
|
rsHissT->gain( volume * brakevolumescale );
|
||||||
rsHissT->play( sound_flags::exclusive | sound_flags::looping );
|
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 );
|
fPPress = ( 4.0f * fPPress + std::max( 0.0, mvOccupied->dpMainValve ) ) / ( 4.0f + 1.0f );
|
||||||
volume = (
|
volume = (
|
||||||
fPPress > 0.0f ?
|
fPPress > 0.0f ?
|
||||||
2.0 * rsHiss->m_amplitudefactor * fPPress :
|
2.0 * rsHiss->m_amplitudefactor * fPPress + rsHiss->m_amplitudeoffset :
|
||||||
0.0 );
|
0.0 );
|
||||||
if( volume > 0.05 ) {
|
if( volume > 0.05 ) {
|
||||||
rsHiss->gain( volume );
|
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 );
|
fNPress = ( 4.0f * fNPress + Min0R( 0.0, mvOccupied->dpMainValve ) ) / ( 4.0f + 1.0f );
|
||||||
volume = (
|
volume = (
|
||||||
fNPress < 0.0f ?
|
fNPress < 0.0f ?
|
||||||
-1.0 * rsHissU->m_amplitudefactor * fNPress :
|
-1.0 * rsHissU->m_amplitudefactor * fNPress + rsHissU->m_amplitudeoffset :
|
||||||
0.0 );
|
0.0 );
|
||||||
if( volume > 0.01 ) {
|
if( volume > 0.01 ) {
|
||||||
rsHissU->gain( volume );
|
rsHissU->gain( volume );
|
||||||
|
|||||||
Reference in New Issue
Block a user