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

Merge pull request #78 from xingzihai/master

feat(overheat): Add overheat indicator lamps for oil, water, water_aux, and engine
This commit is contained in:
2026-04-14 21:01:20 +02:00
committed by GitHub
4 changed files with 33 additions and 4 deletions

View File

@@ -1077,6 +1077,9 @@ class TMoverParameters
float temperatura1{50.0};
float temperatura2{40.0};
float powerfactor{1.0}; // coefficient of heat generation for engines other than su45
// engine overheat threshold
float engine_max_temp{-1}; // maximum acceptable engine temperature, triggers overheat lamp when exceeded
bool engine_is_hot{false}; // engine temperature crossed cooling threshold
};
struct spring_brake

View File

@@ -8156,9 +8156,10 @@ void TMoverParameters::dizel_Heat( double const dt ) {
dizel_heat.oil.is_hot = (
( dizel_heat.oil.config.temp_max > 0 )
&& ( dizel_heat.To > dizel_heat.oil.config.temp_max - ( dizel_heat.oil.is_hot ? 8 : 0 ) ) );
dizel_heat.engine.is_hot = (
( dizel_heat.engine.config.temp_max > 0 )
&& ( dizel_heat.Ts > dizel_heat.engine.config.temp_max - ( dizel_heat.engine.is_hot ? 8 : 0 ) ) );
// engine overheat check
dizel_heat.engine_is_hot = (
( dizel_heat.engine_max_temp > 0 )
&& ( dizel_heat.Ts > dizel_heat.engine_max_temp - ( dizel_heat.engine_is_hot ? 8 : 0 ) ) );
auto const PT = (
( false == dizel_heat.water.is_cold )
@@ -11240,7 +11241,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
extract_value( dizel_heat.water_aux.config.shutters, "WaterAuxShutters", Input, "" );
extract_value( dizel_heat.oil.config.temp_min, "OilMinTemperature", Input, "" );
extract_value( dizel_heat.oil.config.temp_max, "OilMaxTemperature", Input, "" );
extract_value( dizel_heat.engine.config.temp_max, "EngineMaxTemperature", Input, "" );
extract_value( dizel_heat.engine_max_temp, "EngineMaxTemperature", Input, "" );
extract_value( dizel_heat.fan_speed, "WaterCoolingFanSpeed", Input, "" );
// water heater
extract_value( WaterHeater.config.temp_min, "HeaterMinTemperature", Input, "" );

View File

@@ -7926,6 +7926,11 @@ bool TTrain::Update( double const Deltatime )
btLampkaRearRightEndLight.Turn( ( mvOccupied->iLights[ end::rear ] & light::redmarker_right ) != 0 );
// others
btLampkaMalfunction.Turn( mvControlled->dizel_heat.PA );
// overheat indicator lamps
btLampkaOilOverheat.Turn( mvControlled->dizel_heat.oil.is_hot );
btLampkaWaterOverheat.Turn( mvControlled->dizel_heat.water.is_hot );
btLampkaWaterAuxOverheat.Turn( mvControlled->dizel_heat.water_aux.is_hot );
btLampkaEngineOverheat.Turn( mvControlled->dizel_heat.engine_is_hot );
btLampkaMotorBlowers.Turn( ( mvControlled->MotorBlowers[ end::front ].is_active ) && ( mvControlled->MotorBlowers[ end::rear ].is_active ) );
btLampkaCoolingFans.Turn( mvControlled->RventRot > 1.0 );
btLampkaTempomat.Turn( mvOccupied->SpeedCtrlUnit.IsActive );
@@ -7966,6 +7971,11 @@ bool TTrain::Update( double const Deltatime )
btLampkaBrakeProfileR.Turn( false );
btLampkaSpringBrakeActive.Turn( false );
btLampkaSpringBrakeInactive.Turn( false );
// overheat indicator lamps off
btLampkaOilOverheat.Turn( false );
btLampkaWaterOverheat.Turn( false );
btLampkaWaterAuxOverheat.Turn( false );
btLampkaEngineOverheat.Turn( false );
btLampkaMaxSila.Turn( false );
btLampkaPrzekrMaxSila.Turn( false );
btLampkaRadio.Turn( false );
@@ -9756,6 +9766,11 @@ void TTrain::clear_cab_controls()
btLampkaNadmWent.Clear(9);
btLampkaWysRozr.Clear(((mvControlled->TrainType & dt_ET22) != 0) ? -1 : 10); // ET22 nie ma tej lampki
btLampkaOgrzewanieSkladu.Clear(11);
// overheat indicator lamps
btLampkaOilOverheat.Clear(-1);
btLampkaWaterOverheat.Clear(-1);
btLampkaWaterAuxOverheat.Clear(-1);
btLampkaEngineOverheat.Clear(-1);
btHaslerBrakes.Clear(12); // ciśnienie w cylindrach do odbijania na haslerze
btHaslerCurrent.Clear(13); // prąd na silnikach do odbijania na haslerze
// Numer 14 jest używany dla buczka SHP w update_sounds()
@@ -10425,6 +10440,11 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
{ "i-mainbreakerblinking:", btLampkaMainBreakerBlinkingIfReady },
{ "i-vent_ovld:", btLampkaNadmWent },
{ "i-comp_ovld:", btLampkaNadmSpr },
// overheat indicator lamps
{ "i-oil_overheat:", btLampkaOilOverheat },
{ "i-water_overheat:", btLampkaWaterOverheat },
{ "i-wateraux_overheat:", btLampkaWaterAuxOverheat },
{ "i-engine_overheat:", btLampkaEngineOverheat },
{ "i-resistors:", btLampkaOpory },
{ "i-no_resistors:", btLampkaBezoporowa },
{ "i-no_resistors_b:", btLampkaBezoporowaB },

View File

@@ -761,6 +761,11 @@ public: // reszta może by?publiczna
TButton btLampkaBrakeProfileR; // rapid brake acting speed
TButton btLampkaSpringBrakeActive;
TButton btLampkaSpringBrakeInactive;
// overheat indicator lamps
TButton btLampkaOilOverheat;
TButton btLampkaWaterOverheat;
TButton btLampkaWaterAuxOverheat;
TButton btLampkaEngineOverheat;
// KURS90
TButton btLampkaBoczniki;
TButton btLampkaMaxSila;