Sign in to follow this  
Guest EdrickV

is FSX XML only? RPN is just too painful...

Recommended Posts

I realize RPN was chosen as pulling the elements of programming statements and expressions in a queue is easier than jumping around, but the RPN is just too painful. Infix is human-friendly and the standard for most languages. I would hope that with FSX breaking tasks across fibres in a more efficient manner that the performance gains of postfix could be realized in other places: like the use of stronger machines, multi-cores or and what sounds like a more efficient multi-threading approach.XML gauge programming is a blessing on one hand, but RPN is just too much mental contorting... when will a straightforward system, such as occurs with modern interpreted/compiled languages be available to us? honestly, I'd rather be able to compile a gauge and use a contemporary infix-style language like C, but the C gauge SDK is a serious nightmare. XML was a step in the right direction, but the RPN absorbs any gains with its inane difficulty. This is especially true with complex compound expressions and statements.I just wish that gauge and systems programming could have grown up along with other features in Flight Simulator. Honestly, RPN and XML gauges feel like a kludge holding us over until a comprehensive OO scripting approach emerges.oy vey...

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

>honestly, I'd rather be able to compile a gauge and use a>contemporary infix-style language like C, but the C gauge SDK>is a serious nightmare. XML was a step in the right>direction, but the RPN absorbs any gains with its inane>difficulty. This is especially true with complex compound>expressions and statements.Granted, the SDK 'sucks hind teat,' but it really isn't that difficult!There's plethora folks using C, C++ and GDI+ here and in other forums to provide guidance.I highly recommend Dai Griffith's tutorial: sd2gau18.zip as a terrific starting point.You can download the latest MSVC++ .NET 2005 Express Edition for free from Microsoft's website. There's a tutorial series anchored in my "Panels and Gauges" forum at http://flightsim.com illustrating how to set up the IDE for gauge production.

Share this post


Link to post
Share on other sites

I find Algebraic notation to be more difficult than RPN. Been using RPN in HP calculators since 1975.W. Sieffert

Share this post


Link to post
Share on other sites

Yeah, I've been using RPN as long on HP calculators... I remember the first thing I ever programmed was a Monroe 1880 programmable calculator. I still remember Halt was code 301 which I had to punch manually into a punch card with a paper clip on a special holder.If you don't understand the MS header, the key is to remember your basics and that this is MS's attempt to simplify the coding with macros. If you have never used macros before, then it can be a bit confusing, but if you have strong basics it will not take long to figure out.To really get it though, it helps to have some background game programming, particularly understanding the concept of a game loop, and basics about rendering. Beyond that, you'll also want to learn about .dll's over time.

Share this post


Link to post
Share on other sites

FS2k and FS2k2 style gauges are usable in FSX, including the default gauges from FS2k2. (AKA the multiple gauges in one .gau file system.) FS98 style gauges (one gauge per .gau file) aren't supported. I imagine there are more differences between the two types of C/C++ gauges, but I don't know what they are."Let me help you out. You're cleared to taxi any way you can to any runway you see."

Share this post


Link to post
Share on other sites

thanks for the replies...Algebraic notation is defacto standard now and many of us have come up using that notation to program. HP-style RPN is not common now.Norms in development have moved away from MACROS and other such customizations on-top-of C. I was just hoping for a comprehensive library accessible in an object-oriented style.I make a living teaching people contemporary programming techniques and languages. It is unnerving to have to step back 20-30 years to do development for FS. I am capable of it, but the transition hurts.When I first played with XML gauge programming, I was very enthused as I thought it was such a step in the right direction. However, the deeper I got into RPN, the more frustrated I got. I spend my workaday life in extremely straight-forward infix languages and I guess I'm just not crafty enough to devote the patience to let the RPN sink in.In any case, RPN and the macro-laden C gauge SDK are both archaic.In any case, does anyone know the answer to my original question regarding the approach for gauge making in FSX?Thanks

Share this post


Link to post
Share on other sites

>In any case, RPN and the macro-laden C gauge SDK are both>archaic.>>In any case, does anyone know the answer to my original>question regarding the approach for gauge making in FSX?Since this was the only question asked, I have to assume this is what you're referring to:"XML gauge programming is a blessing on one hand, but RPN is just too much mental contorting... when will a straightforward system, such as occurs with modern interpreted/compiled languages be available to us?"I should think the question has been answered, albeit obliquely... ;)The direct, succinct, to-the-point answer then is an unequivocal when pigs fly... :-lol Of course, no one is forced to use the SDK's macros. One always has the option of 'unwrapping' the macro code to expose the lower level, brute-force code... ;)

Share this post


Link to post
Share on other sites

I agree. C++ is an object oriented language and what are gauges if they are not objects? Unless it's changed in FSX the currect approach is completely outdated.

Share this post


Link to post
Share on other sites

>I agree. C++ is an object oriented language and what are>gauges if they are not objects? Unless it's changed in FSX the>currect approach is completely outdated.Any technique you choose to do in FS9 or FSX may be done, providing that it is possible at all within the constrants a DLL...

Share this post


Link to post
Share on other sites

>You can download the latest MSVC++ .NET 2005 Express Edition>for free from Microsoft's website. There's a tutorial series>anchored in my "Panels and Gauges" forum at>http://flightsim.com illustrating how to set up the IDE for>gauge production.Interestingly enough, I cannot ever get that IDE to work again with GDI+. Started off with a new project based on the usual SDK gauge, then tried to add the GDI+ headers/lib, which forced compiling to stop due to those four errors I remember I have had *some*time about a zillion years in the past, but now can't seem to get 'em fixed, for whatever reason. I am talking about "errors" within gdiplus.h, starting at line 25:(25) C2061 syntax error: identifier 'Gdiplus'(25) C2059 syntax error: ';'(26) C2449 found '{' at file scope (missing function header?)(69) C2059 syntax error: ';'These are obviously no errors at all since GDI+ used to work all the time before. Now I suspect some dumb mistake I am doing while trying to set everything up again here. If anyone has a neat hint, do not hesitate to scream away. :)Thanks in advance.Etienne

