16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 09:59:18 +02:00

3d model-related log message filtering, diesel electric engine force calculation tweak, minor bug fixes

This commit is contained in:
tmj-fstate
2018-01-17 01:48:20 +01:00
parent 88c19b2817
commit 4dfe32f34b
14 changed files with 139 additions and 129 deletions

View File

@@ -546,17 +546,17 @@ bool TTrain::is_eztoer() const {
}
// moves train brake lever to specified position, potentially emits switch sound if conditions are met
void TTrain::set_train_brake( int const Position ) {
void TTrain::set_train_brake( double const Position ) {
auto const originalbrakeposition { mvOccupied->BrakeCtrlPos };
auto const originalbrakeposition { static_cast<int>( 100.0 * mvOccupied->fBrakeCtrlPos ) };
mvOccupied->BrakeLevelSet( Position );
if( mvOccupied->BrakeCtrlPos == originalbrakeposition ) { return; }
if( static_cast<int>( 100.0 * mvOccupied->fBrakeCtrlPos ) == originalbrakeposition ) { return; }
if( ( true == is_eztoer() )
&& ( false == (
( ( originalbrakeposition == 0 ) || ( originalbrakeposition >= 5 ) )
( ( originalbrakeposition / 100 == 0 ) || ( originalbrakeposition / 100 >= 5 ) )
&& ( ( mvOccupied->BrakeCtrlPos == 0 ) || ( mvOccupied->BrakeCtrlPos >= 5 ) ) ) ) ) {
// sound feedback if the lever movement activates one of the switches
dsbPneumaticSwitch.play();