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

compressor logic tweaks, battery cab controls, pump sounds

This commit is contained in:
tmj-fstate
2020-01-01 20:37:19 +01:00
parent 2b7f0af9ce
commit 10262f37dc
9 changed files with 102 additions and 15 deletions

View File

@@ -3707,6 +3707,8 @@ void TMoverParameters::CompressorCheck(double dt) {
CompressedVolume = std::max( 0.0, CompressedVolume - dt * AirLeakRate * 0.1 ); // nieszczelności: 0.001=1l/s
Compressor = CompressedVolume / VeselVolume;
// assorted operational logic
auto const MaxCompressorF { CompressorList[ TCompressorList::cl_MaxFactor ][ CompressorListPos ] * MaxCompressor };
auto const MinCompressorF { CompressorList[ TCompressorList::cl_MinFactor ][ CompressorListPos ] * MinCompressor };
@@ -3792,7 +3794,8 @@ void TMoverParameters::CompressorCheck(double dt) {
CompressorSpeedF
* ( 2.0 * MaxCompressorF - Compressor ) / MaxCompressorF
* enginefactor
* dt;
* dt
* ( CompressorGovernorLock ? 0.0 : 1.0 ); // with the lock active air is vented out
break;
}
default: {
@@ -3806,10 +3809,16 @@ void TMoverParameters::CompressorCheck(double dt) {
}
if( ( pressureistoohigh )
&& ( false == governorlockispresent ) ) {
&& ( ( false == governorlockispresent ) || ( CompressorPower == 3 ) ) ) {
// vent some air out if there's no governor lock to stop the compressor from exceeding acceptable pressure level
SetFlag( SoundFlag, sound::relay | sound::loud );
CompressedVolume *= 0.8;
CompressedVolume *= (
false == governorlockispresent ? 0.80 : // arbitrary amount
CompressorTankValve ? MinCompressorF / MaxCompressorF : // drop to mincompressor level
0.999 ); // HACK: drop a tiny bit so the sound doesn't trigger repeatedly
if( ( false == governorlockispresent ) || ( CompressorTankValve ) ) {
CompressorGovernorLock = false;
}
}
// tymczasowo tylko obciążenie sprężarki, tak z 5A na sprężarkę
@@ -9221,6 +9230,7 @@ void TMoverParameters::LoadFIZ_Brake( std::string const &line ) {
*/
extract_value( MinCompressor, "MinCP", line, "" );
extract_value( MaxCompressor, "MaxCP", line, "" );
extract_value( CompressorTankValve, "CompressorTankValve", line, "" );
extract_value( CompressorSpeed, "CompressorSpeed", line, "" );
extract_value( EmergencyValveOff, "MinEVP", line, "" );
extract_value( EmergencyValveOn, "MaxEVP", line, "" );