diff --git a/Driver.cpp b/Driver.cpp index a3b15065..9f54a144 100644 --- a/Driver.cpp +++ b/Driver.cpp @@ -3440,30 +3440,35 @@ void TController::SpeedSet() break; case TEngineType::DieselEngine: // Ra 2014-06: "automatyczna" skrzynia biegów... - if (!mvControlling->MotorParam[mvControlling->ScndCtrlPos].AutoSwitch) // gdy biegi ręczne - if ((mvControlling->ShuntMode ? mvControlling->AnPos : 1.0) * mvControlling->Vel > - 0.75 * mvControlling->MotorParam[mvControlling->ScndCtrlPos].mfi) + if( false == mvControlling->MotorParam[ mvControlling->ScndCtrlPos ].AutoSwitch ) { + // gdy biegi ręczne + if( ( mvControlling->ShuntMode ? mvControlling->AnPos : 1.0 ) * mvControlling->Vel > + 0.75 * mvControlling->MotorParam[ mvControlling->ScndCtrlPos ].mfi ) // if (mvControlling->enrot>0.95*mvControlling->dizel_nMmax) //youBy: jeśli obroty > // 0,95 nmax, wrzuć wyższy bieg - Ra: to nie działa { // jak prędkość większa niż 0.6 maksymalnej na danym biegu, wrzucić wyższy - mvControlling->DecMainCtrl(2); - if (mvControlling->IncScndCtrl(1)) - if (mvControlling->MotorParam[mvControlling->ScndCtrlPos].mIsat == - 0.0) // jeśli bieg jałowy - mvControlling->IncScndCtrl(1); // to kolejny + if( mvControlling->ScndCtrlPos < mvControlling->ScndCtrlPosNo ) { + // ...presuming there is a higher gear + mvControlling->DecMainCtrl( 2 ); + if( mvControlling->IncScndCtrl( 1 ) ) { + while( ( mvControlling->MotorParam[ mvControlling->ScndCtrlPos ].mIsat == 0.0 ) // jeśli bieg jałowy + && ( mvControlling->IncScndCtrl( 1 ) ) ) { // to kolejny + ; + } + } + } } - else if ((mvControlling->ShuntMode ? mvControlling->AnPos : 1.0) * mvControlling->Vel < - mvControlling->MotorParam[mvControlling->ScndCtrlPos].fi) - { // jak prędkość mniejsza niż minimalna na danym biegu, wrzucić niższy - mvControlling->DecMainCtrl(2); - mvControlling->DecScndCtrl(1); - if (mvControlling->MotorParam[mvControlling->ScndCtrlPos].mIsat == - 0.0) // jeśli bieg jałowy - if (mvControlling->ScndCtrlPos) // a jeszcze zera nie osiągnięto - mvControlling->DecScndCtrl(1); // to kolejny wcześniejszy + else if( ( mvControlling->ShuntMode ? mvControlling->AnPos : 1.0 ) * mvControlling->Vel < + mvControlling->MotorParam[ mvControlling->ScndCtrlPos ].fi ) { // jak prędkość mniejsza niż minimalna na danym biegu, wrzucić niższy + mvControlling->DecMainCtrl( 2 ); + mvControlling->DecScndCtrl( 1 ); + if( mvControlling->MotorParam[ mvControlling->ScndCtrlPos ].mIsat == 0.0 ) // jeśli bieg jałowy + if( mvControlling->ScndCtrlPos ) // a jeszcze zera nie osiągnięto + mvControlling->DecScndCtrl( 1 ); // to kolejny wcześniejszy else - mvControlling->IncScndCtrl(1); // a jak zeszło na zero, to powrót + mvControlling->IncScndCtrl( 1 ); // a jak zeszło na zero, to powrót } + } break; } }; diff --git a/McZapkie/Mover.cpp b/McZapkie/Mover.cpp index 6b3efdae..6f35b399 100644 --- a/McZapkie/Mover.cpp +++ b/McZapkie/Mover.cpp @@ -1572,6 +1572,8 @@ void TMoverParameters::HeatingCheck( double const Timestep ) { auto const absrevolutions { std::abs( generator.revolutions ) }; generator.voltage = ( + false == HeatingAllow ? 0.0 : + // TODO: add support for desired voltage selector absrevolutions < generator.revolutions_min ? generator.voltage_min * absrevolutions / generator.revolutions_min : // absrevolutions > generator.revolutions_max ? generator.voltage_max * absrevolutions / generator.revolutions_max : interpolate( diff --git a/Train.cpp b/Train.cpp index 49bb59c0..08dbf68b 100644 --- a/Train.cpp +++ b/Train.cpp @@ -8377,6 +8377,18 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con gauge.AssignDouble(&mvControlled->AnPos); m_controlmapper.insert( gauge, "shuntmodepower:" ); } + else if( Label == "heatingvoltage:" ) { + if( mvControlled->HeatingPowerSource.SourceType == TPowerSource::Generator ) { + auto &gauge = Cabine[ Cabindex ].Gauge( -1 ); // pierwsza wolna gałka + gauge.Load( Parser, DynamicObject ); + gauge.AssignDouble( &(mvControlled->HeatingPowerSource.EngineGenerator.voltage) ); + } + } + else if( Label == "heatingcurrent:" ) { + auto &gauge = Cabine[ Cabindex ].Gauge( -1 ); // pierwsza wolna gałka + gauge.Load( Parser, DynamicObject ); + gauge.AssignDouble( &( mvControlled->TotalCurrent ) ); + } else { // failed to match the label diff --git a/driveruipanels.cpp b/driveruipanels.cpp index 9047f561..4845d6d6 100644 --- a/driveruipanels.cpp +++ b/driveruipanels.cpp @@ -750,17 +750,14 @@ debug_panel::update_vehicle_brake() const { void debug_panel::update_section_engine( std::vector &Output ) { - - if( m_input.train == nullptr ) { return; } + // engine data if( m_input.vehicle == nullptr ) { return; } if( m_input.mover == nullptr ) { return; } - auto const &train { *m_input.train }; auto const &vehicle{ *m_input.vehicle }; auto const &mover{ *m_input.mover }; - // engine data - // induction motor data + // induction motor data if( mover.EngineType == TEngineType::ElectricInductionMotor ) { Output.emplace_back( " eimc: eimv: press:", Global.UITextColor ); @@ -772,7 +769,11 @@ debug_panel::update_section_engine( std::vector &Output ) { + mover.eimv_labels[ i ] + to_string( mover.eimv[ i ], 2, 9 ); if( i < 10 ) { - parameters += " | " + train.fPress_labels[ i ] + to_string( train.fPress[ i ][ 0 ], 2, 9 ); + // NOTE: we pull consist data from the train structure, so show this data only if we're viewing controlled vehicle + parameters += + ( ( m_input.train != nullptr ) && ( m_input.train->Dynamic() == m_input.vehicle ) ? + " | " + TTrain::fPress_labels[ i ] + to_string( m_input.train->fPress[ i ][ 0 ], 2, 9 ) : + "" ); } else if( i == 12 ) { parameters += " med:"; @@ -784,6 +785,7 @@ debug_panel::update_section_engine( std::vector &Output ) { Output.emplace_back( parameters, Global.UITextColor ); } } + // diesel engine data if( mover.EngineType == TEngineType::DieselEngine ) { std::string parameterstext = "param value"; diff --git a/version.h b/version.h index 67a81d3e..9f573cd6 100644 --- a/version.h +++ b/version.h @@ -1,5 +1,5 @@ #pragma once #define VERSION_MAJOR 19 -#define VERSION_MINOR 701 +#define VERSION_MINOR 712 #define VERSION_REVISION 0