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

1 Commits

Author SHA1 Message Date
Hirek c07eb76e51 refactor(physics): the drives of the vehicles are classes, one for each kind of engine
What a vehicle does in the step of its traction depended on a switch on
EngineType in each place: the traction force, the ventilators, the power of
the engine, the ammeters, the revolutions of the engine. Each kind of drive
is now a class of its own in physics/mover/drive.h/.cpp, behind the
interface TractionDrive:

  NoDrive                no engine, or one with no model (steam, Main)
  DumbDrive              an engine with no model (Dumb)
  WheelsDrivenDrive      the wheels driven by hand
  SeriesMotorDrive       series wound DC motors
  InductionMotorDrive    asynchronous motors and inverters
  DieselMechanicalDrive  a diesel engine and a mechanical or hydraulic gear
  DieselElectricDrive    a diesel engine, a generator and traction motors

TMoverParameters::Drive() gives the one of the vehicle's EngineType.
TractionForce(), UpdateVentilators(), UpdateEnginePower(), ShowCurrent(),
EngineRPMRatio(), EngineIdleRPM() and EngineMaxRPM() call it in the same
order the switches went. The drives hold no state yet: the state of each
drive moves into its class next.

No change in behaviour: 1144/1144 tests, golden traces exact against staging
62f7a29b.
2026-11-27 21:36:53 +01:00