end and side were unscoped enums: front, rear, left and right sat in the
global namespace (the test PCH had to leave mover.h out for it), and an end
went into any int, a side into an end, without a word from the compiler. They
become enum class VehicleEnd and VehicleSide (physics/vehicletypes.h); the
names follow the rule for types, and leave "end" and "side" to the many
locals of that name. The numbers stay: front 0, rear 1, right 0, left 1.
- ByEnd<T> / BySide<T>: two values indexed by the enum, and by a number
where a loop or a format counts them. The arrays of the ends and the sides
are these now: Couplers, Neighbours, Pantographs, MotorBlowers, Lights,
iLights, Doors.instances, pVehicles, IsAnyDoor*, m_lighthints, vCoulpler,
m_couplersounds, m_mirrormotion, iInventory, and the voltages of the
couplers
- VehicleEnds / VehicleSides to go through them, Opposite() in place of
1 - end, NumberOf() where a number is needed
- the couplers and the collisions take the ends they work on as VehicleEnd:
CouplerForce, CouplerVelocityDifference, CollisionDetect, crush_hit,
CompatibleCoupling and the rest of their family, DirF, DirPatch, and of
the vehicle couple, uncouple, the adapters, off_track_gap, has_signal_on;
Attach, Dettach and DettachStatus have overloads by the ends
- neighbour_data::FacingEnd() and TCoupling::ConnectedEnd() give the end of
the other vehicle as VehicleEnd; the fields stay numbers, as they hold -1
and 2 for "none" in places
The walks along the consist (FirstFind, Neighbour, the AI's coupling and
uncoupling) still carry the ends as numbers; where one of them meets a typed
end, NumberOf() and EndOf() say so, and keep the number as it was.
Kept as it was, and worth a look: TDynamicObject::SetLights() switches the
headlights A/B off by CabActive with the cases end::front and end::rear, that
is CabActive 0 and 1, while CabActive is 1 or -1 for the cabs; the cases are
NumberOf(VehicleEnd::front / rear) now, the same numbers.
No change in behaviour: 1144/1144 tests, golden traces exact against staging
62f7a29b. betterRenderer/, not built, has had only end:: and side:: renamed.
The folder of the vehicle physics was named after the author of its first
version (2001). Its name now says what it holds, and so do its files:
McZapkie/MOVER.h, Mover.cpp -> physics/mover.h, mover.cpp
McZapkie/hamulce.h, hamulce.cpp -> physics/brakes.h, brakes.cpp
McZapkie/Oerlikon_ESt.h, .cpp -> physics/oerlikonest.h, .cpp
friction, collision, couplerphysics, derailment: same names in physics/
Every include names the folder ("physics/mover.h"); the McZapkie include
directory is gone from CMakeLists.txt. The comments and documents that
named the old paths name the new ones. The credits to McZapkie stay.
Renames only: git sees every file as renamed (98-100%). 1142/1142 tests,
golden traces exact against staging 62f7a29b.
The player switches the fans of the own ET42 section off (converterlocal_sw)
and hands the train to the AI. The AI only works the main converter switch,
and takes the converters for running as the other section's is, but with
LineContactorsInterlock=Converter the line contactors of the own section
stay open and the AI waits at the first controller position forever.
- Switching the converters on (the converteron action), the AI also puts the
local switch back on in the vehicles under its control whose line
contactors wait for their own converter.
- With such a switch off the AI doesn't take the engine for ready, so it
goes back to preparing it, also when the switch is flipped while it
drives. The human driver may still run with a section switched off.
- Vehicles without the interlock are left as they were.
The lever of the switch in the cab doesn't follow the AI, like the one of
the main converter switch; it is set anew when the cab is entered.
(eu07/maszyna#460)
With LineContactorsInterlock=MotorBlowers the line contactors waited for
every motor blower to run. A blower with MotorBlowersStartVelocity starts
only with the vehicle moving and the motors drawing current, so standing it
never ran, the contactors never closed, no current flowed and the vehicle
couldn't start at all; the same after a stop longer than
MotorBlowersSustainTime.
- For a blower with a start velocity the interlock now asks whether it is
switched on and has power (not switched off, switched on where the driver
starts it, its power source present), instead of whether it runs. Blowers
without a start velocity still have to run.
- The power source of a blower (battery: 24 V, converter: 110 V, else the
main circuit) is one function, MotorBlowerPowerIsAvailable(), used by
MotorBlowersCheck() and the interlock. None of the three needs the line
contactors closed: the battery and the converter run before them, and the
main circuit is the line breaker they need anyway.
(eu07/maszyna#460)
The ET22 cab binds its louvre lamp to i-voltbrake: (voltage on the brake
controller) as a stand-in. The real lamp goes out once the main compressors
have filled the main reservoir to about 5 bar and the pneumatic louvres of
the motor fans open.
- New optional lamp i-louvresclosed:, lit (with low voltage power) while the
main reservoir pressure is below LouvresOpenPressure.
- New optional Cntrl. key LouvresOpenPressure [bar], 5.0 by default, so the
.mmd change alone is enough.
- i-vent_trim: (btLampkaWentZaluzje, never driven) is left alone, because
the WMB10 binds it and would suddenly light up.
SVN data, to change once this is released (old data works as before):
- dynamic/pkp/et22_v3/201eo.mmd.inc, 201eo_160ec.mmd.inc, 201ek.mmd:
i-voltbrake: lampka_zaluzje -> i-louvresclosed: lampka_zaluzje
- dynamic/pkp/et22-2000_v2/201em.mmd:
i-voltbrake: zaluzje -> i-louvresclosed: zaluzje
(eu07/maszyna#451)
On the ET42 the fans of each section run off that section's converter: the
section fan switch of the cab is bound to converterlocal_sw. The line
contactors of a section with its fans switched off must not close.
- New optional Cntrl. key LineContactorsInterlock=Converter|MotorBlowers.
MotorConnectorsCheck() then also needs the vehicle's own converter
(ConverterFlag, not the trainset's shared 110 V), or all its motor
blowers, running. It is checked per vehicle, so only that section stays
off, and switching the fans off on the way opens its contactors. Without
the key nothing changes.
- New optional lamp i-converteraoff:, lit while the converter of the
vehicle with the cab is off. i-converteroff: follows the shared 110 V, so
with one ET42 section's fans off it stayed dark. i-converterboff: already
covers the other section.
SVN data, to change once this is released (old data works as before):
- dynamic/pkp/et42_v2/112e-a.fiz, 112e-b.fiz: LineContactorsInterlock=Converter
in the Cntrl. line.
- dynamic/pkp/et42_v2/112e-a.mmd.inc, 112e-b.mmd.inc:
i-converter: nadm_przetw -> i-converteraoff: nadm_przetw,
i-converterb: nadm_przetw_b -> i-converterboff: nadm_przetw_b,
i-compressor: sprezarka -> i-compressoroff: sprezarka,
i-compressorb: sprezarka_b -> i-compressorboff: sprezarka_b
(the compressor "off" lamps already light with the compressor switched off
or stopped by its pressure governor).
(eu07/maszyna#460)