Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CDI Needle Devflection in XML Gauges

Featured Replies

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

  • Moderator

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. ;)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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

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

  • Commercial Member

>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.

Ed Wilson

Mindstar Aviation
My Playland - I69

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.