16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

Developer tools: Add vehicle fiz reload button

This commit is contained in:
2025-02-17 01:23:43 +01:00
parent 7d27e6ce33
commit 5258c4c775
6 changed files with 47 additions and 3 deletions

View File

@@ -1070,6 +1070,8 @@ class TMoverParameters
};
public:
std::string chkPath;
bool reload_FIZ();
double dMoveLen = 0.0;
/*---opis lokomotywy, wagonu itp*/
/*--opis serii--*/

View File

@@ -9443,6 +9443,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;
@@ -12476,6 +12477,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;