17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-25 02:14:49 +01:00

perf(debug): count what keeps the physics on in rail vehicles standing still (active cab, speed, acceleration, switching, ezt/dmu, moving neighbour), for the debug panel

This commit is contained in:
2026-10-23 18:06:12 +02:00
parent 0aa1e2d4b6
commit e054fe900d
3 changed files with 37 additions and 1 deletions

View File

@@ -126,6 +126,17 @@ struct subsystem_stopwatches {
// enabled vehicles of each kind (see vehicles_forces_kind), and of them the ones standing still
std::array<unsigned int, 4> kind {};
std::array<unsigned int, 4> standing {};
// rail vehicles standing still (below 0.01 km/h) with the physics on, and what keeps it on by the test of
// TMoverParameters::ComputeTotalForce(); a vehicle can have several of these
struct awake_reasons {
unsigned int vehicles { 0 };
unsigned int cab { 0 }; // CabActive
unsigned int speed { 0 }; // Vel above 0.0001 km/h
unsigned int acceleration { 0 }; // AccS above 0.0001 m/s2
unsigned int switching { 0 }; // LastSwitchingTime below 5 s
unsigned int multipleunit { 0 }; // EZT, DMU
unsigned int neighbour { 0 }; // a neighbour moving or accelerating
} awake;
};
vehicle_counts vehicles; // of the frame under way
vehicle_counts vehicleslast; // of the last frame