mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 15:02:15 +01:00
feat(blackbox): the speed of the wheels read from the cab record, shown when they slip or skid
The simulator adds the speed of the wheels at the end of the cab record. It is read when there, and the cab panel shows it next to the vehicle's speed when the two are a km/h apart or more: the wheels slipping, or locked in a skid.
This commit is contained in:
@@ -125,6 +125,20 @@ public class HeadCodeTests
|
||||
Assert.Null(cab[1].Extra);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_speed_of_the_wheels_is_read_when_written()
|
||||
{
|
||||
var f = new BlackBoxFile().Info();
|
||||
// the wheels slipping at 40 km/h
|
||||
f.Cab(0, 1, 1000, 40, movement: 1, equippedHead: 0x15, equippedTail: 0x22, engine: 1, wheelSpeed: 55.5f);
|
||||
f.Cab(0.5, 1, 1000, 40, movement: 1, equippedHead: 0x15, equippedTail: 0x22, engine: 1);
|
||||
var cab = BlackBoxReader.Read(f.End(1).Stream()).Cab;
|
||||
Assert.Equal(55.5f, cab[0].WheelSpeedKmh);
|
||||
Assert.Equal(40f, cab[0].SpeedKmh);
|
||||
// an older sample has none
|
||||
Assert.Null(cab[1].WheelSpeedKmh);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_vehicle_with_no_lamps_is_not_judged()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user