mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
Springbrake manometer and indicators
This commit is contained in:
@@ -884,6 +884,7 @@ private:
|
|||||||
|
|
||||||
bool IsReady{ false }; //Output: readyness to braking - cylinder is armed, spring is tentioned
|
bool IsReady{ false }; //Output: readyness to braking - cylinder is armed, spring is tentioned
|
||||||
bool IsActive{ false }; //Output: brake is working
|
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
|
bool PNBrakeConnection{ false }; //Conf: connection to pneumatic brake cylinders
|
||||||
double MaxSetPressure { 0.0 }; //Conf: Maximal pressure for switched off brake
|
double MaxSetPressure { 0.0 }; //Conf: Maximal pressure for switched off brake
|
||||||
|
|||||||
@@ -4079,25 +4079,28 @@ void TMoverParameters::UpdateScndPipePressure(double dt)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
void TMoverParameters::UpdateSpringBrake(double dt)
|
void TMoverParameters::UpdateSpringBrake(double dt)
|
||||||
{
|
{
|
||||||
double SBP = SpringBrake.Cylinder->P();
|
|
||||||
double BP = SpringBrake.PNBrakeConnection ? BrakePress : 0;
|
double BP = SpringBrake.PNBrakeConnection ? BrakePress : 0;
|
||||||
double MSP = SpringBrake.ShuttOff ? 0 : SpringBrake.MaxSetPressure;
|
double MSP = SpringBrake.ShuttOff ? 0 : SpringBrake.MaxSetPressure;
|
||||||
if (!SpringBrake.Activate)
|
if (!SpringBrake.Activate)
|
||||||
{
|
{
|
||||||
double desired_press = std::min(std::max(MSP, BP), Pipe2->P());
|
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);
|
SpringBrake.Cylinder->Flow(-dv);
|
||||||
Pipe2->Flow(std::max(dv,0.0));
|
Pipe2->Flow(std::max(dv,0.0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double dv = PF(BP, SBP, SpringBrake.ValveOnArea);
|
double dv = PF(BP, SpringBrake.SBP, SpringBrake.ValveOnArea);
|
||||||
SpringBrake.Cylinder->Flow(-dv);
|
SpringBrake.Cylinder->Flow(-dv);
|
||||||
}
|
}
|
||||||
if (SBP > SpringBrake.ResetPressure)
|
if (SpringBrake.SBP > SpringBrake.ResetPressure)
|
||||||
SpringBrake.IsReady = true;
|
SpringBrake.IsReady = true;
|
||||||
|
|
||||||
|
SpringBrake.IsActive = SpringBrake.SBP < (SpringBrake.IsActive ? SpringBrake.PressureOff : SpringBrake.PressureOn);
|
||||||
|
|
||||||
SpringBrake.Release = false;
|
SpringBrake.Release = false;
|
||||||
SpringBrake.Cylinder->Act();
|
SpringBrake.Cylinder->Act();
|
||||||
|
SpringBrake.SBP = SpringBrake.Cylinder->P();
|
||||||
}
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
|
|||||||
15
Train.cpp
15
Train.cpp
@@ -5901,6 +5901,8 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
btLampkaBrakeProfileG.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_G ) );
|
btLampkaBrakeProfileG.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_G ) );
|
||||||
btLampkaBrakeProfileP.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_P ) );
|
btLampkaBrakeProfileP.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_P ) );
|
||||||
btLampkaBrakeProfileR.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_R ) );
|
btLampkaBrakeProfileR.Turn( TestFlag( mvOccupied->BrakeDelayFlag, bdelay_R ) );
|
||||||
|
btLampkaSpringBrakeActive.Turn( mvOccupied->SpringBrake.IsActive );
|
||||||
|
btLampkaSpringBrakeInactive.Turn( !mvOccupied->SpringBrake.IsActive );
|
||||||
// light indicators
|
// light indicators
|
||||||
// NOTE: sides are hardcoded to deal with setups where single cab is equipped with all 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 );
|
btLampkaUpperLight.Turn( ( mvOccupied->iLights[ end::front ] & light::headlight_upper ) != 0 );
|
||||||
@@ -5949,6 +5951,8 @@ bool TTrain::Update( double const Deltatime )
|
|||||||
btLampkaBrakeProfileG.Turn( false );
|
btLampkaBrakeProfileG.Turn( false );
|
||||||
btLampkaBrakeProfileP.Turn( false );
|
btLampkaBrakeProfileP.Turn( false );
|
||||||
btLampkaBrakeProfileR.Turn( false );
|
btLampkaBrakeProfileR.Turn( false );
|
||||||
|
btLampkaSpringBrakeActive.Turn( false );
|
||||||
|
btLampkaSpringBrakeInactive.Turn( false );
|
||||||
btLampkaMaxSila.Turn( false );
|
btLampkaMaxSila.Turn( false );
|
||||||
btLampkaPrzekrMaxSila.Turn( false );
|
btLampkaPrzekrMaxSila.Turn( false );
|
||||||
btLampkaRadio.Turn( false );
|
btLampkaRadio.Turn( false );
|
||||||
@@ -7711,6 +7715,8 @@ void TTrain::clear_cab_controls()
|
|||||||
btLampkaBrakeProfileG.Clear();
|
btLampkaBrakeProfileG.Clear();
|
||||||
btLampkaBrakeProfileP.Clear();
|
btLampkaBrakeProfileP.Clear();
|
||||||
btLampkaBrakeProfileR.Clear();
|
btLampkaBrakeProfileR.Clear();
|
||||||
|
btLampkaSpringBrakeActive.Clear();
|
||||||
|
btLampkaSpringBrakeInactive.Clear();
|
||||||
btLampkaSprezarka.Clear();
|
btLampkaSprezarka.Clear();
|
||||||
btLampkaSprezarkaB.Clear();
|
btLampkaSprezarkaB.Clear();
|
||||||
btLampkaSprezarkaOff.Clear();
|
btLampkaSprezarkaOff.Clear();
|
||||||
@@ -8118,6 +8124,8 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
|
|||||||
{ "i-brakeprofileg:", btLampkaBrakeProfileG },
|
{ "i-brakeprofileg:", btLampkaBrakeProfileG },
|
||||||
{ "i-brakeprofilep:", btLampkaBrakeProfileP },
|
{ "i-brakeprofilep:", btLampkaBrakeProfileP },
|
||||||
{ "i-brakeprofiler:", btLampkaBrakeProfileR },
|
{ "i-brakeprofiler:", btLampkaBrakeProfileR },
|
||||||
|
{ "i-springbrakeactive:", btLampkaSpringBrakeActive },
|
||||||
|
{ "i-springbrakeinactive:", btLampkaSpringBrakeInactive },
|
||||||
{ "i-braking-ezt:", btLampkaHamowanie1zes },
|
{ "i-braking-ezt:", btLampkaHamowanie1zes },
|
||||||
{ "i-braking-ezt2:", btLampkaHamowanie2zes },
|
{ "i-braking-ezt2:", btLampkaHamowanie2zes },
|
||||||
{ "i-compressor:", btLampkaSprezarka },
|
{ "i-compressor:", btLampkaSprezarka },
|
||||||
@@ -8473,6 +8481,13 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
|||||||
gauge.Load(Parser, DynamicObject, 0.1);
|
gauge.Load(Parser, DynamicObject, 0.1);
|
||||||
gauge.AssignDouble(&mvControlled->PantPress);
|
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:"))
|
else if ((Label == "compressor:") || (Label == "compressorb:"))
|
||||||
{
|
{
|
||||||
// manometr sprezarki/zbiornika glownego
|
// manometr sprezarki/zbiornika glownego
|
||||||
|
|||||||
2
Train.h
2
Train.h
@@ -578,6 +578,8 @@ public: // reszta może by?publiczna
|
|||||||
TButton btLampkaBrakeProfileG; // cargo train brake acting speed
|
TButton btLampkaBrakeProfileG; // cargo train brake acting speed
|
||||||
TButton btLampkaBrakeProfileP; // passenger train brake acting speed
|
TButton btLampkaBrakeProfileP; // passenger train brake acting speed
|
||||||
TButton btLampkaBrakeProfileR; // rapid brake acting speed
|
TButton btLampkaBrakeProfileR; // rapid brake acting speed
|
||||||
|
TButton btLampkaSpringBrakeActive;
|
||||||
|
TButton btLampkaSpringBrakeInactive;
|
||||||
// KURS90
|
// KURS90
|
||||||
TButton btLampkaBoczniki;
|
TButton btLampkaBoczniki;
|
||||||
TButton btLampkaMaxSila;
|
TButton btLampkaMaxSila;
|
||||||
|
|||||||
Reference in New Issue
Block a user