mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
AI lesson for UniversalBrakeButtons
This commit is contained in:
committed by
tmj-fstate
parent
dbfda7c1e5
commit
b2b49f933c
22
Driver.cpp
22
Driver.cpp
@@ -3650,6 +3650,18 @@ void TController::SetTimeControllers()
|
||||
}
|
||||
}
|
||||
}
|
||||
//6. UniversalBrakeButtons
|
||||
//6.1. Checking flags for Over pressure
|
||||
if (std::abs(BrakeCtrlPosition - gbh_FS)<0.5) {
|
||||
UniversalBrakeButtons |= (TUniversalBrake::ub_HighPressure | TUniversalBrake::ub_Overload);
|
||||
}
|
||||
else {
|
||||
UniversalBrakeButtons &= ~(TUniversalBrake::ub_HighPressure | TUniversalBrake::ub_Overload);
|
||||
}
|
||||
//6.2. Setting buttons
|
||||
for (int i = 0; i < 3; i++) {
|
||||
mvOccupied->UniversalBrakeButton(i, (UniversalBrakeButtons & mvOccupied->UniversalBrakeButtonFlag[i]));
|
||||
}
|
||||
};
|
||||
|
||||
void TController::CheckTimeControllers()
|
||||
@@ -5888,6 +5900,8 @@ TController::UpdateSituation(double dt) {
|
||||
// napełnianie uderzeniowe
|
||||
if( ( mvOccupied->BrakeHandle == TBrakeHandle::FV4a )
|
||||
|| ( mvOccupied->BrakeHandle == TBrakeHandle::MHZ_6P )
|
||||
|| (mvOccupied->BrakeHandle == TBrakeHandle::MHZ_K5P)
|
||||
|| (mvOccupied->BrakeHandle == TBrakeHandle::MHZ_K8P)
|
||||
|| ( mvOccupied->BrakeHandle == TBrakeHandle::M394 ) ) {
|
||||
|
||||
if( /*GBH mvOccupied->BrakeCtrlPos*/BrakeCtrlPosition == -2 ) {
|
||||
@@ -5948,6 +5962,14 @@ TController::UpdateSituation(double dt) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// unlocking main pipe
|
||||
if ((AccDesired > -0.03)
|
||||
&& (true == mvOccupied->LockPipe)) {
|
||||
UniversalBrakeButtons |= TUniversalBrake::ub_UnlockPipe;
|
||||
}
|
||||
else if (false == mvOccupied->LockPipe) {
|
||||
UniversalBrakeButtons &= ~TUniversalBrake::ub_UnlockPipe;
|
||||
}
|
||||
#if LOGVELOCITY
|
||||
WriteLog("Dist=" + FloatToStrF(ActualProximityDist, ffFixed, 7, 1) +
|
||||
", VelDesired=" + FloatToStrF(VelDesired, ffFixed, 7, 1) +
|
||||
|
||||
1
Driver.h
1
Driver.h
@@ -263,6 +263,7 @@ public:
|
||||
int iOverheadZero = 0; // suma bitowa jezdy bezprądowej, bity ustawiane przez pojazdy z podniesionymi pantografami
|
||||
int iOverheadDown = 0; // suma bitowa opuszczenia pantografów, bity ustawiane przez pojazdy z podniesionymi pantografami
|
||||
double BrakeCtrlPosition = 0.0; // intermediate position of main brake controller
|
||||
int UniversalBrakeButtons = 0.0; // flag of which universal buttons need to be pressed
|
||||
int DizelPercentage = 0; // oczekiwane procenty jazdy/hamowania szynobusem
|
||||
int DizelPercentage_Speed = 0; // oczekiwane procenty jazdy/hamowania szynobusem w związku z osiąganiem VelDesired
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user