• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Getting flaps informations without event

Messages
39
Country
france
Hi to all !
I would like to know if there's a way to get flaps informations without positioning them using an event.
well, my question is probably not so clear. I explain...
In the aircraft.cfg, for each planes, you can see informations about flap position and the related angle ([flaps.n] section where n is a number).
I can get those informations using the simconect API OnRecvSimobjectDataByType and variables "FLAPS HANDLE INDEX" and "TRAILING EDGE FLAPS LEFT ANGLE", but only for the current position (or even when its moving using OnRecvSimobjectData).
I would like to get all these informations at the begining of the flight and save thel in an array, without using events.
Does anyone knows how to do that ?
Thank's for your help
 
I can get those informations using the simconect API OnRecvSimobjectDataByType and variables "FLAPS HANDLE INDEX" and "TRAILING EDGE FLAPS LEFT ANGLE", but only for the current position (or even when its moving using OnRecvSimobjectData).

I would like to get all these informations at the begining of the flight and save thel in an array, without using events.
Does anyone knows how to do that ?

I think you are misinterpreting Simconnect's facilities somewhat.

To start with, for all of the data I get in FSUIPC I only use SimConnect_RequestDataOnSimObject, which I assume is what your "OnRecvSimobjectData". The "Type" version is only used to get the object ID.

There are parameters for these which allow you to say how often you want the data, and whether to only send it when it has changed.

All you need to do is initialise your own values to zero (which is what FSX will also do internally in any case), and when they change, you can get the new values.

You are ALWAYS then aware of the current values.

I really do not understand where your "EVENTS" come into it at all. EVENTs are different things altogether. These values are Simulation Variables (SIMVARS) and are supplied as requested or as they change, to your specification.

Regards

Pete
 
OK Pete, i knew that my explanations were not very clear...
Also i talked about event and it was a bit confusing for understanding my need..
well i did something qiute nice programming with VB.net to get informations and transmit events to FSX...
My question was something like "how can i get all the informations of an aircraft (for flaps parameters), without flying"...imagine you are at the gate with a mooney bravo...engines are turned off. I need to know the characteristics of the flaps for this plane : position 0/angle 0°, position 1/angle 8°, position2/angle 33° (whiche are decribred in the aircraft.cfg), without doing anything with the buttons or so.
If the flaps are in position 2, i know how to send a request to simconnect and get the values...but i need to get all the values...
hope my explanations are better now :)
 
My question was something like "how can i get all the informations of an aircraft (for flaps parameters), without flying"...imagine you are at the gate with a mooney bravo...engines are turned off. I need to know the characteristics of the flaps for this plane : position 0/angle 0°, position 1/angle 8°, position2/angle 33° (whiche are decribred in the aircraft.cfg), without doing anything with the buttons or so.

Ah. You want to know the aircraft characteristics, not the position of the flaps.

The only way I know is to read the AIRCRAFT.CFG file.

Regards

Pete
 
well it's what i thought...but as i used to say, when you don't know ..just ask...
Is it easy to find and to read the aircraft.cfg file ?
probably it's not a good way for what i want to do, but i'd like to try....
 
Is it easy to find and to read the aircraft.cfg file ?
probably it's not a good way for what i want to do, but i'd like to try....

Subscribe to the "AircraftLoaded" event, so you get the full pathname of the AIR file when loaded. For the first one you'd need to get the same SystemState value as you'll miss it being loaded.

The AIR file will be in the same folder as the Aircraft.CFG file. CFG files are standard Private Profile files and can be accessed easily via the section names and keywords using GetPrivateProfileString windows API calls.

Regards
Pete
 
Thank's Pete i'm going to watch these API
i'll report back later or ask help again if needed
see you
 
Hi again Pete !

just to tell you that i succeeded using the informations you gave to me. Reading the pathwith the systemstate, modifying it to get the aircraft.cfg file, then reading the keys and values i wanted using the window API.
I'm happy to learn every day and to go on the right way for my needs.
Thank you

Best regards
 
just to tell you that i succeeded using the informations you gave to me. Reading the pathwith the systemstate, modifying it to get the aircraft.cfg file, then reading the keys and values i wanted using the window API.

Great, glad it all worked out.

Pete
 
Back
Top