mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 02:44: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:
@@ -205,6 +205,7 @@ void writer::cab(cab_sample const &Sample) {
|
||||
out.f32(Sample.clutch);
|
||||
out.f32(Sample.converter_fill);
|
||||
out.f32(Sample.consist_brake_cylinder);
|
||||
out.f32(Sample.wheel_speed_kmh);
|
||||
emit(record::cab);
|
||||
}
|
||||
|
||||
|
||||
@@ -257,6 +257,9 @@ struct cab_sample {
|
||||
float clutch{0.0f}; // the clutch of a diesel's gearbox, 0 open .. 1 closed
|
||||
float converter_fill{0.0f}; // the filling of a diesel's hydraulic torque converter, 0..1
|
||||
float consist_brake_cylinder{0.0f}; // the highest brake cylinder pressure of the vehicles of the train [bar]
|
||||
// [km/h] of the wheels as they turn, which the speedometer shows, signed as speed_kmh: apart from it while the wheels
|
||||
// slip, and 0 while they are locked in a skid
|
||||
float wheel_speed_kmh{0.0f};
|
||||
};
|
||||
|
||||
// a station of the timetable of the user's train; the times in minutes of the day, -1 none
|
||||
@@ -354,7 +357,7 @@ struct signal_passing {
|
||||
// sizes of the parts of fixed size, as the readers expect them
|
||||
inline constexpr std::size_t header_size{12};
|
||||
inline constexpr std::size_t record_header_size{5};
|
||||
inline constexpr std::size_t cab_sample_size{190};
|
||||
inline constexpr std::size_t cab_sample_size{194};
|
||||
inline constexpr std::size_t vehicle_state_size{25};
|
||||
|
||||
// writes the records to a stream. nothing is written until header() is
|
||||
|
||||
Reference in New Issue
Block a user