January 16, 200818 yr 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
January 17, 200818 yr Commercial Member 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. Ed Wilson Mindstar AviationMy Playland - I69
January 17, 200818 yr 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
January 17, 200818 yr >>>>How do I convert -127 and 127 to degrees so that the gauge will accuratly display the planes position?<<<
January 17, 200818 yr 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
January 17, 200818 yr 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 AviationMy Playland - I69
January 17, 200818 yr 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