|
Bits and Droids connector
Connect your microcontroller to handle MFS2020 commands.
|
MFSWorker is a class that handles the connection to Microsoft Flight Simulator This class handles the connection to Microsoft Flight Simulator and the data that is sent to and from the simulator. This class inherits from QThread and is run in a separate thread from the main thread. More...
#include <MFSWorker.h>
Signals | |
| void | boardConnectionMade (int con) |
| void | logMessage (std::string message, LogLevel level) |
Public Member Functions | |
| void | setInputs (std::map< int, Input >inputsToSet) |
| MFSWorker () | |
| ~MFSWorker () | |
| void | eventLoop () |
| MFSWorker::eventLoop is the main loop of the application. It directs the connection to the sim and the microcontrollers This loop is started from the Dashboard using the StartButton. /sa Dashboard. More... | |
| void | sendToArduino (float received, const string &prefix, int index, int mode) |
| MFSWorker::sendToArduino is responsible for sending data to the Arduino The modes are defined in the ModeEnum class. More... | |
Public Attributes | |
| bool | abortDual |
| QMutex | mutex |
| QWaitCondition | condition |
Private Member Functions | |
| void | run () override |
| void | setConnected (bool connectedToSim) |
| void | loadRunningPortsAndSets () |
| MFSWorker::loadRunningPortsAndSets initiates the ports and sets that are saved in the settings file It loads in the coms and bundles them into a single ComBundle object. After this the app loads in all the inputs from the dist/Inputs.json file. More... | |
Static Private Member Functions | |
| static void | MyDispatchProcInput (SIMCONNECT_RECV *pData, DWORD cbData, void *pContext) |
| MFSWorker::MyDispatchProcInput handles the data received from the simulator. More... | |
Private Attributes | |
| bool | connected = false |
| SettingsHandler | settingsHandler |
| SIMCONNECT_OBJECT_ID | objectID = SIMCONNECT_OBJECT_ID_USER |
| OutputHandler | OutputHandler |
| QList< ComBundle * > * | comBundles = new QList<ComBundle *>() |
| InputSwitchHandler * | dualInputHandler |
| InputMapper | dualInputMapper = InputMapper() |
| outputMapper * | dualOutputMapper = new outputMapper() |
| double | dataF = 1.2 |
| SIMCONNECT_CLIENT_DATA_ID | ClientDataID = 1 |
| InputEnum | radioDefs = InputEnum() |
| InputMapper | radioMap = InputMapper() |
| QList< Output * > | outputsToMap |
| QStringList * | keys = new QStringList() |
| OutputConverters | converter = OutputConverters() |
| std::map< int, Input > | inputs = std::map<int, Input>() |
MFSWorker is a class that handles the connection to Microsoft Flight Simulator This class handles the connection to Microsoft Flight Simulator and the data that is sent to and from the simulator. This class inherits from QThread and is run in a separate thread from the main thread.
| MFSWorker::MFSWorker | ( | ) |
| MFSWorker::~MFSWorker | ( | ) |
|
signal |
| void MFSWorker::eventLoop | ( | ) |
MFSWorker::eventLoop is the main loop of the application. It directs the connection to the sim and the microcontrollers This loop is started from the Dashboard using the StartButton. /sa Dashboard.
|
private |
MFSWorker::loadRunningPortsAndSets initiates the ports and sets that are saved in the settings file It loads in the coms and bundles them into a single ComBundle object. After this the app loads in all the inputs from the dist/Inputs.json file.
|
signal |
|
staticprivate |
MFSWorker::MyDispatchProcInput handles the data received from the simulator.
This function monitors the SimConnect data. The function handles SimConnect events provided by the simulator. If new data is available, the function will send the data to the Microcontroller using the sendToArduino function. It also handles the data received from the WASM module.
| *pData | |
| cbData | |
| *pContext | Pointer to the calling MFSWorker object. This can be used to reference the MFSWorker object. |
|
inlineoverrideprivate |
| void MFSWorker::sendToArduino | ( | float | received, |
| const string & | prefix, | ||
| int | index, | ||
| int | mode | ||
| ) |
MFSWorker::sendToArduino is responsible for sending data to the Arduino The modes are defined in the ModeEnum class.
| received | is the data received from the simulator |
| prefix | prefix to tag the data |
| index | index of the comport |
| mode | defines the data type |
|
private |
| void MFSWorker::setInputs | ( | std::map< int, Input > | inputsToSet | ) |
| bool MFSWorker::abortDual |
|
private |
| QWaitCondition MFSWorker::condition |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| QMutex MFSWorker::mutex |
|
private |
|
private |
|
private |
|
private |
|
private |