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

@@ -418,6 +418,8 @@ void blackbox_recorder::write_cab() {
sample.vehicle = vehicle_id(vehicle);
sample.position = vehicle->GetPosition();
sample.speed_kmh = static_cast<float>(occupied->V * 3.6);
// of the wheels as they turn, which the speedometer shows: apart from that of the vehicle when they slip or skid
sample.wheel_speed_kmh = static_cast<float>(M_PI * occupied->WheelDiameter * occupied->nrot * 3.6);
sample.acceleration = static_cast<float>(controlling->AccS);
sample.lateral_acceleration = static_cast<float>(occupied->AccN);
if (owner != nullptr && owner->is_train()) {