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

serial port input device configuration, additional control commands and minor control logic tweaks

This commit is contained in:
tmj-fstate
2018-02-10 19:53:21 +01:00
parent e9c4714780
commit 0c880f3d4e
16 changed files with 1437 additions and 897 deletions

View File

@@ -61,17 +61,28 @@ commanddescription_sequence Commands_descriptions = {
{ "reverserincrease", command_target::vehicle },
{ "reverserdecrease", command_target::vehicle },
{ "linebreakertoggle", command_target::vehicle },
{ "linebreakeropen", command_target::vehicle },
{ "linebreakerclose", command_target::vehicle },
{ "convertertoggle", command_target::vehicle },
{ "converterenable", command_target::vehicle },
{ "converterdisable", command_target::vehicle },
{ "convertertogglelocal", command_target::vehicle },
{ "converteroverloadrelayreset", command_target::vehicle },
{ "compressortoggle", command_target::vehicle },
{ "compressorenable", command_target::vehicle },
{ "compressordisable", command_target::vehicle },
{ "compressortogglelocal", command_target::vehicle },
{ "motoroverloadrelaythresholdtoggle", command_target::vehicle },
{ "motoroverloadrelaythresholdsetlow", command_target::vehicle },
{ "motoroverloadrelaythresholdsethigh", command_target::vehicle },
{ "motoroverloadrelayreset", command_target::vehicle },
{ "notchingrelaytoggle", command_target::vehicle },
{ "epbrakecontroltoggle", command_target::vehicle },
{ "brakeactingspeedincrease", command_target::vehicle },
{ "brakeactingspeeddecrease", command_target::vehicle },
{ "brakeactingspeedsetcargo", command_target::vehicle },
{ "brakeactingspeedsetpassenger", command_target::vehicle },
{ "brakeactingspeedsetrapid", command_target::vehicle },
{ "brakeloadcompensationincrease", command_target::vehicle },
{ "brakeloadcompensationdecrease", command_target::vehicle },
{ "mubrakingindicatortoggle", command_target::vehicle },
@@ -109,13 +120,25 @@ commanddescription_sequence Commands_descriptions = {
{ "pantographcompressoractivate", command_target::vehicle },
{ "pantographtogglefront", command_target::vehicle },
{ "pantographtogglerear", command_target::vehicle },
{ "pantographraisefront", command_target::vehicle },
{ "pantographraiserear", command_target::vehicle },
{ "pantographlowerfront", command_target::vehicle },
{ "pantographlowerrear", command_target::vehicle },
{ "pantographlowerall", command_target::vehicle },
{ "heatingtoggle", command_target::vehicle },
{ "heatingenable", command_target::vehicle },
{ "heatingdisable", command_target::vehicle },
{ "lightspresetactivatenext", command_target::vehicle },
{ "lightspresetactivateprevious", command_target::vehicle },
{ "headlighttoggleleft", command_target::vehicle },
{ "headlightenableleft", command_target::vehicle },
{ "headlightdisableleft", command_target::vehicle },
{ "headlighttoggleright", command_target::vehicle },
{ "headlightenableright", command_target::vehicle },
{ "headlightdisableright", command_target::vehicle },
{ "headlighttoggleupper", command_target::vehicle },
{ "headlightenableupper", command_target::vehicle },
{ "headlightdisableupper", command_target::vehicle },
{ "redmarkertoggleleft", command_target::vehicle },
{ "redmarkertoggleright", command_target::vehicle },
{ "headlighttogglerearleft", command_target::vehicle },
@@ -126,11 +149,20 @@ commanddescription_sequence Commands_descriptions = {
{ "redmarkerstoggle", command_target::vehicle },
{ "endsignalstoggle", command_target::vehicle },
{ "headlightsdimtoggle", command_target::vehicle },
{ "headlightsdimenable", command_target::vehicle },
{ "headlightsdimdisable", command_target::vehicle },
{ "motorconnectorsopen", command_target::vehicle },
{ "motorconnectorsclose", command_target::vehicle },
{ "motordisconnect", command_target::vehicle },
{ "interiorlighttoggle", command_target::vehicle },
{ "interiorlightenable", command_target::vehicle },
{ "interiorlightdisable", command_target::vehicle },
{ "interiorlightdimtoggle", command_target::vehicle },
{ "interiorlightdimenable", command_target::vehicle },
{ "interiorlightdimdisable", command_target::vehicle },
{ "instrumentlighttoggle", command_target::vehicle },
{ "instrumentlightenable", command_target::vehicle },
{ "instrumentlightdisable", command_target::vehicle },
{ "generictoggle0", command_target::vehicle },
{ "generictoggle1", command_target::vehicle },
{ "generictoggle2", command_target::vehicle },
@@ -141,7 +173,9 @@ commanddescription_sequence Commands_descriptions = {
{ "generictoggle7", command_target::vehicle },
{ "generictoggle8", command_target::vehicle },
{ "generictoggle9", command_target::vehicle },
{ "batterytoggle", command_target::vehicle }
{ "batterytoggle", command_target::vehicle },
{ "batteryenable", command_target::vehicle },
{ "batterydisable", command_target::vehicle }
};
}
@@ -177,7 +211,7 @@ command_queue::pop( command_data &Command, std::size_t const Recipient ) {
}
void
command_relay::post( user_command const Command, std::uint64_t const Param1, std::uint64_t const Param2, int const Action, command_hint const Hint, std::uint16_t const Recipient ) const {
command_relay::post( user_command const Command, std::uint64_t const Param1, std::uint64_t const Param2, int const Action, std::uint16_t const Recipient ) const {
auto const &command = simulation::Commands_descriptions[ static_cast<std::size_t>( Command ) ];
if( ( command.target == command_target::vehicle )
@@ -194,7 +228,6 @@ command_relay::post( user_command const Command, std::uint64_t const Param1, std
Action,
Param1,
Param2,
Hint,
Timer::GetDeltaTime() },
static_cast<std::size_t>( command.target ) | Recipient );
/*