/* 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 main circuit of a vehicle: the line breaker, the line contactors, the protective relays, the converter. Held by // physics::Vehicle as lineBreaker, lineContactors, protection and converter #pragma once #include #include "physics/vehicletypes.h" namespace physics { // the line breaker (the main switch) of the vehicle struct LineBreaker { bool closed = false; double initTime{0.0}; // how long the main circuit initialises after it gets its power, before the breaker can close [s] double initCountdown{0.0}; // how long it still initialises [s] start_t start{start_t::manual}; // Engine:JointEngineStart: the line breaker / engine start switch of the cab works the vehicles in multiple too; when it // doesn't, the cab has separate switches for them (mainb_*, mainc_*) bool jointStart{true}; // Cntrl.PantRequiresMain: the line breaker closes without traction voltage and holds without it, and the pantographs // rise and stay up only while it's closed (EU05, EP05, ČD 181 family); off, the pantographs come first and the line // breaker needs their voltage. what the main circuit feeds still needs the voltage (MainCircuitPowered()), and without // it the undervoltage relay opens the line contactors (protection.noVoltage) bool pantographsRequireIt{false}; bool closesOnlyAtNoPower{false}; // it closes only with the master controller at a position of no power // Cntrl.EmergencyBrakeMainOff: the brake pipe pressure [bar] taken for an emergency brake application: below it, with // the master controller on a power position, the line breaker opens and doesn't close again. where the pantographs // stay up only through the closed line breaker (pantographsRequireIt) they drop with it (EP05). 0: an emergency // application leaves the line breaker alone double emergencyOffPressure{0.0}; }; // the line contactors of the traction motors struct LineContactors { bool closed = false; bool forcedOpen{false}; // the button that forces them open std::string switchType; // StLinSwitchType: the kind of the switch of the cab line_contactors_interlock interlock{line_contactors_interlock::none}; // what else they need to close double lastSwitchTime = 0.0; // the time since they last switched [s] }; // the protective relays and the pressure switch of the main circuit struct ProtectionRelays { // the undervoltage relay: it switches off if the voltage drops below its threshold, which opens the line breaker; with // lineBreaker.pantographsRequireIt it opens the line contactors instead, and switches back on only with the master // controller at zero or the first position bool noVoltage{true}; bool overvoltage{true}; // the overvoltage relay, which opens above the voltage it's set to bool ground{true}; // the ground relay, which opens to protect against damage from earths start_t groundStart{start_t::manual}; // how the ground relay is reset bool pressureSwitch{false}; // tripped while the brake pipe and/or the brake cylinders aren't at their working pressures bool hasPressureSwitch{true}; // Engine:PressureSwitchBrakeCylinder: the pressure switch watches the brake cylinders (it cuts the start off above 2 bar // there) as well as the brake pipe (below 3.6 bar). off, it's left with the brake pipe alone, and the vehicle takes // current whatever the pressure in its brake cylinders (EP05) bool pressureSwitchWatchesCylinders{true}; }; // the converter of the vehicle struct PowerConverter { start_t start{start_t::manual}; // whether it is started by hand, or another way float startDelay{0.0f}; // the delay before it starts, once its conditions are met [s] double startDelayTimer{0.0}; // how long its conditions have been met bool allow = false; // it may run bool allowLocal{true}; // the switch of the vehicle itself; most have none, so it allows bool running = false; start_t overloadRelayStart{start_t::manual}; // whether its overload relay is reset by a button of its own bool overloadRelayOffWithLineBreaker{false}; // ConverterOverloadRelayOffWhenMainIsOff bool overloaded = false; // the overload relay of the converter and the heating tripped std::string switchType; // ConvSwitchType: the kind of the switch of the cab. TODO: the kinds of the switches belong to the cab definition }; } // namespace physics