mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 22:09:19 +02:00
tempomat fixes
This commit is contained in:
@@ -2853,6 +2853,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
&& ( ctOwner != nullptr ) ) {
|
&& ( ctOwner != nullptr ) ) {
|
||||||
MoverParameters->MainCtrlPos = ctOwner->Controlling()->MainCtrlPos*MoverParameters->MainCtrlPosNo / std::max(1, ctOwner->Controlling()->MainCtrlPosNo);
|
MoverParameters->MainCtrlPos = ctOwner->Controlling()->MainCtrlPos*MoverParameters->MainCtrlPosNo / std::max(1, ctOwner->Controlling()->MainCtrlPosNo);
|
||||||
MoverParameters->SpeedCtrlValue = ctOwner->Controlling()->SpeedCtrlValue;
|
MoverParameters->SpeedCtrlValue = ctOwner->Controlling()->SpeedCtrlValue;
|
||||||
|
MoverParameters->SpeedCtrlUnit.IsActive = ctOwner->Controlling()->SpeedCtrlUnit.IsActive;
|
||||||
}
|
}
|
||||||
MoverParameters->CheckEIMIC(dt1);
|
MoverParameters->CheckEIMIC(dt1);
|
||||||
MoverParameters->CheckSpeedCtrl(dt1);
|
MoverParameters->CheckSpeedCtrl(dt1);
|
||||||
|
|||||||
@@ -688,7 +688,7 @@ struct speed_control {
|
|||||||
bool BrakeIntervention = false;
|
bool BrakeIntervention = false;
|
||||||
bool BrakeInterventionBraking = false;
|
bool BrakeInterventionBraking = false;
|
||||||
bool BrakeInterventionUnbraking = false;
|
bool BrakeInterventionUnbraking = false;
|
||||||
bool Standby = true;
|
bool Standby = false;
|
||||||
bool Parking = false;
|
bool Parking = false;
|
||||||
double InitialPower = 1.0;
|
double InitialPower = 1.0;
|
||||||
double FullPowerVelocity = -1;
|
double FullPowerVelocity = -1;
|
||||||
|
|||||||
@@ -2215,17 +2215,12 @@ bool TMoverParameters::IncScndCtrl(int CtrlSpeed)
|
|||||||
|
|
||||||
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1) && (MainCtrlPos>0))
|
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1) && (MainCtrlPos>0))
|
||||||
{
|
{
|
||||||
// NOTE: round() already adds 0.5, are the ones added here as well correct?
|
SpeedCtrlValue = Vel;
|
||||||
if ((Vmax < 250))
|
|
||||||
SpeedCtrlValue = Round(Vel);
|
|
||||||
else
|
|
||||||
SpeedCtrlValue = Round(Vel * 0.5);
|
|
||||||
if ((EIMCtrlType == 0)&&(SpeedCtrlAutoTurnOffFlag == 1))
|
if ((EIMCtrlType == 0)&&(SpeedCtrlAutoTurnOffFlag == 1))
|
||||||
{
|
{
|
||||||
MainCtrlActualPos = MainCtrlPos;
|
MainCtrlActualPos = MainCtrlPos;
|
||||||
}
|
}
|
||||||
SpeedCtrlUnit.IsActive = true;
|
SpeedCtrlUnit.IsActive = true;
|
||||||
SendCtrlToNext("SpeedCntrl", SpeedCtrlValue, CabNo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((OK) && (SpeedCtrl) && (ScndCtrlPos == 1) && (EngineType == TEngineType::DieselEngine))
|
if ((OK) && (SpeedCtrl) && (ScndCtrlPos == 1) && (EngineType == TEngineType::DieselEngine))
|
||||||
@@ -2286,7 +2281,6 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
|||||||
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1))
|
if ((OK) && (EngineType == TEngineType::ElectricInductionMotor) && (ScndCtrlPosNo == 1))
|
||||||
{
|
{
|
||||||
SpeedCtrlValue = 0;
|
SpeedCtrlValue = 0;
|
||||||
SendCtrlToNext("SpeedCntrl", SpeedCtrlValue, CabNo);
|
|
||||||
SpeedCtrlUnit.IsActive = false;
|
SpeedCtrlUnit.IsActive = false;
|
||||||
if (SpeedCtrlUnit.ManualStateOverride) {
|
if (SpeedCtrlUnit.ManualStateOverride) {
|
||||||
eimic = 0.0;
|
eimic = 0.0;
|
||||||
@@ -5560,6 +5554,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
|||||||
//tempomat
|
//tempomat
|
||||||
if (ScndCtrlPosNo == 4 && SpeedCtrlTypeTime)
|
if (ScndCtrlPosNo == 4 && SpeedCtrlTypeTime)
|
||||||
{
|
{
|
||||||
|
SpeedCtrlUnit.IsActive = ( SpeedCtrlValue > 0 );
|
||||||
switch (ScndCtrlPos) {
|
switch (ScndCtrlPos) {
|
||||||
case 0:
|
case 0:
|
||||||
NewSpeed = 0;
|
NewSpeed = 0;
|
||||||
@@ -5608,7 +5603,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
|||||||
SpeedCtrlTimer += dt;
|
SpeedCtrlTimer += dt;
|
||||||
if (SpeedCtrlTimer > SpeedCtrlDelay)
|
if (SpeedCtrlTimer > SpeedCtrlDelay)
|
||||||
{
|
{
|
||||||
int NewSCAP = (Vmax < 250 ? 1 : 0.5) * (float)ScndCtrlPos / (float)ScndCtrlPosNo * Vmax;
|
int NewSCAP = (float)ScndCtrlPos / (float)ScndCtrlPosNo * Vmax;
|
||||||
if (NewSCAP != SpeedCtrlValue)
|
if (NewSCAP != SpeedCtrlValue)
|
||||||
{
|
{
|
||||||
SpeedCtrlValue = NewSCAP;
|
SpeedCtrlValue = NewSCAP;
|
||||||
@@ -5616,6 +5611,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SpeedCtrlUnit.IsActive = ( SpeedCtrlValue > 0 );
|
||||||
}
|
}
|
||||||
double edBCP = Hamulec->GetEDBCP();
|
double edBCP = Hamulec->GetEDBCP();
|
||||||
if( ( false == Doors.instances[ side::left ].is_closed )
|
if( ( false == Doors.instances[ side::left ].is_closed )
|
||||||
|
|||||||
Reference in New Issue
Block a user