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

feat(overheat): Add overheat indicator lamps for oil, water, water_aux, and engine

- Add engine_max_temp and engine_is_hot fields to heat_data structure
- Add EngineMaxTemperature field extraction from .fiz files
- Add engine overheat check comparing Ts with engine_max_temp
- Add four new overheat lamp indicators:
  - i-oil_overheat
  - i-water_overheat
  - i-wateraux_overheat
  - i-engine_overheat
- Add lamp update logic to turn on/off based on is_hot flags
- Add lamp initialization in clear_cab_controls()

This implements issue #77 - overheat lamps for diesel engines.

The lamps will turn on when:
- Oil temperature exceeds OilMaxTemperature
- Water temperature exceeds WaterMaxTemperature
- Auxiliary water temperature exceeds WaterAuxMaxTemperature
- Engine temperature exceeds EngineMaxTemperature

Each check includes 8-degree hysteresis to prevent rapid on/off cycling.
This commit is contained in:
Agent
2026-04-01 23:26:39 +00:00
parent 203b2727af
commit 68fa78a582
4 changed files with 33 additions and 0 deletions

View File

@@ -1066,6 +1066,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

@@ -8174,6 +8174,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 ) ) );
// 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 )
@@ -11254,6 +11258,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_max_temp, "EngineMaxTemperature", Input, "" );
extract_value( dizel_heat.fan_speed, "WaterCoolingFanSpeed", Input, "" );
// water heater
extract_value( WaterHeater.config.temp_min, "HeaterMinTemperature", Input, "" );