mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 05:04:58 +01:00
Merge remote-tracking branch 'origin/master' into feat/mains-before-pantographs
# Conflicts: # McZapkie/MOVER.h
This commit is contained in:
117
McZapkie/MOVER.h
117
McZapkie/MOVER.h
@@ -10,7 +10,9 @@ http://mozilla.org/MPL/2.0/.
|
||||
#pragma once
|
||||
//---------------------------------------------------------------------------
|
||||
// Q: 20160805 - odlaczenie pliku fizyki .pas od kompilacji
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include "hamulce.h"
|
||||
#include "scripting/ladderlogic.h"
|
||||
|
||||
@@ -261,6 +263,22 @@ enum class range_t
|
||||
/// <summary>Affects the entire consist.</summary>
|
||||
consist
|
||||
};
|
||||
/// <summary>State of the door closure signalling (SOD) of a vehicle or a consist, ordered from the least to the most
|
||||
/// severe: the state of a consist is the most severe state of its vehicles.</summary>
|
||||
enum class door_closure_t
|
||||
{
|
||||
/// <summary>No doors worked by the crew: the vehicle doesn't take part in the signalling.</summary>
|
||||
none,
|
||||
/// <summary>All doors closed and locked: they can't be opened.</summary>
|
||||
locked,
|
||||
/// <summary>All doors closed, but released: a permit is given, or no lock holds them shut.</summary>
|
||||
released,
|
||||
/// <summary>A door is open, or not fully closed yet.</summary>
|
||||
open
|
||||
};
|
||||
/// <summary>Whether the door closure signalling lamp is lit: steadily for locked doors, in the lit phase of the
|
||||
/// blinking for released ones, never with a door open or with no doors signalled.</summary>
|
||||
bool door_closure_lamp(door_closure_t const State, bool const BlinkLit);
|
||||
/// <summary>Possible settings for an enable/disable input pair (mutually exclusive).</summary>
|
||||
enum class operation_t
|
||||
{
|
||||
@@ -324,6 +342,21 @@ enum light
|
||||
highbeamlight_right = 1 << 10
|
||||
};
|
||||
|
||||
/// <summary>The cab interior light a position of the light preset selector sets (eu07/maszyna#529).</summary>
|
||||
struct lights_preset_cablight
|
||||
{
|
||||
/// <summary>Bits of the optional third column of a LightsList row.</summary>
|
||||
enum flag
|
||||
{
|
||||
/// <summary>The cab light is on.</summary>
|
||||
light_on = 1 << 0,
|
||||
/// <summary>The cab light is dimmed.</summary>
|
||||
light_dimmed = 1 << 1
|
||||
};
|
||||
bool light{false};
|
||||
bool dim{false};
|
||||
};
|
||||
|
||||
/// <summary>Door operation method (who controls them and how) — mutually exclusive.</summary>
|
||||
enum control_t
|
||||
{
|
||||
@@ -1131,6 +1164,7 @@ class TSecuritySystem
|
||||
bool is_sifa = false; // Sifa-like pedal device, with inverted input for convenient keyboard usage
|
||||
bool separate_acknowledge = false; // cabsignal reset button is separate from vigilance
|
||||
bool cabsignal_lock = false;
|
||||
bool vigilance_suspended = false; // the vigilance device switched off by the shunt mode of the vehicle, see AwareOffInShuntMode
|
||||
|
||||
double vigilance_timer = 0.0;
|
||||
double alert_timer = 0.0;
|
||||
@@ -1146,6 +1180,7 @@ class TSecuritySystem
|
||||
double EmergencyBrakeDelay = 5.0;
|
||||
double MaxHoldTime = 1.5;
|
||||
bool CabDependent = false;
|
||||
bool AwareOffInShuntMode = false; // the shunt mode of the vehicle switches the vigilance device off, as on the SM42
|
||||
|
||||
public:
|
||||
void set_enabled(bool e);
|
||||
@@ -1155,6 +1190,7 @@ class TSecuritySystem
|
||||
void update(double dt, double Vel, bool pwr, int cab);
|
||||
void set_cabsignal();
|
||||
void set_cabsignal_lock(bool);
|
||||
void set_shunt_mode(bool State);
|
||||
bool is_blinking() const;
|
||||
bool is_vigilance_blinking() const;
|
||||
bool is_cabsignal_blinking() const;
|
||||
@@ -1439,6 +1475,7 @@ class TMoverParameters
|
||||
float auto_velocity{-1.f}; // automatic door closure velocity threshold
|
||||
bool auto_include_remote{false}; // automatic door closure applies also to remote control
|
||||
bool permit_needed{false};
|
||||
bool closure_signal{false}; // the door closure lamp (SOD) of the cab signals the doors of the whole consist in three states
|
||||
std::vector<int> permit_presets; // permit presets selectable with preset switch
|
||||
float voltage{0.f}; // power type required for door movement
|
||||
// ld inputs
|
||||
@@ -1590,6 +1627,9 @@ class TMoverParameters
|
||||
double EpForce = 0.0; /*Poziom zadanej sily EP*/
|
||||
bool Signalling = false; /*Czy jest zalaczona sygnalizacja hamowania ostatniego wagonu*/
|
||||
bool Radio = false; /*Czy jest zalaczony radiotelefon*/
|
||||
// the cut-off in the radio's power supply: a fuse in the cabinet, a lever on the desk or the switch on the radio's power
|
||||
// supply (eu07/maszyna#438). Closed unless the driver opens it, so vehicles without such a switch work as before
|
||||
bool RadioFuse = true;
|
||||
float NominalBatteryVoltage = 0.f; /*Winger - baterie w elektrykach*/
|
||||
TDimension Dim; /*wymiary*/
|
||||
double Cx = 0.0; /*wsp. op. aerodyn.*/
|
||||
@@ -1703,6 +1743,13 @@ class TMoverParameters
|
||||
int LightsDefPos = 1;
|
||||
bool LightsWrap = false;
|
||||
int Lights[2][18]; // pozycje świateł, przód - tył, 1 .. 16 (17 do lightsset)
|
||||
// the cab interior light each light preset sets, from the optional third column of LightsList (bits of
|
||||
// lights_preset_cablight::flag); -1: the preset leaves the cab light as it is (eu07/maszyna#529)
|
||||
std::array<int, 18> LightsCabLight{[] {
|
||||
std::array<int, 18> positions;
|
||||
positions.fill(-1);
|
||||
return positions;
|
||||
}()};
|
||||
int ScndInMain{0}; /*zaleznosc bocznika od nastawnika*/
|
||||
bool MBrake = false; /*Czy jest hamulec reczny*/
|
||||
double maxTachoSpeed = {0.0}; // maksymalna predkosc na tarczce predkosciomierza analogowego
|
||||
@@ -1727,6 +1774,10 @@ class TMoverParameters
|
||||
bool UniCtrlIntegratedBrakeCtrl = false; /*zintegrowany nastawnik JH obsluguje hamowanie*/
|
||||
bool UniCtrlIntegratedLocalBrakeCtrl = false; /*zintegrowany nastawnik JH obsluguje hamowanie hamulcem pomocniczym*/
|
||||
int UniCtrlNoPowerPos{0}; // cached highesr position not generating traction force
|
||||
// UCList CtrlValStep: the universal controller (EIMCtrlType 3) changes its setting in steps of this size (e.g. 0.05 for the
|
||||
// 5% steps of the 6Dg), one at once when moved to a raising or lowering position, then one each time its SpeedUp / SpeedDown
|
||||
// covers a step; 0 (the default) changes it continuously
|
||||
double UniCtrlValStep{0.0};
|
||||
std::pair<std::string, std::array<int, 2>> PantsPreset{"0132", {0, 0}}; // pantograph preset switches; .first holds possible setups as chars, .second holds currently selected preset in each cab
|
||||
|
||||
/*-sekcja parametrow dla lokomotywy elektrycznej*/
|
||||
@@ -1943,6 +1994,7 @@ class TMoverParameters
|
||||
double MirrorVelClose{5.0};
|
||||
bool MirrorForbidden{false}; /*czy jest pozwolenie na otworzenie lusterek (przycisk)*/
|
||||
bool ScndS = false; /*Czy jest bocznikowanie na szeregowej*/
|
||||
bool ScndCtrlResistiveLock{false}; // the shunt controller can't be moved, up or down, while the master controller is at zero or on a resistive position, and drops to 0 when the master controller gets there (ScndCtrlResistiveLock=Yes in Cntrl.)
|
||||
bool SpeedCtrl = false; /*czy jest tempomat*/
|
||||
speed_control SpeedCtrlUnit; /*parametry tempomatu*/
|
||||
double SpeedCtrlButtons[10]{30, 40, 50, 60, 70, 80, 90, 100, 110, 120}; /*przyciski prędkości*/
|
||||
@@ -2093,6 +2145,9 @@ class TMoverParameters
|
||||
double MainsInitTime{0.0}; // config, initialization time (in seconds) of the main circuit after it receives power, before it can be closed
|
||||
double MainsInitTimeCountdown{0.0}; // current state of main circuit initialization, remaining time (in seconds) until it's ready
|
||||
start_t MainsStart{start_t::manual};
|
||||
// config, Engine:JointEngineStart. whether the cab's line breaker / engine start switch works the vehicles in multiple
|
||||
// too; when it doesn't, the cab has separate switches for them (mainb_*, mainc_*)
|
||||
bool JointEngineStart{true};
|
||||
// config, .fiz Cntrl.PantRequiresMain: the line breaker closes without traction voltage and holds without it, and the
|
||||
// pantographs rise and stay up only while it's closed (EU05, EP05, ČD 181 family); off, the pantographs come first and the line
|
||||
// breaker needs their voltage
|
||||
@@ -2175,6 +2230,10 @@ class TMoverParameters
|
||||
bool dizel_startup{false}; // engine startup procedure request indicator
|
||||
bool dizel_ignition{false}; // engine ignition request indicator
|
||||
bool dizel_spinup{false}; // engine spin up to idle speed flag
|
||||
// the starter turns the engine a while before it fires: smoke comes out only after SmokeDelay (the Engine section of the vehicle's
|
||||
// .fiz, seconds from the start of the spin up) has passed. 0, the default, lets it out as soon as the starter turns, as before eu07/maszyna#523
|
||||
double dizel_SmokeDelay{0.0};
|
||||
double dizel_FiringCountdown{0.0}; // seconds left until the engine being started fires, 0 once it runs on its own
|
||||
double dizel_engagedeltaomega = 0.0; /*roznica predkosci katowych tarcz sprzegla*/
|
||||
double dizel_n_old = 0.0; /*poredkosc na potrzeby obliczen sprzegiel*/
|
||||
double dizel_Torque = 0.0; /*aktualny moment obrotowy silnika spalinowego*/
|
||||
@@ -2203,6 +2262,7 @@ class TMoverParameters
|
||||
double eimic = 0; /*aktualna pozycja zintegrowanego sterowania jazda i hamowaniem*/
|
||||
double eimic_analog = 0; /*pozycja zadajnika analogowa*/
|
||||
double eimic_real = 0; /*faktycznie uzywana pozycja zintegrowanego sterowania jazda i hamowaniem*/
|
||||
double eimic_step_progress{0.0}; // the part of the next UniCtrlValStep the controller has covered so far
|
||||
double eim_localbrake = 0; /*nastawa hamowania dodatkowego pneumatycznego lokomotywy*/
|
||||
int EIMCtrlType = 0; /*rodzaj wariantu zadajnika jazdy*/
|
||||
bool SpeedCtrlTypeTime = false; /*czy tempomat sterowany czasowo*/
|
||||
@@ -2290,6 +2350,14 @@ class TMoverParameters
|
||||
// bool modernContainOffPos{true};
|
||||
bool enableModernDimmer{false};
|
||||
bool modernDimmerCanCycle{false};
|
||||
// the given dimmer position brought into the DimmerList, to its first or last entry; 0 for an empty list
|
||||
int clampDimmerPosition(int Position) const;
|
||||
// the entry of the current dimmer position, or a plain one (not off, not dimmed, no high beam) when the
|
||||
// position is outside the DimmerList: the .fiz can give a short or an empty list, or a DefaultPos past its end
|
||||
dimPosition currentDimPosition() const;
|
||||
// moves the dimmer by Step positions within the DimmerList, around to its other end when it can cycle;
|
||||
// a position outside the list is brought into it first. false when the dimmer doesn't move
|
||||
bool stepDimmerPosition(int Step);
|
||||
|
||||
// Barwa reflektora
|
||||
int refR{255}; // Czerwony
|
||||
@@ -2304,6 +2372,9 @@ class TMoverParameters
|
||||
plc::basic_controller m_plc;
|
||||
|
||||
int AIHintPantstate{0}; // suggested pantograph setup
|
||||
// suggested pantograph setup in shunting (AI: ShuntPantstate=, eu07/maszyna#461), the bits as in Pantstate: 1 front,
|
||||
// 2 rear, 3 both; 0 (the default) shunts with the pantographs handled as in train mode
|
||||
int AIHintShuntPantstate{0};
|
||||
bool AIHintPantUpIfIdle{true}; // whether raise both pantographs if idling for a while
|
||||
double AIHintLocalBrakeAccFactor{1.05}; // suggested acceleration weight for local brake operation
|
||||
|
||||
@@ -2376,6 +2447,11 @@ class TMoverParameters
|
||||
bool IncScndCtrl(int CtrlSpeed);
|
||||
bool DecScndCtrl(int CtrlSpeed);
|
||||
int GetVirtualScndPos() const;
|
||||
// whether ScndCtrlResistiveLock keeps the shunt controller from being moved at the current master controller position
|
||||
bool IsScndCtrlLockedByMainCtrl() const;
|
||||
// ScndCtrlResistiveLock: the shunt controller drops to 0 once the master controller is at zero or on a resistive position, so it
|
||||
// can't stay engaged there, locked in place (eu07/maszyna#402)
|
||||
void ScndCtrlResistiveLockCheck();
|
||||
bool IsScndCtrlNoPowerPos() const;
|
||||
bool IsScndCtrlMaxPowerPos() const;
|
||||
|
||||
@@ -2417,6 +2493,8 @@ class TMoverParameters
|
||||
bool BrakeReleaser(int state);
|
||||
bool UniversalBrakeButton(int button, int state); /*uniwersalny przycisk hamulca*/
|
||||
bool SwitchEPBrake(int state);
|
||||
// whether the EP brake control of the cab has power: battery, the reverser out of neutral and the EP fuse on
|
||||
bool EPBrakeControlPowered() const;
|
||||
bool AntiSlippingButton(void); /*! reczny wlacznik urzadzen antyposlizgowych*/
|
||||
|
||||
/*funkcje dla ukladow pneumatycznych*/
|
||||
@@ -2457,6 +2535,14 @@ class TMoverParameters
|
||||
// whether the automatic couplers at the End of this vehicle and the OtherEnd of the other one can catch each other on
|
||||
// contact, rather than the vehicles colliding (with crash damage enabled, only at a closing speed which doesn't derail them)
|
||||
bool AutomaticCouplingSafe(int const End, TMoverParameters const &Other, int const OtherEnd) const;
|
||||
// whether the control coupling (multiple-unit control) can join the End of this vehicle and the OtherEnd of the other
|
||||
// one: not between an electric and a diesel traction vehicle, unless both couplers name the same control system
|
||||
// (ControlType). Vehicles without own traction (cars, control trailers) take any. Global.control_coupling_engine_check
|
||||
// off allows it always (eu07/maszyna#520)
|
||||
bool ControlCouplingAllowed(int const End, TMoverParameters const &Other, int const OtherEnd) const;
|
||||
// the CouplingType to join the End of this vehicle and the OtherEnd of the other one with, without the control coupling
|
||||
// when ControlCouplingAllowed() rules it out. a permanent coupling (of the vehicles of one unit) is kept whole
|
||||
int CompatibleCoupling(int const End, TMoverParameters const &Other, int const OtherEnd, int const CouplingType) const;
|
||||
// the horns of the Signal (WarningSignal bits) which have the air or the voltage they need to sound
|
||||
int SoundingHorns(int const Signal) const;
|
||||
// whether the signal lamps of the main circuit (line contactors, ground relay, motor overload relays) can light:
|
||||
@@ -2465,11 +2551,30 @@ class TMoverParameters
|
||||
{
|
||||
return false == ControlPressureSwitch && (HasControlPressureSwitch || BrakePress < 1.0);
|
||||
}
|
||||
// whether the lamp of the open line contactors is lit, telling the start can be made
|
||||
// whether the lamp of the open line contactors is lit. on the electric locomotives it tells the start can be made, so
|
||||
// it goes out with the start cut off; on the diesel-electric ones (the SU45 and SU46 family) it just tells the
|
||||
// contactors are open, whatever opened them: the master controller at 0, or the pressure switch (eu07/maszyna#263)
|
||||
bool LineContactorsLampLit() const
|
||||
{
|
||||
if (EngineType == TEngineType::DieselElectric)
|
||||
{
|
||||
return false == StLinFlag;
|
||||
}
|
||||
return false == StLinFlag && MainCircuitLampsEnabled();
|
||||
}
|
||||
// the vehicles the line breaker / engine start switch of this vehicle works, and its engine stopping on its own
|
||||
// stops: the whole consist, or with JointEngineStart=No this vehicle alone (eu07/maszyna#80)
|
||||
range_t MainSwitchRange() const
|
||||
{
|
||||
return JointEngineStart ? range_t::consist : range_t::local;
|
||||
}
|
||||
// whether the cab command opening the main circuit opens it where the only cab switch of the circuit is the button
|
||||
// closing it: on a diesel that's the starter button, and the command is the one way to stop an engine whose fuel pump
|
||||
// starts on its own (eu07/maszyna#427). the other vehicles with such a button keep ignoring the command
|
||||
bool MainCircuitOpensWithStarterOnly() const
|
||||
{
|
||||
return EngineType == TEngineType::DieselEngine || EngineType == TEngineType::DieselElectric;
|
||||
}
|
||||
// whether the pumps a joint oil and fuel pump switch works, those not started automatically, are all switched on
|
||||
bool OilFuelPumpsEnabled() const
|
||||
{
|
||||
@@ -2477,10 +2582,10 @@ class TMoverParameters
|
||||
auto const oilmanual{OilPump.start_type != start_t::automatic};
|
||||
return (fuelmanual || oilmanual) && (false == fuelmanual || FuelPump.is_enabled) && (false == oilmanual || OilPump.is_enabled);
|
||||
}
|
||||
// whether the radio is switched on and has the low voltage to work
|
||||
// whether the radio is switched on, its power supply isn't cut off and it has the low voltage to work
|
||||
bool RadioPowered() const
|
||||
{
|
||||
return Radio && (Power24vIsAvailable || Power110vIsAvailable);
|
||||
return Radio && RadioFuse && (Power24vIsAvailable || Power110vIsAvailable);
|
||||
}
|
||||
/*obrot kol uwzgledniajacy poslizg*/
|
||||
double ComputeRotatingWheel(double WForce, double dt, double n) const;
|
||||
@@ -2584,6 +2689,10 @@ class TMoverParameters
|
||||
bool LockDoors(bool const State, range_t const Notify = range_t::consist);
|
||||
bool signal_departure(bool const State, range_t const Notify = range_t::consist); // toggles departure warning
|
||||
void update_doors(double const Deltatime); // door controller update
|
||||
door_closure_t door_closure() const; // state of the door closure signalling of this vehicle
|
||||
// whether the door closure lamp in the cab of this vehicle is lit: with DoorClosureSignal, for the given state of the
|
||||
// consist; without it, for the lock of the vehicle's own doors, as the lamp always worked
|
||||
bool door_closure_lamp_lit(door_closure_t const Consist, bool const BlinkLit) const;
|
||||
|
||||
/* funkcje dla samochodow*/
|
||||
bool ChangeOffsetH(double DeltaOffset);
|
||||
@@ -2593,6 +2702,8 @@ class TMoverParameters
|
||||
bool LoadFIZ_Text(std::string const &Text); // the same, from text in the .fiz format
|
||||
bool CheckLocomotiveParameters(bool ReadyFlag, int Dir);
|
||||
std::string EngineDescription(int what) const;
|
||||
// the cab interior light the light preset at given position (1-based, as LightsPos) sets, if it sets one
|
||||
std::optional<lights_preset_cablight> LightsPresetCabLight(int Position) const;
|
||||
|
||||
private:
|
||||
bool LoadFIZ_Parse(cParser &Parser); // reads the definition from either of the above
|
||||
|
||||
@@ -17,6 +17,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "utilities/parser.h"
|
||||
#include "simulation/simulation.h"
|
||||
|
||||
#include <charconv>
|
||||
#include <cmath>
|
||||
#include <format>
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -152,11 +153,23 @@ void TSecuritySystem::update(double dt, double vel, bool pwr, int cab)
|
||||
velocity = vel;
|
||||
cabactive = cab;
|
||||
|
||||
if (vigilance_enabled && velocity > AwareMinSpeed)
|
||||
vigilance_timer += dt;
|
||||
if (vigilance_suspended)
|
||||
{
|
||||
// the vigilance device is switched off: no time counts towards a new alarm, of the alerter or of the button held
|
||||
// too long. an alarm already on, with the emergency braking it leads to, stays until it's acknowledged as usual
|
||||
if (vigilance_timer <= AwareDelay)
|
||||
vigilance_timer = 0.0;
|
||||
if (press_timer <= MaxHoldTime)
|
||||
press_timer = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vigilance_enabled && velocity > AwareMinSpeed)
|
||||
vigilance_timer += dt;
|
||||
|
||||
if (pressed && (!is_sifa || velocity > AwareMinSpeed))
|
||||
press_timer += dt;
|
||||
if (pressed && (!is_sifa || velocity > AwareMinSpeed))
|
||||
press_timer += dt;
|
||||
}
|
||||
|
||||
if (vigilance_timer > AwareDelay || press_timer > MaxHoldTime || cabsignal_active)
|
||||
alert_timer += dt;
|
||||
@@ -231,6 +244,11 @@ void TSecuritySystem::set_cabsignal_lock(bool v)
|
||||
cabsignal_lock = v;
|
||||
}
|
||||
|
||||
void TSecuritySystem::set_shunt_mode(bool const State)
|
||||
{
|
||||
vigilance_suspended = State && AwareOffInShuntMode;
|
||||
}
|
||||
|
||||
bool TSecuritySystem::is_engine_blocked() const
|
||||
{
|
||||
if (!is_sifa)
|
||||
@@ -260,6 +278,7 @@ void TSecuritySystem::load(std::string const &line, double Vmax)
|
||||
extract_value(radiostop_enabled, "RadioStop", line, "");
|
||||
extract_value(MagnetLocation, "MagnetLocation", line, "");
|
||||
extract_value(CabDependent, "CabDependent", line, "");
|
||||
extract_value(AwareOffInShuntMode, "AwareOffInShuntMode", line, "");
|
||||
}
|
||||
|
||||
double TableInterpolation(std::map<double, double> &Map, double Parameter)
|
||||
@@ -599,7 +618,8 @@ bool TMoverParameters::Attach(int ConnectNo, int ConnectToNr, TMoverParameters *
|
||||
}
|
||||
|
||||
auto &thiscoupler{Couplers[ConnectNo]};
|
||||
auto &othercoupler = ConnectTo->Couplers[ConnectToNr != 2 ? ConnectToNr : thiscoupler.ConnectedNr];
|
||||
auto const otherend{ConnectToNr != 2 ? ConnectToNr : thiscoupler.ConnectedNr};
|
||||
auto &othercoupler = ConnectTo->Couplers[otherend];
|
||||
auto const distance{CouplerDist(this, ConnectTo) - (thiscoupler.adapter_length + othercoupler.adapter_length)};
|
||||
|
||||
|
||||
@@ -608,6 +628,18 @@ bool TMoverParameters::Attach(int ConnectNo, int ConnectToNr, TMoverParameters *
|
||||
return false;
|
||||
}
|
||||
|
||||
// no multiple-unit control between an electric and a diesel locomotive, whoever asks for it: the scenario, the AI
|
||||
// or the player (eu07/maszyna#520)
|
||||
if (auto const compatible{CompatibleCoupling(ConnectNo, *ConnectTo, otherend, CouplingType)}; compatible != CouplingType)
|
||||
{
|
||||
WriteLog(std::format("Vehicles \"{}\" and \"{}\" can't share their control, coupled without the control connection", Name, ConnectTo->Name));
|
||||
CouplingType = compatible;
|
||||
if (CouplingType == coupling::faux)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// stykaja sie zderzaki i kompatybilne typy sprzegow, chyba że łączenie na starcie
|
||||
if (thiscoupler.CouplingFlag == coupling::faux)
|
||||
{
|
||||
@@ -809,6 +841,19 @@ bool TMoverParameters::ChangeCab(int direction)
|
||||
// rozruch wysoki (true) albo niski (false)
|
||||
bool TMoverParameters::CurrentSwitch(bool const State)
|
||||
{
|
||||
// TBD, TODO: split off shunt mode toggle into a separate command? It doesn't make much sense to have these two together like that
|
||||
// the diesels with a shunt mode have no motor overload relay threshold to switch, the switch sets their shunt mode alone.
|
||||
// MaxCurrentSwitch() takes any change of the setting, so asked first it took the first move of the switch (eu07/maszyna#497)
|
||||
if (true == ShuntModeAllow && (EngineType == TEngineType::DieselEngine || EngineType == TEngineType::DieselElectric))
|
||||
{
|
||||
// dla 2Ls150 przed ustawieniem kierunku, for SM42/SP42 at the controller's zero position
|
||||
if (EngineType == TEngineType::DieselEngine ? DirActive != 0 : false == IsMainCtrlNoPowerPos())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ShuntMode = State;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (MaxCurrentSwitch(State))
|
||||
{
|
||||
@@ -818,20 +863,6 @@ bool TMoverParameters::CurrentSwitch(bool const State)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// TBD, TODO: split off shunt mode toggle into a separate command? It doesn't make much sense to have these two together like that
|
||||
// dla 2Ls150
|
||||
if (EngineType == TEngineType::DieselEngine && true == ShuntModeAllow && DirActive == 0)
|
||||
{
|
||||
// przed ustawieniem kierunku
|
||||
ShuntMode = State;
|
||||
return true;
|
||||
}
|
||||
// for SM42/SP42
|
||||
if (EngineType == TEngineType::DieselElectric && true == ShuntModeAllow && IsMainCtrlNoPowerPos())
|
||||
{
|
||||
ShuntMode = State;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
@@ -1206,6 +1237,59 @@ bool TMoverParameters::AutomaticCouplingSafe(int const End, TMoverParameters con
|
||||
return false == Global.crash_damage || CollisionVelocity(End, Other, OtherEnd) <= SafeCollisionVelocity;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
// the kind of traction a vehicle's engine stands for, as far as its multiple-unit control goes
|
||||
enum class traction_kind
|
||||
{
|
||||
none,
|
||||
electric,
|
||||
diesel
|
||||
};
|
||||
|
||||
traction_kind traction_of(TEngineType const Engine)
|
||||
{
|
||||
switch (Engine)
|
||||
{
|
||||
case TEngineType::ElectricSeriesMotor:
|
||||
case TEngineType::ElectricInductionMotor:
|
||||
return traction_kind::electric;
|
||||
case TEngineType::DieselEngine:
|
||||
case TEngineType::DieselElectric:
|
||||
return traction_kind::diesel;
|
||||
default:
|
||||
return traction_kind::none;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool TMoverParameters::ControlCouplingAllowed(int const End, TMoverParameters const &Other, int const OtherEnd) const
|
||||
{
|
||||
if (false == Global.control_coupling_engine_check)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// the same control system named on both couplers is the vehicle authors' word that they work together
|
||||
if (auto const &controltype{Couplers[End].control_type}; false == controltype.empty() && controltype == Other.Couplers[OtherEnd].control_type)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
auto const traction{traction_of(EngineType)};
|
||||
auto const othertraction{traction_of(Other.EngineType)};
|
||||
return traction == traction_kind::none || othertraction == traction_kind::none || traction == othertraction;
|
||||
}
|
||||
|
||||
int TMoverParameters::CompatibleCoupling(int const End, TMoverParameters const &Other, int const OtherEnd, int const CouplingType) const
|
||||
{
|
||||
if ((CouplingType & coupling::control) == 0 || (CouplingType & coupling::permanent) != 0 || ControlCouplingAllowed(End, Other, OtherEnd))
|
||||
{
|
||||
return CouplingType;
|
||||
}
|
||||
return CouplingType & ~coupling::control;
|
||||
}
|
||||
|
||||
int TMoverParameters::SoundingHorns(int const Signal) const
|
||||
{
|
||||
auto const supplied{[this](horn_supply const Supply) {
|
||||
@@ -1631,6 +1715,8 @@ void TMoverParameters::compute_movement_(double const Deltatime)
|
||||
BRVentilators = false;
|
||||
}
|
||||
|
||||
// the master controller set directly, not through IncMainCtrl()/DecMainCtrl() (AI, consist): the locked shunt follows it as well
|
||||
ScndCtrlResistiveLockCheck();
|
||||
// automatyczny rozruch
|
||||
if (EngineType == TEngineType::ElectricSeriesMotor && AutoRelayCheck())
|
||||
{
|
||||
@@ -2539,6 +2625,7 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
|
||||
|
||||
if (true == OK)
|
||||
{
|
||||
ScndCtrlResistiveLockCheck(); // e.g. from the last series position on to the resistive parallel ones
|
||||
SendCtrlToNext("MainCtrl", MainCtrlPos, CabActive); //???
|
||||
SendCtrlToNext("ScndCtrl", ScndCtrlPos, CabActive);
|
||||
}
|
||||
@@ -2664,6 +2751,7 @@ bool TMoverParameters::DecMainCtrl(int CtrlSpeed)
|
||||
|
||||
if (OK)
|
||||
{
|
||||
ScndCtrlResistiveLockCheck(); // the shunt drops when the master controller leaves a resistance-free position
|
||||
/*OK:=*/SendCtrlToNext("MainCtrl", MainCtrlPos, CabActive); // hmmmm...???!!!
|
||||
/*OK:=*/SendCtrlToNext("ScndCtrl", ScndCtrlPos, CabActive);
|
||||
}
|
||||
@@ -2753,7 +2841,7 @@ bool TMoverParameters::IncScndCtrl(int CtrlSpeed)
|
||||
{
|
||||
// if (RList[MainCtrlPos].R=0) and (MainCtrlPos>0) and (ScndCtrlPos<ScndCtrlPosNo) and
|
||||
// (not CoupledCtrl) then
|
||||
if (ScndCtrlPos < ScndCtrlPosNo && !CoupledCtrl)
|
||||
if (ScndCtrlPos < ScndCtrlPosNo && !CoupledCtrl && !IsScndCtrlLockedByMainCtrl())
|
||||
{
|
||||
// TBD, TODO: refactor this validation as part of relay check routine (currently in tractionforce()
|
||||
// TBD, TODO: diesel electric engine utilize scndctrlactualpos like the other types?
|
||||
@@ -2824,7 +2912,7 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
||||
}
|
||||
else if (ScndCtrlPosNo > 0 && CabActive != 0)
|
||||
{
|
||||
if (ScndCtrlPos > 0 && !CoupledCtrl && (EngineType != TEngineType::DieselElectric || !AutoRelayFlag))
|
||||
if (ScndCtrlPos > 0 && !CoupledCtrl && (EngineType != TEngineType::DieselElectric || !AutoRelayFlag) && !IsScndCtrlLockedByMainCtrl())
|
||||
{
|
||||
if (CtrlSpeed == 1)
|
||||
{
|
||||
@@ -2874,6 +2962,22 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool TMoverParameters::IsScndCtrlLockedByMainCtrl() const
|
||||
{
|
||||
// ET21, ET22, EP09: the field shunting engages only on the resistance-free positions of the master controller (eu07/maszyna#402)
|
||||
return ScndCtrlResistiveLock && (IsMainCtrlNoPowerPos() || RList[MainCtrlPos].R >= 0.01);
|
||||
}
|
||||
|
||||
void TMoverParameters::ScndCtrlResistiveLockCheck()
|
||||
{
|
||||
// the shunt controller, locked in both directions on zero and the resistive positions, would otherwise stay engaged there once the
|
||||
// master controller is taken back (or set from elsewhere, e.g. by the AI or another vehicle of the consist) with the shunt on
|
||||
if (ScndCtrlPos > 0 && !CoupledCtrl && IsScndCtrlLockedByMainCtrl())
|
||||
{
|
||||
ScndCtrlPos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int TMoverParameters::GetVirtualScndPos() const
|
||||
{
|
||||
if (TrainType == dt_ET42 && DynamicBrakeFlag && !ScndCtrlPos)
|
||||
@@ -3145,9 +3249,11 @@ void TMoverParameters::SecuritySystemReset(void) // zbijanie czuwaka/SHP
|
||||
void TMoverParameters::SecuritySystemCheck(double dt)
|
||||
{
|
||||
bool isPower = Power24vIsAvailable || Power110vIsAvailable;
|
||||
// the shunt mode of the SM42 switches its vigilance device (CA) off, on the vehicles with AwareOffInShuntMode=Yes (eu07/maszyna#457)
|
||||
SecuritySystem.set_shunt_mode(ShuntMode);
|
||||
SecuritySystem.update(dt, Vel, isPower, CabActive);
|
||||
|
||||
if (!Battery || !Radio)
|
||||
if (!Battery || !Radio || !RadioFuse)
|
||||
{ // wyłączenie baterii deaktywuje sprzęt
|
||||
RadiostopSwitch(false);
|
||||
}
|
||||
@@ -4165,7 +4271,8 @@ bool TMoverParameters::SwitchEPBrake(int state)
|
||||
OK = false;
|
||||
if (BrakeHandle == TBrakeHandle::St113 && CabOccupied != 0)
|
||||
{
|
||||
if (state > 0)
|
||||
// the handle works the EP contactors pneumatically, their supply is cut as the Oerlikon handle's is
|
||||
if (state > 0 && EPBrakeControlPowered())
|
||||
EpForce = Handle->GetEP(); // TODO: przetlumaczyc
|
||||
else
|
||||
EpForce = 0;
|
||||
@@ -4177,6 +4284,11 @@ bool TMoverParameters::SwitchEPBrake(int state)
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool TMoverParameters::EPBrakeControlPowered() const
|
||||
{
|
||||
return Power24vIsAvailable && DirActive != 0 && EpFuse;
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160711
|
||||
// zwiększenie ciśnienia hamowania
|
||||
@@ -4710,7 +4822,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
|
||||
if ((BrakeHandle == TBrakeHandle::FVel6 || BrakeHandle == TBrakeHandle::FVE408) && CabOccupied != 0)
|
||||
{
|
||||
if (Power24vIsAvailable && DirActive != 0 && EpFuse) // tu powinien byc jeszcze bezpiecznik EP i baterie -
|
||||
if (EPBrakeControlPowered()) // tu powinien byc jeszcze bezpiecznik EP i baterie -
|
||||
// temp = (Handle as TFVel6).GetCP
|
||||
EpForce = Handle->GetEP();
|
||||
else
|
||||
@@ -4729,6 +4841,11 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
// Ra 2014-11: na tym się wysypuje, ale nie wiem, w jakich warunkach
|
||||
SendCtrlToNext("Brake", EpForce, CabActive);
|
||||
}
|
||||
else if (BrakeHandle == TBrakeHandle::St113 && CabOccupied != 0 && std::abs(EpForce) > 0.001 && !EPBrakeControlPowered())
|
||||
{
|
||||
// the EP brake switched on with the button drops out with the control's supply
|
||||
SwitchEPBrake(0);
|
||||
}
|
||||
|
||||
Pipe->Act();
|
||||
PipePress = Pipe->P();
|
||||
@@ -5151,6 +5268,7 @@ void TMoverParameters::ComputeTotalForce(double dt)
|
||||
double TMoverParameters::BrakeForceR(double ratio, double velocity) const
|
||||
{
|
||||
double press = 0;
|
||||
ratio = Hamulec->GetBrakeRatio(ratio);
|
||||
if (MBPM > 2)
|
||||
{
|
||||
press = MaxBrakePress[1] + (MaxBrakePress[3] - MaxBrakePress[1]) * std::min(1.0, (TotalMass - Mass) / (MBPM - Mass));
|
||||
@@ -5166,8 +5284,8 @@ double TMoverParameters::BrakeForceR(double ratio, double velocity) const
|
||||
press = MaxBrakePress[3];
|
||||
if (DynamicBrakeType == dbrake_automatic)
|
||||
ratio = ratio + (1.5 - ratio) * std::min(1.0, Vel * 0.02);
|
||||
if (BrakeDelayFlag & bdelay_R && BrakeMethod % 128 != bp_Cosid && BrakeMethod % 128 != bp_D1 && BrakeMethod % 128 != bp_D2 && Power < 1 && velocity < 40)
|
||||
ratio = ratio / 2;
|
||||
if (BrakeDelayFlag & bdelay_R && BrakeMethod % 128 != bp_Cosid && BrakeMethod % 128 != bp_D1 && BrakeMethod % 128 != bp_D2 && Power < 1)
|
||||
ratio *= Hamulec->GetRapidRatio(velocity);
|
||||
if (TrainType == dt_DMU && velocity < 30.0)
|
||||
{
|
||||
ratio -= 0.3;
|
||||
@@ -5458,6 +5576,7 @@ double TMoverParameters::CouplerForce(int const End, double dt)
|
||||
{
|
||||
couplingtype &= ~coupling::control;
|
||||
}
|
||||
couplingtype = CompatibleCoupling(End, *othervehicle, otherend, couplingtype);
|
||||
|
||||
// too fast for the couplers to catch, the vehicles collide instead (and may derail, see CollisionDetect())
|
||||
auto const safe{AutomaticCouplingSafe(End, *othervehicle, otherend)};
|
||||
@@ -7296,6 +7415,60 @@ bool TMoverParameters::DropAllPantographs(bool const State, range_t const Notify
|
||||
return State != initialstate;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
// the setting of the universal controller one UniCtrlValStep further from Value towards Limit, never past it
|
||||
double next_uc_step(double const Value, double const Limit, double const Step)
|
||||
{
|
||||
constexpr double epsilon{1e-6};
|
||||
if (Limit > Value)
|
||||
{
|
||||
return std::min((std::floor(Value / Step + epsilon) + 1.0) * Step, Limit);
|
||||
}
|
||||
return std::max((std::ceil(Value / Step - epsilon) - 1.0) * Step, Limit);
|
||||
}
|
||||
|
||||
// the universal controller with UniCtrlValStep: the setting the continuous ramp got to (Ramped) turned into whole steps.
|
||||
// a move of the controller onto a position which changes the setting makes one step at once, the ramp then one step each
|
||||
// time it covers a step's length; the steps stop at the position's set value (or its bound, past which the ramp doesn't go)
|
||||
double stepped_uc_value(double const Current, double const Ramped, TUniversalCtrl const &Position, double const Step, bool const Moved, double &Progress)
|
||||
{
|
||||
if (Moved)
|
||||
{
|
||||
Progress = 0.0;
|
||||
}
|
||||
double const delta{Ramped - Current};
|
||||
if (std::abs(delta) < 1e-9)
|
||||
{
|
||||
Progress = 0.0;
|
||||
return Ramped;
|
||||
}
|
||||
double limit{0.0};
|
||||
if (delta > 0.0)
|
||||
{
|
||||
limit = Position.SetCtrlVal > Current ? Position.SetCtrlVal : Position.MaxCtrlVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
limit = Position.SetCtrlVal < Current ? Position.SetCtrlVal : Position.MinCtrlVal;
|
||||
}
|
||||
Progress = Moved ? Step : Progress + std::abs(delta);
|
||||
double value{Current};
|
||||
bool reached{std::abs(value - limit) < 1e-9};
|
||||
while (!reached && Progress >= Step - 1e-9)
|
||||
{
|
||||
value = next_uc_step(value, limit, Step);
|
||||
Progress -= Step;
|
||||
reached = std::abs(value - limit) < 1e-9;
|
||||
}
|
||||
if (reached)
|
||||
{
|
||||
Progress = 0.0;
|
||||
}
|
||||
return safe_clamp(value, Position.MinCtrlVal, Position.MaxCtrlVal);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void TMoverParameters::CheckEIMIC(double dt)
|
||||
{
|
||||
double offset = EIMCtrlAdditionalZeros ? 1.0 : 0.0;
|
||||
@@ -7420,11 +7593,14 @@ void TMoverParameters::CheckEIMIC(double dt)
|
||||
|
||||
if (MainCtrlActualPos != MainCtrlPos || LastRelayTime > InitialCtrlDelay)
|
||||
{
|
||||
eimic -= safe_clamp(-UniCtrlList[MainCtrlPos].SetCtrlVal + eimic, 0.0,
|
||||
MainCtrlActualPos == MainCtrlPos ? dt * UniCtrlList[MainCtrlPos].SpeedDown : sign(UniCtrlList[MainCtrlPos].SpeedDown) * 0.01); // odejmuj do X
|
||||
eimic += safe_clamp(UniCtrlList[MainCtrlPos].SetCtrlVal - eimic, 0.0,
|
||||
MainCtrlActualPos == MainCtrlPos ? dt * UniCtrlList[MainCtrlPos].SpeedUp : sign(UniCtrlList[MainCtrlPos].SpeedUp) * 0.01); // dodawaj do X
|
||||
eimic = safe_clamp(eimic, UniCtrlList[MainCtrlPos].MinCtrlVal, UniCtrlList[MainCtrlPos].MaxCtrlVal);
|
||||
auto const &position{UniCtrlList[MainCtrlPos]};
|
||||
double ramped{eimic};
|
||||
ramped -= safe_clamp(-position.SetCtrlVal + ramped, 0.0,
|
||||
MainCtrlActualPos == MainCtrlPos ? dt * position.SpeedDown : sign(position.SpeedDown) * 0.01); // odejmuj do X
|
||||
ramped += safe_clamp(position.SetCtrlVal - ramped, 0.0,
|
||||
MainCtrlActualPos == MainCtrlPos ? dt * position.SpeedUp : sign(position.SpeedUp) * 0.01); // dodawaj do X
|
||||
ramped = safe_clamp(ramped, position.MinCtrlVal, position.MaxCtrlVal);
|
||||
eimic = UniCtrlValStep > 0.0 ? stepped_uc_value(eimic, ramped, position, UniCtrlValStep, MainCtrlActualPos != MainCtrlPos, eimic_step_progress) : ramped;
|
||||
}
|
||||
if (MainCtrlActualPos == MainCtrlPos)
|
||||
LastRelayTime += dt;
|
||||
@@ -7849,6 +8025,9 @@ bool TMoverParameters::dizel_Update(double dt)
|
||||
WaterHeaterCheck(dt);
|
||||
OilPumpCheck(dt);
|
||||
FuelPumpCheck(dt);
|
||||
// the engine being started fires once the starter has turned it a while; one stopped meanwhile starts over
|
||||
dizel_FiringCountdown = (Mains ? std::max(0.0, dizel_FiringCountdown - dt) : 0.0);
|
||||
|
||||
if (true == dizel_startup && true == dizel_StartupCheck())
|
||||
{
|
||||
dizel_ignition = true;
|
||||
@@ -7863,6 +8042,7 @@ bool TMoverParameters::dizel_Update(double dt)
|
||||
LastSwitchingTime = 0;
|
||||
Mains = true;
|
||||
dizel_spinup = true;
|
||||
dizel_FiringCountdown = dizel_SmokeDelay;
|
||||
enrot = std::max(enrot,
|
||||
0.35 * ( // TODO: dac zaleznie od temperatury i baterii
|
||||
EngineType == TEngineType::DieselEngine ? dizel_nmin : DElist[0].RPM / 60.0));
|
||||
@@ -7874,7 +8054,8 @@ bool TMoverParameters::dizel_Update(double dt)
|
||||
{
|
||||
// knock out the engine if the fuel pump isn't feeding it
|
||||
// TBD, TODO: grace period before the engine is starved for fuel and knocked out
|
||||
MainSwitch(false);
|
||||
// an engine started on its own stops on its own
|
||||
MainSwitch(false, MainSwitchRange());
|
||||
}
|
||||
|
||||
bool DU{false};
|
||||
@@ -8165,7 +8346,13 @@ double TMoverParameters::dizel_Momentum(double Fill, double n, double dt)
|
||||
|
||||
if (enrot <= 0 && false == dizel_spinup)
|
||||
{
|
||||
MainSwitch(false);
|
||||
// an engine stalling stops those started together with it, once. one already stopped, from its own switch or
|
||||
// another vehicle's, or not started at all, has nothing to stop: it stays quiet, rather than stop every frame
|
||||
// the engines started on their own or from the separate switches (eu07/maszyna#80)
|
||||
if (true == Mains)
|
||||
{
|
||||
MainSwitch(false, MainSwitchRange());
|
||||
}
|
||||
enrot = 0;
|
||||
}
|
||||
|
||||
@@ -8704,6 +8891,48 @@ bool TMoverParameters::signal_departure(bool const State, range_t const Notify)
|
||||
return true;
|
||||
}
|
||||
|
||||
// state of the door closure signalling (SOD) of this vehicle: open while a door isn't fully closed, released while
|
||||
// the closed doors can be opened (a permit given, or, for doors that need none, no lock engaged), locked otherwise.
|
||||
// doors the crew doesn't close (autonomous) aren't signalled, the same as for the door lights of the consist
|
||||
door_closure_t TMoverParameters::door_closure() const
|
||||
{
|
||||
if (Doors.range == 0.f || Doors.close_control == control_t::autonomous)
|
||||
{
|
||||
return door_closure_t::none;
|
||||
}
|
||||
if (std::ranges::any_of(Doors.instances, [](basic_door const &Door) { return false == Door.is_closed; }))
|
||||
{
|
||||
return door_closure_t::open;
|
||||
}
|
||||
if (Doors.is_locked)
|
||||
{
|
||||
return door_closure_t::locked;
|
||||
}
|
||||
if (Doors.permit_needed && std::ranges::none_of(Doors.instances, [](basic_door const &Door) { return Door.open_permit; }))
|
||||
{
|
||||
return door_closure_t::locked;
|
||||
}
|
||||
return door_closure_t::released;
|
||||
}
|
||||
|
||||
bool TMoverParameters::door_closure_lamp_lit(door_closure_t const Consist, bool const BlinkLit) const
|
||||
{
|
||||
return Doors.closure_signal ? door_closure_lamp(Consist, BlinkLit) : Doors.is_locked;
|
||||
}
|
||||
|
||||
bool door_closure_lamp(door_closure_t const State, bool const BlinkLit)
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
case door_closure_t::locked:
|
||||
return true;
|
||||
case door_closure_t::released:
|
||||
return BlinkLit;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// automatic door controller update
|
||||
void TMoverParameters::update_doors(double const Deltatime)
|
||||
{
|
||||
@@ -9453,6 +9682,52 @@ bool TMoverParameters::readDimmerList(std::string const &line)
|
||||
return true;
|
||||
}
|
||||
|
||||
int TMoverParameters::clampDimmerPosition(int const Position) const
|
||||
{
|
||||
if (dimPositions.empty())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return std::clamp(Position, 0, static_cast<int>(dimPositions.size()) - 1);
|
||||
}
|
||||
|
||||
TMoverParameters::dimPosition TMoverParameters::currentDimPosition() const
|
||||
{
|
||||
if (modernDimmerPosition < 0 || modernDimmerPosition >= static_cast<int>(dimPositions.size()))
|
||||
{
|
||||
return {};
|
||||
}
|
||||
return dimPositions[modernDimmerPosition];
|
||||
}
|
||||
|
||||
bool TMoverParameters::stepDimmerPosition(int const Step)
|
||||
{
|
||||
if (dimPositions.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
auto const last{static_cast<int>(dimPositions.size()) - 1};
|
||||
auto const current{clampDimmerPosition(modernDimmerPosition)};
|
||||
auto next{current + Step};
|
||||
if (next < 0 || next > last)
|
||||
{
|
||||
if (false == modernDimmerCanCycle)
|
||||
{
|
||||
next = current;
|
||||
}
|
||||
else
|
||||
{
|
||||
next = (next < 0 ? last : 0);
|
||||
}
|
||||
}
|
||||
if (next == modernDimmerPosition)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
modernDimmerPosition = next;
|
||||
return true;
|
||||
}
|
||||
|
||||
// parsowanie WWList
|
||||
bool TMoverParameters::readWWList(std::string const &line)
|
||||
{
|
||||
@@ -9498,10 +9773,38 @@ bool TMoverParameters::readLightsList(std::string const &Input)
|
||||
return false;
|
||||
}
|
||||
parser >> Lights[0][idx] >> Lights[1][idx];
|
||||
// optional third column: the cab interior light the preset sets (eu07/maszyna#529). anything but a whole number
|
||||
// (some rows carry stray notes after the two columns) leaves the cab light to its own switch
|
||||
LightsCabLight[idx] = -1;
|
||||
if (true == parser.getTokens(1, false))
|
||||
{
|
||||
std::string cablight;
|
||||
parser >> cablight;
|
||||
int flags{-1};
|
||||
auto const [end, error]{std::from_chars(cablight.data(), cablight.data() + cablight.size(), flags)};
|
||||
if (error == std::errc{} && end == cablight.data() + cablight.size() && flags >= 0)
|
||||
{
|
||||
LightsCabLight[idx] = flags;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::optional<lights_preset_cablight> TMoverParameters::LightsPresetCabLight(int const Position) const
|
||||
{
|
||||
if (Position < 1 || Position > static_cast<int>(LightsCabLight.size()))
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
auto const flags{LightsCabLight[Position - 1]};
|
||||
if (flags < 0)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
return lights_preset_cablight{(flags & lights_preset_cablight::light_on) != 0, (flags & lights_preset_cablight::light_dimmed) != 0};
|
||||
}
|
||||
|
||||
bool TMoverParameters::readCompressorList(std::string const &Input)
|
||||
{
|
||||
|
||||
@@ -10254,6 +10557,9 @@ bool TMoverParameters::LoadFIZ_Parse(cParser &fizparser) // NOSONAR the former b
|
||||
result = false;
|
||||
|
||||
// ustawiamy domyslna pozycje dimmera
|
||||
// the DefaultPos of a short or an empty DimmerList would put the dimmer outside of it
|
||||
modernDimmerDefaultPosition = clampDimmerPosition(modernDimmerDefaultPosition);
|
||||
modernDimmerPosition = clampDimmerPosition(modernDimmerPosition);
|
||||
if (!enableModernDimmer)
|
||||
{
|
||||
modernDimmerPosition = modernDimmerDefaultPosition;
|
||||
@@ -10581,6 +10887,8 @@ void TMoverParameters::LoadFIZ_Doors(std::string const &line)
|
||||
extract_value(Doors.auto_include_remote, "DoorAutoCloseRemote", line, "");
|
||||
// operation permit
|
||||
extract_value(Doors.permit_needed, "DoorNeedPermit", line, "");
|
||||
// the door closure lamp (SOD) of the cab signals the doors of the whole consist
|
||||
extract_value(Doors.closure_signal, "DoorClosureSignal", line, "");
|
||||
{
|
||||
auto permitpresets = Split(extract_value("DoorPermitList", line), '|');
|
||||
for (auto const &permit : permitpresets)
|
||||
@@ -10903,6 +11211,7 @@ void TMoverParameters::LoadFIZ_Cntrl(std::string const &line)
|
||||
extract_value(EIMCtrlEmergency, "EIMCtrlEmergency", line, "");
|
||||
|
||||
extract_value(ScndS, "ScndS", line, ""); // brak pozycji rownoleglej przy niskiej nastawie PSR
|
||||
extract_value(ScndCtrlResistiveLock, "ScndCtrlResistiveLock", line, ""); // bocznikowanie tylko na pozycjach bezoporowych
|
||||
|
||||
extract_value(InitialCtrlDelay, "IniCDelay", line, "");
|
||||
extract_value(CtrlDelay, "SCDelay", line, "");
|
||||
@@ -11164,6 +11473,7 @@ void TMoverParameters::LoadFIZ_Engine(std::string const &Input)
|
||||
{
|
||||
|
||||
EngineType = LoadFIZ_EngineDecode(extract_value("EngineType", Input));
|
||||
extract_value(JointEngineStart, "JointEngineStart", Input, "");
|
||||
|
||||
if (std::string transmission = extract_value("Trans", Input); false == transmission.empty())
|
||||
{
|
||||
@@ -11372,6 +11682,9 @@ void TMoverParameters::LoadFIZ_Engine(std::string const &Input)
|
||||
// oil pump
|
||||
extract_value(OilPump.pressure_minimum, "OilMinPressure", Input, "");
|
||||
extract_value(OilPump.pressure_maximum, "OilMaxPressure", Input, "");
|
||||
// the time the starter turns the engine before it fires and smokes (eu07/maszyna#523)
|
||||
extract_value(dizel_SmokeDelay, "SmokeDelay", Input, "0");
|
||||
dizel_SmokeDelay = std::max(0.0, dizel_SmokeDelay);
|
||||
// engine cooling factore
|
||||
extract_value(dizel_heat.kw, "HeatKW", Input, "");
|
||||
extract_value(dizel_heat.kv, "HeatKV", Input, "");
|
||||
@@ -11397,7 +11710,7 @@ void TMoverParameters::LoadFIZ_Engine(std::string const &Input)
|
||||
// water heater
|
||||
extract_value(WaterHeater.config.temp_min, "HeaterMinTemperature", Input, "");
|
||||
extract_value(WaterHeater.config.temp_max, "HeaterMaxTemperature", Input, "");
|
||||
float pf;
|
||||
float pf{ 1235.f };
|
||||
extract_value(pf, "NominalCoolingPower", Input, "1235");
|
||||
dizel_heat.powerfactor = 1235 / pf;
|
||||
}
|
||||
@@ -11481,6 +11794,7 @@ void TMoverParameters::LoadFIZ_AI(std::string const &Input)
|
||||
{
|
||||
|
||||
extract_value(AIHintPantstate, "Pantstate", Input, "");
|
||||
extract_value(AIHintShuntPantstate, "ShuntPantstate", Input, "");
|
||||
extract_value(AIHintPantUpIfIdle, "IdlePantUp", Input, "");
|
||||
extract_value(AIHintLocalBrakeAccFactor, "LocalBrakeAccFactor", Input, "");
|
||||
}
|
||||
@@ -11522,6 +11836,8 @@ void TMoverParameters::LoadFIZ_UCList(std::string const &Input)
|
||||
extract_value(UniCtrlIntegratedBrakeCtrl, "IntegratedBrake", Input, "");
|
||||
extract_value(UniCtrlIntegratedLocalBrakeCtrl, "IntegratedLocBrake", Input, "");
|
||||
extract_value(UniCtrlIntegratedBrakePNCtrl, "IntegratedBrakePN", Input, "");
|
||||
extract_value(UniCtrlValStep, "CtrlValStep", Input, "");
|
||||
UniCtrlValStep = std::max(UniCtrlValStep, 0.0);
|
||||
}
|
||||
|
||||
void TMoverParameters::LoadFIZ_DList(std::string const &Input)
|
||||
|
||||
@@ -16,6 +16,11 @@ Copyright (C) 2007-2014 Maciej Cierniak
|
||||
#include "Oerlikon_ESt.h"
|
||||
#include "utilities/utilities.h"
|
||||
|
||||
// wstepny nacisk sprezyn na glowny przyrzad rozrzadczy, wyrazony jako roznica cisnien ZS - PG [bar]
|
||||
static double const dPSprezyny = 0.21;
|
||||
// najmniejszy stopien hamowania w cylindrze [bar] (tablica 3-9, proby 12 i 22: 0,25-0,30)
|
||||
static double const pStopnia = 0.28;
|
||||
|
||||
double d2A( double const d )
|
||||
{
|
||||
return d * d * 0.7854 / 1000.0;
|
||||
@@ -218,10 +223,11 @@ double TNESt3::GetPF( double const PP, double const dt, double const Vel ) // pr
|
||||
CheckReleaser(dt);
|
||||
|
||||
// luzowanie
|
||||
double const cel{ CelBCP( CVP, VVP ) };
|
||||
if ((BrakeStatus & b_hld) == b_off)
|
||||
dV =
|
||||
PF(0.0, BCP, Nozzles[dTO] * nastG + (1.0 - nastG) * Nozzles[dOO])
|
||||
* dt * (0.1 + 4.9 * std::min(0.2, BCP - ((CVP - 0.05 - VVP) * BVM + 0.1)));
|
||||
* dt * (0.1 + 4.9 * std::min(0.2, BCP - (cel > 0.0 ? cel + 0.1 : 0.0))); // bez stopnia luzuje do zera
|
||||
else
|
||||
dV = 0.0;
|
||||
// BrakeCyl.Flow(-dV);
|
||||
@@ -229,7 +235,7 @@ double TNESt3::GetPF( double const PP, double const dt, double const Vel ) // pr
|
||||
if ( (BrakeStatus & b_on) == b_on && Przekladniki[1]->P() * HBG300 < MaxBP )
|
||||
dV =
|
||||
PF( BVP, BCP, Nozzles[dTN] * (nastG + 2.0 * (BCP < Podskok ? 1.0 : 0.0)) + Nozzles[dON] * (1.0 - nastG) )
|
||||
* dt * (0.1 + 4.9 * std::min( 0.2, (CVP - 0.05 - VVP) * BVM - BCP ) );
|
||||
* dt * (0.1 + 4.9 * std::min( 0.2, cel - BCP ) );
|
||||
else
|
||||
dV = 0;
|
||||
// BrakeCyl.Flow(-dV);
|
||||
@@ -313,7 +319,7 @@ void TNESt3::Init( double const PP, double const HPP, double const LPP, double c
|
||||
Miedzypoj->CreateCap(5.0);
|
||||
Miedzypoj->CreatePress(PP);
|
||||
|
||||
BVM = 1.0 / (HPP - 0.05 - LPP) * MaxBP;
|
||||
BVM = 1.0 / (HPP - dPSprezyny - LPP) * MaxBP;
|
||||
|
||||
BrakeDelayFlag = BDF;
|
||||
|
||||
@@ -327,6 +333,17 @@ void TNESt3::Init( double const PP, double const HPP, double const LPP, double c
|
||||
RapidStaly = false;
|
||||
}
|
||||
|
||||
double TNESt3::GetRapidRatio(double const Vel) const
|
||||
{
|
||||
// ESt3 has no rapid relay, and with disc brakes the rapid step stays engaged at all speeds
|
||||
if( ( PrzekRapid == nullptr ) || RapidStaly ) {
|
||||
return 1.0;
|
||||
}
|
||||
// a braking vehicle comes from above, so the step is still engaged down to the speed
|
||||
// at which GetPF() drops it, not the one at which it engages
|
||||
return ( Vel < 50.0 ? 1.0 / PrzekRapid->GetRapidMult() : 1.0 );
|
||||
}
|
||||
|
||||
double TNESt3::GetCRP()
|
||||
{
|
||||
return CntrlRes->P();
|
||||
@@ -334,6 +351,24 @@ double TNESt3::GetCRP()
|
||||
// return Miedzypoj.P;
|
||||
}
|
||||
|
||||
double TNESt3::GetBrakeRatio( double const Ratio ) const // udzial cisnienia w cylindrze dla udzialu spadku w PG
|
||||
{
|
||||
if( MaxBP <= 0.0 || BVM <= 0.0 ) {
|
||||
return Ratio;
|
||||
}
|
||||
// pelny spadek sluzbowy w PG (HPP - LPP), odtworzony z przelozenia
|
||||
double const spadek{ MaxBP / BVM + dPSprezyny };
|
||||
double const cel{ ( Ratio * spadek - dPSprezyny ) * BVM };
|
||||
return ( cel > 0.0 ? std::max( cel, pStopnia ) / MaxBP : 0.0 );
|
||||
}
|
||||
|
||||
double TNESt3::CelBCP( double const CVP, double const VVP ) const // docelowe cisnienie w cylindrze
|
||||
{
|
||||
double const cel{ ( CVP - dPSprezyny - VVP ) * BVM };
|
||||
// gdy zawor hamuje, nie daje mniej niz najmniejszy stopien
|
||||
return ( cel > 0.0 ? std::max( cel, pStopnia ) : cel );
|
||||
}
|
||||
|
||||
void TNESt3::CheckState(double const BCP, double & /*dV1*/) // glowny przyrzad rozrzadczy
|
||||
{
|
||||
double const VVP{ ValveRes->P() };
|
||||
@@ -344,14 +379,13 @@ void TNESt3::CheckState(double const BCP, double & /*dV1*/) // glowny przyrzad r
|
||||
Przys_blok = false;
|
||||
|
||||
// sprawdzanie stanu
|
||||
// if ((BrakeStatus and 1)=1)and(BCP>0.25)then
|
||||
if (VVP + 0.01 + BCP / BVM < CVP - 0.05 && Przys_blok)
|
||||
if (double const cel{ CelBCP( CVP, VVP ) }; BCP < cel - 0.01 * BVM && Przys_blok)
|
||||
BrakeStatus |= b_on | b_hld; // hamowanie stopniowe;
|
||||
else if (VVP - 0.01 + (BCP - 0.1) / BVM > CVP - 0.05)
|
||||
else if (BCP - 0.1 > cel + 0.01 * BVM)
|
||||
BrakeStatus &= ~( b_on | b_hld ); // luzowanie;
|
||||
else if (VVP + BCP / BVM > CVP - 0.05)
|
||||
else if (BCP > cel)
|
||||
BrakeStatus &= ~b_on; // zatrzymanie napelaniania;
|
||||
else if (VVP + (BCP - 0.1) / BVM < CVP - 0.05 && BCP > 0.25) // zatrzymanie luzowania
|
||||
else if (BCP - 0.1 < cel && BCP > 0.25) // zatrzymanie luzowania
|
||||
BrakeStatus |= b_hld;
|
||||
|
||||
if( ( BrakeStatus & b_hld ) == 0 )
|
||||
@@ -380,7 +414,7 @@ void TNESt3::CheckReleaser(double const dt) // odluzniacz
|
||||
// odluzniacz automatyczny
|
||||
if ((BrakeStatus & b_rls) == b_rls)
|
||||
{
|
||||
CntrlRes->Flow(PF(CVP, 0, 0.02) * dt);
|
||||
CntrlRes->Flow(PF(CVP, 0, 0.0049) * dt); // ZS 15 l z 5,0 do 0,4 bar w 23 s (proba odbioru nr 27)
|
||||
if (CVP < VVP + 0.3 || false == autom)
|
||||
BrakeStatus &= ~b_rls;
|
||||
}
|
||||
@@ -451,6 +485,18 @@ void TNESt3::SetLBP(double const P)
|
||||
LBP = P;
|
||||
}
|
||||
|
||||
void TNESt3::ScaleNozzlesForAL2() // dysze cylindra przy przekladniku AL2
|
||||
{
|
||||
if( PrzekCiagly == nullptr ) {
|
||||
return;
|
||||
}
|
||||
// dysze cylindra skalibrowane na komore impulsowa przekladnika AL2 (1 l) wg czasow z tablicy 3-9
|
||||
Nozzles[dON] *= 0.914;
|
||||
Nozzles[dTN] *= 0.885;
|
||||
Nozzles[dOO] *= 0.82;
|
||||
Nozzles[dTO] *= 0.8;
|
||||
}
|
||||
|
||||
void TNESt3::SetSize( int const size, std::string const ¶ms ) // ustawianie dysz (rozmiaru ZR)
|
||||
{
|
||||
static double const dNO1l = 1.250;
|
||||
@@ -549,7 +595,7 @@ void TNESt3::SetSize( int const size, std::string const ¶ms ) // ustawianie
|
||||
{ // dON,dOO,dTN,dTO,dP,dS
|
||||
Nozzles[dON] = 3.7;
|
||||
Nozzles[dOO] = 2.50;
|
||||
Nozzles[dTN] = 1.65;
|
||||
Nozzles[dTN] = 1.62;
|
||||
Nozzles[dTO] = 1.39;
|
||||
Nozzles[dP] = 2.65;
|
||||
Nozzles[dPd] = 1.80;
|
||||
@@ -638,6 +684,8 @@ void TNESt3::SetSize( int const size, std::string const ¶ms ) // ustawianie
|
||||
Nozzles[dSd] = 1.1;
|
||||
Nozzles[dSm] = 0.9;
|
||||
|
||||
ScaleNozzlesForAL2();
|
||||
|
||||
// przeliczanie z mm^2 na l/m
|
||||
for (auto &nozzle : Nozzles)
|
||||
{
|
||||
@@ -646,7 +694,8 @@ void TNESt3::SetSize( int const size, std::string const ¶ms ) // ustawianie
|
||||
for (int i = 1; i < 4; ++i)
|
||||
{
|
||||
Przekladniki[i]->BrakeRes = BrakeRes;
|
||||
Przekladniki[i]->CreateCap(i);
|
||||
// komora impulsowa przekladnika AL2 ma 1 l
|
||||
Przekladniki[i]->CreateCap( ( Przekladniki[i] == PrzekCiagly ) ? 1.0 : i );
|
||||
Przekladniki[i]->CreatePress(BrakeCyl->P());
|
||||
if (i < 3)
|
||||
Przekladniki[i]->Next = Przekladniki[i + 1];
|
||||
|
||||
@@ -111,6 +111,7 @@ class TRapid : public TPrzekladnik {
|
||||
public:
|
||||
void SetRapidParams(double mult, double size);
|
||||
void SetRapidStatus(bool rs);
|
||||
double GetRapidMult() const { return RapidMult; }
|
||||
void Update(double dt) override;
|
||||
using TPrzekladnik::TPrzekladnik;
|
||||
};
|
||||
@@ -194,9 +195,13 @@ class TNESt3 : public TBrake {
|
||||
double GetPF( double const PP, double const dt, double const Vel ) override; // przeplyw miedzy komora wstepna i PG
|
||||
void EStParams(double i_crc) const; // parametry charakterystyczne dla ESt
|
||||
double GetCRP() override;
|
||||
double GetRapidRatio(double const Vel) const override;
|
||||
double CelBCP(double const CVP, double const VVP) const; // docelowe cisnienie w cylindrze
|
||||
double GetBrakeRatio(double const Ratio) const override; // udzial cisnienia w cylindrze dla udzialu spadku w PG
|
||||
void CheckState(double const BCP, double &dV1); // glowny przyrzad rozrzadczy
|
||||
void CheckReleaser(double const dt); // odluzniacz
|
||||
double CVs(double const BP) const; // napelniacz sterujacego
|
||||
void ScaleNozzlesForAL2(); // dysze cylindra przy przekladniku AL2
|
||||
double BVs(double const BCP) const; // napelniacz pomocniczego
|
||||
void SetSize( int const size, std::string const ¶ms ); // ustawianie dysz (rozmiaru ZR), przekladniki
|
||||
void PLC(double const mass) override; // wspolczynnik cisnienia przystawki wazacej
|
||||
|
||||
@@ -968,6 +968,28 @@ double TESt::BVs(double const BCP) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refills the auxiliary reservoir (ZP) from the valve pre-chamber through the
|
||||
/// check valve of the slide valve, opened as far as <see cref="BVs"/> says for the
|
||||
/// given cylinder (or impulse-chamber) pressure, while the pre-chamber is more
|
||||
/// than 0.05 bar above the reservoir. The flows wait for the caller's Act().
|
||||
/// </summary>
|
||||
/// <param name="BCP">Brake cylinder (or impulse-chamber) pressure.</param>
|
||||
/// <param name="dt">Time step [s].</param>
|
||||
/// <returns>Volume taken into the auxiliary reservoir, 0.96 of it drawn from the brake pipe.</returns>
|
||||
double TESt::FillBrakeRes(double const BCP, double const dt) const
|
||||
{
|
||||
double const BVP{BrakeRes->P()};
|
||||
double const VVP{ValveRes->P()};
|
||||
double const temp{BVs(BCP)};
|
||||
double dv{0.0};
|
||||
if (VVP - 0.05 > BVP)
|
||||
dv = PF(BVP, VVP, 0.02 * SizeBR * temp / 1.87) * dt;
|
||||
BrakeRes->Flow(dv);
|
||||
ValveRes->Flow(-0.04 * dv);
|
||||
return dv;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// One-step Oerlikon ESt distributor advance: runs CheckState/CheckReleaser,
|
||||
/// integrates the ZS <-> PG, ZP <-> cylinder, ZP <-> pre-chamber and
|
||||
@@ -1021,15 +1043,7 @@ double TESt::GetPF(double const PP, double const dt, double const Vel)
|
||||
BrakeCyl->Flow(-dv);
|
||||
|
||||
// przeplyw ZP <-> rozdzielacz
|
||||
temp = BVs(BCP);
|
||||
// if(BrakeStatus and b_hld)=b_off then
|
||||
if (VVP - 0.05 > BVP)
|
||||
dv = PF(BVP, VVP, 0.02 * SizeBR * temp / 1.87) * dt;
|
||||
else
|
||||
dv = 0;
|
||||
BrakeRes->Flow(dv);
|
||||
dV1 = dV1 + dv * 0.96;
|
||||
ValveRes->Flow(-0.04 * dv);
|
||||
dV1 = dV1 + FillBrakeRes(BCP, dt) * 0.96;
|
||||
// przeplyw PG <-> rozdzielacz
|
||||
dv = PF(PP, VVP, 0.01) * dt;
|
||||
ValveRes->Flow(-dv);
|
||||
@@ -1191,6 +1205,10 @@ double TEStEP2::GetPF(double const PP, double const dt, double const Vel)
|
||||
ValveRes->Flow(-0.04 * dv);
|
||||
dV1 = dV1 - 0.96 * dv;
|
||||
|
||||
// przeplyw ZP <-> rozdzielacz: as in every ESt, the auxiliary reservoir also charges from the brake pipe,
|
||||
// not from the main reservoir pipe alone, so a unit hauled with the brake hose alone charges and brakes
|
||||
dV1 = dV1 + FillBrakeRes(BCP, dt) * 0.96;
|
||||
|
||||
// hamulec EP
|
||||
EPCalc(dt);
|
||||
|
||||
|
||||
@@ -421,6 +421,10 @@ class TBrake
|
||||
double GetVRP() const; // cisnienie komory wstepnej rozdzielacza
|
||||
/// <summary>Returns control reservoir (ZS) pressure [bar]; defaults to the auxiliary reservoir for valves without a dedicated ZS.</summary>
|
||||
virtual double GetCRP(); // cisnienie zbiornika sterujacego
|
||||
/// <summary>Share of the full cylinder pressure the distributor settles at for the given share
|
||||
/// of the full service pipe drop. Used only to predict the brake force; the default is proportional.</summary>
|
||||
/// <param name="Ratio">Share of the full service brake pipe drop.</param>
|
||||
virtual double GetBrakeRatio(double const Ratio) const { return Ratio; }
|
||||
/// <summary>
|
||||
/// Sets the brake delay (G/P/R/M) selector if requested mode is supported.
|
||||
/// </summary>
|
||||
@@ -443,6 +447,11 @@ class TBrake
|
||||
/// <summary>Sets the rapid step ratio. Default no-op; overridden where supported.</summary>
|
||||
/// <param name="RMR">Rapid ratio.</param>
|
||||
virtual void SetRM(double const RMR) { /* no effect for this device type */ } // ustalenie przelozenia rapida
|
||||
/// <summary>Share of the full cylinder pressure the distributor delivers at the given speed
|
||||
/// while the vehicle is slowing down through it, for a vehicle set to R. Used only to predict
|
||||
/// the brake force; the default is the approximation BrakeForceR() has always used.</summary>
|
||||
/// <param name="Vel">Vehicle velocity [km/h].</param>
|
||||
virtual double GetRapidRatio(double const Vel) const { return Vel < 40.0 ? 0.5 : 1.0; }
|
||||
/// <summary>Sets the velocity threshold for the rapid step.</summary>
|
||||
/// <param name="RVR">Velocity threshold (same unit as Vel passed to GetPF).</param>
|
||||
virtual void SetRV(double const RVR)
|
||||
@@ -611,6 +620,15 @@ class TESt : public TBrake
|
||||
/// <param name="BCP">Brake cylinder pressure.</param>
|
||||
/// <returns>Dimensionless opening coefficient.</returns>
|
||||
double BVs(double BCP) const; // napelniacz pomocniczego
|
||||
/// <summary>
|
||||
/// Refills the auxiliary reservoir (ZP) from the valve pre-chamber through the
|
||||
/// check valve of the slide valve, opened as far as <see cref="BVs"/> says, while
|
||||
/// the pre-chamber is above the reservoir. The flows wait for the caller's Act().
|
||||
/// </summary>
|
||||
/// <param name="BCP">Brake cylinder (or impulse-chamber) pressure for <see cref="BVs"/>.</param>
|
||||
/// <param name="dt">Time step [s].</param>
|
||||
/// <returns>Volume taken into the auxiliary reservoir, 0.96 of it drawn from the brake pipe.</returns>
|
||||
double FillBrakeRes(double BCP, double dt) const; // napelnianie pomocniczego z rozdzielacza
|
||||
/// <summary>Vents the valve, brake and control reservoirs to zero.</summary>
|
||||
void ForceEmptiness() override; // wymuszenie bycia pustym
|
||||
|
||||
|
||||
Reference in New Issue
Block a user