mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 00:29:19 +02:00
build 210303. vehicle control hint system, virtual trainman toggle, configurable diesel engine rpm deceleration rate, vehicle repair enhancement, debug panel enhancements, customizable vehicle displays refresh rate, idling compressor sound, traction ac motor sound, braking sound enhancement, sky state enhancement, minor bug fixes
This commit is contained in:
@@ -120,7 +120,7 @@ static int const dtrain_engine = 32; /*dla lokomotyw*/
|
||||
static int const dtrain_loaddestroyed = 32;/*dla wagonow*/
|
||||
static int const dtrain_axle = 64;
|
||||
static int const dtrain_out = 128; /*wykolejenie*/
|
||||
|
||||
static int const dtrain_pantograph = 256;
|
||||
/*wagi prawdopodobienstwa dla funkcji FuzzyLogic*/
|
||||
#define p_elengproblem (1e-02)
|
||||
#define p_elengdamage (1e-01)
|
||||
@@ -837,7 +837,7 @@ private:
|
||||
struct water_pump : public basic_device {
|
||||
// ld inputs
|
||||
// TODO: move to breaker list in the basic device once implemented
|
||||
bool breaker { true }; // device is allowed to operate
|
||||
bool breaker { false }; // device is allowed to operate
|
||||
};
|
||||
|
||||
// basic approximation of a solenoid valve
|
||||
@@ -921,7 +921,7 @@ private:
|
||||
float temp_max { -1 }; // highest accepted temperature
|
||||
} config;
|
||||
// ld inputs
|
||||
bool breaker { true }; // device is allowed to operate
|
||||
bool breaker { false }; // device is allowed to operate
|
||||
bool is_enabled { false }; // device is requested to operate
|
||||
// ld outputs
|
||||
bool is_active { false }; // device is working
|
||||
@@ -1215,6 +1215,7 @@ public:
|
||||
double dizel_minVelfullengage = 0.0; /*najmniejsza predkosc przy jezdzie ze sprzeglem bez poslizgu*/
|
||||
double dizel_maxVelANS = 3.0; /*predkosc progowa rozlaczenia przetwornika momentu*/
|
||||
double dizel_AIM = 1.0; /*moment bezwladnosci walu itp*/
|
||||
double dizel_RevolutionsDecreaseRate{ 2.0 };
|
||||
double dizel_NominalFuelConsumptionRate = 250.0; /*jednostkowe zużycie paliwa przy mocy nominalnej, wczytywane z fiz, g/kWh*/
|
||||
double dizel_FuelConsumption = 0.0; /*współczynnik zużycia paliwa przeliczony do jednostek maszynowych, l/obrót*/
|
||||
double dizel_FuelConsumptionActual = 0.0; /*chwilowe spalanie paliwa w l/h*/
|
||||
@@ -1273,7 +1274,7 @@ public:
|
||||
double MED_Vmax = 0; // predkosc maksymalna dla obliczen chwilowej sily hamowania EP w MED
|
||||
double MED_Vmin = 0; // predkosc minimalna dla obliczen chwilowej sily hamowania EP w MED
|
||||
double MED_Vref = 0; // predkosc referencyjna dla obliczen dostepnej sily hamowania EP w MED
|
||||
double MED_amax = 9.81; // maksymalne opoznienie hamowania sluzbowego MED
|
||||
double MED_amax { 9.81 }; // maksymalne opoznienie hamowania sluzbowego MED
|
||||
bool MED_EPVC = 0; // czy korekcja sily hamowania EP, gdy nie ma dostepnego ED
|
||||
double MED_EPVC_Time = 7; // czas korekcji sily hamowania EP, gdy nie ma dostepnego ED
|
||||
bool MED_Ncor = 0; // czy korekcja sily hamowania z uwzglednieniem nacisku
|
||||
@@ -1673,12 +1674,15 @@ public:
|
||||
bool DecMainCtrl(int CtrlSpeed);
|
||||
bool IsMainCtrlActualNoPowerPos() const; // whether the master controller is actually set to position which won't generate any extra power
|
||||
bool IsMainCtrlNoPowerPos() const; // whether the master controller is set to position which won't generate any extra power
|
||||
bool IsMainCtrlMaxPowerPos() const;
|
||||
int MainCtrlNoPowerPos() const; // highest setting of master controller which won't cause engine to generate extra power
|
||||
int MainCtrlActualPowerPos() const; // current actual setting of master controller, relative to the highest setting not generating extra power
|
||||
int MainCtrlPowerPos() const; // current setting of master controller, relative to the highest setting not generating extra power
|
||||
/*! pomocniczy nastawnik:*/
|
||||
bool IncScndCtrl(int CtrlSpeed);
|
||||
bool DecScndCtrl(int CtrlSpeed);
|
||||
bool IsScndCtrlNoPowerPos() const;
|
||||
bool IsScndCtrlMaxPowerPos() const;
|
||||
|
||||
|
||||
bool AddPulseForce(int Multipler);/*dla drezyny*/
|
||||
|
||||
@@ -2419,6 +2419,11 @@ bool TMoverParameters::IsMainCtrlNoPowerPos() const {
|
||||
return MainCtrlPos <= MainCtrlNoPowerPos();
|
||||
}
|
||||
|
||||
bool TMoverParameters::IsMainCtrlMaxPowerPos() const {
|
||||
// TODO: wrap controller pieces into a class for potential specializations, similar to brake subsystems
|
||||
return MainCtrlPos == MainCtrlPosNo;
|
||||
}
|
||||
|
||||
int TMoverParameters::MainCtrlNoPowerPos() const {
|
||||
|
||||
switch( EIMCtrlType ) {
|
||||
@@ -2578,6 +2583,16 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool TMoverParameters::IsScndCtrlNoPowerPos() const {
|
||||
// TODO: refine the check on account of potential electric series vehicles with speed control
|
||||
return ( ( ScndCtrlPos == 0 ) || ( true == SpeedCtrl ) );
|
||||
}
|
||||
|
||||
bool TMoverParameters::IsScndCtrlMaxPowerPos() const {
|
||||
// TODO: refine the check on account of potential electric series vehicles with speed control
|
||||
return ( ( ScndCtrlPos == ScndCtrlPosNo ) || ( true == SpeedCtrl ) );
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160710
|
||||
// załączenie rozrządu
|
||||
@@ -2833,12 +2848,12 @@ void TMoverParameters::SecuritySystemCheck(double dt)
|
||||
if( ( TestFlag( SecuritySystem.SystemType, 2 )
|
||||
&& ( SecuritySystem.Status == s_waiting )
|
||||
&& ( false == SecuritySystem.PoweredUp )
|
||||
&& ( Power24vIsAvailable ) ) ) {
|
||||
&& ( Power24vIsAvailable || Power110vIsAvailable ) ) ) {
|
||||
// Ra: znowu w kabinie jest coś, co być nie powinno!
|
||||
SetFlag( SecuritySystem.Status, s_active );
|
||||
SetFlag( SecuritySystem.Status, s_SHPalarm );
|
||||
}
|
||||
SecuritySystem.PoweredUp = Power24vIsAvailable;
|
||||
SecuritySystem.PoweredUp = ( Power24vIsAvailable || Power110vIsAvailable );
|
||||
|
||||
if ((SecuritySystem.SystemType > 0)
|
||||
&& (SecuritySystem.Status != s_off)
|
||||
@@ -5175,6 +5190,7 @@ double TMoverParameters::CouplerForce( int const End, double dt ) {
|
||||
}
|
||||
|
||||
if( Attach( End, otherend, othervehicle, couplingtype ) ) {
|
||||
// HACK: we're reusing sound enum to mark whether vehicle was connected to another
|
||||
SetFlag( AIFlag, sound::attachcoupler );
|
||||
coupler.AutomaticCouplingAllowed = false;
|
||||
othercoupler.AutomaticCouplingAllowed = false;
|
||||
@@ -5241,8 +5257,8 @@ double TMoverParameters::TractionForce( double dt ) {
|
||||
enrot = clamp(
|
||||
enrot + ( dt / dizel_AIM ) * (
|
||||
enrot < tmp ?
|
||||
1.0 :
|
||||
-2.0 ), // NOTE: revolutions drop faster than they rise, maybe? TBD: maybe not
|
||||
1.0 :
|
||||
-1.0 * dizel_RevolutionsDecreaseRate ), // NOTE: revolutions typically drop faster than they rise
|
||||
0.0, std::max( tmp, enrot ) );
|
||||
if( std::abs( tmp - enrot ) < 0.001 ) {
|
||||
enrot = tmp;
|
||||
@@ -6851,8 +6867,6 @@ bool TMoverParameters::OperatePantographsValve( operation_t const State, range_t
|
||||
if( ( EnginePowerSource.SourceType == TPowerSource::CurrentCollector )
|
||||
&& ( EnginePowerSource.CollectorParameters.CollectorsNo > 0 ) ) {
|
||||
|
||||
auto const lowvoltagepower { PantsValve.solenoid ? ( Power24vIsAvailable || Power110vIsAvailable ) : true };
|
||||
|
||||
auto &valve { PantsValve };
|
||||
|
||||
switch( State ) {
|
||||
@@ -8156,7 +8170,7 @@ bool TMoverParameters::ChangeDoorControlMode( bool const State, range_t const No
|
||||
OperateDoors( side::right, true );
|
||||
}
|
||||
|
||||
return ( Doors.step_enabled != initialstate );
|
||||
return ( Doors.remote_only != initialstate );
|
||||
}
|
||||
|
||||
bool TMoverParameters::OperateDoors( side const Door, bool const State, range_t const Notify ) {
|
||||
@@ -8298,8 +8312,8 @@ TMoverParameters::update_doors( double const Deltatime ) {
|
||||
|
||||
door.local_open = door.local_open && ( false == door.is_open ) && ( ( false == Doors.permit_needed ) || door.open_permit );
|
||||
door.remote_open = ( door.remote_open || Doors.remote_only ) && ( false == door.is_open ) && ( ( false == Doors.permit_needed ) || door.open_permit );
|
||||
door.local_close = door.local_close && ( false == door.is_closed );
|
||||
door.remote_close = door.remote_close && ( false == door.is_closed );
|
||||
door.local_close = door.local_close && ( false == door.is_closed ) && ( ( false == remoteopencontrol ) || ( false == door.remote_open ) );
|
||||
door.remote_close = door.remote_close && ( false == door.is_closed ) && ( ( false == localopencontrol ) || ( false == door.local_open ) );
|
||||
|
||||
auto const autoopenrequest {
|
||||
( Doors.open_control == control_t::autonomous )
|
||||
@@ -10497,6 +10511,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
||||
extract_value( dizel_nmax_cutoff, "nmax_cutoff", Input, "0.0" );
|
||||
dizel_nmax_cutoff /= 60.0;
|
||||
extract_value( dizel_AIM, "AIM", Input, "1.0" );
|
||||
extract_value( dizel_RevolutionsDecreaseRate, "RPMDecRate", Input, "" );
|
||||
|
||||
extract_value(engageupspeed, "EUS", Input, "0.5");
|
||||
extract_value(engagedownspeed, "EDS", Input, "0.9");
|
||||
@@ -10561,6 +10576,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
|
||||
}
|
||||
extract_value( EngineHeatingRPM, "HeatingRPM", Input, "" );
|
||||
extract_value( dizel_AIM, "AIM", Input, "1.25" );
|
||||
extract_value( dizel_RevolutionsDecreaseRate, "RPMDecRate", Input, "" );
|
||||
break;
|
||||
}
|
||||
case TEngineType::ElectricInductionMotor: {
|
||||
|
||||
Reference in New Issue
Block a user