mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 17:29:18 +02:00
Merge pull request #79 from xingzihai/engine-overheat
feat: add EngineMaxTemperature support for diesel locomotive overheat detection
This commit is contained in:
@@ -1056,7 +1056,7 @@ class TMoverParameters
|
|||||||
bool is_warm{false}; // fluid is too hot
|
bool is_warm{false}; // fluid is too hot
|
||||||
bool is_hot{false}; // fluid temperature crossed cooling threshold
|
bool is_hot{false}; // fluid temperature crossed cooling threshold
|
||||||
bool is_flowing{false}; // fluid is being pushed through the circuit
|
bool is_flowing{false}; // fluid is being pushed through the circuit
|
||||||
} water, water_aux, oil;
|
} water, water_aux, oil, engine;
|
||||||
// output, state of affected devices
|
// output, state of affected devices
|
||||||
bool PA{false}; // malfunction flag
|
bool PA{false}; // malfunction flag
|
||||||
float rpmw{0.0}; // current main circuit fan revolutions
|
float rpmw{0.0}; // current main circuit fan revolutions
|
||||||
|
|||||||
@@ -8156,6 +8156,9 @@ void TMoverParameters::dizel_Heat( double const dt ) {
|
|||||||
dizel_heat.oil.is_hot = (
|
dizel_heat.oil.is_hot = (
|
||||||
( dizel_heat.oil.config.temp_max > 0 )
|
( 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.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 ) ) );
|
||||||
|
|
||||||
auto const PT = (
|
auto const PT = (
|
||||||
( false == dizel_heat.water.is_cold )
|
( false == dizel_heat.water.is_cold )
|
||||||
@@ -8163,7 +8166,8 @@ void TMoverParameters::dizel_Heat( double const dt ) {
|
|||||||
&& ( false == dizel_heat.water_aux.is_cold )
|
&& ( false == dizel_heat.water_aux.is_cold )
|
||||||
&& ( false == dizel_heat.water_aux.is_hot )
|
&& ( false == dizel_heat.water_aux.is_hot )
|
||||||
&& ( false == dizel_heat.oil.is_cold )
|
&& ( false == dizel_heat.oil.is_cold )
|
||||||
&& ( false == dizel_heat.oil.is_hot ) /* && ( false == awaria_termostatow ) */ ) /* || PTp */;
|
&& ( false == dizel_heat.oil.is_hot )
|
||||||
|
&& ( false == dizel_heat.engine.is_hot ) /* && ( false == awaria_termostatow ) */ ) /* || PTp */;
|
||||||
auto const PPT = ( false == PT ) /* && ( false == PPTp ) */;
|
auto const PPT = ( false == PT ) /* && ( false == PPTp ) */;
|
||||||
dizel_heat.PA = ( /* ( ( !zamkniecie or niedomkniecie ) and !WBD ) || */ PPT /* || nurnik || ( woda < 7 ) */ ) /* && ( !PAp ) */;
|
dizel_heat.PA = ( /* ( ( !zamkniecie or niedomkniecie ) and !WBD ) || */ PPT /* || nurnik || ( woda < 7 ) */ ) /* && ( !PAp ) */;
|
||||||
|
|
||||||
@@ -11236,6 +11240,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
|||||||
extract_value( dizel_heat.water_aux.config.shutters, "WaterAuxShutters", 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_min, "OilMinTemperature", Input, "" );
|
||||||
extract_value( dizel_heat.oil.config.temp_max, "OilMaxTemperature", 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.fan_speed, "WaterCoolingFanSpeed", Input, "" );
|
extract_value( dizel_heat.fan_speed, "WaterCoolingFanSpeed", Input, "" );
|
||||||
// water heater
|
// water heater
|
||||||
extract_value( WaterHeater.config.temp_min, "HeaterMinTemperature", Input, "" );
|
extract_value( WaterHeater.config.temp_min, "HeaterMinTemperature", Input, "" );
|
||||||
|
|||||||
Reference in New Issue
Block a user