-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# MSFSPythonSimConnectMobiFlightExtension | ||
Extends the python simconnect library for MSFS2020 with the capability to read A and L variables with help of the MobiFlight WASM module. | ||
# MSFS Python SimConnect MobiFlight Extension | ||
Extends the [python simconnect library](https://github.com/odwdinc/Python-SimConnect) for MSFS2020 with the capability to read A and L variables with help of the [MobiFlight](https://www.mobiflight.com) WASM module. | ||
|
||
* ```SimConnectMobiFlight``` inherits from ```SimConnect```, fixes an issue and adds the feature to register additional client data handlers. | ||
* ```MobiFlightVariableRequests``` implements the variable access via the MobiFlight WASM module. | ||
* A collection of possible variables can be found [here](https://bitbucket.org/mobiflight/mobiflightfc/src/master/Presets/msfs2020_simvars.cip) in the [MobiFlight repository](https://bitbucket.org/mobiflight/mobiflightfc). | ||
* ATTENTION: At the moment it is only possible for one client at a time to access variables via MobiFlight WASM. There is not yet multi client support. | ||
|
||
## Example | ||
|
||
**Example code on how to use the library and read variables:** | ||
```python | ||
from simconnect_mobiflight import SimConnectMobiFlight | ||
from mobiflight_variable_requests import MobiFlightVariableRequests | ||
from time import sleep | ||
|
||
sm = SimConnectMobiFlight() | ||
vr = MobiFlightVariableRequests(sm) | ||
vr.clear_sim_variables() | ||
|
||
while True: | ||
alt_ground = vr.get("(A:GROUND ALTITUDE,Meters)") | ||
alt_plane = vr.get("(A:PLANE ALTITUDE,Feet)") | ||
# FlyByWire A320 | ||
ap1 = vr.get("(L:A32NX_AUTOPILOT_1_ACTIVE)") | ||
hdg = vr.get("(L:A32NX_AUTOPILOT_HEADING_SELECTED)") | ||
mode = vr.get("(L:A32NX_FMA_LATERAL_MODE)") | ||
sleep(1) | ||
``` | ||
|
||
## MobiFlight WASM working principle | ||
|
||
 |