18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 20:14:59 +01:00

fix: the SOD lamp of the whole consist is opt-in per vehicle (DoorClosureSignal)

The three-state door closure lamp is switched on by DoorClosureSignal=Yes in the
Doors: section of the .fiz of the vehicle whose cab shows the lamp (the occupied
vehicle), off by default: without it the lamp keeps showing the lock of the
vehicle's own doors. The eu07.ini switch doorclosuresignal is gone, the data
decides. Sets whose cars lack DoorNeedPermit would blink at every standstill, so
only the sets with permits get the key.
This commit is contained in:
jerrrrycho
2026-11-08 18:30:22 +01:00
parent 4b769d95c1
commit 57db0087ff
6 changed files with 64 additions and 13 deletions

View File

@@ -1455,6 +1455,7 @@ class TMoverParameters
float auto_velocity{-1.f}; // automatic door closure velocity threshold
bool auto_include_remote{false}; // automatic door closure applies also to remote control
bool permit_needed{false};
bool closure_signal{false}; // the door closure lamp (SOD) of the cab signals the doors of the whole consist in three states
std::vector<int> permit_presets; // permit presets selectable with preset switch
float voltage{0.f}; // power type required for door movement
// ld inputs
@@ -2610,6 +2611,9 @@ class TMoverParameters
bool signal_departure(bool const State, range_t const Notify = range_t::consist); // toggles departure warning
void update_doors(double const Deltatime); // door controller update
door_closure_t door_closure() const; // state of the door closure signalling of this vehicle
// whether the door closure lamp in the cab of this vehicle is lit: with DoorClosureSignal, for the given state of the
// consist; without it, for the lock of the vehicle's own doors, as the lamp always worked
bool door_closure_lamp_lit(door_closure_t const Consist, bool const BlinkLit) const;
/* funkcje dla samochodow*/
bool ChangeOffsetH(double DeltaOffset);

View File

@@ -8723,6 +8723,11 @@ door_closure_t TMoverParameters::door_closure() const
return door_closure_t::released;
}
bool TMoverParameters::door_closure_lamp_lit(door_closure_t const Consist, bool const BlinkLit) const
{
return Doors.closure_signal ? door_closure_lamp(Consist, BlinkLit) : Doors.is_locked;
}
bool door_closure_lamp(door_closure_t const State, bool const BlinkLit)
{
switch (State)
@@ -10613,6 +10618,8 @@ void TMoverParameters::LoadFIZ_Doors(std::string const &line)
extract_value(Doors.auto_include_remote, "DoorAutoCloseRemote", line, "");
// operation permit
extract_value(Doors.permit_needed, "DoorNeedPermit", line, "");
// the door closure lamp (SOD) of the cab signals the doors of the whole consist
extract_value(Doors.closure_signal, "DoorClosureSignal", line, "");
{
auto permitpresets = Split(extract_value("DoorPermitList", line), '|');
for (auto const &permit : permitpresets)