Merge pull request #8 from Unofficial-MaSzyna-Developement/kermit-requested-features

Kermit requested features
This commit is contained in:
2025-01-07 03:45:47 +01:00
committed by GitHub
4 changed files with 39 additions and 9 deletions

View File

@@ -959,6 +959,7 @@ private:
std::array<basic_door, 2> instances; // door on the right and left side of the vehicle
// ld outputs
bool is_locked { false };
double doorLockSpeed = 10.0; // predkosc przy ktorej wyzwalana jest blokada drzwi
};
struct water_heater {
@@ -1191,6 +1192,7 @@ public:
int Lights[2][17]; // pozycje świateł, przód - tył, 1 .. 16
int ScndInMain{ 0 }; /*zaleznosc bocznika od nastawnika*/
bool MBrake = false; /*Czy jest hamulec reczny*/
double maxTachoSpeed = 0.0; // maksymalna predkosc na tarczce predkosciomierza analogowego
double StopBrakeDecc = 0.0;
bool ReleaseParkingBySpringBrake { false };
bool ReleaseParkingBySpringBrakeWhenDoorIsOpen{ false };

View File

@@ -8617,8 +8617,7 @@ TMoverParameters::update_doors( double const Deltatime ) {
Doors.is_locked =
( true == Doors.has_lock )
&& ( true == Doors.lock_enabled )
&& ( Vel >= 10.0 );
&& ( true == Doors.lock_enabled ) && (Vel >= Doors.doorLockSpeed);
for( auto &door : Doors.instances ) {
// revoke permit if...
@@ -10292,7 +10291,7 @@ void TMoverParameters::LoadFIZ_Doors( std::string const &line ) {
extract_value( Doors.has_warning, "DoorClosureWarning", line, "" );
extract_value( Doors.has_autowarning, "DoorClosureWarningAuto", line, "" );
extract_value( Doors.has_lock, "DoorBlocked", line, "" );
extract_value(Doors.doorLockSpeed, "DoorLockSpeed", line, "");
{
auto const remotedoorcontrol {
( Doors.open_control == control_t::driver )
@@ -10540,6 +10539,10 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
}
// mbrake
extract_value( MBrake, "ManualBrake", line, "" );
// maksymalna predkosc dostepna na tarczce predkosciomierza
extract_value(maxTachoSpeed, "MaxTachoSpeed", line, "");
// dynamicbrake
{
std::map<std::string, int> dynamicbrakes{

View File

@@ -6943,16 +6943,23 @@ bool TTrain::Update( double const Deltatime )
// McZapkie: predkosc wyswietlana na tachometrze brana jest z obrotow kol
auto const maxtacho { 3.0 };
fTachoVelocity = static_cast<float>( std::min( std::abs(11.31 * mvControlled->WheelDiameter * mvControlled->nrot), mvControlled->Vmax * 1.05) );
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));
{ // skacze osobna zmienna
float ff = simulation::Time.data().wSecond; // skacze co sekunde - pol sekundy
// pomiar, pol sekundy ustawienie
if (ff != fTachoTimer) // jesli w tej sekundzie nie zmienial
{
if (fTachoVelocity > 1) // jedzie
fTachoVelocityJump = fTachoVelocity + (2.0 - LocalRandom(3) + LocalRandom(3)) * 0.5;
else
fTachoVelocityJump = 0; // stoi
if (fTachoVelocity >= 5) // jedzie
fTachoVelocityJump = fTachoVelocity + (2.0 - LocalRandom(3) + LocalRandom(3)) * 0.5;
else if (fTachoVelocity < 5 && fTachoVelocity > 1)
fTachoVelocityJump = Random(0, 4); // tu ma sie bujac jak wariat i zatrzymac na jakiejs predkosci
// fTachoVelocityJump = 0; // stoi
fTachoTimer = ff; // juz zmienil
}
}
@@ -7367,6 +7374,20 @@ bool TTrain::Update( double const Deltatime )
btLampkaPoslizg.Turn( false );
}
// Lampka pracujacej sprezacki
if (mvControlled->CompressorFlag || mvOccupied->CompressorFlag)
btCompressors.Turn(true);
else
btCompressors.Turn(false);
// Lampka aktywowanej kabiny
if (mvControlled->CabActive != 0) {
btCabActived.Turn(true);
}
else {
btCabActived.Turn(false);
}
if( true == lowvoltagepower ) {
// McZapkie-141102: SHP i czuwak, TODO: sygnalizacja kabinowa
if( mvOccupied->SecuritySystem.is_vigilance_blinking() ) {
@@ -10069,7 +10090,9 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
{ "i-universal6:", btUniversals[ 6 ] },
{ "i-universal7:", btUniversals[ 7 ] },
{ "i-universal8:", btUniversals[ 8 ] },
{ "i-universal9:", btUniversals[ 9 ] }
{ "i-universal9:", btUniversals[ 9 ] },
{ "i-cabactived:", btCabActived },
{"i-compressorany:", btCompressors }
};
{
auto lookup = lights.find( Label );

View File

@@ -771,6 +771,8 @@ public: // reszta może by?publiczna
TButton btLampkaRearRightLight;
TButton btLampkaRearLeftEndLight;
TButton btLampkaRearRightEndLight;
TButton btCabActived;
TButton btCompressors; // lampka pracy jakiejkolwiek sprezarki
// other
TButton btLampkaMalfunction;
TButton btLampkaMalfunctionB;