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

Springbrake manometer and indicators

This commit is contained in:
Królik Uszasty
2019-09-07 15:03:33 +02:00
committed by tmj-fstate
parent 414ef2e362
commit 2b1fe26265
4 changed files with 25 additions and 4 deletions

View File

@@ -869,6 +869,7 @@ private:
bool IsReady{ false }; //Output: readyness to braking - cylinder is armed, spring is tentioned
bool IsActive{ false }; //Output: brake is working
double SBP{ 0.0 }; //Output: pressure in spring brake cylinder
bool PNBrakeConnection{ false }; //Conf: connection to pneumatic brake cylinders
double MaxSetPressure { 0.0 }; //Conf: Maximal pressure for switched off brake

View File

@@ -4092,25 +4092,28 @@ void TMoverParameters::UpdateScndPipePressure(double dt)
// *************************************************************************************************
void TMoverParameters::UpdateSpringBrake(double dt)
{
double SBP = SpringBrake.Cylinder->P();
double BP = SpringBrake.PNBrakeConnection ? BrakePress : 0;
double MSP = SpringBrake.ShuttOff ? 0 : SpringBrake.MaxSetPressure;
if (!SpringBrake.Activate)
{
double desired_press = std::min(std::max(MSP, BP), Pipe2->P());
double dv = PF(desired_press, SBP, SpringBrake.ValveOffArea);
double dv = PF(desired_press, SpringBrake.SBP, SpringBrake.ValveOffArea);
SpringBrake.Cylinder->Flow(-dv);
Pipe2->Flow(std::max(dv,0.0));
}
else
{
double dv = PF(BP, SBP, SpringBrake.ValveOnArea);
double dv = PF(BP, SpringBrake.SBP, SpringBrake.ValveOnArea);
SpringBrake.Cylinder->Flow(-dv);
}
if (SBP > SpringBrake.ResetPressure)
if (SpringBrake.SBP > SpringBrake.ResetPressure)
SpringBrake.IsReady = true;
SpringBrake.IsActive = SpringBrake.SBP < (SpringBrake.IsActive ? SpringBrake.PressureOff : SpringBrake.PressureOn);
SpringBrake.Release = false;
SpringBrake.Cylinder->Act();
SpringBrake.SBP = SpringBrake.Cylinder->P();
}
// *************************************************************************************************

View File

@@ -5899,6 +5899,8 @@ bool TTrain::Update( double const Deltatime )
btLampkaBrakeProfileG.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_G ) );
btLampkaBrakeProfileP.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_P ) );
btLampkaBrakeProfileR.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_R ) );
btLampkaSpringBrakeActive.Turn( mvOccupied->SpringBrake.IsActive );
btLampkaSpringBrakeInactive.Turn( !mvOccupied->SpringBrake.IsActive );
// light indicators
// NOTE: sides are hardcoded to deal with setups where single cab is equipped with all indicators
btLampkaUpperLight.Turn( ( mvOccupied->iLights[ end::front ] & light::headlight_upper ) != 0 );
@@ -5947,6 +5949,8 @@ bool TTrain::Update( double const Deltatime )
btLampkaBrakeProfileG.Turn( false );
btLampkaBrakeProfileP.Turn( false );
btLampkaBrakeProfileR.Turn( false );
btLampkaSpringBrakeActive.Turn( false );
btLampkaSpringBrakeInactive.Turn( false );
btLampkaMaxSila.Turn( false );
btLampkaPrzekrMaxSila.Turn( false );
btLampkaRadio.Turn( false );
@@ -7572,6 +7576,8 @@ void TTrain::clear_cab_controls()
btLampkaBrakeProfileG.Clear();
btLampkaBrakeProfileP.Clear();
btLampkaBrakeProfileR.Clear();
btLampkaSpringBrakeActive.Clear();
btLampkaSpringBrakeInactive.Clear();
btLampkaSprezarka.Clear();
btLampkaSprezarkaB.Clear();
btLampkaSprezarkaOff.Clear();
@@ -7979,6 +7985,8 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
{ "i-brakeprofileg:", btLampkaBrakeProfileG },
{ "i-brakeprofilep:", btLampkaBrakeProfileP },
{ "i-brakeprofiler:", btLampkaBrakeProfileR },
{ "i-springbrakeactive:", btLampkaSpringBrakeActive },
{ "i-springbrakeinactive:", btLampkaSpringBrakeInactive },
{ "i-braking-ezt:", btLampkaHamowanie1zes },
{ "i-braking-ezt2:", btLampkaHamowanie2zes },
{ "i-compressor:", btLampkaSprezarka },
@@ -8334,6 +8342,13 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
gauge.Load(Parser, DynamicObject, 0.1);
gauge.AssignDouble(&mvControlled->PantPress);
}
else if (Label == "springbrakepress:")
{
// manometr cylindra hamulca sprężynowego
auto &gauge = Cabine[Cabindex].Gauge(-1); // pierwsza wolna gałka
gauge.Load(Parser, DynamicObject, 0.1);
gauge.AssignDouble(&mvOccupied->SpringBrake.SBP);
}
else if ((Label == "compressor:") || (Label == "compressorb:"))
{
// manometr sprezarki/zbiornika glownego

View File

@@ -568,6 +568,8 @@ public: // reszta może by?publiczna
TButton btLampkaBrakeProfileG; // cargo train brake acting speed
TButton btLampkaBrakeProfileP; // passenger train brake acting speed
TButton btLampkaBrakeProfileR; // rapid brake acting speed
TButton btLampkaSpringBrakeActive;
TButton btLampkaSpringBrakeInactive;
// KURS90
TButton btLampkaBoczniki;
TButton btLampkaMaxSila;