Git Product home page Git Product logo

x-touch-mini-fs2020's People

Contributors

bigbrowncow avatar elewarr avatar koseng avatar maartentamboer avatar mkx173 avatar ticktricktrack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

x-touch-mini-fs2020's Issues

Global Variables - init

Is it possible to add an init section for every aircraft
running when aircraft/flight load to

  • initialize global variables
  • or aircraft setting, f.e. predefined values for cockpit lights, flashlight depending on time
  • or define a random set of settings which are random set or not set (to make pre flight checks of switches more realistic)

Rotary Knob 6 plus 8 / Layer A create Errors in Console

Hello,
I'm using your X-Touch Layout , I checked all rotary Encoder buttons in the X Touch Editor, They are all identical.
Pushing knob 6 and 8 - but only in layer A - create following messages
traceback (most recent call last):
File "site-packages\mido\backends\rtmidi.py", line 171, in _callback_wrapper
File "main.py", line 40, in handle_message
File "rotaryencoder.py", line 91, in on_cc_data
File "eventqueue.py", line 37, in call
File "eventqueue.py", line 27, in call
TypeError: 'NoneType' object is not callable
on_cc_data: 6: 65
The error occurs when I tunr Button 6/Layera to the left or right, push brings no error. Unpressing Button 8 also (Button 8 turn left/right is possible, push also)
I

Is there a relativ easy way to debug this code without running FS2020. I'm ot a python export but I have programming knowledge on other languages.

CRJ - Throttle via vjoy

Thanks for the reply but is closed quick, so i post again:

Hi, any possibility to integrate the management of the throttle slide with vjoy to be used it with the new CRJ plane ?

They is a misunderstanding seems to be.
I use x-touch with this software dev because it is very flexible and effective due to direct management by Simconnect api.

But asobo as help to dev a new CRJ, and I contacted them on this same subject.
Because this new type of command management does not allow to use the API to manage the axle controls of the aircraft. So X-Touch-Mini-FS2020 i now incompatible with new aircraft management.

Asobo's response and aircraft developers is that the axes management system must go through a joystick axis management.
is it is not intended to make it completely compatible with the API.

I can confirm that if you handle this via a virtual joystick vjoy, on the one hand, it's possible with MIDI controllers and that it works. Like can do FreePIE.

The only thing they were able to tell us to try to work around this problem is to try to use another event. But it does not work according to my first tries.

What he said to try:

You can try key_throttle_axis_set_ex1, key_throttle1_axis_set_ex1 and key_throttle2_axis_set_ex1
However, this is not officially supported by US, so if it works, good for you. If not, we can't help. "

Another setup question

I set the Min Value encoders in the x-touch editor to Relative 2.

Then ran X-Touch-Mini-FS2020.exe, a black window opens momentarily, and nothing else.

The x-touch device is seen in device manager, and all the buttons light up. See that another user had a problem with possible conflicting USB input devices. I removed all mine, on the keyboard/mouse/xtouch using the usb slots.

Any thoughts?

Problem with v1.9

Hi,
at start, I have this error

C:\Utilitaires\MFS\X-Touch-Mini-FS2020>X-Touch-Mini-FS2020.exe
Traceback (most recent call last):
File "main.py", line 9, in
File "c:\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "configfile.py", line 3, in
File "c:\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "eventqueue.py", line 3, in
File "c:\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "conditionalrunner.py", line 1, in
File "c:\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "site-packages\jinja2_init_.py", line 12, in
File "c:\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "site-packages\jinja2\environment.py", line 25, in
File "c:\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "site-packages\jinja2\defaults.py", line 3, in
File "c:\Python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
File "site-packages\jinja2\filters.py", line 13, in
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (C:\Utilitaires\MFS\X-Touch-Mini-FS2020\markupsafe_init_.pyc)
[33432] Failed to execute script main

I don't have this file <markupsafe_init_.pyc>, only a subfolder which contains <_speedups.cp37-win_amd64.pyd>

Previous v1.8.1 works fine.

Simple question :D

This program is amazing and I'm starting to learn. How can I make the LED of the button light up with the function I enter?

Example having set the parking brake, I would like it to light up when I press it.

Thanks for your patience. : D

Led status according to Simvar values

