18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 09:15:01 +01:00

Merge remote-tracking branch 'origin/master' into fix/freight-brake-setting-cw1

# Conflicts:
#	CMakeLists.txt
This commit is contained in:
jerrrrycho
2026-11-08 21:15:31 +01:00
86 changed files with 3447 additions and 124 deletions

View File

@@ -456,6 +456,66 @@ bool global_settings::ConfigParseInput(cParser& Parser, const std::string& token
return false;
}
bool global_settings::ConfigParseTest(cParser& Parser, std::string_view const Token)
{
// integration test limits, usually given in the config block of a test scenery
if (Token == "test.timeout")
{
double value{ test.timeout };
ParseOne(Parser, value);
if (false == test.timeout_from_command_line)
test.timeout = std::max(0.0, value);
return true;
}
if (Token == "test.wall_timeout")
{
double value{ 0.0 };
ParseOne(Parser, value);
if (false == test.wall_timeout_from_command_line)
test.wall_timeout = std::max(0.0, value);
return true;
}
if (Token == "test.vehicle")
{
// a vehicle of a train under test, by its name in the scenery; the pass and the standstill wait for its
// consist only, not for other trains (eu07/maszyna#541). given more than once, for each of them
std::string name;
ParseOne(Parser, name, 1, true);
if (false == name.empty() && std::ranges::find(test.vehicles, name) == test.vehicles.end())
test.vehicles.emplace_back(name);
return true;
}
if (Token == "test.standstill")
{
ParseOne(Parser, test.standstill);
test.standstill = std::max(0.0, test.standstill);
return true;
}
if (Token == "test.pass_on_standstill")
{
ParseOne(Parser, test.pass_on_standstill);
return true;
}
if (Token == "test.fail_if_stop_overran")
{
ParseOne(Parser, test.fail_if_stop_overran);
return true;
}
if (Token == "test.no_movement_before_pass")
{
ParseOne(Parser, test.no_movement_before_pass);
return true;
}
return false;
}
bool global_settings::ConfigParseSimulation(cParser& Parser, const std::string& token)
{
if (token == "async.trainThreads")
@@ -1322,6 +1382,9 @@ void global_settings::ConfigParse(cParser& Parser)
if (ConfigParseDebug(Parser, token))
continue;
if (ConfigParseTest(Parser, token))
continue;
// WriteLog(std::format("Unknown config token: {}", token), logtype::warning, false);
} while (true);
@@ -1749,6 +1812,17 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.shadowmap.enabled", gfx_shadowmap_enabled );
// TODO: export fpslimit
export_as_text( Output, "randomseed", Global.random_seed );
export_as_text( Output, "test.timeout", test.timeout );
if( test.wall_timeout.has_value() ) {
export_as_text( Output, "test.wall_timeout", *test.wall_timeout );
}
export_as_text( Output, "test.standstill", test.standstill );
export_as_text( Output, "test.pass_on_standstill", test.pass_on_standstill );
export_as_text( Output, "test.fail_if_stop_overran", test.fail_if_stop_overran );
export_as_text( Output, "test.no_movement_before_pass", test.no_movement_before_pass );
for( auto const &vehicle : test.vehicles ) {
export_as_text( Output, "test.vehicle", vehicle );
}
export_as_text( Output, "gfx.envmap.enabled", gfx_envmap_enabled );
export_as_text( Output, "gfx.postfx.motionblur.enabled", gfx_postfx_motionblur_enabled );
export_as_text( Output, "gfx.postfx.motionblur.shutter", gfx_postfx_motionblur_shutter );