Python x plane 11 plugin

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Next Generation Python Interface for X-Plane

License

stormrose-va/FlyWithPython

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

FlyWithPython — New Python Interface for X-Plane

This project repository contains all code of FlyWithPython, a new Python Interface for X-Plane. This project aims at providing a successor for the well-known but abandoned Python Interface by Sandy Barbour.

FlyWithPython is being developed for a couple of reasons, although the legacy Python interface still works. These reasons also form the objectives of this project:

  • Open Source Develoment: Sandy’s work cannot be continued by the community as he decided to keep the sources closed. FlyWithPython on the contrary is Open Source, licensed under one of the most permissive licenses available.
  • Python 3 Compatibility: The latest published legacy Python interface only works with a quite dated version of the Python 2.7 branch. FlyWithPython is designed to bring the latest Python 3 to X-Plane.
  • Improved Encapsulation: The legacy interface relied on a system-wide installed Python interpreter, sometimes creating conflicts with third-party dependencies or simply version mayhem. FlyWithPython bundles a dedicated Python interpreter to avoid such problems.

Will scripts created for Sandy Barbour’s Python Interface run on FlyWithPython?

FlyWithPython is not a drop-in replacement for the previous Python interface. Thus, most probably existing scripts will not work out of the box with FlyWithPython, but will need some adaptation to the new structures. Furthermore, FlyWithPython will work by default with a Python 3 interpreter, so most probably also the Python code itself will need some love & care before it can run on FlyWithPython.

Will you provide an installer bundle?

We hope there won’t be a need for complex installer bundles. We seek at creating a traditional plugin package which won’t need any third party packages to be installed on your computer. However, our first priority is providing a stable release before thinking about any bundling (that would require some careful studying of licenses not only of Python itself, but of all other 3rd party stuff included to prevent us from being sued for distributing stuff we were not allowed to).

Читайте также:  Thread wait and notify in java

Will you support all three OSes X-Plane runs on?

That is certainly one of our objectives, but this will depend on whether we can get hold of a sufficient number of testers for the different platforms. Particularly Linux could prove to be difficult to be supported due to the high number of flavours, coming all with different versions of the Python interpreter.

Will X-Plane 11 be supported?

Indeed, FlyWithPython is being develped only for X-Plane 11.10 and later versions. This project uses the most recent API SDK (version 3.0) and thus is not compatbile with older X-Plane versions.

For the time being, we cannot tell. FlyWithPython is being developed by volunteers in their leisure time, so the resources we can dedicate to this project are limited.

About

Next Generation Python Interface for X-Plane

Источник

Plugin Installation¶

This version of XPPython3 requires X-Plane 12. If you are using X-Plane 11.52, you must install XPPython3 v3.1.5. See Installation for X-Plane 11.

If you’re upgrading from XPPython v3.1.5, see Upgrading XPPython3 .

Installation¶

Warning

Do not use Python 3.11.1 on Windows. It has a loading bug and will not work.

Version 3.10.x is okay, 3.11.0 is okay, 3.11.2+ is okay.

../_images/windows_python_environment.jpg

For Windows

select “Add Python x.x to PATH” (PLEASE. This is the single most common error!)

Choose either “Install Now” or “Customize Installation”, either will work as long as python is added to your path!

For Linux

use your package manager (deb, apt, etc.) install as root, and make sure you also have pip and libpython. (e.g., apt-get install python3-pip ) Check which version of python3 is actually installed, because you’ll need to get that version of XPPython3 plugin: python3 —version .

We search for the matching library along the usual library search path. If you’re using a virtual environment or install a personal copy of python, just make sure it’s visible on the search path.

For Mac

just install directly from python.org.

Questions, see 1. Want to use a different version of python, see Other Versions of Python.

Select zipfile based on the version of python you are using:

For Python 3.11.x

xp311.zip

For Python 3.10.x

xp310.zip

  1. Extract the xp31x.zip into your X-Plane/Resources/plugins folder, such that you have folder there called XPPython3 .

This plugin XPPython3 folder must be placed in /Resources/plugins . On first execution, XPPython3 will create the Resources/plugins/PythonPlugins folder.

You should place any third-party python plugins in that PythonPlugins folder. (On first run of the plugin, XPPython3 will automatically download a set of sample plugins into your Resources/plugins/PythonPlugins/samples folder. To execute a sample, move a plugin up into the PythonPlugins folder.)

You file system layout should match:

/ └─── Resources/ └─── plugins/ └─── XPPython3/ ├─── mac_x64/ | └─── XPPython3.xpl ├─── lin_x64/ | └─── XPPython3.xpl └─── win_x64/ └─── XPPython3.xpl

