mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-07 18:04:47 +01:00
fix: single horn lever tones, skid of a stopped vehicle, destination signs after the timetable
- a cab with only the combined horn lever (horn_bt:) and no separate tone buttons could sound the low and high tones at once, which the lever can't do; the tones are now exclusive there, and releasing the other tone's key keeps the lever in place (eu07/maszyna#392), - a skid ends when the wheel speed crosses the vehicle speed, which never happens with wheels locked by the brakes once the vehicle has stopped; it stayed flagged as slipping, its braking force capped by the sliding adhesion, so a few such wagons could push a braked consist around (eu07/maszyna#479). Like the Vel > 0.1 trap of the skid start, a (nearly) stopped vehicle with wheels turning at its speed is no longer slipping, - lit electronic destination signs kept showing the relation after the timetable had ended, until the battery was switched off (eu07/maszyna#446); they are blanked when the timetable runs out, physical signs stay up until changed. What the horn keys do to WarningSignal moves out of the TTrain command handlers into vehicle/horn, which the unit tests call; the handlers keep the gauges. Tests: tests/unit/test_horn.cpp, both kinds of cabs, and tests/unit/test_wheelslip.cpp, a wagon which stopped in a skid on slippery rail holds on a slope like one which stopped on dry rail (without the fix it runs away, ~70 km/h after 30 s).
This commit is contained in:
24
vehicle/horn.h
Normal file
24
vehicle/horn.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
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/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// the horn controls of the cab, on the WarningSignal bits of the vehicle (1: low tone, 2: high tone)
|
||||
namespace horn {
|
||||
|
||||
int const low{1};
|
||||
int const high{2};
|
||||
|
||||
// the signal after the key or button of the Tone is pressed. a single lever for both tones, without
|
||||
// separate buttons for them, can't sound both tones at once
|
||||
int pressed(int Signal, int Tone, bool Singlelever);
|
||||
// the signal after the key or button of the Tone is released
|
||||
int released(int Signal, int Tone);
|
||||
|
||||
} // namespace horn
|
||||
Reference in New Issue
Block a user