Jump to content
The simFlight Network Forums

PMDG


gfd

Recommended Posts

I just purchased the PMDG 777 for P3D. I have it installed in 2.5. I use the button screen, thanks for that, to program controls. I learned a lot doing the Aerosoft Airbus, but it seems this is a different bird.

 

I had a brief look at the SDK and it appears that everything is programmed using C++. Perhaps I misinterpreted that. I was hoping to reference local variables and write lua scripts to assign to button screen buttons. 

 

I am seeing entries like this in the LINDA module: ipc.control(PMDGBaseVariable +CDUCstartVar+ 38, 1). I am unfamiliar with that. I am not asking you to second guess what the good folks at LINDA are doing. I just want to get a start. I could hack LINDA and copy the necessary routines into a file in the Modules folder, but I'd feel like a bit of a burglar. I dabble a bit in C# and if necessary, I could look into acquiring a few C++ skills. I'm a little leery of that, given it interacts with Windows at a lower level than managed languages. I don't want to flush my toilet when I move the throttle!

 

If I could be pointed in the right direction, I would appreciate it. You know, it would be brilliant if LINDA would support the button screen. I don't think I'll hold my breath though.

 

Hope you had a good trip.

Link to comment
Share on other sites

Hi Graham,

 

Since Pete is away I can give you a few pointers.

ipc.control(PMDGBaseVariable +CDUCstartVar+ 38, 1)

This is a lua function to send a 'control' (aka 'event') to the flight sim. The flight sim will respond to whatever the control is meant to do, for example FSX has built in controls to turn on lights, operate the landing gear and loads more. These cannot be read like offsets they are just commands that perform actions. Some controls have a parameter if a value is needed. For example a control that toggles the parking brake does not require a parameter, but one that sets the autobrake to a certain position will.

 

PMDG seem to use controls rather than LVars for allowing control of the aircraft (certainly the case for the 737NGX and it seems from what you've wrote that the 777 works this way as well).

 

Developers can add their own custom controls over and above the built in ones for FSX/P3D and this is what PMDG have done.

 

The list of built in controls is here: "modules\FSUIPC documents\List of FSX and P3D controls.pdf".

 

The PMDG additional controls is found somewhere in their SDK, likely in a c header file (extension .h). Look for comments saying something like 'Control Events'.

 

Here is the start of the relevant lines from the 737NGX header file:

// Control Events

#ifndef THIRD_PARTY_EVENT_ID_MIN
#define THIRD_PARTY_EVENT_ID_MIN         0x00011000 // equals to 69632
#endif

// CDU
#define EVT_CDU_L_L1 (THIRD_PARTY_EVENT_ID_MIN + 534) 
#define EVT_CDU_L_L2 (THIRD_PARTY_EVENT_ID_MIN + 535) 
#define EVT_CDU_L_L3 (THIRD_PARTY_EVENT_ID_MIN + 536) 
#define EVT_CDU_L_L4 (THIRD_PARTY_EVENT_ID_MIN + 537) 

Here we can see they use a base control number of 69632 (defined as THIRD_PARTY_EVENT_ID_MIN) and then for the CDU they are adding an offset (+534 etc..) to get the final control number.

 

The LiNDA code you posted seems to be doing something similar. They may have taken this directly from the 777 sdk header, or they may have their own way of calculating the end result. Either way you arrive at a control number that is sent.

 

There seems to be the need to send a parameter as well as the LINDA code has ,1 on the end. This maybe explained in the SDK. I think for the 737 it signifies which mouse button to simulate.

 

So, see if you can find the controls list in the .h file in the 777 SDK and send them in LUA code with ipc.control(). You can cross-reference the LINDA code to see that you're on the right lines or have any problems with the parameter values.

 

Paul

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.