mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
Bring back hasler and door lock tweaks
This commit is contained in:
@@ -971,6 +971,7 @@ class TMoverParameters
|
|||||||
std::array<basic_door, 2> instances; // door on the right and left side of the vehicle
|
std::array<basic_door, 2> instances; // door on the right and left side of the vehicle
|
||||||
// ld outputs
|
// ld outputs
|
||||||
bool is_locked{false};
|
bool is_locked{false};
|
||||||
|
double doorLockSpeed = 10.0; // predkosc przy ktorej wyzwalana jest blokada drzwi
|
||||||
};
|
};
|
||||||
|
|
||||||
struct water_heater
|
struct water_heater
|
||||||
@@ -1415,6 +1416,7 @@ class TMoverParameters
|
|||||||
#endif
|
#endif
|
||||||
double MirrorMaxShift{90.0};
|
double MirrorMaxShift{90.0};
|
||||||
double MirrorVelClose{5.0};
|
double MirrorVelClose{5.0};
|
||||||
|
double maxTachoSpeed = 0.0; // maksymalna predkosc na tarczce predkosciomierza analogowego
|
||||||
bool MirrorForbidden{false}; /*czy jest pozwolenie na otworzenie lusterek (przycisk)*/
|
bool MirrorForbidden{false}; /*czy jest pozwolenie na otworzenie lusterek (przycisk)*/
|
||||||
bool ScndS = false; /*Czy jest bocznikowanie na szeregowej*/
|
bool ScndS = false; /*Czy jest bocznikowanie na szeregowej*/
|
||||||
bool SpeedCtrl = false; /*czy jest tempomat*/
|
bool SpeedCtrl = false; /*czy jest tempomat*/
|
||||||
|
|||||||
@@ -8615,10 +8615,7 @@ TMoverParameters::update_doors( double const Deltatime ) {
|
|||||||
|| ( Doors.close_control == control_t::conductor )
|
|| ( Doors.close_control == control_t::conductor )
|
||||||
|| ( Doors.close_control == control_t::mixed ) };
|
|| ( Doors.close_control == control_t::mixed ) };
|
||||||
|
|
||||||
Doors.is_locked =
|
Doors.is_locked = (true == Doors.has_lock) && (true == Doors.lock_enabled) && (Vel >= Doors.doorLockSpeed);
|
||||||
( true == Doors.has_lock )
|
|
||||||
&& ( true == Doors.lock_enabled )
|
|
||||||
&& ( Vel >= 10.0 );
|
|
||||||
|
|
||||||
for( auto &door : Doors.instances ) {
|
for( auto &door : Doors.instances ) {
|
||||||
// revoke permit if...
|
// revoke permit if...
|
||||||
@@ -10319,6 +10316,7 @@ void TMoverParameters::LoadFIZ_Doors( std::string const &line ) {
|
|||||||
extract_value( Doors.has_warning, "DoorClosureWarning", line, "" );
|
extract_value( Doors.has_warning, "DoorClosureWarning", line, "" );
|
||||||
extract_value( Doors.has_autowarning, "DoorClosureWarningAuto", line, "" );
|
extract_value( Doors.has_autowarning, "DoorClosureWarningAuto", line, "" );
|
||||||
extract_value( Doors.has_lock, "DoorBlocked", line, "" );
|
extract_value( Doors.has_lock, "DoorBlocked", line, "" );
|
||||||
|
extract_value(Doors.doorLockSpeed, "DoorLockSpeed", line, "");
|
||||||
|
|
||||||
{
|
{
|
||||||
auto const remotedoorcontrol {
|
auto const remotedoorcontrol {
|
||||||
@@ -10567,6 +10565,10 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
|||||||
}
|
}
|
||||||
// mbrake
|
// mbrake
|
||||||
extract_value( MBrake, "ManualBrake", line, "" );
|
extract_value( MBrake, "ManualBrake", line, "" );
|
||||||
|
|
||||||
|
// maksymalna predkosc dostepna na tarczce predkosciomierza
|
||||||
|
extract_value(maxTachoSpeed, "MaxTachoSpeed", line, "");
|
||||||
|
|
||||||
// dynamicbrake
|
// dynamicbrake
|
||||||
{
|
{
|
||||||
std::map<std::string, int> dynamicbrakes{
|
std::map<std::string, int> dynamicbrakes{
|
||||||
|
|||||||
13
Train.cpp
13
Train.cpp
@@ -7005,16 +7005,23 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
|
|
||||||
// McZapkie: predkosc wyswietlana na tachometrze brana jest z obrotow kol
|
// McZapkie: predkosc wyswietlana na tachometrze brana jest z obrotow kol
|
||||||
auto const maxtacho { 3.0 };
|
auto const maxtacho { 3.0 };
|
||||||
|
double maxSpeed = mvControlled->Vmax * 1.05; // zachowanie starej logiki jak nie ma definicji max tarczki
|
||||||
|
if (mvOccupied->maxTachoSpeed != 0)
|
||||||
|
{
|
||||||
|
maxSpeed = mvOccupied->maxTachoSpeed;
|
||||||
|
}
|
||||||
|
fTachoVelocity = static_cast<float>(std::min(std::abs(11.31 * mvControlled->WheelDiameter * mvControlled->nrot), maxSpeed));
|
||||||
fTachoVelocity = static_cast<float>( std::min( std::abs(11.31 * mvControlled->WheelDiameter * mvControlled->nrot), mvControlled->Vmax * 1.05) );
|
fTachoVelocity = static_cast<float>( std::min( std::abs(11.31 * mvControlled->WheelDiameter * mvControlled->nrot), mvControlled->Vmax * 1.05) );
|
||||||
{ // skacze osobna zmienna
|
{ // skacze osobna zmienna
|
||||||
float ff = simulation::Time.data().wSecond; // skacze co sekunde - pol sekundy
|
float ff = simulation::Time.data().wSecond; // skacze co sekunde - pol sekundy
|
||||||
// pomiar, pol sekundy ustawienie
|
// pomiar, pol sekundy ustawienie
|
||||||
if (ff != fTachoTimer) // jesli w tej sekundzie nie zmienial
|
if (ff != fTachoTimer) // jesli w tej sekundzie nie zmienial
|
||||||
{
|
{
|
||||||
if (fTachoVelocity > 1) // jedzie
|
if (fTachoVelocity >= 5) // jedzie
|
||||||
fTachoVelocityJump = fTachoVelocity + (2.0 - LocalRandom(3) + LocalRandom(3)) * 0.5;
|
fTachoVelocityJump = fTachoVelocity + (2.0 - LocalRandom(3) + LocalRandom(3)) * 0.5;
|
||||||
else
|
else if (fTachoVelocity < 5 && fTachoVelocity > 1)
|
||||||
fTachoVelocityJump = 0; // stoi
|
fTachoVelocityJump = Random(0, 4); // tu ma sie bujac jak wariat i zatrzymac na jakiejs predkosci
|
||||||
|
// fTachoVelocityJump = 0; // stoi
|
||||||
fTachoTimer = ff; // juz zmienil
|
fTachoTimer = ff; // juz zmienil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user