PDA

View Full Version : XML Radio Height Gauge not working



captses
07-12-2007, 10:28 AM
Hi all. I am in the process of removing all my hair at too early an age. I have created the bitmaps for a RADIO HEIGHT gauge and I am having trouble getting the code to work. First I am a newbie at all this gauge stuff so please be kind as bald and bruises do not look good together. First let me include the code I have as of yet.

<Gauge Name="RadAlt" Version="1.0">
<Image Name="RadAltBackground.bmp"/>
<Element>
<Image Name="RadAltOFF.bmp"/>
</Element>
<Element>
<Image Name="RadAltDH.bmp"/>
</Element>
<Element>
<Position X="450" Y="450"/>
<Image Name="RadAltHeightNeedle.bmp">
<Axis X="450" Y="450"/>
</Image>
<Rotate>
<Value Minimum="0" Maximum="5000">(A:RADIO HEIGHT, degrees)</Value>
<Nonlinearity>
<Item Value="100" Degrees="80"/>
<Item Value="200" Degrees="124"/>
<Item Value="400" Degrees="165"/>
<Item Value="1000" Degrees="240"/>
<Item Value="5000" Degrees="322"/>
</Nonlinearity>
</Rotate>
</Element>
<Element>
<Image Name="RadAltRim.bmp"/>
</Element>
</Gauge>

The gauge is appearing on the panel how and where I want it. The issue I am having is getting the height needle to represent the correct height. Sitting on the tarmac (433') the gauge reads 85 feet. As I apply collective the needle rotates until it indicates 5000'. The aircraft at this point is only 293' off the ground. What am I doing wrong? Any help would be appreciated.

n4gix
07-12-2007, 04:05 PM
Er, the variable's return is FEET, not degrees... ;)

(A:RADIO HEIGHT, feet)

So, all the entries in the nonlinearity table should also be using feet instead of degrees, but there is no provision for listing that in the table... See the next paragraph.

Format of the nonlinearity table is incorrect. You need to specify the x,y coordinates for the "tip" of the needle at each location desired. For example:

<Nonlinearity>
<Item Value="0" X="23" Y="97"/>
<Item Value="30" X="122" Y="98"/>
</Nonlinearity>

Scale markings on a Radar Height are most commonly "non-linear," hence you should provide an entry for each labeled scale marking:

100'
200'
300'
400'
etc.

captses
07-13-2007, 02:44 PM
Thanks for the reply. I am new to this and I am learning by the seat of my pants. I was reading in a tutorial that I could use degrees to set the needle direction. I will change it back to feet and go from there. Another question if you don't mind? I made all my bitmaps at 900x900. As I understand it I should be setting the X and Y for the top left corner of the needle bitmap? Thanks once again for the help.

n4gix
07-14-2007, 03:10 PM
The top left corner of the bitmap is 0,0 by definition.

Hence, 100,100 means 100 pixels to the right, 100 pixels down. ;)

The proper way to determine the direction of a needle's rotation is the order of the entries in the non-linearity table.

For needles that rotate clockwise, begin the table entries at the most anti-clockwise position, and list the remainder in clockwise sequence.

For needles that rotate anti-clockwise, begine the table entries at the most clockwise position, and list the remainder in anti-clockwise sequence.

For lot's of help with XML gauges, visit Nick Pike's tutorial series at http://fs2x.com/Tutorials.htm

BTW, 900x900 is about three times larger than ideal. Design the artwork at such a large scale, but use your paint program to rescale the layered images down to final size for optimum use in the sim.

Ideally, the actual gauge graphics "set" will be at or near the size they will actually display in the sim... ;)