16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 06:59:18 +02:00

minor ui and ai logic tweaks, tachometer sound fix

This commit is contained in:
tmj-fstate
2018-06-17 02:32:55 +02:00
parent 14448d70d1
commit 66184922c1
3 changed files with 32 additions and 37 deletions

View File

@@ -1202,26 +1202,29 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
sSpeedTable[ i ].iFlags = 0; sSpeedTable[ i ].iFlags = 0;
} }
} }
else if (go == cm_Unknown) // jeśli jeszcze nie ma komendy else if( go == cm_Unknown ) {
if (v != 0.0) // komenda jest tylko gdy ma jechać, bo stoi na podstawie // jeśli jeszcze nie ma komendy
// tabelki // komenda jest tylko gdy ma jechać, bo stoi na podstawietabelki
{ // jeśli nie było komendy wcześniej - pierwsza się liczy - ustawianie if( v != 0.0 ) {
// VelSignal // jeśli nie było komendy wcześniej - pierwsza się liczy - ustawianie VelSignal
go = cm_ShuntVelocity; // w trybie pociągowym tylko jeśli włącza go = cm_ShuntVelocity; // w trybie pociągowym tylko jeśli włącza
// tryb manewrowy (v!=0.0) // tryb manewrowy (v!=0.0)
// Ra 2014-06: (VelSignal) nie może być tu ustawiane, bo Tm może być // Ra 2014-06: (VelSignal) nie może być tu ustawiane, bo Tm może być
// daleko // daleko
// VelSignal=v; //nie do końca tak, to jest druga prędkość // VelSignal=v; //nie do końca tak, to jest druga prędkość
if (VelSignal == 0.0) if( VelSignal == 0.0 ) {
VelSignal = v; // aby stojący ruszył // aby stojący ruszył
if (sSpeedTable[i].fDist < 0.0) // jeśli przejechany VelSignal = v;
{ }
VelSignal = v; //!!! ustawienie, gdy przejechany jest lepsze niż if( sSpeedTable[ i ].fDist < 0.0 ) {
// wcale, ale to jeszcze nie to // jeśli przejechany
sSpeedTable[i].iFlags = //!!! ustawienie, gdy przejechany jest lepsze niż wcale, ale to jeszcze nie to
0; // to można usunąć (nie mogą być usuwane w skanowaniu) VelSignal = v;
// to można usunąć (nie mogą być usuwane w skanowaniu)
sSpeedTable[ i ].iFlags = 0;
} }
} }
}
} }
else if( !( sSpeedTable[ i ].iFlags & spSectionVel ) ) { else if( !( sSpeedTable[ i ].iFlags & spSectionVel ) ) {
//jeśli jakiś event pasywny ale nie ograniczenie //jeśli jakiś event pasywny ale nie ograniczenie
@@ -4648,22 +4651,13 @@ TController::UpdateSituation(double dt) {
VelDesired, VelDesired,
TrainParams->TTVmax ); TrainParams->TTVmax );
} }
if( ( ( iDrivigFlags & moveStopHere ) != 0 )
&& ( vel < 0.01 )
&& ( SemNextIndex != -1 )
&& ( SemNextIndex < sSpeedTable.size() ) // BUG: index can point at non-existing slot. investigate reason(s)
&& ( sSpeedTable[ SemNextIndex ].fVelNext == 0.0 ) ) {
// don't depart if told to wait at passenger stop until allowed to by the signal
VelDesired = 0.0;
}
} }
if( ( OrderCurrentGet() & ( Shunt | Obey_train ) ) != 0 ) { if( ( OrderCurrentGet() & ( Shunt | Obey_train ) ) != 0 ) {
// w Connect nie, bo moveStopHere odnosi się do stanu po połączeniu // w Connect nie, bo moveStopHere odnosi się do stanu po połączeniu
if( ( ( iDrivigFlags & moveStopHere ) != 0 ) if( ( ( iDrivigFlags & moveStopHere ) != 0 )
&& ( vel < 0.01 ) && ( vel < 0.01 )
&& ( VelSignal == 0.0 ) ) { && ( VelSignalNext == 0.0 ) ) {
// jeśli ma czekać na wolną drogę, stoi a wyjazdu nie ma, to ma stać // jeśli ma czekać na wolną drogę, stoi a wyjazdu nie ma, to ma stać
VelDesired = 0.0; VelDesired = 0.0;
} }

View File

@@ -5645,7 +5645,7 @@ TTrain::update_sounds( double const Deltatime ) {
m_radiostop.stop(); m_radiostop.stop();
} }
if( fTachoCount > 3.f ) { if( fTachoCount >= 3.f ) {
auto const frequency { ( auto const frequency { (
true == dsbHasler.is_combined() ? true == dsbHasler.is_combined() ?
fTachoVelocity * 0.01 : fTachoVelocity * 0.01 :

View File

@@ -673,19 +673,7 @@ ui_layer::update() {
uitextline3 = uitextline3 =
"vehicles: " + to_string( Timer::subsystem.sim_dynamics.average(), 2 ) + " msec" "vehicles: " + to_string( Timer::subsystem.sim_dynamics.average(), 2 ) + " msec"
+ " update total: " + to_string( Timer::subsystem.sim_total.average(), 2 ) + " msec"; + " update total: " + to_string( Timer::subsystem.sim_total.average(), 2 ) + " msec";
// current event queue
break;
}
case( GLFW_KEY_F10 ) : {
uitextline1 = "Press [Y] key to quit / Aby zakonczyc program, przycisnij klawisz [Y].";
break;
}
case( GLFW_KEY_F11 ): {
// scenario inspector
auto const time { Timer::GetTime() }; auto const time { Timer::GetTime() };
auto const *event { simulation::Events.begin() }; auto const *event { simulation::Events.begin() };
auto eventtableindex{ 0 }; auto eventtableindex{ 0 };
@@ -711,6 +699,19 @@ ui_layer::update() {
break; break;
} }
case( GLFW_KEY_F10 ) : {
uitextline1 = "Press [Y] key to quit / Aby zakonczyc program, przycisnij klawisz [Y].";
break;
}
case( GLFW_KEY_F11 ): {
// scenario inspector
break;
}
case( GLFW_KEY_F12 ) : { case( GLFW_KEY_F12 ) : {
// opcje włączenia i wyłączenia logowania // opcje włączenia i wyłączenia logowania
uitextline1 = "[0] Debugmode " + std::string( DebugModeFlag ? "(on)" : "(off)" ); uitextline1 = "[0] Debugmode " + std::string( DebugModeFlag ? "(on)" : "(off)" );