18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 19:14:59 +01:00

refactor(simulation): tidy the test mode code

The test manager is reached through simulation::test() instead of a global,
the result cell is owned by a unique_ptr until the memory table takes it, the
cell value is compared with a margin, strings are built with std::format and
the --test settings moved to apply_test_mode_settings(). The driver's signal
check is folded into UpdateSpeedPosition(), which updates a speed table entry
and reports a signal at stop the head of the train just passed. The test.*
keys are listed with the other settings at the start of the log.
This commit is contained in:
jerrrrycho
2026-11-07 17:12:11 +01:00
parent 6a538d202b
commit 441caeed64
12 changed files with 131 additions and 75 deletions

View File

@@ -519,8 +519,9 @@ private:
bool TableNotFound( basic_event const *Event, double const Distance ) const;
void TableTraceRoute( double fDistance, TDynamicObject *pVehicle );
void TableCheck( double fDistance );
// reports the train going past a signal showing stop (SetVelocity 0 0); called once the head passed Point
void CheckSignalPassedAtDanger( TSpeedPos const &Point ) const;
// updates a position of the speed table, returns true when a switch on it changed (TSpeedPos::Update).
// reports the head of the train going past it, if it's a signal showing stop
bool UpdateSpeedPosition( TSpeedPos &Point ) const;
TCommandType TableUpdate( double &fVelDes, double &fDist, double &fNext, double &fAcc );
bool TableUpdateStopPoint( TCommandType &Command, TSpeedPos &Point, double const Signaldistance );
bool TableUpdateEvent( double &Velocity, TCommandType &Command, TSpeedPos &Point, double &Signaldistance, int const Pointindex );