16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 11:29:18 +02:00

Merge branch 'gfx-work' into sim

This commit is contained in:
milek7
2019-03-23 12:47:20 +01:00
16 changed files with 566 additions and 192 deletions

View File

@@ -462,6 +462,7 @@ dictionary_source *TTrain::GetTrainState() {
dict->insert( "main_ctrl_actual_pos", mover->MainCtrlActualPos );
dict->insert( "scndctrl_pos", mover->ScndCtrlPos );
dict->insert( "scnd_ctrl_actual_pos", mover->ScndCtrlActualPos );
dict->insert( "new_speed", mover->NewSpeed);
// brakes
dict->insert( "manual_brake", ( mvOccupied->ManualBrakePos > 0 ) );
bool const bEP = ( mvControlled->LocHandle->GetCP() > 0.2 ) || ( fEIMParams[ 0 ][ 2 ] > 0.01 );
@@ -789,8 +790,8 @@ void TTrain::OnCommand_jointcontrollerset( TTrain *Train, command_data const &Co
clamp(
1.0 - ( Command.param1 * 2 ),
0.0, 1.0 ) );
if( Train->mvControlled->MainCtrlPos > 0 ) {
Train->set_master_controller( 0 );
if( Train->mvControlled->MainCtrlPowerPos() > 0 ) {
Train->set_master_controller( Train->mvControlled->MainCtrlNoPowerPos() );
}
}
}
@@ -846,7 +847,7 @@ void TTrain::OnCommand_mastercontrollerdecrease( TTrain *Train, command_data con
if( Command.action != GLFW_RELEASE ) {
// on press or hold
if( ( Train->ggJointCtrl.SubModel != nullptr )
&& ( Train->mvControlled->MainCtrlPos == 0 ) ) {
&& ( Train->mvControlled->IsMainCtrlNoPowerPos() ) ) {
OnCommand_independentbrakeincrease( Train, Command );
}
else {
@@ -866,7 +867,7 @@ void TTrain::OnCommand_mastercontrollerdecreasefast( TTrain *Train, command_data
if( Command.action != GLFW_RELEASE ) {
// on press or hold
if( ( Train->ggJointCtrl.SubModel != nullptr )
&& ( Train->mvControlled->MainCtrlPos == 0 ) ) {
&& ( Train->mvControlled->IsMainCtrlNoPowerPos() ) ) {
OnCommand_independentbrakeincreasefast( Train, Command );
}
else {
@@ -5521,7 +5522,12 @@ bool TTrain::Update( double const Deltatime )
}
if (ggIgnitionKey.SubModel)
{
ggIgnitionKey.UpdateValue(mvControlled->dizel_startup);
ggIgnitionKey.UpdateValue(
( mvControlled->Mains )
|| ( mvControlled->dizel_startup )
|| ( fMainRelayTimer > 0.f )
|| ( ggMainButton.GetDesiredValue() > 0.95 )
|| ( ggMainOnButton.GetDesiredValue() > 0.95 ) );
ggIgnitionKey.Update();
}
}
@@ -5719,6 +5725,7 @@ bool TTrain::Update( double const Deltatime )
// others
btLampkaMalfunction.Turn( mvControlled->dizel_heat.PA );
btLampkaMotorBlowers.Turn( ( mvControlled->MotorBlowers[ end::front ].is_active ) && ( mvControlled->MotorBlowers[ end::rear ].is_active ) );
btLampkaCoolingFans.Turn( mvControlled->RventRot > 1.0 );
// universal devices state indicators
for( auto idx = 0; idx < btUniversals.size(); ++idx ) {
btUniversals[ idx ].Turn( ggUniversals[ idx ].GetValue() > 0.5 );
@@ -5779,6 +5786,7 @@ bool TTrain::Update( double const Deltatime )
// others
btLampkaMalfunction.Turn( false );
btLampkaMotorBlowers.Turn( false );
btLampkaCoolingFans.Turn( false );
// universal devices state indicators
for( auto &universal : btUniversals ) {
universal.Turn( false );
@@ -7535,6 +7543,7 @@ void TTrain::clear_cab_controls()
btLampkaMalfunction.Clear();
btLampkaMalfunctionB.Clear();
btLampkaMotorBlowers.Clear();
btLampkaCoolingFans.Clear();
ggLeftLightButton.Clear();
ggRightLightButton.Clear();
@@ -7879,6 +7888,7 @@ bool TTrain::initialize_button(cParser &Parser, std::string const &Label, int co
{ "i-highcurrent:", btLampkaWysRozr },
{ "i-vent_trim:", btLampkaWentZaluzje },
{ "i-motorblowers:", btLampkaMotorBlowers },
{ "i-coolingfans:", btLampkaCoolingFans },
{ "i-trainheating:", btLampkaOgrzewanieSkladu },
{ "i-security_aware:", btLampkaCzuwaka },
{ "i-security_cabsignal:", btLampkaSHP },