mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-09-01 06:59:18 +02:00
Add independent dynamic brake support (eg. Vectron) to UART controllers
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user