Sign in to follow this  
Guest lilo

FSX - the new XML gauge syntax - my experiences

Recommended Posts

Dear all,this topic is for collecting details about the new XML gauge syntax introduced by FSX. I want to share my results and I am curious about what others found out.The background: I developed a gauge for FS9 which lets you put in a lat/lon as well as a proximity range around it. If the aircraft comes within this range the flight sim is paused. This gauge is useful for long range, unattended flights where you want the flight sim to stop near the destination airport. The gauge worked perfectly in FS9. Now I installed it in FSX. You guess what? It doesn't work. The lat/lon values (text elements) are not displayed and the expression evaluation doesn't work. So I rewrote the whole gauge using UltraEdit32 and the ACE tool which is provided as part of the FSX SDK.First I would like to point out that from my point of view the new syntax, the ACE tool as well as the documentation are a step forward. It is definitely more and better structured than what was available under FS9. And I hope the MS and Aces people will go on this way.Now, here are some of the experiences I had while rebuilding the gauge:- The ACE tool has no expression editor whith syntax hilighting (not to mention syntax checker). This is the least I would expect from a system which forces the developer to write code in reversed polish notation.- It is not possible to simulate the gauge in the ACE tool. So it is still the time consuming procedure of editing the XML file, starting a shell script to put it into a cab file and start a predefined test flight. Not quite a boost in productivity.- Each and every value has to be changed by double clicking on a property line. A dialog window opens where you put in the value. This slows down the productivity! I can't imagine how the people at MS/Aces managed to develop the G1000 using this tool.- It is not possible to provide custom tooltip text. The XML structure for tooltips has only properties for ID's. From looking at the header files I can see that it is possible when writing in C++. But not in XML. This is a step back compared to FS9.- When placing multiple Update elements I had the problem that not all the scripts where executed. By changing the order and looking at the G1000 gauge I found out that it is necessary to append a white space at the end of each script. I get the impression that internally FSX just concatenates the scripts of all Update elements and executes them at once.- If you specify a Frequency in one of the Update elements the whole gauge is refreshed with that frequency. If there are multiple frequencies, it is not clear which frequency drives the UI refresh and the update cycles.- I had difficulties when placing macros inside a GaugeText element. In FS9 it was possible to encapsulate the whole statement of a text element so that you don't have to copy and paste the same formatting and mouse event evaluation again and again. In FSX it seems that macros are not directly recognized in the values of the GaugeString property. But I may be wrong in this. I just didn't found an appropriate example in one of the FSX standard gauges. May be one of you can show me how to do that.- Color values in Hex have to be provided in reversed polish notation as well. In contrast to the sample in the documentation, the order is 0xBBGGRR, not 0xRRGGBB. I know, this is the same as in FS9 syntax. But at least the documentation should be clear in this.- I spent some hours to find out why a GaugeText element was not displayed when it contained the pure text "Destinationnreached" while being displayed with the contents "Destinationnreached %((L:DEST REACHED,number))%!d!". The element had an expression in the Visibility property. I didn't found out. Other GaugeText elements were displayed correctly. As a workaround I placed some meaningful expression inside the GaugeString property.Finally, I finished my gauge and it works now. I would like to know what your experiences are and which other trap is hidden in the new syntax. May be one of the MS/Aces developers reads this and can use it as input for future updates.rgdslilo

Share this post


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

I could write a book on this, but I'm going to keep this short(ish).>First I would like to point out that from my point of view the new syntax, the ACE tool as well as the documentation are a step forward. It is definitely more and better structured than what was available under FS9. And I hope the MS and Aces people will go on this way.Hope you don't mind, but I have to completely dissagree with you. The new syntax is a headache. Far too long winded. Doing it in the fs9 way in a good text editor that 'understands' XML (try Notepad++ and it's free) is a lot less hassle, and you can keep an eye on the logical progression far easier.There was no need to change this and is another example where FSX is not an addition to an already good flight sim (fs9) but another unwelcome change.The Ace tool is useful for checking if there are overlapping click areas, but that's about it.cheers,nick

Share this post


Link to post
Share on other sites

Hi lilo,>- When placing multiple Update elements I had the problem that>not all the scripts where executed. By changing the order and>looking at the G1000 gauge I found out that it is necessary to>append a white space at the end of each script. I get the>impression that internally FSX just concatenates the scripts>of all Update elements and executes them at once.In FS9 there is no reason to place multiple Updates because only the code inside the LAST one in the gauge

Share this post


Link to post
Share on other sites

<>That tool was really designed for me, Scott, and Sean to layout dialog boxes with. The fact that it would also edit XML gauges was just sort of an added bonus :-> I was actually suprised to find out we had shipped this as part of the SDK :->

Share this post


Link to post
Share on other sites

>...>That tool was really designed for me, Scott, and Sean to>layout dialog boxes with...Ah, that's how it looks like. Although the SDK documentation states that complex gauges like the G1000 were developed using this tool.Still I find it a good idea to provide a proper tool. It's like, well, you can administer an Oracle DBMS completely from the commandline. But Oracle also provides GUI's for that where commands and parameters are grouped so that the administrator can concentrate on the task rather than on the syntax.

Share this post


Link to post
Share on other sites

>...>In FS9 the Frequency used is that of the last Update; I guess>should be the same in FSX>>And, quoting NickPike,>>"Hope you don't mind, but I have to completely dissagree with>you. The new syntax is a headache. Far too long winded. Doing>it in the fs9 way in a good text editor that 'understands' XML>...My answer could be: I find the new syntax better because it is clean except for the id property (don't know why they didn't placed them in tags).But I don't want to discuss here whether the new syntax is worse or better and whether it was necessary to change something or not. And also not how it was done in FS9. The new syntax is there. I would like to here from you what you found out when working with it. You know, the little details, what worked, what didn't.rgdslilo

Share this post


Link to post
Share on other sites

>My answer could be: I find the new syntax better because it is>clean except for the id property (don't know why they didn't>placed them in tags).This was just a topic here a few days ago. To use "custom tooltips" in FSX is no different than in FS9:Whatever you want to use for custom text here is reserved for use of pre-defined tooltips listed in the SDK...More importantly, if you are indeed concerned with a smooth workflow, you absolutely do NOT have to ".CAB" your gauge before testing...Whenever I develop an XML gauge, I place a subfolder in the aircraft's panel folder with my gauge's name:..Sim ObjectsAirplanesMy AircraftpanelMy New XML GaugeIn that subfolder I have my .xml file and bitmaps.I use a small gauge cleverly named "RELOAD.xml" to unlock the panel & gauge system, then proceed to create/edit my XML code.Now, I can save my revisions, click once on the RELOAD icon, and instantly see the changes in the sim...Simple! ;)