Share this post


Link to post
Share on other sites

#define ULONG_PTR DWORD#define UNICODE#include #pragma comment (lib, "gdiplus.lib")using namespace Gdiplus;

Share this post


Link to post
Share on other sites

I think I have cured the problem, although I still cannot 100% understand how that could happen. It works at least. :)

Share this post


Link to post
Share on other sites

>#define ULONG_PTR DWORD>#define UNICODE>#include >#pragma comment (lib, "gdiplus.lib")>using namespace Gdiplus;The line #pragma comment (lib, "gdiplus.lib") shouldn't be there.gdiplus.lib should be listed in the Linker section of the Project file's Properties...Here is the complete header for one of my gauge projects, with the GDI+ specific lines highlighted in red:#include "..incfs9gauges.h"#include "ESXLS_Misc.h"#include #include #include #include #include #include "BCD.h"#include #include #define ULONG_PTR DWORD#define UNICODEusing namespace Gdiplus;GdiplusStartupInput gdiplusStartupInput;ULONG_PTR gdiplusToken;

Share this post


Link to post
Share on other sites

Thanks Bill, actually there is no difference if you link with IDE or pragma...The include section looks similar to yours. I got it working earlier today.Thanks for your help though, still greatly appreciated. :)Etienne

Share this post


Link to post
Share on other sites

>Thanks Bill, actually there is no difference if you link with>IDE or pragma...>>The include section looks similar to yours. I got it working>earlier today.>>Thanks for your help though, still greatly appreciated. :)Sure there is... less typing! ;)I'm glad you got it working... Have fun!

Share this post


Link to post
Share on other sites

So Bill,now the the NDA is lifted, what is different about FSX gauge programming?Thanks...

Share this post


Link to post
Share on other sites

>So Bill,>>now the the NDA is lifted, what is different about FSX gauge>programming?Very little as far as C goes... there's a lot of new token variables and key_events, but the new gauges.h isn't available yet so it's anyone's guess at this juncture what will work and what might still be broken... ;)As for XML gauges, the syntax and structure has changed a LOT. The best news for XML'ers is that there will be a WYSIWYG XML editor shipped with the SDKs that will make building XML gauges much easier...

Share this post


Link to post
Share on other sites

At the cost of 2 to 500 bucks per license for a producerto avoid ---"FSX (C++gauges)will need to be code signed or users will get a security warning when the gauges are loaded."---the " XML editor shipped with the SDKs " should be a popular tool .It may be reasonable to expect payware producers to follow good policy with registration but i have a vision of booting some aircraft that would generate a Caralon effect as a series warnings get clicked on until the entire list of gauges has been approved for use.This may do a great deal to promote the great divide betweenprofessional developers working in C and the greater wholeof the contributors who will stick with what works cheap.The worst is unlike adding old module's into the fs9.cfgthis seems a windows thing and i have not figured out where to fix it

Share this post


Link to post
Share on other sites

You could try looking in the FSX.cfg file under the Trusted section. It has lines like this:D:Program FilesMicrosoft GamesMicrosoft Flight Simulator X DemoGAUGESBendix_King_Radio.DLL.azzawnbbzlbhzwathhahqthnzrhouicewuuuuiuz=2Not sure what that string of letters after the second . is though. It's probably some sort of hash or checksum, but what kind I don't know. Also not sure what the =2 is for."Let me help you out. You're cleared to taxi any way you can to any runway you see."

Share this post


Link to post
Share on other sites

>You could try looking in the FSX.cfg file under the Trusted>section. It has lines like this:>>D:Program FilesMicrosoft GamesMicrosoft Flight Simulator X>DemoGAUGESBendix_King_Radio.DLL.azzawnbbzlbhzwathhahqthnzrhouicewuuuuiuz=2>>Not sure what that string of letters after the second . is>though. It's probably some sort of hash or checksum, but what>kind I don't know. Also not sure what the =2 is for.That is in fact a generated code that's unique for a specific .gau/.dll file at that specific time. Recompiling the .gau/.dll will result in having to go through the process again...During the past four days, I now have nearly a hundred unique entries in the fsx.cfg file for the same gauge!!!OK, I can see the need for ACES to maintain this list of self-approved .gau/.dll files, but does it have to be in the fsx.cfg file??? :(For three plus years, my primary advice for folks with FS9 problems has been:Step #1: Rename or Delete your FS9.cfg file and allow FS9 to build a new one. Ninety+ percent of the time your problem will disappear...Now, imagine the ramifications of blowing out the FSX.cfg file... :-bat

Share this post


Link to post
Share on other sites

So advise people to backup their FSX.cfg file frequently. :)"Let me help you out. You're cleared to taxi any way you can to any runway you see."

Share this post


Link to post
Share on other sites

So advise people to backup their FSX.cfg file frequently. :)"Let me help you out. You're cleared to taxi any way you can to any runway you see."

Share this post


Link to post
Share on other sites

>I agree. C++ is an object oriented language and what are>gauges if they are not objects? Unless it's changed in FSX the>currect approach is completely outdated.Remember, the SDK is just an API. You have to code your own OO wrapper if you want one.

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