mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 04:47:06 +01:00
refactor(physics): the positions of the brake handles are private to the brakes
The positions of the driver's brake valve (stepped, continuous, and of the
FV4a with its cap), of the independent brake and of its EP counterpart in
units with induction motors, and of the hand brake are private to
physics::Braking: read through HandlePosition(), IndependentPosition(), ...
and moved through SetHandlePosition(), SetIndependentPosition(), ..., by the
vehicle's own stepping as by the cab, the AI and the consist braking. The
gauges of the cab bind to them read-only.
No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
@@ -73,7 +73,7 @@ mouse_slider::bind( user_command const &Command ) {
|
||||
+ 0.5 * ( vehicle->CoupledCtrl ?
|
||||
vehicle->MainCtrlPos() + vehicle->ScndCtrlPos() :
|
||||
vehicle->MainCtrlPos() ) / powerrange
|
||||
- 0.5 * occupied->brakes.independentPosition;
|
||||
- 0.5 * occupied->brakes.IndependentPosition();
|
||||
m_analogue = true;
|
||||
m_invertrange = false;
|
||||
break;
|
||||
@@ -94,14 +94,14 @@ mouse_slider::bind( user_command const &Command ) {
|
||||
}
|
||||
case user_command::trainbrakeset: {
|
||||
m_valuerange = 1.0;
|
||||
m_value = ( vehicle->brakes.handlePositionSmooth - vehicle->brakes.driverValve->GetPos( bh_MIN ) ) / ( vehicle->brakes.driverValve->GetPos( bh_MAX ) - vehicle->brakes.driverValve->GetPos( bh_MIN ) );
|
||||
m_value = ( vehicle->brakes.HandlePositionSmooth() - vehicle->brakes.driverValve->GetPos( bh_MIN ) ) / ( vehicle->brakes.driverValve->GetPos( bh_MAX ) - vehicle->brakes.driverValve->GetPos( bh_MIN ) );
|
||||
m_analogue = true;
|
||||
m_invertrange = true;
|
||||
break;
|
||||
}
|
||||
case user_command::independentbrakeset: {
|
||||
m_valuerange = 1.0;
|
||||
m_value = vehicle->brakes.independentPosition;
|
||||
m_value = vehicle->brakes.IndependentPosition();
|
||||
m_analogue = true;
|
||||
m_invertrange = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user