Jump to content

Recommended Posts

In the SDK, I find the following #defines:// defines for VOR_INFO.CODE field#define VOR_CODE_IS_LOCALIZER BIT7 // bit7 = 0= VOR 1= Localizer#define VOR_CODE_GLIDESLOPE BIT6 // bit6 = 1= Glideslope Available#define VOR_CODE_BACKCOURSE_UNAVAIL BIT5 // bit5 = 1= no localizer backcourse#define VOR_CODE_DME_AT_GLIDE_SLOPE BIT4 // bit4 = 1= DME transmitter at Glide Slope Transmitter#define VOR_CODE_NAV_UNAVAILABLE BIT3 // bit3 = 1= no nav signal available#define VOR_CODE_VOICE_AVAILABLE BIT2 // bit2 = Voice Available#define VOR_CODE_TACAN BIT1 // bit1 = TACAN#define VOR_CODE_DME_AVAILABLE BIT0 // bit0 = DMEHow does one go about USING them though???


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest mgipson

You need to do a bitwise AND (&) operation to test if the bits you are looking for are set.In C++ you would do this if you were testing to see if VOR1 has a localizer:MODULE_VAR FSVARS_vor1code = { VOR1_CODE };lookup_var(&FSVARS_vor1code);if(FSVARS_vor1code.var_value.f & VOR_CODE_IS_LOCALIZER) return(true);else return(false);I can't help you with XML I'm afraid as that's not my thing.Mark

Share this post


Link to post
Share on other sites
Guest Dan G Martin

Hi there Bill I've been looking for that info for ages(I am just a dumb scenery type) so that would explain why I did not see it LOL. Anyway for you "gageheads" many airports put the dme xmitter at the G.S ant I.E. co-locate both the G.S and dme thus your dme would read zero at the glide path intercept point with the ground instead of the distance to the localizer when the dme is co-located with the localizer the others should be self-explanitory I.E. say voice on the localizer freq etc.The above post does however tell one how to use the above. Sorry duh I should really read you post as you no doubt know what all the displys do and how they need to be programmed I hope I've been of some help .though Dan Martin

Share this post


Link to post
Share on other sites

>You need to do a bitwise AND (&) operation to test if the>bits you are looking for are set.>>In C++ you would do this if you were testing to see if VOR1>has a localizer:>>MODULE_VAR FSVARS_vor1code = { VOR1_CODE };>lookup_var(&FSVARS_vor1code);>if(FSVARS_vor1code.var_value.f & VOR_CODE_IS_LOCALIZER)> return(true);>else> return(false);>>I can't help you with XML I'm afraid as that's not my thing.Were I asking an XML question, I wouldn't have posted code from the fs9gauges.h file, would I? ;)I have been using this, but thought there MUST be an easier way... ;) MODULE_VAR mvvorcode = { VOR1_CODE }; FLOAT64 vorcode = 0; FLOAT64 vor_code = 0; FLOAT64 vorcodeisloc = 0; FLOAT64 vorcodegsavail = 0; FLOAT64 vorcodeisbc = 0; lookup_var (&mvvorcode); vorcode = mvvorcode.var_value.f; /* Update Variables */ if (vorcode >= 128) { vorcodeisloc = 1 ; } else { vorcodeisloc = 0 ; } if (vorcode >= 128) { vor_code = vorcode - 128; if (vor_code >= 64) {vorcodegsavail = 1;} else {vorcodegsavail = 0; } } if (vor_code >= 64) { vor_code = vor_code - 64; if(vor_code >= 32) {vorcodeisbc = 0;} else {vorcodeisbc=1;} }


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Thanks again, Mark... Now I know how to work with these as well!// Back course flags for VOR gauges#define BC_FLAG_BACKCOURSE_AVAILABLE BIT0#define BC_FLAG_LOCALIZER_TUNED_IN BIT1#define BC_FLAG_ON_BACKCOURSE BIT2#define BC_FLAG_STATION_ACTIVE BIT7I was puzzled why I couldn't find a way to determine whether I was on a normal localizer or a backcourse localizer approach. I needed to invert the drawing code for the HSI needle: if (mvbcflags.var_value.f & BC_FLAG_ON_BACKCOURSE) { vorbcavail = 1 ; } else { vorbcavail = 0 ; } /* Localizer */ if (hsivertvalid == -1 && vorcodeisloc == 1) { if (vorbcavail == 0) { graphics.TranslateTransform (152.0f + (hsivert*50), 157.0f); } if (vorbcavail == 1) { graphics.TranslateTransform (152.0f - (hsivert*50), 157.0f); } PointF fd_vert [] = { PointF (-4.0f, -60.0f), PointF (4.0f, -60.0f), PointF (4.0f, 60.0f), PointF (-4.0f, 60.0f), }; graphics.FillPolygon (&yellowBrush, fd_vert, 4);


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...