• 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.

P3D v4 p3dv4_gauges.h

DragonflightDesign

Resource contributor
Messages
1,356
Country
northernireland
Okay... some of you will recognise my name and some of you won't. For those that don't recognise it, I wrote the sd2gau series on C-gauge building which is listed at avsim.com and flightsim.com libraries. The current version is sd2gau35.

That said, those that do recognise my name know that the original gauges.h file in both FSX and all versions of P3D has... a few errors in it. Arne Bartels (who is no longer involved in flight simming) and I dutifully corrected each version as it was released. I've now got round to doing the same with the P3Dv4 gauges.h file and called it p3dv4_gauges.h (the FSX equivalent is fsxgauges_sp2.h and is in the sd2gau35 archive).

So... the question is, if there's any interest, where to put it?
 
I normally put it in a separate folder and use #ifdef _M_X64 to decide which gauges.h is included.
 
Uh Jon, Dai meant where to put the corrected file for others to find. Three places come to mind immediately, Dai:

  1. Here in the Wiki
  2. AVSIM.com where I can sticky the post
  3. Flightsim.com were I can sticky the post
 
Looks like a good idea Bill. I'm half-tempted to add a setup guide to sd2gau similar to your Visual Studio one but for P3Dv4. How are you with the idea of me copying your existing FSX setup guide and including it in an sd2gau36?

Just as a passing comment, the fact that the P3Dv4 gauges.h file contains the same errors as the FSX gauges.h (and all the previous FS/P3D ones) but includes a lot of additional stuff made me wonder if LM have been given permission to add to the file, but have been told they can't correct it. If you recall, we did supply LM (specifically: Adam Breed) with a list of the corrections when they first announced P3D.
 
Added to the Wiki here but I had to externally link it. It pasted to the editor okay but the preview destroyed a lot of the file formatting.
 
Looks like a good idea Bill. I'm half-tempted to add a setup guide to sd2gau similar to your Visual Studio one but for P3Dv4. How are you with the idea of me copying your existing FSX setup guide and including it in an sd2gau36?
Dai, that is a terrific idea! Please be my guest at recycling anything of mine you wish.
 
Question, Bill: I assume the Wiki page has to be released by a moderator?
I don't think so, but then I've not been there much over the past year or two. At least in the past I've had no difficulty in editing someone else's entry. That's really sort of the point of Wiki, to build on each other's contributions.

EDIT: I just visited the Wiki and had no problem with Editing entries. I canceled my changes of course after testing/previewing.
 
Last edited:
Added to the Wiki here but I had to externally link it. It pasted to the editor okay but the preview destroyed a lot of the file formatting.
Yes, the Wiki software doesn't preserve formatting very nicely. I've had to rework a lot of the posts at AVSIM since over the years some really strange things have happened. At once "migration" Tom did about six or seven years ago, all of the posts were imported and stored in reverse order!

Also, another "upgrade" totally FUBARED the formatting, making a complete mess of not only XML scripts, but C code as well... :yikes:
 
Editing the Wiki is something of a challenge isn't it? :laughing:
I'm slowly getting my "old sim machine" reconfigured as my "new dev machine." I now have the revised gauges.h in the P3Dv4 ..\inc folder ready for use.
 
Ok, another newbie question, why not have a single gauges header?

I did a windiff and could see where the additions and modifications are between FSX and P3Dv4 headers; in most respects the only problem I could come up with is if you use only the p3d4 header, and lets say an evenid key (which is true I have seen it at least once) really doesn't exist in fsxa but does in p3dv4, then you could wind up with something that doesn't work in fsxa.

It occurred to me that we can just use custom events in those cases to make sure that the single gauges header file works and the simobject/gauge(s) in P3D remain backward compatible. Another issue I just thought about was that only holds true if it is just the IDs that changed, so I looked at a couple of the enums in windiff and they seem to have kept the old one for backwards compatibility. May not hold true for all cases...unless someone merges the header files into one...

What do you guys think?
 
Things changed in the GAUGEHDR struct. In v4 the user_data member is 64bit, while in FSX/earlier P3D versions it is UINT32. The same applies to the 3rd parameter of the gauge callback prototype function. This is important because user_data is usually a pointer to a class used to draw the gauge. Not to mention that the GAUGEHDR struct is going to be a different size than would fit in FSX.
 
Yes I saw that as I kept scanning the file with WinDiff, so its basically down to we compile 32 versus 64 bit using the latest header for each major version of the simulator. For example, the P3D V3 header would be used to develop and compile both FSXA and P3D V3 DLL, and the P3D V4 header only for the 64 bit DLL compile...correct?
 
Back
Top