mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 07:59:18 +02:00
Dodana lampka czuwaka/shp (2 w 1), dodany dźwięk/wskazówka stycznika EP zależny od stopnia zahamowania, poszerzenie zakresu informacji wyjściowych UART na potrzeby pulpitu EZT, poprawka dźwięku hamulca pomocniczego, poprawka pozycjonowania dźwięków w kabinach, dodane sterowanie procentowe po UART
This commit is contained in:
45
uart.cpp
45
uart.cpp
@@ -277,13 +277,28 @@ void uart_input::poll()
|
||||
|
||||
if( true == conf.mainenable ) {
|
||||
// master controller
|
||||
relay.post(
|
||||
user_command::mastercontrollerset,
|
||||
buffer[ 6 ],
|
||||
0,
|
||||
GLFW_PRESS,
|
||||
// TODO: pass correct entity id once the missing systems are in place
|
||||
0 );
|
||||
if (false == conf.mainpercentage) {
|
||||
//old method for direct positions
|
||||
relay.post(
|
||||
user_command::mastercontrollerset,
|
||||
buffer[6],
|
||||
0,
|
||||
GLFW_PRESS,
|
||||
// TODO: pass correct entity id once the missing systems are in place
|
||||
0);
|
||||
}
|
||||
else {
|
||||
auto desiredpercent{ buffer[6] * 0.01 };
|
||||
auto desiredposition{ desiredpercent > 0.01 ? 1 + ((simulation::Train->Occupied()->MainCtrlPosNo - 1) * desiredpercent) : buffer[6] };
|
||||
relay.post(
|
||||
user_command::mastercontrollerset,
|
||||
desiredposition,
|
||||
0,
|
||||
GLFW_PRESS,
|
||||
// TODO: pass correct entity id once the missing systems are in place
|
||||
0);
|
||||
simulation::Train->Occupied()->eimic_analog = desiredpercent;
|
||||
}
|
||||
}
|
||||
if( true == conf.scndenable ) {
|
||||
// second controller
|
||||
@@ -357,10 +372,20 @@ void uart_input::poll()
|
||||
(uint8_t)(
|
||||
trainstate.epbrake_enabled << 0
|
||||
| trainstate.ventilator_overload << 1
|
||||
| trainstate.motor_overload_threshold << 2),
|
||||
| trainstate.motor_overload_threshold << 2
|
||||
| trainstate.emergencybrake << 3
|
||||
| trainstate.lockpipe << 4
|
||||
| trainstate.dir_forward << 5
|
||||
| trainstate.dir_backward << 6),
|
||||
//byte 3
|
||||
(uint8_t)(
|
||||
trainstate.coupled_hv_voltage_relays << 0),
|
||||
trainstate.coupled_hv_voltage_relays << 0
|
||||
| trainstate.doorleftallowed << 1
|
||||
| trainstate.doorleftopened << 2
|
||||
| trainstate.doorrightallowed << 3
|
||||
| trainstate.doorrightopened << 4
|
||||
| trainstate.doorstepallowed << 5
|
||||
| trainstate.battery << 6),
|
||||
//byte 4
|
||||
(uint8_t)(
|
||||
trainstate.train_heating << 0
|
||||
@@ -412,7 +437,7 @@ void uart_input::poll()
|
||||
(uint8_t)trainstate.radio_channel,
|
||||
//byte 34-35
|
||||
SPLIT_INT16(pantograph_press),
|
||||
//byte 36-48
|
||||
//byte 36-47
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user