16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 12:49:18 +02:00

Merge branch 'tmj-dev' into milek-dev

This commit is contained in:
milek7
2018-12-09 23:19:36 +01:00
5 changed files with 24 additions and 11 deletions

View File

@@ -363,7 +363,7 @@ enum class TBrakeSystem { Individual, Pneumatic, ElectroPneumatic };
/*podtypy hamulcow zespolonych*/ /*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 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 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*/ /*typy hamulcow indywidualnych*/
enum class TLocalBrake { NoBrake, ManualBrake, PneumaticBrake, HydraulicBrake }; enum class TLocalBrake { NoBrake, ManualBrake, PneumaticBrake, HydraulicBrake };
/*dla osob/towar: opoznienie hamowania/odhamowania*/ /*dla osob/towar: opoznienie hamowania/odhamowania*/

View File

@@ -8223,6 +8223,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
{ "D2", TBrakeHandle::D2 }, { "D2", TBrakeHandle::D2 },
{ "MHZ_EN57", TBrakeHandle::MHZ_EN57 }, { "MHZ_EN57", TBrakeHandle::MHZ_EN57 },
{ "MHZ_K5P", TBrakeHandle::MHZ_K5P }, { "MHZ_K5P", TBrakeHandle::MHZ_K5P },
{ "MHZ_K8P", TBrakeHandle::MHZ_K8P },
{ "M394", TBrakeHandle::M394 }, { "M394", TBrakeHandle::M394 },
{ "Knorr", TBrakeHandle::Knorr }, { "Knorr", TBrakeHandle::Knorr },
{ "Westinghouse", TBrakeHandle::West }, { "Westinghouse", TBrakeHandle::West },
@@ -9013,6 +9014,7 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
Handle = std::make_shared<TFV4aM>(); Handle = std::make_shared<TFV4aM>();
break; break;
case TBrakeHandle::MHZ_EN57: case TBrakeHandle::MHZ_EN57:
case TBrakeHandle::MHZ_K8P:
Handle = std::make_shared<TMHZ_EN57>(); Handle = std::make_shared<TMHZ_EN57>();
break; break;
case TBrakeHandle::FVel6: case TBrakeHandle::FVel6:

View File

@@ -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 ) { void TTrain::OnCommand_mastercontrollerincrease( TTrain *Train, command_data const &Command ) {
if( Command.action != GLFW_RELEASE ) { if( Command.action != GLFW_RELEASE ) {
@@ -755,6 +758,7 @@ void TTrain::OnCommand_mastercontrollerincrease( TTrain *Train, command_data con
else if (Command.action == GLFW_RELEASE) { else if (Command.action == GLFW_RELEASE) {
// release // release
Train->m_mastercontrollerinuse = false; 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) { else if (Command.action == GLFW_RELEASE) {
// release // release
Train->m_mastercontrollerinuse = false; 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 { else {
// release // release
Train->m_mastercontrollerinuse = false; Train->m_mastercontrollerinuse = false;
Train->m_mastercontrollerreturndelay = EU07_CONTROLLER_BASERETURNDELAY; // NOTE: keyboard return delay is omitted for other input sources
} }
} }
@@ -3697,7 +3703,7 @@ void TTrain::OnCommand_redmarkerstoggle( TTrain *Train, command_data const &Comm
int const CouplNr { int const CouplNr {
clamp( clamp(
vehicle->DirectionGet() 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 :
-1 ), -1 ),
0, 1 ) }; // z [-1,1] zrobić [0,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 { int const CouplNr {
clamp( clamp(
vehicle->DirectionGet() 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 :
-1 ), -1 ),
0, 1 ) }; // z [-1,1] zrobić [0,1] 0, 1 ) }; // z [-1,1] zrobić [0,1]
@@ -4877,6 +4883,9 @@ bool TTrain::Update( double const Deltatime )
|| ( input::command == user_command::mastercontrollerdecrease ) ) ) { || ( input::command == user_command::mastercontrollerdecrease ) ) ) {
*/ */
if( false == m_mastercontrollerinuse ) { if( false == m_mastercontrollerinuse ) {
m_mastercontrollerreturndelay -= Deltatime;
if( m_mastercontrollerreturndelay < 0.f ) {
m_mastercontrollerreturndelay = EU07_CONTROLLER_BASERETURNDELAY;
if( mvOccupied->MainCtrlPos > mvOccupied->MainCtrlActualPos ) { if( mvOccupied->MainCtrlPos > mvOccupied->MainCtrlActualPos ) {
mvOccupied->DecMainCtrl( 1 ); mvOccupied->DecMainCtrl( 1 );
} }
@@ -4887,6 +4896,7 @@ bool TTrain::Update( double const Deltatime )
} }
} }
} }
}
// McZapkie: predkosc wyswietlana na tachometrze brana jest z obrotow kol // McZapkie: predkosc wyswietlana na tachometrze brana jest z obrotow kol
auto const maxtacho { 3.0 }; auto const maxtacho { 3.0 };

View File

@@ -645,6 +645,7 @@ private:
// McZapkie: do syczenia // McZapkie: do syczenia
float fPPress, fNPress; float fPPress, fNPress;
bool m_mastercontrollerinuse { false }; bool m_mastercontrollerinuse { false };
float m_mastercontrollerreturndelay { 0.f };
int iRadioChannel { 1 }; // numer aktualnego kana?u radiowego int iRadioChannel { 1 }; // numer aktualnego kana?u radiowego
std::vector<std::pair<std::string, texture_handle>> m_screens; std::vector<std::pair<std::string, texture_handle>> m_screens;

View File

@@ -1 +1 @@
#define VERSION_INFO "M7 03.12.2018, based on tmj-3fbf5bf8" #define VERSION_INFO "M7 09.12.2018, based on tmj-57327f96"