mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
@@ -363,7 +363,7 @@ enum class TBrakeSystem { Individual, Pneumatic, ElectroPneumatic };
|
||||
/*podtypy hamulcow zespolonych*/
|
||||
enum class TBrakeSubSystem { ss_None, ss_W, ss_K, ss_KK, ss_Hik, ss_ESt, ss_KE, ss_LSt, ss_MT, ss_Dako };
|
||||
enum class TBrakeValve { NoValve, W, W_Lu_VI, W_Lu_L, W_Lu_XR, K, Kg, Kp, Kss, Kkg, Kkp, Kks, Hikg1, Hikss, Hikp1, KE, SW, EStED, NESt3, ESt3, LSt, ESt4, ESt3AL2, EP1, EP2, M483, CV1_L_TR, CV1, CV1_R, Other };
|
||||
enum class TBrakeHandle { NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113, MHZ_P, MHZ_T, MHZ_EN57, MHZ_K5P };
|
||||
enum class TBrakeHandle { NoHandle, West, FV4a, M394, M254, FVel1, FVel6, D2, Knorr, FD1, BS2, testH, St113, MHZ_P, MHZ_T, MHZ_EN57, MHZ_K5P, MHZ_K8P };
|
||||
/*typy hamulcow indywidualnych*/
|
||||
enum class TLocalBrake { NoBrake, ManualBrake, PneumaticBrake, HydraulicBrake };
|
||||
/*dla osob/towar: opoznienie hamowania/odhamowania*/
|
||||
|
||||
@@ -8223,6 +8223,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
||||
{ "D2", TBrakeHandle::D2 },
|
||||
{ "MHZ_EN57", TBrakeHandle::MHZ_EN57 },
|
||||
{ "MHZ_K5P", TBrakeHandle::MHZ_K5P },
|
||||
{ "MHZ_K8P", TBrakeHandle::MHZ_K8P },
|
||||
{ "M394", TBrakeHandle::M394 },
|
||||
{ "Knorr", TBrakeHandle::Knorr },
|
||||
{ "Westinghouse", TBrakeHandle::West },
|
||||
@@ -9013,6 +9014,7 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
|
||||
Handle = std::make_shared<TFV4aM>();
|
||||
break;
|
||||
case TBrakeHandle::MHZ_EN57:
|
||||
case TBrakeHandle::MHZ_K8P:
|
||||
Handle = std::make_shared<TMHZ_EN57>();
|
||||
break;
|
||||
case TBrakeHandle::FVel6:
|
||||
|
||||
28
Train.cpp
28
Train.cpp
@@ -745,6 +745,9 @@ void TTrain::OnCommand_aidriverdisable( TTrain *Train, command_data const &Comma
|
||||
}
|
||||
}
|
||||
|
||||
auto const EU07_CONTROLLER_BASERETURNDELAY { 0.5f };
|
||||
auto const EU07_CONTROLLER_KEYBOARDETURNDELAY { 1.5f };
|
||||
|
||||
void TTrain::OnCommand_mastercontrollerincrease( TTrain *Train, command_data const &Command ) {
|
||||
|
||||
if( Command.action != GLFW_RELEASE ) {
|
||||
@@ -755,6 +758,7 @@ void TTrain::OnCommand_mastercontrollerincrease( TTrain *Train, command_data con
|
||||
else if (Command.action == GLFW_RELEASE) {
|
||||
// release
|
||||
Train->m_mastercontrollerinuse = false;
|
||||
Train->m_mastercontrollerreturndelay = EU07_CONTROLLER_KEYBOARDETURNDELAY + EU07_CONTROLLER_BASERETURNDELAY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -776,6 +780,7 @@ void TTrain::OnCommand_mastercontrollerdecrease( TTrain *Train, command_data con
|
||||
else if (Command.action == GLFW_RELEASE) {
|
||||
// release
|
||||
Train->m_mastercontrollerinuse = false;
|
||||
Train->m_mastercontrollerreturndelay = EU07_CONTROLLER_KEYBOARDETURNDELAY + EU07_CONTROLLER_BASERETURNDELAY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,6 +802,7 @@ void TTrain::OnCommand_mastercontrollerset( TTrain *Train, command_data const &C
|
||||
else {
|
||||
// release
|
||||
Train->m_mastercontrollerinuse = false;
|
||||
Train->m_mastercontrollerreturndelay = EU07_CONTROLLER_BASERETURNDELAY; // NOTE: keyboard return delay is omitted for other input sources
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,7 +811,7 @@ void TTrain::OnCommand_secondcontrollerincrease( TTrain *Train, command_data con
|
||||
if( Command.action != GLFW_RELEASE ) {
|
||||
// on press or hold
|
||||
if( ( Train->mvControlled->EngineType == TEngineType::DieselElectric )
|
||||
&& ( true == Train->mvControlled->ShuntMode ) ) {
|
||||
&& ( true == Train->mvControlled->ShuntMode ) ) {
|
||||
Train->mvControlled->AnPos = clamp(
|
||||
Train->mvControlled->AnPos + 0.025,
|
||||
0.0, 1.0 );
|
||||
@@ -3697,7 +3703,7 @@ void TTrain::OnCommand_redmarkerstoggle( TTrain *Train, command_data const &Comm
|
||||
int const CouplNr {
|
||||
clamp(
|
||||
vehicle->DirectionGet()
|
||||
* ( LengthSquared3( vehicle->HeadPosition() - Global.pCamera.Pos ) > LengthSquared3( vehicle->RearPosition() - Global.pCamera.Pos ) ?
|
||||
* ( Math3D::LengthSquared3( vehicle->HeadPosition() - Global.pCamera.Pos ) > Math3D::LengthSquared3( vehicle->RearPosition() - Global.pCamera.Pos ) ?
|
||||
1 :
|
||||
-1 ),
|
||||
0, 1 ) }; // z [-1,1] zrobić [0,1]
|
||||
@@ -3723,7 +3729,7 @@ void TTrain::OnCommand_endsignalstoggle( TTrain *Train, command_data const &Comm
|
||||
int const CouplNr {
|
||||
clamp(
|
||||
vehicle->DirectionGet()
|
||||
* ( LengthSquared3( vehicle->HeadPosition() - Global.pCamera.Pos ) > LengthSquared3( vehicle->RearPosition() - Global.pCamera.Pos ) ?
|
||||
* ( Math3D::LengthSquared3( vehicle->HeadPosition() - Global.pCamera.Pos ) > Math3D::LengthSquared3( vehicle->RearPosition() - Global.pCamera.Pos ) ?
|
||||
1 :
|
||||
-1 ),
|
||||
0, 1 ) }; // z [-1,1] zrobić [0,1]
|
||||
@@ -4877,12 +4883,16 @@ bool TTrain::Update( double const Deltatime )
|
||||
|| ( input::command == user_command::mastercontrollerdecrease ) ) ) {
|
||||
*/
|
||||
if( false == m_mastercontrollerinuse ) {
|
||||
if( mvOccupied->MainCtrlPos > mvOccupied->MainCtrlActualPos ) {
|
||||
mvOccupied->DecMainCtrl( 1 );
|
||||
}
|
||||
else if( mvOccupied->MainCtrlPos < mvOccupied->MainCtrlActualPos ) {
|
||||
// Ra 15-01: a to nie miało być tylko cofanie?
|
||||
mvOccupied->IncMainCtrl( 1 );
|
||||
m_mastercontrollerreturndelay -= Deltatime;
|
||||
if( m_mastercontrollerreturndelay < 0.f ) {
|
||||
m_mastercontrollerreturndelay = EU07_CONTROLLER_BASERETURNDELAY;
|
||||
if( mvOccupied->MainCtrlPos > mvOccupied->MainCtrlActualPos ) {
|
||||
mvOccupied->DecMainCtrl( 1 );
|
||||
}
|
||||
else if( mvOccupied->MainCtrlPos < mvOccupied->MainCtrlActualPos ) {
|
||||
// Ra 15-01: a to nie miało być tylko cofanie?
|
||||
mvOccupied->IncMainCtrl( 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
Train.h
1
Train.h
@@ -645,6 +645,7 @@ private:
|
||||
// McZapkie: do syczenia
|
||||
float fPPress, fNPress;
|
||||
bool m_mastercontrollerinuse { false };
|
||||
float m_mastercontrollerreturndelay { 0.f };
|
||||
int iRadioChannel { 1 }; // numer aktualnego kana?u radiowego
|
||||
std::vector<std::pair<std::string, texture_handle>> m_screens;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user