mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 19:09:18 +02:00
fixes after merge
This commit is contained in:
@@ -881,7 +881,7 @@ TCommandType TController::TableUpdate(double &fVelDes, double &fDist, double &fN
|
||||
eSignNext = nullptr;
|
||||
IsAtPassengerStop = false;
|
||||
IsScheduledPassengerStopVisible = false;
|
||||
mvOccupied->SecuritySystem.SHPLock = false;
|
||||
mvOccupied->SecuritySystem.set_cabsignal_lock(false);
|
||||
// te flagi są ustawiane tutaj, w razie potrzeby
|
||||
iDrivigFlags &= ~(moveTrackEnd | moveSwitchFound | moveSignalFound | /*moveSpeedLimitFound*/ moveStopPointFound );
|
||||
|
||||
@@ -1424,7 +1424,7 @@ TController::TableUpdateEvent( double &Velocity, TCommandType &Command, TSpeedPo
|
||||
// thus we're doing a more precise check in such situation (we presume direction change takes place only if the vehicle is standing still)
|
||||
if( ( mvOccupied->Vel > EU07_AI_NOMOVEMENT )
|
||||
|| ( false == ismagnetpassed ) ) {
|
||||
mvOccupied->SecuritySystem.SHPLock |= ( !AIControllFlag ); // don't make life difficult for the ai, but a human driver is a fair game
|
||||
mvOccupied->SecuritySystem.set_cabsignal_lock(!AIControllFlag); // don't make life difficult for the ai, but a human driver is a fair game
|
||||
PutCommand(
|
||||
Point.evEvent->input_text(),
|
||||
Point.evEvent->input_value( 1 ),
|
||||
@@ -1434,7 +1434,7 @@ TController::TableUpdateEvent( double &Velocity, TCommandType &Command, TSpeedPo
|
||||
}
|
||||
if( ismagnetpassed ) {
|
||||
Point.Clear();
|
||||
mvOccupied->SecuritySystem.SHPLock = false;
|
||||
mvOccupied->SecuritySystem.set_cabsignal_lock(false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -648,6 +648,7 @@ class TSecuritySystem
|
||||
bool enabled = false;
|
||||
bool is_sifa = false; // Sifa-like pedal device, with inverted input for convenient keyboard usage
|
||||
bool separate_acknowledge = false; // cabsignal reset button is separate from vigilance
|
||||
bool cabsignal_lock = false;
|
||||
|
||||
double vigilance_timer = 0.0;
|
||||
double alert_timer = 0.0;
|
||||
@@ -669,6 +670,7 @@ public:
|
||||
void cabsignal_reset();
|
||||
void update(double dt, double Vel, bool pwr);
|
||||
void set_cabsignal();
|
||||
void set_cabsignal_lock(bool);
|
||||
bool is_blinking() const;
|
||||
bool is_vigilance_blinking() const;
|
||||
bool is_cabsignal_blinking() const;
|
||||
@@ -677,11 +679,9 @@ public:
|
||||
bool is_braking() const;
|
||||
bool is_engine_blocked() const;
|
||||
bool radiostop_available() const;
|
||||
bool system_available() const;
|
||||
void load(std::string const &line, double Vmax);
|
||||
|
||||
bool SHPLock = false;
|
||||
double MagnetLocation;
|
||||
double MagnetLocation = 0.0;
|
||||
};
|
||||
|
||||
struct TTransmision
|
||||
|
||||
@@ -95,7 +95,7 @@ void TSecuritySystem::acknowledge_press() {
|
||||
}
|
||||
vigilance_timer = 0.0;
|
||||
|
||||
if (!separate_acknowledge && cabsignal_active) {
|
||||
if (!separate_acknowledge && cabsignal_active && !cabsignal_lock) {
|
||||
cabsignal_active = false;
|
||||
alert_timer = 0.0;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void TSecuritySystem::acknowledge_release() {
|
||||
}
|
||||
|
||||
void TSecuritySystem::cabsignal_reset() {
|
||||
if (cabsignal_active) {
|
||||
if (cabsignal_active && !cabsignal_lock) {
|
||||
cabsignal_active = false;
|
||||
alert_timer = 0.0;
|
||||
}
|
||||
@@ -192,12 +192,12 @@ bool TSecuritySystem::is_cabsignal_beeping() const {
|
||||
}
|
||||
|
||||
bool TSecuritySystem::is_braking() const {
|
||||
if (!power && (vigilance_enabled || cabsignal_enabled || radiostop_enabled))
|
||||
return true;
|
||||
|
||||
if (!enabled)
|
||||
return false;
|
||||
|
||||
if (!power && (vigilance_enabled || cabsignal_enabled))
|
||||
return true;
|
||||
|
||||
return alert_timer > SoundSignalDelay + EmergencyBrakeDelay;
|
||||
}
|
||||
|
||||
@@ -205,8 +205,8 @@ bool TSecuritySystem::radiostop_available() const {
|
||||
return radiostop_enabled;
|
||||
}
|
||||
|
||||
bool TSecuritySystem::system_available() const {
|
||||
return vigilance_enabled || cabsignal_enabled;
|
||||
void TSecuritySystem::set_cabsignal_lock(bool v) {
|
||||
cabsignal_lock = v;
|
||||
}
|
||||
|
||||
bool TSecuritySystem::is_engine_blocked() const {
|
||||
@@ -234,6 +234,7 @@ void TSecuritySystem::load(std::string const &line, double Vmax) {
|
||||
extract_value( EmergencyBrakeDelay, "EmergencyBrakeDelay", line, "" );
|
||||
extract_value( MaxHoldTime, "MaxHoldTime", line, "" );
|
||||
extract_value( radiostop_enabled, "RadioStop", line, "" );
|
||||
extract_value( MagnetLocation, "MagnetLocation", line, "" );
|
||||
}
|
||||
|
||||
double TableInterpolation(std::map<double, double> &Map, double Parameter)
|
||||
@@ -4450,7 +4451,6 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
// ulepszony hamulec bezp.
|
||||
EmergencyValveFlow = 0.0;
|
||||
|
||||
auto const securitysystempresent { SecuritySystem.radiostop_available() || SecuritySystem.system_available() };
|
||||
auto const lowvoltagepower { Power24vIsAvailable || Power110vIsAvailable };
|
||||
|
||||
if( (( true == RadioStopFlag )
|
||||
@@ -4468,9 +4468,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
*/
|
||||
|| ( ( SpringBrakeDriveEmergencyVel >= 0 )
|
||||
&& ( Vel > SpringBrakeDriveEmergencyVel )
|
||||
&& ( SpringBrake.IsActive ) )
|
||||
|| ( ( true == securitysystempresent )
|
||||
&& ( false == lowvoltagepower ) ) ) {
|
||||
&& ( SpringBrake.IsActive ) ) ) {
|
||||
EmergencyValveFlow = PF( 0, PipePress, 0.15 ) * dt;
|
||||
}
|
||||
dpMainValve += EmergencyValveFlow;
|
||||
|
||||
@@ -7873,7 +7873,7 @@ void TTrain::update_sounds_radio() {
|
||||
}
|
||||
|
||||
void TTrain::update_screens() {
|
||||
if (fScreenTimer > Global.PythonScreenUpdateRate * 0.001f) {
|
||||
if (fScreenTimer > std::max(Global.PythonScreenUpdateRate, ScreenUpdateRate) * 0.001f) {
|
||||
fScreenTimer = 0.f;
|
||||
for (auto const &screen : m_screens) {
|
||||
auto state_dict = GetTrainState(screen.parameters);
|
||||
@@ -8282,7 +8282,7 @@ bool TTrain::InitializeCab(int NewCabNo, std::string const &asFileName)
|
||||
}
|
||||
else if (token == "pyscreenupdatetime:") {
|
||||
parser.getTokens();
|
||||
parser >> fScreenUpdateRate;
|
||||
parser >> ScreenUpdateRate;
|
||||
}
|
||||
// btLampkaUnknown.Init("unknown",mdKabina,false);
|
||||
} while ( ( token != "" )
|
||||
|
||||
2
Train.h
2
Train.h
@@ -789,7 +789,7 @@ private:
|
||||
float fConverterTimer; // hunter-261211: dla przekaznika
|
||||
float fMainRelayTimer; // hunter-141211: zalaczanie WSa z opoznieniem
|
||||
float fScreenTimer { 0.f };
|
||||
int fScreenUpdateRate { 0 }; // vehicle specific python screen update rate override
|
||||
int ScreenUpdateRate { 0 }; // vehicle specific python screen update rate override
|
||||
|
||||
// McZapkie-240302 - przyda sie do tachometru
|
||||
float fTachoVelocity{ 0.0f };
|
||||
|
||||
Reference in New Issue
Block a user