18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 00:22:42 +01:00
Commit Graph

3 Commits

Author SHA1 Message Date
Hirek 04f76951f5 refactor(physics): the diesel engine, the torque converter and the retarder are components of their own
TMoverParameters held some 80 fields of the diesel engine and its hydraulic
transmission among its other 600, named dizel_*, hydro_TC_* and hydro_R_*.
They are now three structures of physics/components/dieselengine.h, with
English names:

- DieselEngine diesel: the definition (maxMoment, maxRevolutions,
  minRevolutions, the governor, the clutch, the fuel consumption, the tables)
  and the state (fill, clutchState, clutchPressure, torque, power, the start
  up, the fuel consumed) and its heat (EngineHeat, heat_data before)
- TorqueConverter torqueConverter: present, the ratios, the lockup, the
  fill rates, the table, and its state (fill, lockedUp, torqueRatio, the
  revolutions in and out)
- Retarder retarder: present, its placement, torque, power, fill rates,
  clutch, and its state

The .fiz keywords, the keys of the dictionaries of the Python screens and the
names of the golden channels (dizel_fill...) are unchanged; only the C++
names changed. The functions of the engine (dizel_Update, dizel_Momentum...)
stay members of TMoverParameters for now.

No change in behaviour: 1144/1144 tests, golden traces exact against staging
62f7a29b.
2026-11-28 15:23:36 +01:00
Hirek 54d3a1040a refactor(physics): EnumSet<E> for the sets of flags; the damage of a vehicle is VehicleDamage and DamageSet
- utilities/enumset.h: EnumSet<E>, a set of the values of an enum class whose
  values are bits, with the operations CouplingSet had (HasAll, HasAny,
  Empty, Set, Clear, Without, |, &, ^, ==, FromBits, Bits). CouplingSet is
  EnumSet<Coupling> now; an enum is a kind of the sets by IsEnumSetKind<E>,
  which gives it its operator |.
- the damage of a vehicle (DamageFlag) is a DamageSet of VehicleDamage
  instead of the int and the dtrain_* constants. A bit means one thing for a
  locomotive and another for a wagon; both names are there (thinWheel and
  loadShift, ventilator and loadDamage, engine and loadDestroyed).
- the SetDamage command of the scenery adds or takes away the damage by its
  number as SetFlag() did (setOrClear()); "WRECKED" is still the set of the
  number 255; the bearing divisor of the resistance stays the number 4.
- the damage of the tracks and of the catenary (dtrack_*, the traction's
  DamageFlag) are other flags and stay as they were.

No change in behaviour: 1144/1144 tests, golden traces exact against staging
62f7a29b.
2026-11-28 01:22:57 +01:00
Hirek d4bd3fc5ca refactor(physics): physics/mover/ becomes physics/components/
The files of the parts of a vehicle (pneumatics, electrics, traction, doors,
drives...) are in physics/components/, not under the old name of the mover;
the file of the vehicle as a body, its forces and its movement, is body.cpp
(was mover.cpp). The includes, CMakeLists.txt and AGENTS.md name the new
paths.

Renames only. 1144/1144 tests, golden traces exact against staging 62f7a29b.
2026-11-28 00:28:34 +01:00