16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 16:19:19 +02:00

Developer tools: Add vehicle fiz reload button

This commit is contained in:
2025-02-17 01:23:43 +01:00
parent 4aa0978290
commit eb387c3715
6 changed files with 47 additions and 3 deletions

View File

@@ -9444,6 +9444,7 @@ void TMoverParameters::BrakeSubsystemDecode()
// *************************************************************************************************
bool TMoverParameters::LoadFIZ(std::string chkpath)
{
chkPath = chkpath; // assign class path for reloading
const int param_ok = 1;
const int wheels_ok = 2;
const int dimensions_ok = 4;
@@ -12473,6 +12474,24 @@ double TMoverParameters::ShowCurrentP(int AmpN) const
}
}
bool TMoverParameters::reload_FIZ() {
WriteLog("[DEV] Reloading FIZ for " + Name);
// pause simulation
Global.iPause |= 0b1000;
bool result = LoadFIZ(chkPath);
if (result == true)
{
// jesli sie udalo przeladowac FIZ
Global.iPause &= 0b0111;
WriteLog("[DEV] FIZ reloaded for " + Name);
}
else {
// failed to reload - exit simulator
ErrorLog("[DEV] Failed to reload fiz for vehicle " + Name);
}
}
namespace simulation {
weights_table Weights;