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

build 210424. soundproofing enhancement, battery sound, heating command propagation, memory cell command retrieval logic enhancement, coupling mode logic enhancement, motor overload relay threshold cab control animation fix, cab control fallback sound activation fixes,

This commit is contained in:
tmj-fstate
2021-04-24 19:37:16 +02:00
parent 66bd63336b
commit 3775d20e0c
17 changed files with 276 additions and 112 deletions

View File

@@ -1046,7 +1046,7 @@ public:
double EngineHeatingRPM { 0.0 }; // guaranteed engine revolutions with heating enabled
double LightPower = 0.0; /*moc pobierana na ogrzewanie/oswietlenie*/
double BatteryVoltage = 0.0; /*Winger - baterie w elektrykach*/
bool Battery = false; /*Czy sa zalavzone baterie*/
bool Battery = false; /*Czy sa zalaczone baterie*/
start_t BatteryStart = start_t::manual;
bool EpFuse = true; /*Czy sa zalavzone baterie*/
bool Signalling = false; /*Czy jest zalaczona sygnalizacja hamowania ostatniego wagonu*/
@@ -1805,8 +1805,10 @@ public:
bool ConverterSwitch( bool State, range_t const Notify = range_t::consist );/*! wl/wyl przetwornicy*/
bool CompressorSwitch( bool State, range_t const Notify = range_t::consist );/*! wl/wyl sprezarki*/
bool ChangeCompressorPreset( int const Change, range_t const Notify = range_t::consist );
bool HeatingSwitch( bool const State, range_t const Notify = range_t::consist );
void HeatingSwitch_( bool const State );
/*-funkcje typowe dla lokomotywy elektrycznej*/
/*-funkcje typowe dla lokomotywy elektrycznej*/
void LowVoltagePowerCheck( double const Deltatime );
void MainsCheck( double const Deltatime );
void PowerCouplersCheck( double const Deltatime, coupling const Coupling );

View File

@@ -647,10 +647,12 @@ bool TMoverParameters::ChangeCab(int direction)
// rozruch wysoki (true) albo niski (false)
bool
TMoverParameters::CurrentSwitch(bool const State) {
// Ra: przeniosłem z Train.cpp, nie wiem czy ma to sens
if (MaxCurrentSwitch(State)) {
if (TrainType != dt_EZT)
return (MinCurrentSwitch(State));
if( MaxCurrentSwitch( State ) ) {
if( TrainType != dt_EZT ) {
( MinCurrentSwitch( State ) );
}
return true;
}
// TBD, TODO: split off shunt mode toggle into a separate command? It doesn't make much sense to have these two together like that
// dla 2Ls150
@@ -3641,6 +3643,33 @@ bool TMoverParameters::ChangeCompressorPreset( int const State, range_t const No
return ( CompressorListPos != initialstate );
}
bool TMoverParameters::HeatingSwitch( bool const State, range_t const Notify ) {
bool const initialstate { HeatingAllow };
HeatingSwitch_( State );
if( Notify != range_t::local ) {
// pass the command to other vehicles
// TBD: pass the requested state, or the actual state?
SendCtrlToNext(
"HeatingSwitch",
( State ? 1 : 0 ),
CabActive,
( Notify == range_t::unit ?
coupling::control | coupling::permanent :
coupling::control ) );
}
return ( HeatingAllow != initialstate );
}
void TMoverParameters::HeatingSwitch_( bool const State ) {
// TBD, TODO: activation dependencies?
HeatingAllow = State;
}
// *************************************************************************************************
// Q: 20160711
// zwiększenie nastawy hamulca
@@ -6550,12 +6579,14 @@ bool TMoverParameters::MaxCurrentSwitch(bool State)
if (State && (Imax == ImaxLo) && (RList[MainCtrlPos].Bn < 2) &&
!((TrainType == dt_ET42) && (MainCtrlPos > 0)))
{
Imax = ImaxHi;
MCS = true;
if (CabActive != 0)
SendCtrlToNext("MaxCurrentSwitch", 1, CabActive);
}
if (!State)
if (Imax == ImaxHi)
if (!((TrainType == dt_ET42) && (MainCtrlPos > 0)))
{
@@ -11771,6 +11802,11 @@ bool TMoverParameters::RunCommand( std::string Command, double CValue1, double C
MainSwitch_( CValue1 > 0.0 );
OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype );
}
else if (Command == "HeatingSwitch")
{
HeatingSwitch_( CValue1 > 0.0 );
OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype );
}
else if (Command == "Direction")
{
DirActive = static_cast<int>(floor(CValue1));