mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 00:29:19 +02:00
vehicle controllers ai logic fixes
This commit is contained in:
31
Driver.cpp
31
Driver.cpp
@@ -2706,9 +2706,17 @@ bool TController::IncBrake()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
standalone = standalone && ( mvControlling->EIMCtrlType == 0 );
|
||||||
|
|
||||||
if( true == standalone ) {
|
if( true == standalone ) {
|
||||||
OK = mvOccupied->IncLocalBrakeLevel(
|
if( mvControlling->EIMCtrlType > 0 ) {
|
||||||
1 + static_cast<int>( std::floor( 0.5 + std::fabs( AccDesired ) ) ) ); // hamowanie lokalnym bo luzem jedzie
|
OK = IncBrakeEIM();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OK = mvOccupied->IncLocalBrakeLevel(
|
||||||
|
1 + static_cast<int>( std::floor( 0.5 + std::fabs( AccDesired ) ) ) ); // hamowanie lokalnym bo luzem jedzie
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( mvOccupied->BrakeCtrlPos + 1 == mvOccupied->BrakeCtrlPosNo ) {
|
if( mvOccupied->BrakeCtrlPos + 1 == mvOccupied->BrakeCtrlPosNo ) {
|
||||||
@@ -2846,8 +2854,10 @@ bool TController::DecBrake()
|
|||||||
mvOccupied->BrakeLevelSet(0.0);
|
mvOccupied->BrakeLevelSet(0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!OK)
|
if( !OK ) {
|
||||||
OK = mvOccupied->DecLocalBrakeLevel(2);
|
OK = DecBrakeEIM();
|
||||||
|
// OK = mvOccupied->DecLocalBrakeLevel(2);
|
||||||
|
}
|
||||||
if (mvOccupied->PipePress < 3.0)
|
if (mvOccupied->PipePress < 3.0)
|
||||||
Need_BrakeRelease = true;
|
Need_BrakeRelease = true;
|
||||||
break;
|
break;
|
||||||
@@ -2936,7 +2946,7 @@ bool TController::IncSpeed()
|
|||||||
return false; // to nici z ruszania
|
return false; // to nici z ruszania
|
||||||
}
|
}
|
||||||
if (!mvControlling->FuseFlag) //&&mvControlling->StLinFlag) //yBARC
|
if (!mvControlling->FuseFlag) //&&mvControlling->StLinFlag) //yBARC
|
||||||
if ((mvControlling->IsMainCtrlZero()) ||
|
if ((mvControlling->IsMainCtrlNoPowerPos()) ||
|
||||||
(mvControlling->StLinFlag)) // youBy polecił dodać 2012-09-08 v367
|
(mvControlling->StLinFlag)) // youBy polecił dodać 2012-09-08 v367
|
||||||
// na pozycji 0 przejdzie, a na pozostałych będzie czekać, aż się załączą liniowe (zgaśnie DelayCtrlFlag)
|
// na pozycji 0 przejdzie, a na pozostałych będzie czekać, aż się załączą liniowe (zgaśnie DelayCtrlFlag)
|
||||||
if (Ready || (iDrivigFlags & movePress)) {
|
if (Ready || (iDrivigFlags & movePress)) {
|
||||||
@@ -3093,17 +3103,6 @@ void TController::ZeroSpeed( bool const Enforce ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TController::ZeroMasterController( bool const Enforce ) {
|
|
||||||
|
|
||||||
// combined controller may be set to braking, i.e. position lower than neutral
|
|
||||||
auto const neutralposition { mvControlling->MainCtrlZeroPos() };
|
|
||||||
while( ( mvControlling->MainCtrlPos < neutralposition )
|
|
||||||
&& ( DecBrake() ) ) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
ZeroSpeed( Enforce );
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TController::DecSpeed(bool force)
|
bool TController::DecSpeed(bool force)
|
||||||
{ // zmniejszenie prędkości (ale nie hamowanie)
|
{ // zmniejszenie prędkości (ale nie hamowanie)
|
||||||
bool OK = false; // domyślnie false, aby wyszło z pętli while
|
bool OK = false; // domyślnie false, aby wyszło z pętli while
|
||||||
|
|||||||
1
Driver.h
1
Driver.h
@@ -212,7 +212,6 @@ private:
|
|||||||
bool IncSpeed();
|
bool IncSpeed();
|
||||||
bool DecSpeed(bool force = false);
|
bool DecSpeed(bool force = false);
|
||||||
void ZeroSpeed( bool const Enforce = false );
|
void ZeroSpeed( bool const Enforce = false );
|
||||||
void ZeroMasterController( bool const Enforce = false );
|
|
||||||
bool IncBrakeEIM();
|
bool IncBrakeEIM();
|
||||||
bool DecBrakeEIM();
|
bool DecBrakeEIM();
|
||||||
bool IncSpeedEIM();
|
bool IncSpeedEIM();
|
||||||
|
|||||||
@@ -1592,7 +1592,7 @@ TDynamicObject::Init(std::string Name, // nazwa pojazdu, np. "EU07-424"
|
|||||||
return 0.0; // zerowa długość to brak pojazdu
|
return 0.0; // zerowa długość to brak pojazdu
|
||||||
}
|
}
|
||||||
// controller position
|
// controller position
|
||||||
MoverParameters->MainCtrlPos = MoverParameters->MainCtrlZeroPos();
|
MoverParameters->MainCtrlPos = MoverParameters->MainCtrlNoPowerPos();
|
||||||
// ustawienie pozycji hamulca
|
// ustawienie pozycji hamulca
|
||||||
MoverParameters->LocalBrakePosA = 0.0;
|
MoverParameters->LocalBrakePosA = 0.0;
|
||||||
if (driveractive)
|
if (driveractive)
|
||||||
|
|||||||
@@ -1208,6 +1208,7 @@ public:
|
|||||||
int LightsPos = 0;
|
int LightsPos = 0;
|
||||||
int ActiveDir = 0; //czy lok. jest wlaczona i w ktorym kierunku:
|
int ActiveDir = 0; //czy lok. jest wlaczona i w ktorym kierunku:
|
||||||
//względem wybranej kabiny: -1 - do tylu, +1 - do przodu, 0 - wylaczona
|
//względem wybranej kabiny: -1 - do tylu, +1 - do przodu, 0 - wylaczona
|
||||||
|
int MaxMainCtrlPosNoDirChange { 0 }; // can't change reverser state with master controller set above this position
|
||||||
int CabNo = 0; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
int CabNo = 0; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
||||||
int DirAbsolute = 0; //zadany kierunek jazdy względem sprzęgów (1=w strone 0,-1=w stronę 1)
|
int DirAbsolute = 0; //zadany kierunek jazdy względem sprzęgów (1=w strone 0,-1=w stronę 1)
|
||||||
int ActiveCab = 0; //numer kabiny, w ktorej jest obsada (zwykle jedna na skład)
|
int ActiveCab = 0; //numer kabiny, w ktorej jest obsada (zwykle jedna na skład)
|
||||||
@@ -1356,6 +1357,7 @@ public:
|
|||||||
int DettachStatus(int ConnectNo);
|
int DettachStatus(int ConnectNo);
|
||||||
bool Dettach(int ConnectNo);
|
bool Dettach(int ConnectNo);
|
||||||
bool DirectionForward();
|
bool DirectionForward();
|
||||||
|
bool DirectionBackward( void );/*! kierunek ruchu*/
|
||||||
void BrakeLevelSet(double b);
|
void BrakeLevelSet(double b);
|
||||||
bool BrakeLevelAdd(double b);
|
bool BrakeLevelAdd(double b);
|
||||||
bool IncBrakeLevel(); // wersja na użytek AI
|
bool IncBrakeLevel(); // wersja na użytek AI
|
||||||
@@ -1392,9 +1394,9 @@ public:
|
|||||||
/*! glowny nastawnik:*/
|
/*! glowny nastawnik:*/
|
||||||
bool IncMainCtrl(int CtrlSpeed);
|
bool IncMainCtrl(int CtrlSpeed);
|
||||||
bool DecMainCtrl(int CtrlSpeed);
|
bool DecMainCtrl(int CtrlSpeed);
|
||||||
bool IsMainCtrlZero() const;
|
bool IsMainCtrlNoPowerPos() const; // whether the master controller is set to position which won't generate any extra power
|
||||||
int MainCtrlZeroPos() const;
|
int MainCtrlNoPowerPos() const; // highest setting of master controller which won't cause engine to generate extra power
|
||||||
int MainCtrlPowerPos() const;
|
int MainCtrlPowerPos() const; // current setting of master controller, relative to the highest setting not generating extra power
|
||||||
/*! pomocniczy nastawnik:*/
|
/*! pomocniczy nastawnik:*/
|
||||||
bool IncScndCtrl(int CtrlSpeed);
|
bool IncScndCtrl(int CtrlSpeed);
|
||||||
bool DecScndCtrl(int CtrlSpeed);
|
bool DecScndCtrl(int CtrlSpeed);
|
||||||
@@ -1458,7 +1460,6 @@ public:
|
|||||||
double ComputeRotatingWheel(double WForce, double dt, double n) const;
|
double ComputeRotatingWheel(double WForce, double dt, double n) const;
|
||||||
|
|
||||||
/*--funkcje dla lokomotyw*/
|
/*--funkcje dla lokomotyw*/
|
||||||
bool DirectionBackward(void);/*! kierunek ruchu*/
|
|
||||||
bool WaterPumpBreakerSwitch( bool State, range_t const Notify = range_t::consist ); // water pump breaker state toggle
|
bool WaterPumpBreakerSwitch( bool State, range_t const Notify = range_t::consist ); // water pump breaker state toggle
|
||||||
bool WaterPumpSwitch( bool State, range_t const Notify = range_t::consist ); // water pump state toggle
|
bool WaterPumpSwitch( bool State, range_t const Notify = range_t::consist ); // water pump state toggle
|
||||||
bool WaterPumpSwitchOff( bool State, range_t const Notify = range_t::consist ); // water pump state toggle
|
bool WaterPumpSwitchOff( bool State, range_t const Notify = range_t::consist ); // water pump state toggle
|
||||||
@@ -1582,6 +1583,7 @@ private:
|
|||||||
bool readLightsList( std::string const &Input );
|
bool readLightsList( std::string const &Input );
|
||||||
void BrakeValveDecode( std::string const &s ); //Q 20160719
|
void BrakeValveDecode( std::string const &s ); //Q 20160719
|
||||||
void BrakeSubsystemDecode(); //Q 20160719
|
void BrakeSubsystemDecode(); //Q 20160719
|
||||||
|
bool EIMDirectionChangeAllow( void );
|
||||||
};
|
};
|
||||||
|
|
||||||
//double Distance(TLocation Loc1, TLocation Loc2, TDimension Dim1, TDimension Dim2);
|
//double Distance(TLocation Loc1, TLocation Loc2, TDimension Dim1, TDimension Dim2);
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ bool TMoverParameters::Dettach(int ConnectNo)
|
|||||||
|
|
||||||
bool TMoverParameters::DirectionForward()
|
bool TMoverParameters::DirectionForward()
|
||||||
{
|
{
|
||||||
if ((MainCtrlPosNo > 0) && (ActiveDir < 1) && (IsMainCtrlZero()))
|
if ((MainCtrlPosNo > 0) && (ActiveDir < 1) && (MainCtrlPos <= MaxMainCtrlPosNoDirChange) && (EIMDirectionChangeAllow()))
|
||||||
{
|
{
|
||||||
++ActiveDir;
|
++ActiveDir;
|
||||||
DirAbsolute = ActiveDir * CabNo;
|
DirAbsolute = ActiveDir * CabNo;
|
||||||
@@ -512,7 +512,7 @@ bool TMoverParameters::DirectionForward()
|
|||||||
SendCtrlToNext("Direction", ActiveDir, CabNo);
|
SendCtrlToNext("Direction", ActiveDir, CabNo);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if ((ActiveDir == 1) && (IsMainCtrlZero()) && (TrainType == dt_EZT) && (EngineType != TEngineType::ElectricInductionMotor))
|
else if ((ActiveDir == 1) && (IsMainCtrlNoPowerPos()) && (TrainType == dt_EZT) && (EngineType != TEngineType::ElectricInductionMotor))
|
||||||
return MinCurrentSwitch(true); //"wysoki rozruch" EN57
|
return MinCurrentSwitch(true); //"wysoki rozruch" EN57
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
@@ -641,7 +641,7 @@ TMoverParameters::CurrentSwitch(bool const State) {
|
|||||||
// for SM42/SP42
|
// for SM42/SP42
|
||||||
if( ( EngineType == TEngineType::DieselElectric )
|
if( ( EngineType == TEngineType::DieselElectric )
|
||||||
&& ( true == ShuntModeAllow )
|
&& ( true == ShuntModeAllow )
|
||||||
&& ( IsMainCtrlZero() ) ) {
|
&& ( IsMainCtrlNoPowerPos() ) ) {
|
||||||
ShuntMode = State;
|
ShuntMode = State;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1904,23 +1904,23 @@ bool TMoverParameters::DecMainCtrl(int CtrlSpeed)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMoverParameters::IsMainCtrlZero() const {
|
bool TMoverParameters::IsMainCtrlNoPowerPos() const {
|
||||||
// TODO: wrap controller pieces into a class for potential specializations, similar to brake subsystems
|
// TODO: wrap controller pieces into a class for potential specializations, similar to brake subsystems
|
||||||
return MainCtrlPos == MainCtrlZeroPos();
|
return MainCtrlPos <= MainCtrlNoPowerPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TMoverParameters::MainCtrlZeroPos() const {
|
int TMoverParameters::MainCtrlNoPowerPos() const {
|
||||||
|
|
||||||
switch( EIMCtrlType ) {
|
switch( EIMCtrlType ) {
|
||||||
case 1: { return 4; }
|
case 1: { return 3; }
|
||||||
case 2: { return 2; }
|
case 2: { return 3; }
|
||||||
default: { return 0; }
|
default: { return 0; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TMoverParameters::MainCtrlPowerPos() const {
|
int TMoverParameters::MainCtrlPowerPos() const {
|
||||||
|
|
||||||
return MainCtrlPos - MainCtrlZeroPos();
|
return MainCtrlPos - MainCtrlNoPowerPos();
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
@@ -1931,7 +1931,7 @@ bool TMoverParameters::IncScndCtrl(int CtrlSpeed)
|
|||||||
{
|
{
|
||||||
bool OK = false;
|
bool OK = false;
|
||||||
|
|
||||||
if ((IsMainCtrlZero()) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) && (DynamicBrakeFlag))
|
if ((IsMainCtrlNoPowerPos()) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) && (DynamicBrakeFlag))
|
||||||
{
|
{
|
||||||
OK = DynamicBrakeSwitch(false);
|
OK = DynamicBrakeSwitch(false);
|
||||||
}
|
}
|
||||||
@@ -1992,7 +1992,7 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
|||||||
{
|
{
|
||||||
bool OK = false;
|
bool OK = false;
|
||||||
|
|
||||||
if ((IsMainCtrlZero()) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) &&
|
if ((IsMainCtrlNoPowerPos()) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) &&
|
||||||
!(DynamicBrakeFlag) && (CtrlSpeed == 1))
|
!(DynamicBrakeFlag) && (CtrlSpeed == 1))
|
||||||
{
|
{
|
||||||
// Ra: AI wywołuje z CtrlSpeed=2 albo gdy ScndCtrlPos>0
|
// Ra: AI wywołuje z CtrlSpeed=2 albo gdy ScndCtrlPos>0
|
||||||
@@ -2339,16 +2339,13 @@ bool TMoverParameters::EpFuseSwitch(bool State)
|
|||||||
bool TMoverParameters::DirectionBackward(void)
|
bool TMoverParameters::DirectionBackward(void)
|
||||||
{
|
{
|
||||||
bool DB = false;
|
bool DB = false;
|
||||||
if ( ( TrainType == dt_EZT )
|
if ((ActiveDir == 1) && (MainCtrlPos == 0) && (TrainType == dt_EZT) && (EngineType != TEngineType::ElectricInductionMotor))
|
||||||
&& ( EngineType != TEngineType::ElectricInductionMotor )
|
|
||||||
&& ( ActiveDir == 1 )
|
|
||||||
&& (IsMainCtrlZero() ) )
|
|
||||||
if (MinCurrentSwitch(false))
|
if (MinCurrentSwitch(false))
|
||||||
{
|
{
|
||||||
DB = true; //
|
DB = true; //
|
||||||
return DB; // exit; TODO: czy dobrze przetlumaczone?
|
return DB; // exit; TODO: czy dobrze przetlumaczone?
|
||||||
}
|
}
|
||||||
if ((MainCtrlPosNo > 0) && (ActiveDir > -1) && (IsMainCtrlZero()))
|
if ((MainCtrlPosNo > 0) && (ActiveDir > -1) && (MainCtrlPos <= MaxMainCtrlPosNoDirChange) && (EIMDirectionChangeAllow()))
|
||||||
{
|
{
|
||||||
if (EngineType == TEngineType::WheelsDriven)
|
if (EngineType == TEngineType::WheelsDriven)
|
||||||
CabNo--;
|
CabNo--;
|
||||||
@@ -2366,6 +2363,13 @@ bool TMoverParameters::DirectionBackward(void)
|
|||||||
return DB;
|
return DB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TMoverParameters::EIMDirectionChangeAllow(void)
|
||||||
|
{
|
||||||
|
bool OK = false;
|
||||||
|
OK = (EngineType != TEngineType::ElectricInductionMotor || ((eimic <= 0) && (eimic_real <= 0) && (Vel < 0.1)));
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
// Q: 20160710
|
// Q: 20160710
|
||||||
// załączenie przycisku przeciwpoślizgowego
|
// załączenie przycisku przeciwpoślizgowego
|
||||||
@@ -2968,7 +2972,7 @@ bool TMoverParameters::DynamicBrakeSwitch(bool Switch)
|
|||||||
{
|
{
|
||||||
bool DBS;
|
bool DBS;
|
||||||
|
|
||||||
if ((DynamicBrakeType == dbrake_switch) && (IsMainCtrlZero()))
|
if ((DynamicBrakeType == dbrake_switch) && (IsMainCtrlNoPowerPos()))
|
||||||
{
|
{
|
||||||
DynamicBrakeFlag = Switch;
|
DynamicBrakeFlag = Switch;
|
||||||
DBS = true;
|
DBS = true;
|
||||||
@@ -4841,7 +4845,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
|||||||
Voltage = 0;
|
Voltage = 0;
|
||||||
|
|
||||||
// przekazniki bocznikowania, kazdy inny dla kazdej pozycji
|
// przekazniki bocznikowania, kazdy inny dla kazdej pozycji
|
||||||
if ((IsMainCtrlZero()) || (ShuntMode) || (false==Mains))
|
if ((IsMainCtrlNoPowerPos()) || (ShuntMode) || (false==Mains))
|
||||||
ScndCtrlPos = 0;
|
ScndCtrlPos = 0;
|
||||||
|
|
||||||
else {
|
else {
|
||||||
@@ -5324,7 +5328,7 @@ bool TMoverParameters::FuseFlagCheck(void) const
|
|||||||
bool TMoverParameters::FuseOn(void)
|
bool TMoverParameters::FuseOn(void)
|
||||||
{
|
{
|
||||||
bool FO = false;
|
bool FO = false;
|
||||||
if ((IsMainCtrlZero()) && (ScndCtrlPos == 0) && (TrainType != dt_ET40) &&
|
if ((IsMainCtrlNoPowerPos()) && (ScndCtrlPos == 0) && (TrainType != dt_ET40) &&
|
||||||
((Mains) || (TrainType != dt_EZT)) && (!TestFlag(EngDmgFlag, 1)))
|
((Mains) || (TrainType != dt_EZT)) && (!TestFlag(EngDmgFlag, 1)))
|
||||||
{ // w ET40 jest blokada nastawnika, ale czy działa dobrze?
|
{ // w ET40 jest blokada nastawnika, ale czy działa dobrze?
|
||||||
SendCtrlToNext("FuseSwitch", 1, CabNo);
|
SendCtrlToNext("FuseSwitch", 1, CabNo);
|
||||||
@@ -5812,7 +5816,7 @@ bool TMoverParameters::MotorConnectorsCheck() {
|
|||||||
( false == Mains )
|
( false == Mains )
|
||||||
|| ( true == FuseFlag )
|
|| ( true == FuseFlag )
|
||||||
|| ( true == StLinSwitchOff )
|
|| ( true == StLinSwitchOff )
|
||||||
|| ( IsMainCtrlZero() )
|
|| ( IsMainCtrlNoPowerPos() )
|
||||||
|| ( ActiveDir == 0 ) };
|
|| ( ActiveDir == 0 ) };
|
||||||
|
|
||||||
if( connectorsoff ) { return false; }
|
if( connectorsoff ) { return false; }
|
||||||
@@ -6070,7 +6074,7 @@ bool TMoverParameters::dizel_AutoGearCheck(void)
|
|||||||
{
|
{
|
||||||
if (dizel_engagestate > 0)
|
if (dizel_engagestate > 0)
|
||||||
dizel_EngageSwitch(0);
|
dizel_EngageSwitch(0);
|
||||||
if ((IsMainCtrlZero()) && (ScndCtrlActualPos > 0))
|
if ((IsMainCtrlNoPowerPos()) && (ScndCtrlActualPos > 0))
|
||||||
dizel_automaticgearstatus = -1;
|
dizel_automaticgearstatus = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -6357,7 +6361,7 @@ double TMoverParameters::dizel_Momentum(double dizel_fill, double n, double dt)
|
|||||||
if ((MainCtrlPowerPos() > 0) && (Mains) && (enrot>dizel_nmin*0.9))
|
if ((MainCtrlPowerPos() > 0) && (Mains) && (enrot>dizel_nmin*0.9))
|
||||||
hydro_TC_Fill += hydro_TC_FillRateInc * dt;
|
hydro_TC_Fill += hydro_TC_FillRateInc * dt;
|
||||||
//oproznianie przetwornika
|
//oproznianie przetwornika
|
||||||
if (((IsMainCtrlZero()) && (Vel<3))
|
if (((IsMainCtrlNoPowerPos()) && (Vel<3))
|
||||||
|| (!Mains)
|
|| (!Mains)
|
||||||
|| (enrot<dizel_nmin*0.8))
|
|| (enrot<dizel_nmin*0.8))
|
||||||
hydro_TC_Fill -= hydro_TC_FillRateDec * dt;
|
hydro_TC_Fill -= hydro_TC_FillRateDec * dt;
|
||||||
@@ -8523,6 +8527,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
|||||||
extract_value( MainCtrlPosNo, "MCPN", line, "" );
|
extract_value( MainCtrlPosNo, "MCPN", line, "" );
|
||||||
extract_value( ScndCtrlPosNo, "SCPN", line, "" );
|
extract_value( ScndCtrlPosNo, "SCPN", line, "" );
|
||||||
extract_value( ScndInMain, "SCIM", line, "" );
|
extract_value( ScndInMain, "SCIM", line, "" );
|
||||||
|
extract_value( MaxMainCtrlPosNoDirChange, "DirChangeMaxPos", line, "" );
|
||||||
|
|
||||||
std::string autorelay;
|
std::string autorelay;
|
||||||
extract_value( autorelay, "AutoRelay", line, "" );
|
extract_value( autorelay, "AutoRelay", line, "" );
|
||||||
|
|||||||
@@ -783,7 +783,7 @@ void TTrain::OnCommand_jointcontrollerset( TTrain *Train, command_data const &Co
|
|||||||
1.0 - ( Command.param1 * 2 ),
|
1.0 - ( Command.param1 * 2 ),
|
||||||
0.0, 1.0 ) );
|
0.0, 1.0 ) );
|
||||||
if( Train->mvControlled->MainCtrlPowerPos() > 0 ) {
|
if( Train->mvControlled->MainCtrlPowerPos() > 0 ) {
|
||||||
Train->set_master_controller( Train->mvControlled->MainCtrlZeroPos() );
|
Train->set_master_controller( Train->mvControlled->MainCtrlNoPowerPos() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -839,7 +839,7 @@ void TTrain::OnCommand_mastercontrollerdecrease( TTrain *Train, command_data con
|
|||||||
if( Command.action != GLFW_RELEASE ) {
|
if( Command.action != GLFW_RELEASE ) {
|
||||||
// on press or hold
|
// on press or hold
|
||||||
if( ( Train->ggJointCtrl.SubModel != nullptr )
|
if( ( Train->ggJointCtrl.SubModel != nullptr )
|
||||||
&& ( Train->mvControlled->IsMainCtrlZero() ) ) {
|
&& ( Train->mvControlled->IsMainCtrlNoPowerPos() ) ) {
|
||||||
OnCommand_independentbrakeincrease( Train, Command );
|
OnCommand_independentbrakeincrease( Train, Command );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -859,7 +859,7 @@ void TTrain::OnCommand_mastercontrollerdecreasefast( TTrain *Train, command_data
|
|||||||
if( Command.action != GLFW_RELEASE ) {
|
if( Command.action != GLFW_RELEASE ) {
|
||||||
// on press or hold
|
// on press or hold
|
||||||
if( ( Train->ggJointCtrl.SubModel != nullptr )
|
if( ( Train->ggJointCtrl.SubModel != nullptr )
|
||||||
&& ( Train->mvControlled->IsMainCtrlZero() ) ) {
|
&& ( Train->mvControlled->IsMainCtrlNoPowerPos() ) ) {
|
||||||
OnCommand_independentbrakeincreasefast( Train, Command );
|
OnCommand_independentbrakeincreasefast( Train, Command );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user