Hi !
First of all, many thanks for this fantastic tool.
I'm playing with it, try things, some work, some don't :-)
I'm trying to make buttons allowing to switch the NAV mode GPS, NAV1, NAV2.

    {
      "index": 3,
      "event_press": "TOGGLE_GPS_DRIVES_NAV1",
	  "simvar_led": "GPS_DRIVES_NAV1"
    },
    {
      "index": 6,
	  "event_press": {
		"event": "AP_NAV_SELECT_SET",
		"type": "manual",
		"value": 1
		}
	},
    {
      "index": 14,
	  "event_press": {
		"event": "AP_NAV_SELECT_SET",
		"type": "manual",
		"value": 2
   },

That works fine : button 3 toggles NAV/GPS (and button 3 lights up if in GPS mode).
Now I'd like to light up button 6 if NAV1 is selected, and button 14 if NAV2, but the simvar is AUTOPILOT_NAV_SELECTED, which give a different value accoding to the NAV selected.

Whats is please the syntax for a conditional "simvar_led" ?

CRJ Template Format knob lvar correction.

In the current template the map format knob is not functional anymore due to using what i assume is outdated lvars, see the corrected ones below.

MobiFlight.ASCRJ_LSP_FORMAT_right/left should be replaced with MobiFlight.ASCRJ_LSP_FORMAT_CHANGE_ENCOD_INC/DEC in config_crj.json

"index": 1,
"event_up": { "event": "MobiFlight.ASCRJ_LSP_FORMAT_CHANGE_ENCOD_INC", "type": "manual", "value": 1 },
"event_down": { "event": "MobiFlight.ASCRJ_LSP_FORMAT_CHANGE_ENCOD_DEC", "type": "manual", "value": 1 },
"alternate_event_up": { "event": "MobiFlight.ASCRJ_LSP_ZOOM_RANGE_CHANGE_INC", "type": "manual", "value": 1 },
"alternate_event_down": { "event": "MobiFlight.ASCRJ_LSP_ZOOM_RANGE_CHANGE_DEC", "type": "manual", "value": 1 },
"event_press": "{alternate}"

Auto Switch Layer B to A when inactive

Hi,

is it possible to add an option to revert from Layer B to A after some time of inactivity?

I would like to use Layer B for light and maybe views,
but most time i want to use layer 1 for flight/ap controls

Andreas

Lights on layer 2 are one off

Hi,

when i use this
{
"index": 20,
"event_press": [
{
"event": "TOGGLE_BEACON_LIGHTS",
"type": "manual",
"value": 0
}
],
"simvar_led": "LIGHT_BEACON"
}

f.e. Button 4 on layer B will switch the Beacon, but Button 5 will light.

I think the lights on layer 2 position are one off

Regards
Andreas

Knob rotating speed

Hi,

Is it possible to modify how fast values change when you rotate a knob? If I try to set baro minimums for some planes, the values jump from tens to thousands and it's difficult to set exact value quickly.

Is it possible for example to set this in config file for each knob separately?

Otherwise, thanks for great job. It's working nice!

Better behavior of long pressing a button?

Hello, first of all thank you for your great work! I am trying to create my own configuration for a32nx and I found that currently the long press event only triggers when the button/encoder is released, which is not very intuitive. Is is possible to add a new behavior that make the event trigger after pressing the button for a certain amount of time? I already implemented the new bahavior myself and I feel like it's much better. Thanks!

Improvement ideas

So glad I found your project. Everything I have hoped for. I was reading some solutions to make the X Touch Mini work with MSFS 2020 and was not satisfied with these solutions with tons of sketchy software (FreePIE + script + vJoy + mapping in MSFS2020). Your solution is the best, backed by a great Python SimConnect project.

I have made a few improvements yesterday to your code to support manual events which requires a specific value set for example the A32NX Managed and Selected modes in the AP (odwdinc/Python-SimConnect#57).

    {
      "index": 4,
      "event_up": "AP_ALT_VAR_INC",
      "event_down": "AP_ALT_VAR_DEC",
      "event_press": {"event": "ALTITUDE_SLOT_INDEX_SET", "type": "manual", "value": 1, "description": "A32NX - set AP Altitude Hold to selected mode"},
      "event_long_press": {"event": "ALTITUDE_SLOT_INDEX_SET", "type": "manual", "value": 2, "description": "A32NX - set AP Altitude Hold to managed mode"}
    },

Or to support multiple events for a single press.

  "buttons": [
    {
      "index": 1,
      "event_press": ["TOGGLE_FLIGHT_DIRECTOR", "AP_MASTER"],
      "simvar_led": "AUTOPILOT_FLIGHT_DIRECTOR_ACTIVE"
    },

Other ideas not yet implemented:

  • conditional events based on a value (a bit like your triggers)
  • plane specific configuration (G1000 planes, A32NX, 787) based on the currently selected plane
  • UI to display the currently loaded configuration

Would love to contribute to the project, let me know if you want me to share the improvements to the code.

Heading button (2) causes heading bug to snap to current heading

Pressing the heading button 2 causes the heading bug to snap to the current heading. It looks like this is the behaviour for pressing in the encoder but should not be happening with just pressing button 2 according to the configuration:

  "index": 2,
  "event_up": "HEADING_BUG_INC",
  "event_down": "HEADING_BUG_DEC",
  "event_press": {
    "type": "condition",
    "event": [ "{% set heading = (data.get_simvar_value('HEADING_INDICATOR') * 180 / 3.14) | round %}",
                 "{{ data.trigger_event('HEADING_BUG_SET', heading) }}"],
    "description": "Set heading bug to current heading"

Compared to this, which shouldn't change the heading bug but does for me:
"index": 2,
"event_press": "AP_HDG_HOLD",
"simvar_led": "AUTOPILOT_HEADING_LOCK"

Pressure the button just shows this in the log:
on_note_data BTN: 2
on_note_data BTN: 2

Just wanted to add that I love the tool and thank you for your work!

Is it possible to run RPN scripts?

Is it possible to run a script, rather than an event, when a button is pressed? For example, this is how you toggle the Wing/Engine Anti-ice in the CJ4.

(A:STRUCTURAL DEICE SWITCH, Bool) 0 == if{ 1 (>L:DEICE_Airframe_1, bool) 1 (>L:DEICE_Airframe_2, bool) 1 (>K:TOGGLE_STRUCTURAL_DEICE) } els{ 0 (>L:DEICE_Airframe_1, bool) 0 (>L:DEICE_Airframe_2, bool) 0 (>K:TOGGLE_STRUCTURAL_DEICE) }

Can something like this be done?

Adding Mobiflight events to the config JSON schema

I love how you included a JSON schema for the config files that lists all the allowable event names. Would you consider adding all the Mobiflight ones to it as well?

In the same way you scrape the SDK for the native events, you can easily do the same for Mobiflight.

Just run this

document.querySelector('pre').textContent.split('\n').filter(text => !text.startsWith('//')).map(text => `Mobiflight.${text.split('#')[0]}`)

in the dev console here

https://raw.githubusercontent.com/Mobiflight/MobiFlight-Connector/main/MSFS2020-module/mobiflight-event-module/modules/events.txt

local/global variable set/get feature

Hello, is setting simvar values supported in event_press conditions?

I'm trying to create a COM swap button as follows:

    {
      "index": 6,      
      "event_press": {
        "type": "condition",
        "event": [ "{% if data.get_simvar_value('SWAP_COM') == 1.0 %}",
                  "{{ data.trigger_event('COM_STBY_RADIO_SWAP', 1.0) }}",
                  "{{ data.set_simvar_value('SWAP_COM', 0.0) }}",                  
                "{% else %}",
                  "{{ data.trigger_event('COM2_RADIO_SWAP', 1.0) }}",
                  "{{ data.set_simvar_value('SWAP_COM', 1.0) }}",                  
                "{% endif %}" ],
        "description": "Swap COM"
      }   

But set_simvar_value does not seem to work. Any ideas?

i can't launch the program

the program starts but warns me that the encoders are not set in relative2. I can't save the mini in relative2. I open the editor to change, but when I launch the program it is not in relative2. x-touch editor 1.21

Mobiflight events

Is it possible to get information which Mobiflight events are supported, which one is the correct documentation.
All Mobiflight events are shown here: https://hubhop.mobiflight.com/#/
If I use eg "Mobiflight.AS3000_PFD_SOFTKEYS_1" a message is shown that this event is not supported otherwise it is working well.
This message is appearing because the event is not part of simconnect, correct?
The test of suppported events should consider Mobiflight events.

If I look to the official Mobiflight documentation the name for this button should be:
AS3000_PFD_1_SOFTKEYS_1
Using this coding does not work.
Of course try an error is a possibility but not a convienient one.
All my test have been done with the latestet software release (Mobiflight and X-touch-mini-FS2020 using the default TBM930 from Asobo.
thx.

rotary encoder problem with Thrustmaster TCA Throttle buttons

Hi,

I'm still encountering a problem, which may and may not be associated with this script.

I'm using the Thrustmaster TCA Throttle and Stick. I know exactly when the problem occurs but have no idea why.

As soon as I push/adjust certain buttons (Engine Master 1 & 2, Crank/Mode Norm/IGN switch) on the Thrustmaster throttle, when I fiddle with the rotary encoders on the Behringer, they change the in-game value by 10x for HDG and SPD, and by 1000x feet for ALT.

If I turn everything to the default position on the throttle (Engine master switches off, IGN switch at norm position), then the rotary dials on the Behringer work perfectly fine (by 1s for HDG and SPD, 100s for ALT). But because when I'm in the air the Engine Switches are always in the ON position, I really can't use Behringer's rotary dials to control the AP accurately because the increments are not fine enough. (and I don't really want to sacrifice the functionality of master switches on the throttle, since I bought the stick and throttle for extra realism)

I don't encounter this problem if I disconnect my throttle, or simply delete the bindings of those buttons. Then I can change HDG and SPD by 1 increments, and 100 feet for ALT. And thrust lever works perfectly fine. But those engine/norm switches are one of the few buttons on the throttle, and for the added realism I want to keep it working if possible.

Any ideas why this happens and how to fix it?

CRJ config missing FLC/speed function

The config for the Speed function is missing (supposed to be button 12).

I've tried to fix it myself but to no avail with the following:

In config_crj.json:

{
  "index": 12,
  "event_press": { "event": "MobiFlight.ASCRJ_FCP_SPEED_BTN", "type": "manual", "value": 1 }
},

In events.user.txt:

// 12. FLC
ASCRJ_FCP_SPEED_BTN#(L:ASCRJ_FCP_SPEED,Bool) ! (>L:ASCRJ_FCP_SPEED,Bool)

But this doesn't work. I can't figure it out....

Button LEDs support

Hello,

I just got an X-Touch-Mini, so I am programming it based on the original samples provided and comments in other issues.
I am struggling with the button LEDs.

I am using MobiFlight, and I manually updated the events.txt file to add new vars. The variables are working fine, and I can see that in MSFS they are working as expected.
However, I cannot make the button LEDs work.

As an example, here are my MobiFlight vars for the APPR button:
A32NX_AUTOPILOT_APPR_MODE_RELEASED#0 (>L:A32NX_AUTOPILOT_APPR_MODE)
A32NX_AUTOPILOT_APPR_MODE_PRESSED#1 (>L:A32NX_AUTOPILOT_APPR_MODE)

And here is my code for the APPR button for the A32NX (in "buttons"):

{
  "index": 15,
  "event_press": {
    "type": "condition",
    "event": [ "{% if data.get_global_variable('APPR_ACTIVE') == true %}",
				 "{{ data.trigger_event('MobiFlight.A32NX_AUTOPILOT_APPR_MODE_RELEASED', 1) }}",
				 "{{ data.set_global_variable('APPR_ACTIVE', false) }}",
				 "{{ data.set_button_led(15, 0) }}",
               "{% else %}",
				 "{{ data.trigger_event('MobiFlight.A32NX_AUTOPILOT_APPR_MODE_PRESSED', 1) }}",
				 "{{ data.set_global_variable('APPR_ACTIVE', true) }}",
				 "{{ data.set_button_led(15, 1) }}",
               "{% endif %}" ]
  }
}

I tried everything:
"{{ data.set_button_led(15, 1) }}",
"{{ data.set_button_led(15, True) }}",
"{{ data.set_button_led(15, true) }}",

And of course, I also used the simvar_led method:

{
  "index": 15,
  "event_press": {
    "type": "condition",
    "event": [ "{% if data.get_global_variable('APPR_ACTIVE') == true %}",
				 "{{ data.trigger_event('MobiFlight.A32NX_AUTOPILOT_APPR_MODE_RELEASED', 1) }}",
				 "{{ data.set_global_variable('APPR_ACTIVE', false) }}",
               "{% else %}",
				 "{{ data.trigger_event('MobiFlight.A32NX_AUTOPILOT_APPR_MODE_PRESSED', 1) }}",
				 "{{ data.set_global_variable('APPR_ACTIVE', true) }}",
               "{% endif %}" ]
  }
  "simvar_led": "MobiFlight.A32NX_AUTOPILOT_APPR_MODE"
}

If you have any ideas, I would be grateful.
Cheers!

Vicente

ADF 1, 10 & 100 on a single rotary swtich?

Hi,

I wonder if it would be possible to set ADF 1, 10 & 100 KHz to a single rotary switch? Something like this:

{
  "index": 6,
  "description": "ADF Settings",
  "event_up": "ADF_100_INC",
  "event_down": "ADF_100_DEC",
  "alternate_event_up": "ADF_10_INC",
  "alternate_event_down": "ADF_10_DEC",
  "alternate2_event_up": "ADF_1_INC",
  "alternate2_event_down": "ADF_1_DEC",
  "event_short_press": "{alternate}",
  "event_long_press": "{alternate2}"
},

Controlling encoder LEDs

Is it possible to control the encoder LEDs just like the button LEDs? With e.g.
"simvar_led": "AUTOPILOT_FLIGHT_DIRECTOR_ACTIVE"
I'd like to configure the different Autopilot toggles to the encoder press events and still have visual feedback, if the APs are on or off.

All LEDs of one encoder treated as one would be fine.
The LEDs should all still be on when the encoder is turned.

It would also be nice to turn all LEDs of the specific encoder off. So turning the encoder does not create misleading LED positions. (This can still be done by a mask over the hardware ;) )

Encoder rotation velocity questions

Hello, not sure it's at the stage of "reporting a bug" yet but I thought I'd open a task to discuss. I'm having some trouble with encoder rotation velocity behavior (as in, faster one rotates the encoder => how fast does the value change).

I've noticed two opposite issues and taking a look at the code I cannot explain them quite yet, but here are two different behaviors to discuss.

Possibly related code: https://github.com/maartentamboer/X-Touch-Mini-FS2020/blob/main/rotaryencoder.py#L101 and maybe #69 (although it should be fixed)

1/ CRJ heading/altitude changes going way too fast if encoder rotated too fast.

In the CRJ when the heading/altitude encoder is being rotated, at low rotation speed it will simply increment by one, but if the rotation is a bit faster then it will get in a mode where it increases the value by a lot (eg. altitude by 1400ft for each "notch" or heading between 15+ degrees). Stopping rotation for a bit might help but it often doesn't. It makes it quite difficult to be precise if getting into this situation.

2/ Default config on G1000 NXi and altitude

Opposite of that for G1000 NXi using the default config, if rotated too fast the value change actually slows down. Here is an extreme example with the logs from the program, doing a quick rotation:

on_cc_data: 3: 65
on_cc_data: 3: 68
on_cc_data: 3: 70
on_cc_data: 3: 71
on_cc_data: 3: 71
on_cc_data: 3: 71
on_cc_data: 3: 70
on_cc_data: 3: 71
on_cc_data: 3: 71
on_cc_data: 3: 70
on_cc_data: 3: 70
on_cc_data: 3: 70
on_cc_data: 3: 69

  => exp. number of altitude increment: Sum - 64 * Count = 75 => 7500 feet.
  => actual change in altitude on NXi G1000: 200 feet.

This is kinda visible but not as difficult to deal with with the first example.

Are you able to reproduce this? Do you think this could be coming from the velocity implementation sending multiple events depending on how fast the controller is reporting?

Layer B Encoder press # are incorrect

On layer B

encoder 1 press = ENC 10
encoder 2 press = ENC 11
etc
encoder 7 press = ENC 16
encoder 8 press does not have a number

Correction:

encoder 1 press should = 9

Love this program so far, works a treat (except above...)
Thanks for your efforts.

Exception during execution of template

is it normal for cj4 and 1.6.0
image

Loading config file: Configurations/config_cj4.json
Exception during execution of template: unsupported operand type(s) for /: 'NoneType' and 'float'
For template: {% set encoder_index = data.get_global_variable('HEADING_ENC_IDX') %}
{% set heading = (data.get_simvar_value('AUTOPILOT_HEADING_LOCK_DIR') / 27.0) | round %}
{{ data.set_encoder_led_value(encoder_index, heading) }}

Exception during execution of template: '>' not supported between instances of 'NoneType' and 'int'
For template: {% set button_index = data.get_global_variable('BATT_BUT_IDX') %}
{% set batt_load = data.get_simvar_value('ELECTRICAL_BATTERY_LOAD') %}
{% set battery_on = data.get_simvar_value('ELECTRICAL_MASTER_BATTERY') %}
{{ data.set_button_led(button_index, battery_on, blink=(batt_load > 0)) }}

Exception during execution of template: unsupported operand type(s) for /: 'NoneType' and 'float'
For template: {% set encoder_index = data.get_global_variable('HEADING_ENC_IDX') %}
{% set heading = (data.get_simvar_value('AUTOPILOT_HEADING_LOCK_DIR') / 27.0) | round %}
{{ data.set_encoder_led_value(encoder_index, heading) }}

PMDG DC6 Config

Is not finish, but i share a sample config for PMDG DC6 plane

config.json

  "aircraft": [
    ....
    {
      "aircraft_contains": "PMDG DC-6",
      "file": "config_dc6.json"
    }
 ],
....

events.user.txt

....
DC6_AP_BTN#43401 (>K:ROTOR_BRAKE)
DC6_AP_HANDLE_BTN#40401 (>K:ROTOR_BRAKE)
DC6_AP_PITCH_UP#440 100 * 8 + (>K:ROTOR_BRAKE)
DC6_AP_PITCH_DOWN#440 100 * 7 + (>K:ROTOR_BRAKE)
DC6_AP_TURN_KNOB_LEFT#442 100 * 8 + (>K:ROTOR_BRAKE)
DC6_AP_TURN_KNOB_RIGHT#442 100 * 7 + (>K:ROTOR_BRAKE)
DC6_AP_ALT_HOLD_BTN#43601 (>K:ROTOR_BRAKE)
DC6_PROP_PITCH_UP#518 100 * 7 + (>K:ROTOR_BRAKE)
DC6_PROP_PITCH_DOWN#518 100 * 8 + (>K:ROTOR_BRAKE)

config_dc6.json

{
  "$schema": "./config.schema.json",
  "version":
  {
    "major": 1,
    "minor": 0,
    "patch": 0
  },
  "encoders": [
    {
      "index": 1,
      "event_up": { "event": "MobiFlight.DC6_AP_TURN_KNOB_RIGHT", "type": "manual", "value": 1 },
      "event_down": { "event": "MobiFlight.DC6_AP_TURN_KNOB_LEFT", "type": "manual", "value": 1 }
    },
    {
      "index": 2,
      "event_up": "KOHLSMAN_INC",
      "event_down": "KOHLSMAN_DEC",
      "event_press": "BAROMETRIC"
    },
    {
      "index": 3,
      "event_up": { "event": "MobiFlight.DC6_AP_PITCH_UP", "type": "manual", "value": 1 },
      "event_down": { "event": "MobiFlight.DC6_AP_PITCH_DOWN", "type": "manual", "value": 1 },
      "event_press": { "event": "MobiFlight.DC6_AP_ALT_HOLD_BTN", "type": "manual", "value": 1 }
    },
    {
      "index": 4,
      "event_up": "AP_SPD_VAR_INC",
      "event_down": "AP_SPD_VAR_DEC",
      "alternate_event_up": "AP_VS_VAR_INC",
      "alternate_event_down": "AP_VS_VAR_DEC"
    },
    {
      "index": 5,
      "event_up": "COM_RADIO_WHOLE_INC",
      "event_down": "COM_RADIO_WHOLE_DEC",
      "alternate_event_up": "COM_RADIO_FRACT_INC",
      "alternate_event_down": "COM_RADIO_FRACT_DEC",
      "event_short_press": "{alternate}",
      "event_long_press": "COM_STBY_RADIO_SWAP"
    },
    {
      "index": 6,
      "event_up": "NAV1_RADIO_WHOLE_INC",
      "event_down": "NAV1_RADIO_WHOLE_DEC",
      "alternate_event_up": "NAV1_RADIO_FRACT_INC",
      "alternate_event_down": "NAV1_RADIO_FRACT_DEC",
      "event_short_press": "{alternate}",
      "event_long_press": "NAV1_RADIO_SWAP"
    },
    {
      "index": 7,
      "event_up": "ELEV_TRIM_UP",
      "event_down": "ELEV_TRIM_DN"
    },
    {
      "index": 8,
      "event_up": { "event": "MobiFlight.DC6_PROP_PITCH_UP", "type": "manual", "value": 1 },
      "event_down": { "event": "MobiFlight.DC6_PROP_PITCH_DOWN", "type": "manual", "value": 1 }
    }
  ],
  "buttons": [
    {
      "index": 1,
      "event_press": { "event": "MobiFlight.DC6_AP_BTN", "type": "manual", "value": 1 },
      "simvar_led": "AUTOPILOT_FLIGHT_DIRECTOR_ACTIVE"
    },
    {
      "index": 2,
      "event_press": "AP_HDG_HOLD",
      "simvar_led": "AUTOPILOT_HEADING_LOCK"
    },
    {
      "index": 3,
      "event_press": { "event": "MobiFlight.DC6_AP_ALT_HOLD_BTN", "type": "manual", "value": 1 },
      "simvar_led": "AUTOPILOT_ALTITUDE_LOCK"
    },
    {
      "index": 4,
      "event_press": "AP_VS_HOLD",
      "simvar_led": "AUTOPILOT_VERTICAL_HOLD"
    },
    {
      "index": 5,
      "event_press": "AP_APR_HOLD",
      "simvar_led": "AUTOPILOT_APPROACH_HOLD"
    },
    {
      "index": 6
    },
    {
      "index": 7
    },
    {
      "index": 8,
      "event_press": "FLAPS_DECR"
    },
    {
      "index": 9,
      "event_press": { "event": "MobiFlight.DC6_AP_HANDLE_BTN", "type": "manual", "value": 1 },
      "simvar_led": "AUTOPILOT_MASTER"
    },
    {
      "index": 10,
      "event_press": "AP_NAV1_HOLD",
      "simvar_led": "AUTOPILOT_NAV1_LOCK"
    },
    {
      "index": 11
    },
    {
      "index": 12,
      "event_press": "FLIGHT_LEVEL_CHANGE",
      "simvar_led": "AUTOPILOT_FLIGHT_LEVEL_CHANGE"
    },
    {
      "index": 13,
      "event_press": "YAW_DAMPER_TOGGLE"
    },
    {
      "index": 14,
      "event_press": "TOGGLE_MASTER_BATTERY"
    },
    {
      "index": 15,
      "event_press": "GEAR_TOGGLE"
    },
    {
      "index": 16,
      "event_press": "FLAPS_INCR"
    }
  ],
  "faders": [
    {
      "index": 1,
      "event_change": "THROTTLE_AXIS_SET_EX1",
      "min_value": -16383,
      "max_value": 16383
    }
  ],
  "triggers": [
    {
      "trigger_type": "condition-file",
      "simvar": "AUTOPILOT_VERTICAL_HOLD",
      "condition": "Functions/Generic/ap-spd-vs-encoder-switcher.jinja2"
    },
    {
      "trigger_type": "condition-file",
      "simvar": "AUTOPILOT_HEADING_LOCK_DIR",
      "condition": "Functions/Generic/hdg-lock-sync.jinja2"
    },
    {
      "trigger_type": "condition-file",
      "simvar": "GEAR_POSITION",
      "condition": "Functions/Generic/gear-position-sync.jinja2"
    },
    {
      "trigger_type": "condition-file",
      "simvar": "FLAPS_HANDLE_INDEX",
      "condition": "Functions/Generic/flaps-position-sync.jinja2"
    },
    {
      "trigger_type": "condition-file",
      "simvar": "GEAR_POSITION",
      "condition": "Functions/Generic/flaps-position-sync.jinja2"
    },
    {
      "trigger_type": "condition-file",
      "simvar": "GEAR_POSITION",
      "condition": "Functions/Generic/yd-active-sync.jinja2"
    },
    {
      "trigger_type": "condition-file",
      "simvar": "AUTOPILOT_YAW_DAMPER",
      "condition": "Functions/Generic/yd-active-sync.jinja2"
    },
    {
      "trigger_type": "condition-file",
      "simvar": "ELECTRICAL_BATTERY_LOAD",
      "condition": "Functions/Generic/batt-load-sync.jinja2"
    }
  ],
  "initialization": {
    "global_variables": [
      {
        "name": "HEADING_ENC_IDX",
        "value": 1
      },
      {
        "name": "AP_SPD_ENC_IDX",
        "value": 4
      },
      {
        "name": "FLAPS_UP_BUT_IDX",
        "value": 8
      },
      {
        "name": "YD_BUT_IDX",
        "value": 13
      },
      {
        "name": "BATT_BUT_IDX",
        "value": 14
      },
      {
        "name": "GEAR_BUT_IDX",
        "value": 15
      },
      {
        "name": "FLAPS_DN_BUT_IDX",
        "value": 16
      }
    ]
  }
}

Help with installation please

Sorry for bothering you with troubleshooting... unfortunately, I'm finding the instructions lack enough detail for me to make this work. I've downloaded and run the exe after launching the sim (from various screens through to sitting at the gate) as well as before launching the sim. I have the Behringer utility installed and it recognizes my device. SimConnect is installed (it's part of the FS2020 SDK which I have installed). It doesn't seem to be working however and I have no idea how to proceed. Thanks for any help.

Encoder led status not synced when switching between layers

Hi,
Many thanks for the latest release, with great improvements.

I noticed than, when switching between layers, the LED status of the encoder don't re-sync.
For example : i use AP controls on Layer A, and now I've set up the encoders so that they light up when activating AP controls.
I use Layer B for garmin encoder and keys - thanks to mobiflight wasm module - which works great. But when switching back from LAyer B to layer A, the encoders leds are out of sync.

CRJ - Throttle via vjoy

Hi, any possibility to integrate the management of the throttle slide with vjoy to be used it with the new CRJ plane ?

Setup issue - OSError connecting to X-TOUCH MINI

Hi,

I got a problem with Behringer x-touch mini and using the X-Touch-Mini-FS2020.
The X-TOUCH MINI is setup via the Behringer Editor app, and rotary encoders are set to "Relative 2" mode.
When I start MSFS 2020 and then run the x-touch mini-fs2020.exe, the python script gives this error:

OSError: unknown port ‘X-TOUCH MINI 1’
[1228] Failed to execute script main

I also tried changing the Device ID to different values in Behringer Editor, as well as Global CH to other channels, but that didn't solve the issue.

The thing is, the x-touch mini works perfectly fine with my ableton software (with Mackie Control mode). So there is no issue with the detection, drivers etc.

In Device Manager, under "Software devices" I can see "X-TOUCH MINI [0]" and "X-TOUCH MINI [1]" as well as under "Sound, video and game controllers" I can see "X-TOUCH MINI".

I also have an audio interface (EDIROL FA-66) with physical MIDI in/outs, I think that could be the reason why the script can’t connect to my behringer using python’s “mido”.

Edit: If I disable my audio interface under "Sound, video and game controllers", the script can connect without any problems. So it seems the audio interface's midi ports somehow conflict with this script.

Any idea how to fix it?

Encoder lights

Hi,

can you add a simple option to the encoders to set light to current status (first, alternate1, alternate2),
like "autolights": 0/1 and "on"/"off"
which sets 1/2 or 3 lights depending on status

Andreas

Override a default config to avoid copying between config files

Many of my plane settings habe common rotary/buttons. Is it possible to have a common config file and only plane specific values in other files (other languages have something like a perform) . I'm not talking about global values.
Yes I understand the problem of aircraft load time, we would have to wait until the flight/plan is really loaded.
thx

Originally posted by @reimuell in #57 (comment)

Set-Up Issue - 2

Hi Maarten,

I think I'm having the same issue as tombaer1044 before, but unfortunately that topic was closed due to inactivity.
I got myself a Mini today and was trying to get it working with the zip you provided.

I've set the encoders to the relative2 mode in the x-touch editor. Started FS2020 and got in the stock 747 to test it.

CMD says the following:
Midi input devices: ['X-TOUCH MINI 0']
Midi output devices: ['Microsoft GS Wavetable Synth 0', 'X-TOUCH MINI 1']
Using midi input device: X-TOUCH MINI 0
Using midi output device: X-TOUCH MINI 1
Current aircraft: b'Boeing 747-8i Asobo'
Loading config file: Configurations/config_default.json

But I cannot get the Mini to work in the plane. The lights on the console in the plane do work when I turn on A/P and change and set items as flight-level and heading.

Would you be able to advise what I could do or change in the setup to get it working?

Alvast bedankt!

Groeten Kevin

Turning the X-Tocuh button LEDs on/off?

How do I control the LEDs on the x-touch to get the lights on/off when enabling disabling a cockpit feature? For example, I've mapped a few buttons to turn the taxi/landing lights on and off but I'd like to get the lights on the x-touch to go on and off with them but I don't see anything obvious. No rush on this and thanks again for putting together this great little tool.

Process hangs and can not be terminated

If the program loses connection to the Midi-Controller, or the configuration.json is changed during runtime, the process will run forever without accepting any inputs.
It can not be terminated by the Windows Task Manager nor a taskkill command. A forced shutdown (powerbutton) of the PC is necessary in order to be able to restart X-Touch-Mini-FS2020.exe again.

simvar_led's not working

Hi. I am trying to work out why Simvar LEDs have never worked correctly for me.

Today I upgraded to 1.6.1 release, updated the x-touch mini config files using x-touch editor, and used the default config flying a TBM-930.

As the x-touch-mini-fs2020 app starts I verified that it is using X-TOUCH MINI 1 as the midi output device.

Input commands from the x-touch mini (knob encoders, knob press and buttons) all work correctly.

I have tried sending midi commands to the x-touch to turn on and off LEDs from the Bome SendSx tool and I can get the LEDs to light up and turn off with MIDI commands so I know my x-touch LEDs are working

Any ideas why I am not getting any LED response at all on my x-touch?

Add documentation to modifiy configuration file

Hi,

I have Logitech Yoke so I don't need fader to simulate speed brake. I try this config_a320.json:

{ "version": { "major": 1, "minor": 1, "patch": 0 }, "encoders": [ { "index": 1, "event_up": "KOHLSMAN_INC", "event_down": "KOHLSMAN_DEC", "event_press": "BAROMETRIC" }, { "index": 2, "event_up": "AP_SPD_VAR_INC", "event_down": "AP_SPD_VAR_DEC", "event_press": { "event": "SPEED_SLOT_INDEX_SET", "type": "manual", "value": 1, "description": "A32NX - set AP Speed Hold to selected mode" }, "event_long_press": { "event": "SPEED_SLOT_INDEX_SET", "type": "manual", "value": 2, "description": "A32NX - set AP Speed Hold to managed mode" } }, { "index": 3, "event_up": "HEADING_BUG_INC", "event_down": "HEADING_BUG_DEC", "event_press": { "event": "HEADING_SLOT_INDEX_SET", "type": "manual", "value": 1, "description": "A32NX - set AP Heading Hold to selected mode" }, "event_long_press": { "event": "HEADING_SLOT_INDEX_SET", "type": "manual", "value": 2, "description": "A32NX - set AP Heading Hold to managed mode" } }, { "index": 4, "event_up": "AP_ALT_VAR_INC", "event_down": "AP_ALT_VAR_DEC", "event_press": { "event": "ALTITUDE_SLOT_INDEX_SET", "type": "manual", "value": 1, "description": "A32NX - set AP Altitude Hold to selected mode" }, "event_long_press": { "event": "ALTITUDE_SLOT_INDEX_SET", "type": "manual", "value": 2, "description": "A32NX - set AP Altitude Hold to managed mode" } }, { "index": 5, "event_up": "AP_VS_VAR_INC", "event_down": "AP_VS_VAR_DEC", "alternate_event_up": "AP_VS_VAR_INC", "alternate_event_down": "AP_VS_VAR_DEC", "event_press": "AP_PANEL_VS_ON" } ], "buttons": [ { "index": 1, "event_press": [ "TOGGLE_FLIGHT_DIRECTOR", "AP_MASTER" ], "simvar_led": "AUTOPILOT_FLIGHT_DIRECTOR_ACTIVE" }, { "index": 4, "event_press": "AP_MASTER", "simvar_led": "AUTOPILOT_MASTER" }, { "index": 5, "event_press": "AP_MASTER", "simvar_led": "AUTOPILOT_MASTER" }, { "index": 6, "event_press": "SPOILERS_ARM_TOGGLE", "simvar_led": "SPOILERS_ARMED" }, { "index": 10, "event_press": "AUTO_THROTTLE_ARM", "simvar_led": "AUTOPILOT_THROTTLE_ARM" }, { "index": 12, "event_press": "AP_LOC_HOLD", "simvar_led": "AUTOPILOT_NAV1_LOCK" }, { "index": 13, "event_press": "AP_APR_HOLD", "simvar_led": "AUTOPILOT_APPROACH_HOLD" } ], "faders": [ { "index": 1 } ], "triggers": [ { "simvar": "AUTOPILOT_VERTICAL_HOLD", "trigger_type": "encoder", "trigger_index": 5 } ] }

but at execution, I have this error:

C:\Utilitaires\MFS\X-Touch-Mini-FS2020>X-Touch-Mini-FS2020.exe
Current aircraft: b'Airbus A320 Neo Air France'
Loading config file: Configurations/config_a320.json
Traceback (most recent call last):
File "main.py", line 100, in
File "main.py", line 63, in main_app
File "configfile.py", line 35, in configure
File "configfile.py", line 115, in _configure_faders
KeyError: 'event_change'
[15520] Failed to execute script main

So a little documentation will be nice. Another question: Idon'tknow where is Triggers ?

Thanks for tour help

Mobiflight events

Hello,

I need some help.
Not a single mobiflight G1000 command is working. I tried different , many. Any change to monitor, track this.
Steps I have done.
X touch softwaree 1.0.3 downloaded.
Mobiflight downloaded, Beta flagged, Module copied to community folder (checked: it's really there), Mobiflight is running too.

Starting x-touch-mini-fs2020, running , selected the correct config file with mobiflight commands, correct button is recognized (I see this in the console).

Nothing happens on/with the G1000 (Cessna). i tried directto button and different other buttons.
Any idea , hint.

I'm using visual studio to change the config files. While coding events I get syntax proposals. All mobiflight events are not visible. ? Because Mobiflight ist unknown to the visual studio environment? Correct?

Set-Up Issue

Dear Maarten,
at first many thanks for your effort! Really appreciate your project.

However, I only got this far:

  • The command window remains open (thanks to your tip with the command prompt)
  • The command window recognizes the airplane and shows "Loading config file: Configurations/config_default.json"
  • The command window recognizes the Xtouch and shows the individual inputs as "on_cc_data:" with the respective No. behind

And this is where the issue starts. I can twist and turn the knobs, but nothing seems to happen in the plane ... I re-installed the simconnect and even the current sdk...

Am I overlooking a step in the installment?

Thanks again for your efforts!
Best,
Thomas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.