Black box: older recordings read as before, single vehicles told apart, each platform end its own tolerance

- A light pattern asked for in a recording made before the lamps were
  written is checked as the signal it shows, as before.
- Whether the couplings were written is told by the format (the
  movement in the cab samples), not by there being any: a recording
  where every train is a single vehicle has none, and the user going
  over to another vehicle left the timetable shown.
- The 2 m a train may stand off the platform is at each end, not for
  both together.
This commit is contained in:
maj00r
2026-11-11 01:05:59 +01:00
parent 532875fc7b
commit de3f088ba8
5 changed files with 57 additions and 5 deletions

View File

@@ -101,7 +101,8 @@ public static class HeadCodes
var pattern = (Lights)hint;
if (usual == HeadCode.Pc1 && pattern == (Lights.RedMarkerLeft | Lights.HeadlightRight | Lights.HeadlightUpper))
return Shows(HeadCode.Pc2, lit, equipped);
return (lit & ~HighBeams) == (equipped is { } lamps ? pattern & lamps : pattern);
// a recording made before the lamps were written: the signal the pattern shows, as before
return equipped is { } lamps ? (lit & ~HighBeams) == (pattern & lamps) : Of(lit) == Of(pattern);
}
/// <summary>