16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 14:49:19 +02:00

First attempt of driver's helper - commands sound for braking

This commit is contained in:
Królik Uszasty
2018-09-09 15:14:20 +02:00
committed by tmj-fstate
parent e16dedfd27
commit bfb12981f5
3 changed files with 23 additions and 0 deletions

View File

@@ -5154,6 +5154,24 @@ TController::UpdateSituation(double dt) {
( mvControlling->CategoryFlag == 2 ? -2.0 : -0.9 ),
( mvControlling->CategoryFlag == 2 ? 2.0 : 0.9 ) );
if ((-AccDesired > fBrake_a0[0] + 8 * fBrake_a1[0]) && (HelperState == 0))
{
HelperState = 1;
}
if ((-AccDesired > fBrake_a0[0] + 12 * fBrake_a1[0]) && (HelperState == 1))
{
HelperState = 2;
}
if ((-AccDesired > 0) && (HelperState == 2) && (-ActualProximityDist > 5))
{
HelperState = 3;
}
if ((-AccDesired < fBrake_a0[0] + 2 * fBrake_a1[0]) && (HelperState > 0) && (vel>1))
{
HelperState = 0;
}
if (AIControllFlag) {
// część wykonawcza tylko dla AI, dla człowieka jedynie napisy

View File

@@ -5880,6 +5880,8 @@ bool TTrain::Update( double const Deltatime )
ggHornLowButton.Update();
ggHornHighButton.Update();
ggWhistleButton.Update();
ggHelperButton.UpdateValue(DynamicObject->Mechanik->HelperState);
ggHelperButton.Update();
for( auto &universal : ggUniversals ) {
universal.Update();
}
@@ -7054,6 +7056,7 @@ void TTrain::clear_cab_controls()
ggHornLowButton.Clear();
ggHornHighButton.Clear();
ggWhistleButton.Clear();
ggHelperButton.Clear();
ggNextCurrentButton.Clear();
for( auto &universal : ggUniversals ) {
universal.Clear();
@@ -7649,6 +7652,7 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
{ "hornlow_bt:", ggHornLowButton },
{ "hornhigh_bt:", ggHornHighButton },
{ "whistle_bt:", ggWhistleButton },
{ "helper_bt:", ggHelperButton },
{ "fuse_bt:", ggFuseButton },
{ "converterfuse_bt:", ggConverterFuseButton },
{ "stlinoff_bt:", ggStLinOffButton },

View File

@@ -422,6 +422,7 @@ public: // reszta może by?publiczna
TGauge ggHornLowButton;
TGauge ggHornHighButton;
TGauge ggWhistleButton;
TGauge ggHelperButton;
TGauge ggNextCurrentButton;
std::array<TGauge, 10> ggUniversals; // NOTE: temporary arrangement until we have dynamically built control table