18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 15:17:08 +01:00
Files
maszyna/physics/components/lowvoltage.h
T
Hirek 89258eb72c refactor(physics): the low voltage, the train heating and the electrodynamic brake as components
The rest of the electrics of physics::Vehicle beside the traction motors
becomes components, with English names:

  lowVoltage (LowVoltageSupply,   Battery batteryOn, BatteryVoltage,
  physics/components/lowvoltage.h) NominalBatteryVoltage, BatteryStart,
                                  Power110vIsAvailable / Power24vIsAvailable /
                                  Power24vVoltage power110vAvailable /
                                  power24vAvailable / power24vVoltage, the
                                  battery button of the cab: batteryButtonFired,
                                  batteryButtonImpulse, batteryButtonHeld,
                                  batteryButtonHoldTime
  trainHeating (TrainHeating)     Heating on, HeatingAllow allow,
                                  HeatingSwitchImpulse switchImpulse,
                                  HeatingPower power, EngineHeatingRPM engineRpm
  brakes.electrodynamic           the DynamicBrake* fields: type, ammeters,
  (ElectrodynamicBrake,           controllerPositions, controllerPosition,
  physics/components/braking.h)   resistance(1, 2), on, emuWorking;
                                  SplitEDPneumaticBrake splitFromPneumatic;
                                  the fans of the braking resistor (BRVentilators,
                                  BRVto, BRVtimer, Imaxrpc): resistorFansRunning,
                                  resistorFansSustain, resistorFansTimer,
                                  resistorPassiveMaxCurrent

The diesel-electric dynamic brake (DEDynamicBrake) and the currents of the
traction circuit (Im, Itot, EngineVoltage ...) stay for the traction stage.

No string literal changed (checked over all the changed files).

No change in behaviour: 1149/1149 tests, golden traces exact against staging
62f7a29b.
2026-11-29 03:15:56 +01:00

47 lines
1.6 KiB
C++

/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
// the low voltage supply and the train heating of a vehicle, held by physics::Vehicle as lowVoltage and trainHeating
#pragma once
#include "physics/vehicletypes.h"
namespace physics
{
// the battery and the low voltage circuits
struct LowVoltageSupply
{
bool batteryOn = false; // the battery switched on
double batteryVoltage = 0.0;
float nominalBatteryVoltage = 0.f;
start_t batteryStart = start_t::manual;
bool power110vAvailable = false; // the 110 V circuit has power, as the last step found it
bool power24vAvailable = false; // the 24 V circuit has power, as the last step found it
double power24vVoltage{0.0}; // the voltage of the battery circuit, as the last step found it
// the battery switch of the cab
bool batteryButtonFired = false; // the button already pressed
bool batteryButtonImpulse = false; // the switch works as a single button
bool batteryButtonHeld = false; // the button has to be held to switch the battery on or off
float batteryButtonHoldTime = 1.f; // how long it has to be held [s]
};
// the heating of the train fed by the vehicle
struct TrainHeating
{
bool on = false;
bool allow{false}; // the heating switch. TODO: wrap the heating in a basic device
bool switchImpulse{false}; // the switch springs back to its middle position
double power = 0.0;
double engineRpm{0.0}; // the revolutions of the engine guaranteed with the heating on
};
} // namespace physics