/* 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