|
Bits and Droids connector
Connect your microcontroller to handle MFS2020 commands.
|
The InputSwitchHandler class is responsible for handling the input commands. The input commands are sent from the MFSWorker class. It uses the received prefix from a microncontroller over serial port to determine which input command to handle. More...
#include <InputSwitchHandler.h>
Signals | |
| void | logMessage (std::string message, LogLevel level) |
Public Member Functions | |
| InputSwitchHandler () | |
| InputSwitchHandler (std::map< int, Input > inputs, HANDLE connect) | |
| void | switchHandling (const char *stringToParse) |
| this function triggers the appropriate input handling function Depending on the incomming string this function will parse and fire the appropriate input function. Input types are determined in the Input.json file. Types are defined in the InputTypeEnum. More... | |
| void | setRanges () |
| void | setCurve (QList< coordinates > curve, CurveTypeEnum curveType) |
Public Attributes | |
| HANDLE | connect |
| SIMCONNECT_OBJECT_ID | object |
| std::array< Axis *, constants::supportedEngines > | enginelist |
| float | reverseAxis = -23000.0 |
Private Member Functions | |
| void | setEngineValues (std::string stringToSet) |
| void | setMixtureValues (std::string stringToSet) |
| void | set_prop_values (std::string stringToSet) |
| int | setComs (const std::string &stringToSet, int comNo) const |
| void | sendBasicCommandOn (SIMCONNECT_CLIENT_EVENT_ID eventID) const |
| void | sendBasicCommandOff (SIMCONNECT_CLIENT_EVENT_ID eventID) const |
| void | setElevatorTrim (std::string stringToSet) |
| void | setFlaps (std::string stringToSet) |
| void | setRudder (std::string stringToSet) |
| void | setBrakeAxis (std::string stringToSet) |
| void | sendBasicCommandValue (SIMCONNECT_CLIENT_EVENT_ID eventID, int value) |
| void | controlYoke (std::string stringToSet) |
| void | sendBasicCommand (SIMCONNECT_CLIENT_EVENT_ID eventID, const std::string &stringToSet) |
| void | sendWASMCommand (int prefix, int value) const |
| void | setAxisValue (Axis *axis) |
| void | mapEngineValueToAxis (Engine *engine) const |
| void | mapInputs () |
| void | mapValueToAxis (Axis *axis) const |
Static Private Member Functions | |
| static int | mapCoordinates (int value, coordinates toMapMin, coordinates toMapMax) |
| static vector< int > | cutInputs (int amountOfPartsNeeded, std::string stringToSet) |
| static void | calibratedRange (CurveAxis *curveAxis) |
Private Attributes | |
| float | closedAxis = -16383.0 |
| float | openAxis = 16383.0 |
| std::map< int, Input > | inputs |
| std::string | prefix |
| SettingsHandler | settingsHandler |
| Axis | elevatorTrimAxis = Axis(0, 1023, InputEnum::DEFINITION_ELEVATOR_TRIM_SET) |
| Axis | mixtureRanges [constants::supportedMixtureLevers] |
| Axis | propellerRanges [constants::supportedPropellerLevers] |
| Axis | flapsRange |
| QStringList | curveStrings = {"Rudder", "Toe brakes", "Aileron", "Elevator"} |
| CurveAxis | rudderAxis = CurveAxis(InputEnum::DEFINITION_AXIS_RUDDER_SET) |
| CurveAxis | leftBrakeAxis = CurveAxis(InputEnum::DEFINITION_AXIS_LEFT_BRAKE_SET) |
| CurveAxis | rightBrakeAxis = CurveAxis(InputEnum::DEFINITION_AXIS_RIGHT_BRAKE_SET) |
| CurveAxis | brakeAxis [2] = {leftBrakeAxis, rightBrakeAxis} |
| CurveAxis | aileronAxis = CurveAxis(InputEnum::DEFINITION_AXIS_AILERONS_SET) |
| CurveAxis | elevatorAxis = CurveAxis(InputEnum::DEFINITION_AXIS_ELEVATOR_SET) |
The InputSwitchHandler class is responsible for handling the input commands. The input commands are sent from the MFSWorker class. It uses the received prefix from a microncontroller over serial port to determine which input command to handle.
| InputSwitchHandler::InputSwitchHandler | ( | ) |
| InputSwitchHandler::InputSwitchHandler | ( | std::map< int, Input > | inputs, |
| HANDLE | connect | ||
| ) |
|
staticprivate |
|
private |
|
staticprivate |
|
signal |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| void InputSwitchHandler::setCurve | ( | QList< coordinates > | curve, |
| CurveTypeEnum | curveType | ||
| ) |
|
private |
|
private |
|
private |
|
private |
| void InputSwitchHandler::setRanges | ( | ) |
|
private |
| void InputSwitchHandler::switchHandling | ( | const char * | stringToParse | ) |
this function triggers the appropriate input handling function Depending on the incomming string this function will parse and fire the appropriate input function. Input types are determined in the Input.json file. Types are defined in the InputTypeEnum.
| stringToParse | the string that has been sent by a microcontroller |
|
private |
|
private |
|
private |
| HANDLE InputSwitchHandler::connect |
|
private |
|
private |
|
private |
| std::array<Axis *, constants::supportedEngines> InputSwitchHandler::enginelist |
|
private |
|
private |
|
private |
|
private |
| SIMCONNECT_OBJECT_ID InputSwitchHandler::object |
|
private |
|
private |
|
private |
| float InputSwitchHandler::reverseAxis = -23000.0 |
|
private |
|
private |
|
private |