Extra For Mac

STOP! Before continuing, you need to remove the quarantine. Follow instructions in Mac Quarantine .

Читайте также:  Open sans bold html

If you forget to do this, XPPython3 will not load and you’ll get error popup indicating XPPython3.xpl cannot be opened. See Common Installation Errors .

../_images/python_samples_popup.png

On installation success, we’ll popup a window:

If you have problems with installation

  1. Actually read this page.
  2. Check Common Installation Errors .
  3. If you still have problems with installation provide information described in Getting Support .

If it’s running, get familiar with XPPython3 Menus .

But I already have a copy of python on my computer”. Yes, you probably do. Is it the right version, includes the necessary packages and scripts, and located in the correct location? Maybe, but no one wants to try and debug that, so please: you have the disk space. Download a brand new copy of python, place it in the recommended location and think of it as being used exclusively for X-Plane.

Table of Contents

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

XpLanel is a simple python script that makes the Elegato Stream Deck device «smart» connected with X-Plane 11.

License

simfender/xplanel

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

A simple script in python 3 that makes the Elgato Stream Deck device «smart» connected with X-Plane 11. With this script you can dynamically assign a button of the deck to a button/function of an aircraft cockpit. X-Plane «datarefs» are used in order to get the statuses and update the buttons according to them, «commands» are used to send the deck buttons input to X-Plane. So all this explanation to say that the communication is bi-directional. The communication between the script and X-Plane is via UDP, that is native in the simulator so no plugins to be installed.

  • Python3
  • Python3 libraries:
    • hid
    • hidapi
    • numpy
    • pi
    • Pillow
    • pyxpudpserver
    • streamdeck

    XpLanel uses Python 3, so you need to install Python 3.

    Download the files, or perform

    git clone https://github.com/simfender/xplanel 

    Then, install the required libraries

    python3 -m pip install -r requirements.txt 

    The script reads a config.json file and the images from a specified folder, I’ll make it easy to understand with an example:

    We want to put the «Master Caution» button to the second button/first raw of the Stream Deck, so firstly we have to create two images for it, one for the «ON» state and the other for the «OFF» state.

    The file name is important and contains three dot separated informations:

    1.mc.on.png
    1 mc on png
    The position of the button, It’s zero based, so the first one in the first raw is the number 0, the last one in the third row is the number 14 This is a name reference to the button, will be written in the config.json On/Off for the two states Image extension, could be png or jpeg

    So what if we want to put the «Master Caution» in the last button of our Stream Deck, we have to change the name files to «14.mc.on.png» and «14.mc.off.png», I think it’s pretty easy, isn’t it?

    OK after we created the images we have to put them in a defined folder created on the same level of the script. In this case a folder named «737800». After that we have to make some change to the config.json.

    It’s kind of self-explanatory but we can say something about it as well, the first part «MAIN» is needed to the script to work correctly, since we work through the UDP, you can use this script also on another pc put in the same network, in that case you have to change the XPLANE_IP and SERVER_IP accordly, if you’re planning to use it on the same pc you do not need to change anything till «SELECTED_AIRCRAFT», which is the reference to the settings for the aircraft written below, in this case «B738».

    The aicraft settings need:

    • «imgfolder» path, the folder which contains our ON/OFF «Master Caution» images.
    • «dataref» string, the X-PLane aircraft dataref related to the status we want report to the button, in this case is reported the one of the ZIBO 737 «Master Caution»
    • «command» string, the X-PLane aircraft command related to the function we want assign to the button, in this case is reported the one of the ZIBO 737 «Master Caution»
    • «imgrefn» name, in this case «mc», the same one used in the ON/OFF images for «Master Caution»

    After set that, all we have to do is running the script (Please note that you have to close the Elegato Stream Deck software before)

    The uploaded script in the repository has all functions displayed in the first image and works for the ZIBO737 aicraft. In order to make it working with another aicraft you have to change all datarefs and commands reported in the config.json. It’s something in alpha stage and I have to say that this script is provided «AS IS», without warranty of any kind.

    I’ve tested it on Windows 10 64 bit, I really do not know If could work on other os. Feel free to try it out.

    I had a lot of fun on making this, really, hope you’ll enjoy it! Happy Flying!

    —It’s the first time I use Python and GitHub so please understand me for any kind of errors I’ve made!—

    About

    XpLanel is a simple python script that makes the Elegato Stream Deck device «smart» connected with X-Plane 11.

    Источник

Оцените статью