18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 10:24:58 +01:00

feat(blackbox): the cab record holds the speed of the wheels, apart from the vehicle's when they slip

The speed of the cab record is the vehicle's. The speedometer, and a speed recorder's tape with it, shows the
speed of the wheels as they turn, which runs away from it while they slip and drops to 0 while they are
locked in a skid. It is added at the end of the record (194 bytes), where the readers skip what they don't
know; the .dat tapes have it already, in their second column.
This commit is contained in:
maj00r
2026-11-14 00:48:18 +01:00
parent 03a3b4c09a
commit 7b7529e24e
5 changed files with 14 additions and 3 deletions

View File

@@ -127,6 +127,7 @@ blackbox::cab_sample sample() {
s.clutch = 0.75f;
s.converter_fill = 0.25f;
s.consist_brake_cylinder = 3.5f;
s.wheel_speed_kmh = 71.5f;
return s;
}
@@ -285,6 +286,8 @@ TEST_CASE("blackbox: a sample of the user's train has the documented size and or
CHECK(cab.get<float>() == 0.25f);
// the highest brake cylinder pressure of the train
CHECK(cab.get<float>() == 3.5f);
// the speed of the wheels
CHECK(cab.get<float>() == 71.5f);
CHECK(cab.done());
}