mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 22:09:19 +02:00
experimental et42 uart dynamic brake fix
This commit is contained in:
@@ -1289,7 +1289,7 @@ public:
|
|||||||
/*! pomocniczy nastawnik:*/
|
/*! pomocniczy nastawnik:*/
|
||||||
bool IncScndCtrl(int CtrlSpeed);
|
bool IncScndCtrl(int CtrlSpeed);
|
||||||
bool DecScndCtrl(int CtrlSpeed);
|
bool DecScndCtrl(int CtrlSpeed);
|
||||||
|
int GetVirtualScndPos();
|
||||||
|
|
||||||
bool AddPulseForce(int Multipler);/*dla drezyny*/
|
bool AddPulseForce(int Multipler);/*dla drezyny*/
|
||||||
|
|
||||||
|
|||||||
@@ -2064,6 +2064,16 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TMoverParameters::GetVirtualScndPos()
|
||||||
|
{
|
||||||
|
if (TrainType == dt_ET42)
|
||||||
|
{
|
||||||
|
if (DynamicBrakeFlag && !ScndCtrlPos)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return ScndCtrlPos;
|
||||||
|
}
|
||||||
|
|
||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
// Q: 20160710
|
// Q: 20160710
|
||||||
// załączenie rozrządu
|
// załączenie rozrządu
|
||||||
|
|||||||
@@ -898,14 +898,13 @@ void TTrain::OnCommand_secondcontrollerdecreasefast( TTrain *Train, command_data
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_secondcontrollerset( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_secondcontrollerset( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
auto const targetposition { std::min<int>( Command.param1, Train->mvControlled->ScndCtrlPosNo ) };
|
auto const targetposition { std::min<int>( Command.param1, Train->mvControlled->ScndCtrlPosNo ) };
|
||||||
while( ( targetposition < Train->mvControlled->ScndCtrlPos )
|
while( ( targetposition < Train->mvControlled->GetVirtualScndPos() )
|
||||||
&& ( true == Train->mvControlled->DecScndCtrl( 1 ) ) ) {
|
&& ( true == Train->mvControlled->DecScndCtrl( 1 ) ) ) {
|
||||||
// all work is done in the header
|
// all work is done in the header
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
while( ( targetposition > Train->mvControlled->ScndCtrlPos )
|
while( ( targetposition > Train->mvControlled->GetVirtualScndPos() )
|
||||||
&& ( true == Train->mvControlled->IncScndCtrl( 1 ) ) ) {
|
&& ( true == Train->mvControlled->IncScndCtrl( 1 ) ) ) {
|
||||||
// all work is done in the header
|
// all work is done in the header
|
||||||
;
|
;
|
||||||
|
|||||||
2
uart.cpp
2
uart.cpp
@@ -197,7 +197,7 @@ void uart_input::poll()
|
|||||||
// second controller
|
// second controller
|
||||||
relay.post(
|
relay.post(
|
||||||
user_command::secondcontrollerset,
|
user_command::secondcontrollerset,
|
||||||
buffer[ 7 ],
|
static_cast<int8_t>(buffer[ 7 ]),
|
||||||
0,
|
0,
|
||||||
GLFW_PRESS,
|
GLFW_PRESS,
|
||||||
// TODO: pass correct entity id once the missing systems are in place
|
// TODO: pass correct entity id once the missing systems are in place
|
||||||
|
|||||||
Reference in New Issue
Block a user