MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

icon
Avatar
moripas
Posts: 3
hi , sorry for my english , i 'm french and i 'm not speak english very well :love:

i have a problem when i want create a switch for the " landing light" in my pmdg 737 , " mobiflight " and p3dv4
in p3dv4 , when i want extend and activate the landing light , i clic with the left button of the mouse
for extend and i click with the right button of the mouse for retract them .
that is ok.

also ,when i want create this switch in mobiflight , the event number ( 536870912 ... MOUSE_FLAG_LEFTSINGLE ) is operationnal for extend, and when i want enter the event number ( 2147483648....MOUSE_FLAG_RIGHTSINGLE ) , for retract , it is not possible , and there are an error message : the number is too big , the maximum number is : 2147483647.....

thank you very much for help :-/
2018-05-27 20:17
Avatar
StephanHo
From: EDDG, Germany
Posts: 1867
Supporter
Hi moripas,

welcome to MobiFlight!

I think you are using the wrong parameters.

Please usa as follows:

Event_ID 69743 (EVT_OH_LIGHTS_L_RETRACT)
You need an ON-OFF-ON-switch
Retract Lights are moved in = the switch is in the TOP-position
Retract Lights are out but off = the switch is in the MIDDLE-position
Retract Lights are out an switched on = the switcht is in the bottom position

RETRACT_OFF
Input pin 1: EVENT_ID 69743 ON PRESS Parameter: 0 - ON RELEASE Parameter 1 [TOP-and Middle-position of the switch]
Input pin 2: EVENT_ID 69743 ON PRESS Parameter 2 - ON RELEASE Parameter 1 [BOTTOM and Middle-position of the switch]

Do the same with the EVT_OH_LIGHTS_R_RETRACT (EVENT_ID 69744)

Please report your experiences.
Grüße,
Stephan (Time: UTC+2)
2018-05-28 07:58
Avatar
moripas
Posts: 3
hello, thank you for your help, :w00t:
it works perfectly with your values ​​in parameter, in return I did not understand why we must write parameter "0" , "1" or "2 " ?
can you explain me simply ?

best regards .
pascal
2018-05-28 14:38
Avatar
StephanHo
From: EDDG, Germany
Posts: 1867
Supporter
Hello Pascal,

great, if it works.

Why the programmer of PMDG in this case has just taken these parameters, I do not know. But: Basically, certain parameters are always used the same way in the PMDG.

Wherever something is rotated, such as an encoder, the parameters for Mousewheel are used up / down.

The rotary switches always use the parameters 0, 1, 2, 3 ....

For simple switches, you have to try whether 0 or 1 or left / right mouse click.

As far as I know, the light switches are always 0, 1 or 2.

With the parameters one must get rid of the fact that a 0 turns off something, a 1 or two switches something on. OFF could also be the 2 from the pure logic. Here the programmer pursues his own logic, which however, when "built" by a studied programmer, follows the learned logic, which is always logical. Logically, right? ;)
So it's up to the programmer who fixes these things.

To your switch, why you need two pins of the MEGA and the parameters:

The numbers have the advantage that we understand them logically easier. The parameters could also be called peanuts, bananas or oranges. Here we have, however, which promotes better understanding, only 0, 1 and 2.

The switch is wired as follows: 3 connections, the lower one stands for the OFF position and comes to the 1st pin of the MEGA, the middle connection is connected to GND and the upper goes to the 2nd pin of the MEGA.
The connections are reversed at the top and bottom because the connections are closed by the lever opposite.

To proceed: Assuming that the shift lever is in the upper position, so GND is switched from the middle port to the lower port and thus to Pin1 of the MEGA. This tells Mobiflight to send parameter 0 to the simulator. The parameter 0 is thus the Zusatnd lights retracted and OFF assigned.

However, if the gear lever is now in the middle, Mobiflight does not recognize this position, but only recognizes that GND Pin1 is no longer in contact. This corresponds to the ON RELEASE state. This, in turn, causes MobiFlight to send a 1 (because it puts it that way) to the simulation. As a result, the lamp is extended, but still remains off.

If the lever is now folded down, GND is now placed on the upper terminal of the switch and thus on pin2 of the MEGA. Mobiflight detects this and sends the parameter 2 to the simulation (always connected to the corresponding EventID), which turns on the light.

What follows is again the switch in middle position. As a result, Mobiflight detects that GND is no longer present at pin2, which now means for this pin ON RELEASE, whereupon parameter 1 is again sent to the simulation. The light is then turned off, but the headlight remains extended. The rest is repeated.

If you have not realized things in English, you can simply copy this text and copy it to the Google translator and have it translated to French there.

I've tried to explain the context to you in simple terms and hope it's understandable for you.

If you have further questions, do not be afraid to ask them here in the forum. Every user has his or her area of ​​expertise here and will be happy to help you as best he can. It will not take long, then you can help other users ;)
Grüße,
Stephan (Time: UTC+2)
2018-05-28 17:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Just two additional informations....


1.
iconmoripas:


also ,when i want create this switch in mobiflight , the event number ( 536870912 ... MOUSE_FLAG_LEFTSINGLE ) is operationnal for extend, and when i want enter the event number ( 2147483648....MOUSE_FLAG_RIGHTSINGLE ) , for retract , it is not possible , and there are an error message : the number is too big , the maximum number is : 2147483647.....

/



Whatever you will not use the rightsingle click here as stephan said.... This Problem will happen lots of time with PMDG and Mobiflight on other spots like Buttons !

This is a Signed/Unsigned Problem. PMDG work Unsigned here ( Value from 0 - 4.294.967.295) Mobiflight is Signed ( Value from MINUS −2.147.483.648 to 2.147.483.647 )
In Integer Count logic the numbers above the Half range are go with MINUS in front back to 0 ..... So the needed 2147483648 is in Signed format simply the same in MINUS.
Put a "-" in front and all is fine !
( If you like to lear more about that check this https://en.wikipedia.org/wiki/Integer_(computer_science) )


2.
iconStephanHo:



Why the programmer of PMDG in this case has just taken these parameters, I do not know. But: Basically, certain parameters are always used the same way in the PMDG.



It sucks that PMDG not have a 100% clear logic ( some functios work different) BUT 99% of stuff is also logical !

I think the basic rule is....
1. IF a Input is Momentary Button THEN its a Execute Event ( that start a sequence and is contolled always by a Mouse Action).... So you use Leftclick Parameter most of time ( Parameter 1 and 0 will not work i think on most Button events)
1b. IF its a ON/OFF Non Momentary the it work with LEFT and RIGHT Click most of the time

2. If a Input have more then 2 status like the 3 Way switches of ADF Selector in EFIS or the LandingLights (Or all Multiposition Rotary switches) THEN they use always parameter SET... Means Upper or Left Position is Parameter 0 .... NExt Position is 1 then 2 and so on . ( Here Mouswheel will work but is not usefull cause position can be wrong then)

3. If a Input is a Encoder setting THEN Mouswheel UP/Down work fine cause it include a internal "Fast" logic i think..... But Left/Rightclick should work here, too.
Good Luck !
2018-05-29 08:30
Avatar
moripas
Posts: 3
Hello and thank you again for your answers,
it's a little clearer for me. I have to test for each function I want.
Thank you and see you soon .

best regard . pascal :thumbup:
2018-05-29 16:24
icon