Jump to content

Sign in to follow this  
Guest zavoq

CDI Needle Devflection in XML Gauges

Recommended Posts

Guest zavoq

I am attempting to create a VOR gauge in XML, and am stuck on the way FSX interprets the deflection of the needle. According to the SDK, it is seen as a number between -127 and 127. Problem is, the gauges show deflection based on degrees from the course, in 2 degree increments with 10 degrees left or right of the course being full deflection. How do I convert -127 and 127 to degrees so that the gauge will accuratly display the planes position?Thanks in advance,Charlie

Share this post


Link to post
Share on other sites

For a tuned VOR the +/- 127 represents the +/- 10* of lateral deflection.For a tuned ILS the +/- 127 represents the +/- 2.5* of lateral deflection.

Share this post


Link to post
Share on other sites

The best (and simplest) way is to look at some of the default XML gauge for examples. For instance, here's the code from the Beech Baron: (A:HSI CDI needle valid, bool) if{ (A:HSI CDI needle, number) } els{ 0 }Note that ACES scaled the movement by a factor of 22, and the 'needle' will shift left/right accordingly. You would calculate your own scale factor to match with your artwork size/scale. In this particular case, the total scale is 45 pixels (so 22 on either side of center), so 22 pixels is the scalar: 22/127 = 0.173 scale factor.For a VOR head, you might need to pivot the needle from the top, in which case you'd use a rather than a movement.You could also use a non-linearity table instead of a scaling factor......there's a baker's dozen different ways to accomplish the task. ;)

Share this post


Link to post
Share on other sites
Guest Douglas K

>>>>How do I convert -127 and 127 to degrees so that the gauge will accuratly display the planes position?<<<

Share this post


Link to post
Share on other sites
Guest zavoq

So in other words (just to make sure that I have this correct) +127 = full 10 degree deflection right and -127 should be a full 10degree deflection left.So I just need to match up 127 with my artworks 10 degree mark to the right, and 127 with my artworks 10 degree mark to the leftIs that correct?Charlie

Share this post


Link to post
Share on other sites

>So in other words (just to make sure that I have this>correct) +127 = full 10 degree deflection right and -127>should be a full 10degree deflection left.>>So I just need to match up 127 with my artworks 10 degree mark>to the right, and 127 with my artworks 10 degree mark to the>left>>Is that correct?>>CharlieWell, I can't claim for certain negative is left... but... yes, you have the right understanding.

Share this post


Link to post
Share on other sites
Guest zavoq

Fantastic. Thanks for all of the help everyone. I think I got my Vor working like a charm. and to test it, I threw in 7 different NAVs from various planes into my panel just to make sure everything matched up. So either mine is spot on, or all others (including mine now) is incorrect. Im betting for the formerThanks againCharlie

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...