mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 07:39:19 +02:00
Fixed BrakeHandle type MHZ_EN57 and brake operation mode selector
This commit is contained in:
committed by
tmj-fstate
parent
bb87a63eed
commit
fc1f57a5d4
@@ -3025,7 +3025,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
||||
}
|
||||
|
||||
auto FzadED { 0.0 };
|
||||
if( ( MoverParameters->EpFuse )
|
||||
if( ( MoverParameters->EpFuse && (MoverParameters->BrakeHandle != MHZ_EN57))
|
||||
|| ( ( MoverParameters->BrakeHandle == MHZ_EN57 )
|
||||
&& ( MoverParameters->BrakeOpModeFlag & bom_MED ) ) ) {
|
||||
FzadED = std::min( Fzad, FmaxED );
|
||||
|
||||
36
Train.cpp
36
Train.cpp
@@ -193,6 +193,8 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
|
||||
{ user_command::wheelspinbrakeactivate, &TTrain::OnCommand_wheelspinbrakeactivate },
|
||||
{ user_command::sandboxactivate, &TTrain::OnCommand_sandboxactivate },
|
||||
{ user_command::epbrakecontroltoggle, &TTrain::OnCommand_epbrakecontroltoggle },
|
||||
{ user_command::brakeoperationmodeincrease, &TTrain::OnCommand_brakeoperationmodeincrease },
|
||||
{ user_command::brakeoperationmodedecrease, &TTrain::OnCommand_brakeoperationmodedecrease },
|
||||
{ user_command::brakeactingspeedincrease, &TTrain::OnCommand_brakeactingspeedincrease },
|
||||
{ user_command::brakeactingspeeddecrease, &TTrain::OnCommand_brakeactingspeeddecrease },
|
||||
{ user_command::brakeactingspeedsetcargo, &TTrain::OnCommand_brakeactingspeedsetcargo },
|
||||
@@ -1264,6 +1266,40 @@ void TTrain::OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &
|
||||
}
|
||||
}
|
||||
|
||||
void TTrain::OnCommand_brakeoperationmodeincrease(TTrain *Train, command_data const &Command) {
|
||||
|
||||
if (Command.action == GLFW_PRESS) {
|
||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||
if (0 < (Train->mvOccupied->BrakeOpModeFlag * 2) & Train->mvOccupied->BrakeOpModes) {
|
||||
// next mode
|
||||
Train->mvOccupied->BrakeOpModeFlag *= 2;
|
||||
// audio feedback
|
||||
Train->dsbPneumaticSwitch.play();
|
||||
// visual feedback
|
||||
// NOTE: there's no button for brake operation mode switch
|
||||
// TBD, TODO: add brake operation mode switch?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TTrain::OnCommand_brakeoperationmodedecrease(TTrain *Train, command_data const &Command) {
|
||||
|
||||
if (Command.action == GLFW_PRESS) {
|
||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||
if (0 < (Train->mvOccupied->BrakeOpModeFlag / 2) & Train->mvOccupied->BrakeOpModes) {
|
||||
// previous mode
|
||||
Train->mvOccupied->BrakeOpModeFlag /= 2;
|
||||
// audio feedback
|
||||
Train->dsbPneumaticSwitch.play();
|
||||
// visual feedback
|
||||
// NOTE: there's no button for brake operation mode switch
|
||||
// TBD, TODO: add brake operation mode switch?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TTrain::OnCommand_brakeactingspeedincrease( TTrain *Train, command_data const &Command ) {
|
||||
|
||||
if( Command.action == GLFW_PRESS ) {
|
||||
|
||||
2
Train.h
2
Train.h
@@ -184,6 +184,8 @@ class TTrain
|
||||
static void OnCommand_wheelspinbrakeactivate( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_sandboxactivate( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_brakeoperationmodeincrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_brakeoperationmodedecrease(TTrain *Train, command_data const &Command);
|
||||
static void OnCommand_brakeactingspeedincrease( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_brakeactingspeeddecrease( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_brakeactingspeedsetcargo( TTrain *Train, command_data const &Command );
|
||||
|
||||
@@ -102,6 +102,8 @@ commanddescription_sequence Commands_descriptions = {
|
||||
{ "motoroverloadrelayreset", command_target::vehicle },
|
||||
{ "notchingrelaytoggle", command_target::vehicle },
|
||||
{ "epbrakecontroltoggle", command_target::vehicle },
|
||||
{ "brakeoperationmodeincrease", command_target::vehicle },
|
||||
{ "brakeoperationmodedecrease", command_target::vehicle },
|
||||
{ "brakeactingspeedincrease", command_target::vehicle },
|
||||
{ "brakeactingspeeddecrease", command_target::vehicle },
|
||||
{ "brakeactingspeedsetcargo", command_target::vehicle },
|
||||
|
||||
@@ -96,6 +96,8 @@ enum class user_command {
|
||||
motoroverloadrelayreset,
|
||||
notchingrelaytoggle,
|
||||
epbrakecontroltoggle,
|
||||
brakeoperationmodeincrease,
|
||||
brakeoperationmodedecrease,
|
||||
brakeactingspeedincrease,
|
||||
brakeactingspeeddecrease,
|
||||
brakeactingspeedsetcargo,
|
||||
|
||||
@@ -333,6 +333,10 @@ keyboard_input::default_bindings() {
|
||||
{ GLFW_KEY_G },
|
||||
// epbrakecontroltoggle
|
||||
{ GLFW_KEY_Z | keymodifier::control },
|
||||
// brakeoperationmodeincrease
|
||||
{ GLFW_KEY_L | keymodifier::shift },
|
||||
// brakeoperationmodedecrease
|
||||
{ GLFW_KEY_L},
|
||||
// brakeactingspeedincrease
|
||||
{ GLFW_KEY_B | keymodifier::shift },
|
||||
// brakeactingspeeddecrease
|
||||
|
||||
Reference in New Issue
Block a user