Like a Kid in a Candy Store... But Now I Need Some Help
The title pretty much says it all, but now for the specifics:
I'm a bit of a data geek. Meaning I like mounds of data while I'm flying, whether I think I could actually use it or not. Getting it to read out while I fly I find fascinating. Now I'm not the sort of person who necessarily wants to mount gauges to my panel permanently (though I really ought to learn to do that too). But I like to make the stand-alone gauges that I can power up using the SHIFT + (1-9) sequence. That way I can see them... even in spot view if I'd like.
I began last week on a quest to find a digital thermometer gauge that read in degrees Fahrenheit and gave me ambient outside air temperature (without the TAT correction associated with airspeed). I was successful in my quest in the form of a free download gauge that did just that. Now it was crucial that what I found was an .xml/.bmp combination, instead of a .gau. That way I could open the .xml, pick apart the code, and try to learn from it. So that's what I did, changing the font and color of the numerals to suite my taste.
Just a note to the community: Yes... I know that reverse engineering other people's work is a big no-no. I would never try to create a gauge from someone else's .xml file that was partially altered, change the label on the .bmp file, and then upload it as my own to the library. This is purely in the privacy of my own home, just so I can learn how the process works, and I can get data sets as I fly that Microsoft doesn't provide in those big default numbers along the top of the screen.
Then I thought to myself-- well gee... why stop there? If I find out what other data commands exist maybe I can make all sorts of digital gauges that tell me all sorts of stuff... using the original OAT gauge and bitmap as my template.
So then I checked out the SDK for panels and gauges, and discovered the Parameter.doc... and I was literally all excited like a kid in a candy store. There before my very eyes was all the command line codes that go in the "A:" line of the .xml file! All I had to do was replace the line "Ambient Temperature" with any number of commands, and I now have a new piece of data that reads out in the digital field where the temperature used to be. Some of the ones of particular interest to me are:
Altitude AGL
Elevation of Ground Below
Ground Speed relative to earth's surface
Distance Traveled
True Heading
Plane Pitch Degrees
Plane Bank Degrees
That's just a few for now.
I gave each a test in the field of the OAT gauge just to see if it would work and they were indeed functioning.
However some did not give me quite the numbers I was looking for and now I'd like to tweak. The problem is I know really nothing about C (+++) programing, so the Boolean string thing is not really my thing. I just like to reverse-engineer other people's examples of .xml files and try to make my own from there. In some cases, a whole new .xml file script (that has nothing to do with the OAT gauge I derived it from) would probably be better. But until I learn more about this process, making a totally different data gauge from a temperature gauge will have to suffice.
Here are the specific problems I'm having:
1. I want pitch-angle to read so that UP is POSITIVE and DOWN is NEGATIVE. The polarity is reversed in the command "Attitude Indicator Pitch Degrees", and it reads up as negative and down as positive. How do I reverse it? Is there some kind of command to tell it to take the value and multiply it by negative-1, so I get the polarity the way I want it?
2. Same goes for "Attitude Indicator Bank Degrees". I want it to read RIGHT is POSITIVE and LEFT is NEGATIVE, and it has those reversed as well.
3. I want my GROUND VELOCITY in Miles Per Hour, but my units choices (per the Units.doc in the SDK) are only...
...• meter/second
• meter per minute
• feet/second
• feet per second
• feet/minute
• feet per minute
• kilometer/hour
• kilometer per hour
• knot
If I know the multiplier to convert knots to MPH, is there a way to tell it knots, but to include a "multiply by 1.15077945" command in the .xml file to make it do that for me?
I know where I want to get to. I just don't know quite how to word it in the .xml file to make it do that.
Here's a sample of the .xml text. Please ignore the fact that it's originally an .xml file for a digital OAT gauge. Many of the OAT commands I didn't change, but I had to start with something I could work with.
Thank you.
===================================
<Gauge Name="UMA OAT" Version="1.0">
<Image Name="UMA_OAT_b.bmp" />
<Element>
<Visible>(A:Circuit General Panel on,bool)</Visible>
<Position X="24" Y="77" />
<Element>
<Position X="0" Y="-2" />
<Text X="90" Y="50" Length="4" Font="Arial Black" Color="Light Blue" Adjust="Right" Bright="Yes">
<String>%((P:UNITS OF MEASURE, Enum) 0 == )%{if}%((A:Attitude Indicator Pitch Degrees, degree))%!2d! %{else}%((A:Ambient Temperature, Celsius))%!2d! %{end </String>
</Text>
</Element>
<Element>
<Position X="110" Y="-2" />
<Text X="45" Y="50" Length="2" Font="Arial Black" Color="Light Blue" Bright="Yes">
<String>%((P:UNITS OF MEASURE, Enum) 0 == )%{if} F %{else} C %{end</String>
</Text>
</Element>
</Element>
</Gauge>
MSFS 2004 v9.1; Windows 7 Ultimate 64-bit
AMD FX 8120 8-core processor 4.3Ghz, XFX R7870 2GB GDDR5, Corsair Vengeance 8GB 1600, Western Digital 500GB HDD, Biostar A880GZ AM3+, Antec Kuhler 620 water cooling
Bookmarks