mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
Added automatic sanding allowance switch
This commit is contained in:
committed by
tmj-fstate
parent
b6ca21d280
commit
12a95fc423
@@ -1491,9 +1491,10 @@ public:
|
|||||||
|
|
||||||
bool AddPulseForce(int Multipler);/*dla drezyny*/
|
bool AddPulseForce(int Multipler);/*dla drezyny*/
|
||||||
|
|
||||||
bool SandboxManual( bool const State, range_t const Notify = range_t::consist );/*wlacza/wylacza sypanie piasku*/
|
bool SandboxManual( bool const State, range_t const Notify = range_t::consist );/*wlacza/wylacza reczne sypanie piasku*/
|
||||||
bool SandboxAuto( bool const State, range_t const Notify = range_t::consist );/*wlacza/wylacza sypanie piasku*/
|
bool SandboxAuto( bool const State, range_t const Notify = range_t::consist );/*wlacza/wylacza automatyczne sypanie piasku*/
|
||||||
bool Sandbox( bool const State, range_t const Notify = range_t::consist );/*wlacza/wylacza sypanie piasku*/
|
bool Sandbox( bool const State, range_t const Notify = range_t::consist );/*wlacza/wylacza sypanie piasku*/
|
||||||
|
bool SandboxAutoAllow(bool const State);/*wlacza/wylacza zezwolenie na automatyczne sypanie piasku*/
|
||||||
|
|
||||||
/*! zbijanie czuwaka/SHP*/
|
/*! zbijanie czuwaka/SHP*/
|
||||||
void SSReset(void);
|
void SSReset(void);
|
||||||
|
|||||||
@@ -2441,6 +2441,24 @@ bool TMoverParameters::Sandbox( bool const State, range_t const Notify )
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *************************************************************************************************
|
||||||
|
// yB: 20190909
|
||||||
|
// włączenie / wyłączenie automatycznej piasecznicy
|
||||||
|
// *************************************************************************************************
|
||||||
|
bool TMoverParameters::SandboxAutoAllow(bool State)
|
||||||
|
{
|
||||||
|
//SendCtrlToNext("SandboxAutoAllow", int(State), CabNo, ctrain_controll);
|
||||||
|
|
||||||
|
if (SandDoseAutoAllow != State)
|
||||||
|
{
|
||||||
|
SandDoseAutoAllow = State;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void TMoverParameters::SSReset(void)
|
void TMoverParameters::SSReset(void)
|
||||||
{ // funkcja pomocnicza dla SecuritySystemReset - w Delphi Reset()
|
{ // funkcja pomocnicza dla SecuritySystemReset - w Delphi Reset()
|
||||||
SecuritySystem.SystemTimer = 0;
|
SecuritySystem.SystemTimer = 0;
|
||||||
|
|||||||
32
Train.cpp
32
Train.cpp
@@ -1447,6 +1447,37 @@ void TTrain::OnCommand_sandboxactivate( TTrain *Train, command_data const &Comma
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_autosandboxtoggle(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 (false == Train->mvOccupied->SandDoseAutoAllow) {
|
||||||
|
// turn on
|
||||||
|
OnCommand_autosandboxactivate(Train, Command);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//turn off
|
||||||
|
OnCommand_autosandboxdeactivate(Train, Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void TTrain::OnCommand_autosandboxactivate(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
|
||||||
|
Train->mvOccupied->SandboxAutoAllow(true);
|
||||||
|
Train->ggAutoSandAllow.UpdateValue(1.0, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void TTrain::OnCommand_autosandboxdeactivate(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
|
||||||
|
Train->mvOccupied->SandboxAutoAllow(false);
|
||||||
|
Train->ggAutoSandAllow.UpdateValue(0.0, Train->dsbSwitch);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void TTrain::OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
if( Command.action == GLFW_PRESS ) {
|
if( Command.action == GLFW_PRESS ) {
|
||||||
@@ -8122,6 +8153,7 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
|||||||
{ "security_reset_bt:", ggSecurityResetButton },
|
{ "security_reset_bt:", ggSecurityResetButton },
|
||||||
{ "releaser_bt:", ggReleaserButton },
|
{ "releaser_bt:", ggReleaserButton },
|
||||||
{ "sand_bt:", ggSandButton },
|
{ "sand_bt:", ggSandButton },
|
||||||
|
{ "autosandallow_sw:", ggAutoSandAllow },
|
||||||
{ "antislip_bt:", ggAntiSlipButton },
|
{ "antislip_bt:", ggAntiSlipButton },
|
||||||
{ "horn_bt:", ggHornButton },
|
{ "horn_bt:", ggHornButton },
|
||||||
{ "hornlow_bt:", ggHornLowButton },
|
{ "hornlow_bt:", ggHornLowButton },
|
||||||
|
|||||||
4
Train.h
4
Train.h
@@ -200,6 +200,9 @@ class TTrain {
|
|||||||
static void OnCommand_alarmchaintoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_alarmchaintoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_wheelspinbrakeactivate( TTrain *Train, command_data const &Command );
|
static void OnCommand_wheelspinbrakeactivate( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_sandboxactivate( TTrain *Train, command_data const &Command );
|
static void OnCommand_sandboxactivate( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_autosandboxtoggle(TTrain *Train, command_data const &Command);
|
||||||
|
static void OnCommand_autosandboxactivate(TTrain *Train, command_data const &Command);
|
||||||
|
static void OnCommand_autosandboxdeactivate(TTrain *Train, command_data const &Command);
|
||||||
static void OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_epbrakecontroltoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_trainbrakeoperationmodeincrease(TTrain *Train, command_data const &Command);
|
static void OnCommand_trainbrakeoperationmodeincrease(TTrain *Train, command_data const &Command);
|
||||||
static void OnCommand_trainbrakeoperationmodedecrease(TTrain *Train, command_data const &Command);
|
static void OnCommand_trainbrakeoperationmodedecrease(TTrain *Train, command_data const &Command);
|
||||||
@@ -413,6 +416,7 @@ public: // reszta może by?publiczna
|
|||||||
TGauge ggSecurityResetButton;
|
TGauge ggSecurityResetButton;
|
||||||
TGauge ggReleaserButton;
|
TGauge ggReleaserButton;
|
||||||
TGauge ggSandButton; // guzik piasecznicy
|
TGauge ggSandButton; // guzik piasecznicy
|
||||||
|
TGauge ggAutoSandAllow; // przełącznik piasecznicy
|
||||||
TGauge ggAntiSlipButton;
|
TGauge ggAntiSlipButton;
|
||||||
TGauge ggFuseButton;
|
TGauge ggFuseButton;
|
||||||
TGauge ggConverterFuseButton; // hunter-261211: przycisk odblokowania nadmiarowego przetwornic i ogrzewania
|
TGauge ggConverterFuseButton; // hunter-261211: przycisk odblokowania nadmiarowego przetwornic i ogrzewania
|
||||||
|
|||||||
Reference in New Issue
Block a user