mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 21:49:19 +02:00
Automatic W5 if in train state
Speed table in white font VelSignal only for stop and start
This commit is contained in:
31
Driver.cpp
31
Driver.cpp
@@ -659,7 +659,7 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
||||
if (k < 0)
|
||||
k += iSpeedTableSize; // ilość pozycji do przeanalizowania
|
||||
iDrivigFlags &=
|
||||
~(moveTrackEnd | moveSwitchFound); // te flagi są ustawiane tutaj, w razie potrzeby
|
||||
~(moveTrackEnd | moveSwitchFound | moveSemaphorFound); // te flagi są ustawiane tutaj, w razie potrzeby
|
||||
for (i = iFirst; k > 0; --k, i = (i + 1) % iSpeedTableSize)
|
||||
{ // sprawdzenie rekordów od (iFirst) do (iLast), o ile są istotne
|
||||
if (sSpeedTable[i].iFlags & spEnabled) // badanie istotności
|
||||
@@ -971,8 +971,10 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
||||
}
|
||||
else if (sSpeedTable[i].iFlags & spSemaphor)
|
||||
{ // to semaphor
|
||||
if (sSpeedTable[i].fDist < 0)
|
||||
VelSignalLast = sSpeedTable[i].fVelNext; //minięty daje prędkość obowiązującą
|
||||
if (sSpeedTable[i].fDist < 0)
|
||||
VelSignalLast = sSpeedTable[i].fVelNext; //minięty daje prędkość obowiązującą
|
||||
else
|
||||
iDrivigFlags |= moveSemaphorFound; //jeśli z przodu to dajemy falgę, że jest
|
||||
}
|
||||
else if (sSpeedTable[i].iFlags & spRoadVel)
|
||||
{ // to W6
|
||||
@@ -983,9 +985,12 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
||||
{ // to W27
|
||||
if (sSpeedTable[i].fDist < 0)
|
||||
VelLimitLast = sSpeedTable[i].fVelNext;
|
||||
if (sSpeedTable[i].evEvent->ValueGet(1) > 0.0 &&
|
||||
sSpeedTable[i].fDist + sSpeedTable[i].evEvent->ValueGet(1) > -fLength)
|
||||
iDrivigFlags |= moveSpeedLimitFound; // jeśli jesteśmy w ograniczeniu
|
||||
}
|
||||
|
||||
//sprawdzenie eventów pasywnych przed nami
|
||||
//sprawdzenie eventów pasywnych przed nami
|
||||
if ((mvOccupied->CategoryFlag & 1) ?
|
||||
sSpeedTable[i].fDist > pVehicles[0]->fTrackBlock - 20.0 :
|
||||
false) // jak sygnał jest dalej niż zawalidroga
|
||||
@@ -1034,10 +1039,10 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
||||
// VelSignal=v; //nie do końca tak, to jest druga prędkość; -1 nie
|
||||
// wpisywać...
|
||||
if (VelSignal == 0.0)
|
||||
VelSignal = v; // aby stojący ruszył
|
||||
VelSignal = -1.0; // aby stojący ruszył
|
||||
if (sSpeedTable[i].fDist < 0.0) // jeśli przejechany
|
||||
{
|
||||
VelSignal = v; //!!! ustawienie, gdy przejechany jest lepsze niż
|
||||
if (v != 0 ? VelSignal = -1.0 : VelSignal = 0.0); //!!! ustawienie, gdy przejechany jest lepsze niż
|
||||
// wcale, ale to jeszcze nie to
|
||||
if (sSpeedTable[i].iFlags & 0x100) // jeśli semafor
|
||||
if ((sSpeedTable[i].evEvent != eSignSkip) ?
|
||||
@@ -1134,12 +1139,17 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
||||
}
|
||||
} // if (sSpeedTable[i].iFlags&1)
|
||||
} // for
|
||||
|
||||
if (VelSignalLast >= 0.0 && !(iDrivigFlags & (moveSemaphorFound | moveSwitchFound)) &&
|
||||
(OrderCurrentGet() & Obey_train))
|
||||
VelSignalLast = -1.0; // jeśli mieliśmy ograniczenie z semafora i nie ma przed nami
|
||||
if (fVelDes > VelSignalLast) //analiza spisanych z tabelki ograniczeń i nadpisanie aktualnego
|
||||
fVelDes = VelSignalLast;
|
||||
else if (fVelDes > VelLimitLast)
|
||||
if (fVelDes > VelLimitLast)
|
||||
fVelDes = VelLimitLast;
|
||||
else if (fVelDes > VelRoad)
|
||||
if (fVelDes > VelRoad)
|
||||
fVelDes = VelRoad;
|
||||
// nastepnego semafora albo zwrotnicy to uznajemy, że mijamy W5
|
||||
return go;
|
||||
};
|
||||
|
||||
@@ -3950,9 +3960,10 @@ bool TController::UpdateSituation(double dt)
|
||||
VelDesired = 0.0; // jak ma czekać, to nie ma jazdy
|
||||
// else if (VelSignal<0)
|
||||
// VelDesired=fVelMax; //ile fabryka dala (Ra: uwzględione wagony)
|
||||
else if (VelSignal >= 0) // VelSignal>0 jest ograniczeniem prędkości (z semafora)
|
||||
else if (VelSignal >= 0) // jeśli skład był zatrzymany na początku i teraz już może jechać
|
||||
VelDesired = Min0R(VelDesired, VelSignal);
|
||||
if (mvOccupied->RunningTrack.Velmax >=
|
||||
|
||||
if (mvOccupied->RunningTrack.Velmax >=
|
||||
0) // ograniczenie prędkości z trajektorii ruchu
|
||||
VelDesired =
|
||||
Min0R(VelDesired,
|
||||
|
||||
Reference in New Issue
Block a user