Share this post


Link to post
Share on other sites

>...To use "custom>tooltips" in FSX is no different than in FS9:>>Whatever you want...Did you tested this by yourself using the new XML schema? I wasn't able to mix the old schema with the new schema. So when I start to write a gauge using the new schema (which is the topic here) it is not possible to simply place the text between the Tooltip tags. And if I read the other topic you mention correctly there is no indication, neither in the documentation nor in the standard gauges that you can do this. Which correlates with my results.>...More importantly, if you are indeed concerned with a smooth>workflow, you absolutely do NOT have to ".CAB" your gauge>before testing...Okay, the cab was too much. What I wanted to say is: If there is already such a nice little tool like the ACE tool which has a preview window, why can't it at least display the text. Do I have to run the gauge in the flight sim in order to see whether the color has been specified correctly?rgdslilo

Share this post


Link to post
Share on other sites

>>...To use "custom>>tooltips" in FSX is no different than in FS9:>>>>Whatever you want...>>Did you tested this by yourself using the new XML schema? I>wasn't able to mix the old schema with the new schema. So when>I start to write a gauge using the new schema (which is the>topic here) it is not possible to simply place the text>between the Tooltip tags. And if I read the other topic you>mention correctly there is no indication, neither in the>documentation nor in the standard gauges that you can do this.>Which correlates with my results.Gah! I can't believe I wrote that... is only valid in embedded XML model code.For FS9/FSX gauges the tag is simply:[bPopup/Toggle GNS530[/b]Since I don't really code much in XML, I've never even tried. The only reason for the new schema is because it's needed for the ACE.exe tool, and since I don't use it anyway... However, it xxx does work in both FS9/FSX when added to the XML "code" manually.>Okay, the cab was too much. What I wanted to say is: If there>is already such a nice little tool like the ACE tool which has>a preview window, why can't it at least display the text. Do I>have to run the gauge in the flight sim in order to see>whether the color has been specified correctly?Since the "preview" function seems not to work, that appears to be the case.>

Share this post


Link to post
Share on other sites

>I use a small gauge cleverly named "RELOAD.xml" to unlock the>panel & gauge system, then proceed to create/edit my XML>code.>>Now, I can save my revisions, click once on the RELOAD icon,>and instantly see the changes in the sim...Hi Bill, would this be the same RELOAD.xml that you would have used in fs9? Because it don't work in FSX (Grrrrrrrrrrr) I've already discussed this one with Susan.cheers,nick

Share this post


Link to post
Share on other sites

Hi,it was the case in FS9 and it didn't changed in FSX: I can reload the panels/the aircraft two three or four times after having changed something. Than the flight sim hangs. I have to shoot it up and restart. Don't know why. It happens with simple and complex gauges.I got bored with this. Now I start the flight sim each and every time by double clicking on my test flight. This way I can be sure that the flight sim really loaded everything correctly.rgdslilo

Share this post


Link to post
Share on other sites

>>I use a small gauge cleverly named "RELOAD.xml" to unlock>the>>panel & gauge system, then proceed to create/edit my XML>>code.>>>>Now, I can save my revisions, click once on the RELOAD icon,>>and instantly see the changes in the sim...>>Hi Bill, would this be the same RELOAD.xml that you would have>used in fs9? Because it don't work in FSX (Grrrrrrrrrrr) I've>already discussed this one with Susan.FSX requires a different key event for the same result. I simply created another gauge in the same .CAB I've been using and modified the code:(>K:RELOAD_USER_AIRCRAFT)

Share this post


Link to post
Share on other sites

Thanks Bill. This is reloading the complete aircraft then and not just the panel. I've achieved the same by hitting keys Alt, 'A' and Return.The panel reload is the one that won't work any more. cheers,nick

Share this post


Link to post
Share on other sites

Hi,the event RELOAD_PANELS still works. Try this code:<?xml version="1.0" encoding="UTF-8"?>Reload the panelsReload.xml0.000,0.00020,20TrueTrue0.000,0.00013,13HandRELOAD_PANELSLeftSingleIt's the new stype ;-). Attached the cab file. No problems with bitmap changes (I put everything into a cab file :-)) Still, when changing the XML code of gauges the flight sim tends to hang.rgdslilo

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