mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-22 00:54:59 +01:00
Merge remote-tracking branch 'origin/master' into feat/persistent-odometer-store
# Conflicts: # vehicle/DynObj.h
This commit is contained in:
@@ -14,6 +14,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include "hamulce.h"
|
||||
#include "couplerphysics.h"
|
||||
#include "scripting/ladderlogic.h"
|
||||
#include "vehicle/odometerreading.h"
|
||||
|
||||
@@ -1256,6 +1257,7 @@ struct TCoupling
|
||||
double Dist = 0.0; /*strzalka ugiecia zderzaków*/
|
||||
bool CheckCollision = false; /*czy sprawdzac sile czy pedy*/
|
||||
float stretch_duration{0.f}; // seconds, elapsed time with excessive force applied to the coupler
|
||||
bool broken{false}; // the coupler broke (damage_coupler()), until it's repaired (repair_coupler())
|
||||
// optional adapter piece
|
||||
double adapter_length{0.0}; // meters, value added on the given end to standard vehicle (half)length
|
||||
double adapter_height{0.0}; // meters, distance from rail level
|
||||
@@ -1265,6 +1267,11 @@ struct TCoupling
|
||||
power_coupling power_110v;
|
||||
power_coupling power_24v;
|
||||
|
||||
// the physical model of the coupling (couplerphysics in eu07.ini), see couplerphysics.h: the parameters of this end,
|
||||
// and the state of the coupling with the vehicle at this end, which that vehicle keeps alike on its own end
|
||||
coupler_physics::end_parameters physics;
|
||||
coupler_physics::pair_state physics_state;
|
||||
|
||||
int sounds{0}; // sounds emitted by the coupling devices
|
||||
bool Render = false; /*ABu: czy rysowac jak zaczepiony sprzeg*/
|
||||
std::string control_type; // abstraction of control coupling interface and communication standard
|
||||
@@ -2008,6 +2015,9 @@ class TMoverParameters
|
||||
glm::vec3 Front{};
|
||||
std::string Name; /*nazwa wlasna*/
|
||||
TCoupling Couplers[2]; // urzadzenia zderzno-sprzegowe, polaczenia miedzy wagonami
|
||||
// the physical coupler model covers the vehicle: it's in the player's train or in one the player's train closes in on
|
||||
// (vehicle_table::update_coupler_physics()); with couplerphysics all in eu07.ini every vehicle is covered
|
||||
bool CouplerPhysics{false};
|
||||
std::array<neighbour_data, 2> Neighbours; // potential collision sources
|
||||
bool Power110vIsAvailable = false; // cached availability of 110v power
|
||||
bool Power24vIsAvailable = false; // cached availability of 110v power
|
||||
@@ -2267,6 +2277,7 @@ class TMoverParameters
|
||||
int SpeedCtrlAutoTurnOffFlag = 0; /*czy tempomat sam się wyłącza*/
|
||||
bool EIMCtrlAdditionalZeros = false; /*czy ma dodatkowe zero jazdy i zero hamowania */
|
||||
bool EIMCtrlEmergency = false; /*czy ma dodatkowe zero jazdy i zero hamowania */
|
||||
bool EIMCtrlMainEmergency = false; /*czy zadajnik typu 2 (Elf) ma pozycje hamowania naglego ponizej swojej pozycji 0*/
|
||||
double eimv_pr = 0; /*realizowany procent dostepnej sily rozruchu/hamowania*/
|
||||
double eimv[21];
|
||||
static std::vector<std::string> const eimv_labels;
|
||||
@@ -2384,6 +2395,10 @@ class TMoverParameters
|
||||
int DettachStatus(int ConnectNo);
|
||||
bool Dettach(int ConnectNo);
|
||||
void damage_coupler(int const End);
|
||||
// repairs the broken coupler of the end, and the one of the vehicle it was coupled with, so they can be coupled
|
||||
// again; the vehicles clear their coupler damage once neither of their couplers is broken. returns: whether there
|
||||
// was a broken coupler to repair
|
||||
bool repair_coupler(int const End);
|
||||
void Derail(DerailReason Reason);
|
||||
bool DirectionForward();
|
||||
bool DirectionBackward(void); /*! kierunek ruchu*/
|
||||
@@ -2441,6 +2456,15 @@ class TMoverParameters
|
||||
int MainCtrlNoPowerPos() const; // highest setting of master controller which won't cause engine to generate extra power
|
||||
int MainCtrlActualPowerPos() const; // current actual setting of master controller, relative to the highest setting not generating extra power
|
||||
int MainCtrlPowerPos() const; // current setting of master controller, relative to the highest setting not generating extra power
|
||||
// positions the master controller of the EIMCtrlType 2 (Elf) has below its own position 0, the emergency brake (0 or 1)
|
||||
int EIMCtrlEmergencyPositions() const;
|
||||
// whether the master controller is in its emergency brake position (EIMCtrlType 2 with EIMCtrlMainEmergency)
|
||||
bool IsMainCtrlEmergencyPos() const;
|
||||
// the master controller position sent to the coupled vehicles ("MainCtrl"), the same with and without
|
||||
// EIMCtrlMainEmergency: the Elf's positions without the emergency brake one, which goes as the full braking
|
||||
int MainCtrlPosForCoupled() const;
|
||||
// the master controller position of this vehicle for one received from a coupled vehicle ("MainCtrl")
|
||||
int MainCtrlPosFromCoupled(int Position) const;
|
||||
/*! pomocniczy nastawnik:*/
|
||||
bool IncScndCtrl(int CtrlSpeed);
|
||||
bool DecScndCtrl(int CtrlSpeed);
|
||||
@@ -2521,6 +2545,17 @@ class TMoverParameters
|
||||
double BrakeForceP(double press, double velocity) const;
|
||||
double BrakeForce(const TTrackParam &Track);
|
||||
double CouplerForce(int const End, double dt);
|
||||
// whether the coupling at the end is computed by the physical model: couplerphysics set in eu07.ini, and this
|
||||
// vehicle or the one at the end covered by it (CouplerPhysics), or every vehicle with couplerphysics all
|
||||
bool coupler_physics_at(int const End) const;
|
||||
// the force of the coupling at the end by the physical model (couplerphysics in eu07.ini), see couplerphysics.h
|
||||
double coupler_force_physical(int const End, double const dt);
|
||||
// with the physical model: whether the vehicles at the end hit the stop of their springs at the last update and
|
||||
// still close in on it, so that they collide; a hit hard enough breaks the coupling or crushes the buffers
|
||||
bool coupler_stop_hit(int const End, TMoverParameters &Other, int const OtherEnd);
|
||||
// couples the automatic couplers of the end and of the other vehicle pressed against each other, unless the hit
|
||||
// is too fast for them to catch
|
||||
void automatic_coupling(int const End, TMoverParameters &Other, int const OtherEnd);
|
||||
void CollisionDetect(int const End, double const dt);
|
||||
// closing speed of a collision [km/h] above which the vehicles involved may derail, adjusted for their mass ratio
|
||||
static constexpr double SafeCollisionVelocity{15.0};
|
||||
|
||||
Reference in New Issue
Block a user