mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
Merge pull request #76 from Unofficial-MaSzyna-Developement/kermit-requested-features
Kermit requested features
This commit is contained in:
@@ -959,6 +959,7 @@ private:
|
|||||||
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 {
|
||||||
@@ -1191,6 +1192,7 @@ public:
|
|||||||
int Lights[2][17]; // pozycje świateł, przód - tył, 1 .. 16
|
int Lights[2][17]; // pozycje świateł, przód - tył, 1 .. 16
|
||||||
int ScndInMain{ 0 }; /*zaleznosc bocznika od nastawnika*/
|
int ScndInMain{ 0 }; /*zaleznosc bocznika od nastawnika*/
|
||||||
bool MBrake = false; /*Czy jest hamulec reczny*/
|
bool MBrake = false; /*Czy jest hamulec reczny*/
|
||||||
|
double maxTachoSpeed = 0.0; // maksymalna predkosc na tarczce predkosciomierza analogowego
|
||||||
double StopBrakeDecc = 0.0;
|
double StopBrakeDecc = 0.0;
|
||||||
bool ReleaseParkingBySpringBrake { false };
|
bool ReleaseParkingBySpringBrake { false };
|
||||||
bool ReleaseParkingBySpringBrakeWhenDoorIsOpen{ false };
|
bool ReleaseParkingBySpringBrakeWhenDoorIsOpen{ false };
|
||||||
|
|||||||
@@ -8617,8 +8617,7 @@ TMoverParameters::update_doors( double const Deltatime ) {
|
|||||||
|
|
||||||
Doors.is_locked =
|
Doors.is_locked =
|
||||||
( true == Doors.has_lock )
|
( true == Doors.has_lock )
|
||||||
&& ( true == Doors.lock_enabled )
|
&& ( true == Doors.lock_enabled ) && (Vel >= Doors.doorLockSpeed);
|
||||||
&& ( Vel >= 10.0 );
|
|
||||||
|
|
||||||
for( auto &door : Doors.instances ) {
|
for( auto &door : Doors.instances ) {
|
||||||
// revoke permit if...
|
// 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_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 {
|
||||||
( Doors.open_control == control_t::driver )
|
( Doors.open_control == control_t::driver )
|
||||||
@@ -10540,6 +10539,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{
|
||||||
|
|||||||
41
Train.cpp
41
Train.cpp
@@ -6943,16 +6943,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 };
|
||||||
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
|
{ // 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7367,6 +7374,25 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
btLampkaPoslizg.Turn( false );
|
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 (mvControlled->Battery && mvControlled->CabActive == 0)
|
||||||
|
btAKLVents.Turn(true);
|
||||||
|
else
|
||||||
|
btAKLVents.Turn(true);
|
||||||
|
|
||||||
if( true == lowvoltagepower ) {
|
if( true == lowvoltagepower ) {
|
||||||
// McZapkie-141102: SHP i czuwak, TODO: sygnalizacja kabinowa
|
// McZapkie-141102: SHP i czuwak, TODO: sygnalizacja kabinowa
|
||||||
if( mvOccupied->SecuritySystem.is_vigilance_blinking() ) {
|
if( mvOccupied->SecuritySystem.is_vigilance_blinking() ) {
|
||||||
@@ -10069,7 +10095,10 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
|
|||||||
{ "i-universal6:", btUniversals[ 6 ] },
|
{ "i-universal6:", btUniversals[ 6 ] },
|
||||||
{ "i-universal7:", btUniversals[ 7 ] },
|
{ "i-universal7:", btUniversals[ 7 ] },
|
||||||
{ "i-universal8:", btUniversals[ 8 ] },
|
{ "i-universal8:", btUniversals[ 8 ] },
|
||||||
{ "i-universal9:", btUniversals[ 9 ] }
|
{ "i-universal9:", btUniversals[ 9 ] },
|
||||||
|
{ "i-cabactived:", btCabActived },
|
||||||
|
{"i-aklvents:", btAKLVents},
|
||||||
|
{"i-compressorany:", btCompressors }
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
auto lookup = lights.find( Label );
|
auto lookup = lights.find( Label );
|
||||||
|
|||||||
3
Train.h
3
Train.h
@@ -771,6 +771,9 @@ public: // reszta może by?publiczna
|
|||||||
TButton btLampkaRearRightLight;
|
TButton btLampkaRearRightLight;
|
||||||
TButton btLampkaRearLeftEndLight;
|
TButton btLampkaRearLeftEndLight;
|
||||||
TButton btLampkaRearRightEndLight;
|
TButton btLampkaRearRightEndLight;
|
||||||
|
TButton btCabActived;
|
||||||
|
TButton btAKLVents;
|
||||||
|
TButton btCompressors; // lampka pracy jakiejkolwiek sprezarki
|
||||||
// other
|
// other
|
||||||
TButton btLampkaMalfunction;
|
TButton btLampkaMalfunction;
|
||||||
TButton btLampkaMalfunctionB;
|
TButton btLampkaMalfunctionB;
|
||||||
|
|||||||
Reference in New Issue
Block a user