17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 22:06:21 +01:00

Merge branch 'master' into refactor/split-oncommands-train

Brings the branch up to date after ~6 weeks of drift (51 commits).

The only real conflict was vehicle/Train.cpp, deleted here and modified
on master by 763a76d4, which added a dynamicbrake_pos entry to
GetTrainState. That line is re-applied in its new home,
vehicle/train/TrainState.cpp; the file deletion is kept.

utilities/uart.cpp and vehicle/Driver.cpp merged cleanly: master edited
function bodies, this branch only rewrote the Train.h include paths.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-09-06 16:02:39 +02:00
25 changed files with 417 additions and 307 deletions

View File

@@ -223,6 +223,12 @@ bool global_settings::ConfigParseGraphics(cParser& Parser, const std::string& to
return true;
}
if (token == "targetfps")
{
ParseOne(Parser, targetfps, 1, false);
return true;
}
if (token == "heightbase")
{
ParseOne(Parser, fDistanceFactor, 1, false);

View File

@@ -133,7 +133,7 @@ struct global_settings {
float ShakingMultiplierRL {1.f}; // mnożnik bujania kamera lewo/prawo
float ShakingMultiplierUD {1.f}; // mnożnik bujania kamera gora/dol
float fDistanceFactor{ 1.f }; // baza do przeliczania odległości dla LoD
float targetfps{ 0.0f };
float targetfps{ 60.0f };
bool bFullScreen{ false };
bool VSync{ false };
bool bWireFrame{ false };
@@ -224,7 +224,8 @@ struct global_settings {
{"train", &uart_conf.trainenable},
{"local", &uart_conf.localenable},
{"radiovolume", &uart_conf.radiovolumeenable},
{"radiochannel", &uart_conf.radiochannelenable}
{"radiochannel", &uart_conf.radiochannelenable},
{"dynamicbrake", &uart_conf.dynamicenable},
};
#endif
#ifdef WITH_ZMQ

View File

@@ -506,6 +506,19 @@ void uart_input::poll()
0
);
}
if (true == conf.dynamicenable)
{
// dynamic brake 8 bit
double const position{(float)(buffer[13] - conf.dynamicbrakemin) / (conf.dynamicbrakemax - conf.dynamicbrakemin)};
relay.post(
user_command::dynamicbrakecontrollerset,
position,
0,
GLFW_PRESS,
0
);
}
old_packet = buffer;
}

View File

@@ -53,6 +53,8 @@ public:
float lvmax = 150.0f;
float lvuart = 65535.0f;
float tachoscale = 1.0f;
float dynamicbrakemin = 0.0f;
float dynamicbrakemax = 255.0f;
bool mainenable = true;
bool scndenable = true;
@@ -60,6 +62,7 @@ public:
bool localenable = true;
bool radiovolumeenable = false;
bool radiochannelenable = false;
bool dynamicenable = false;
bool debug = false;