Jump to content

Sign in to follow this  
Djeez1

How to operate MFD buttons through SDK ?

Recommended Posts

When using the SDK to control the 737NGX I experience strange behavior when controlling the MFD buttons such as

EVT_MPM_MFD_ENG_BUTTON and EVT_MPM_MFD_SYS_BUTTON.

When I send a control with parameter 1 the button gets pressed and the MFD changes, but when I send a parameter -1, the button is released but the function is activated again, resulting in another change in MFD. How should I properly release the button press without activating the function again?

Thanks!

Emile van Gerwen.

(737NGX on P3D v2.5)


Emile van Gerwen.

Share this post


Link to post
Share on other sites

Emile, it depends of the function.  For example, pitch control cannot generally be turned on or off rather it changes from one mode to another.  This is on the MCP and of course I reread and saw MFD......, I suspect the button has only a press value since they are spring loaded and do not stay in when pressed.

Edited by downscc

Dan Downs KCRP

Share this post


Link to post
Share on other sites

Thanks for your response. In this case, you can see in the Virtual Cockpit that the button is pressed and keeps being down if I send it the "1" parameter. Furthermore, it is not possible to "press" it again by sending it another "1" so it looks like I really need it to "release" again. This does happen when I send it a "-1", but, and that is my problem, that triggers the function again.

Regards,

 

Emile van Gerwen,


Emile van Gerwen.

Share this post


Link to post
Share on other sites

That is interesting, because they operate on a mouse click as a momentary spring return button.  May I suggest that you document the discrepancy in a trouble ticket, not sure it will lead to anything quickly but it might be of value in the development of NG3.


Dan Downs KCRP

Share this post


Link to post
Share on other sites

For others having the same issue:

I found a solution to not set a value directly but to emulate a mouse click:

MOUSE_FLAG_LEFTSINGLE = 0x20000000  # mouse click from PMDG SDK
ipc.control(70095, MOUSE_FLAG_LEFTSINGLE)

This is not showing the on-screen button pressed and released the same as the physical button but clicking the physical button presses and releases the on-screen button, just as it would at mouse click.

Emile van Gerwen.


Emile van Gerwen.

Share this post


Link to post
Share on other sites

When setting controls directly, buttons and 2-position switches are boolean (0 and 1).  In C++ 0 is 'false' and I think any other value that can be implicitly converted to a bool is 'true'.  Examples from my NG in FSUIPC:

1=P1,6,C70316,1 ; EVT_CONTROL_STAND_TOGA1_SWITCH         1=Depress     -{Custom control: <70316>}-
2=P1,3,C70319,1 ; EVT_CONTROL_STAND_TOGA2_SWITCH         1=Depress     -{Custom control: <70319>}-
3=U1,6,C70316,0 ; EVT_CONTROL_STAND_TOGA1_SWITCH         0=Release     -{Custom control: <70316>}-
4=U1,3,C70319,0 ; EVT_CONTROL_STAND_TOGA2_SWITCH         0=Release     -{Custom control: <70319>}-
5=P1,5,C70314,1 ; EVT_CONTROL_STAND_AT1_DISENGAGE_SWITCH 1=Depress     -{Custom control: <70314>}-
6=U1,5,C70314,0 ; EVT_CONTROL_STAND_AT1_DISENGAGE_SWITCH 0=Release     -{Custom control: <70314>}-
7=P1,2,C70317,1 ; EVT_CONTROL_STAND_AT2_DISENGAGE_SWITCH 1=Depress     -{Custom control: <70317>}-
8=U1,2,C70317,0 ; EVT_CONTROL_STAND_AT2_DISENGAGE_SWITCH 0=Release     -{Custom control: <70317>}-

 


Larry

i9-9900k@5.0 HT, Maximus XI Code, 16GB TridentZ @ 4000, 2080Ti FTW3 Ultra Hydro, ekwb EK-KIT P360 water, 4K@30, W10 Pro, P3D v5.0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    18%
    $4,700.00 of $25,000.00 Donate Now
×
×
  • Create New...