Sign in to follow this  
Guest bartels

xml adf

Recommended Posts

Help AVSIM continue to serve you!
Please donate today!

Unfortunately, no. I *do* have a working BFO switch that will tune i.e. 358.0 to 358.5, but I'm not able to understand what is going on in the gauge code. I got this one from Bill, and edited it to suit my own needs.There are two (weird) things going on, the code with comments:(A:ADF1 Active Frequency, Kilohertz) 999.5 < if{ (A:ADF1 Active Frequency, Kilohertz) 10 * 5 + (>G:Var1) (G:Var1) 10 % flr (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 16 * (L:ADFX1,number) + (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 256 * (L:ADFX1,number) + (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 4096 * (L:ADFX1,number) + (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 65536 * (L:ADFX1,number) + (>L:ADFX1,number) } els{ (A:ADF1 Active Frequency, Kilohertz) 10 * 9995 - (>G:Var1) (G:Var1) 10 % flr (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 16 * (L:ADFX1,number) + (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 256 * (L:ADFX1,number) + (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 4096 * (L:ADFX1,number) + (>L:ADFX1,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 65536 * (L:ADFX1,number) + (>L:ADFX1,number)(A:ADF1 Active Frequency, Kilohertz) 1000.5 < if{ (A:ADF1 Active Frequency, Kilohertz) 10 * 5 - (>G:Var1) (G:Var1) 10 % flr (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 16 * (L:ADFX2,number) + (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 256 * (L:ADFX2,number) + (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 4096 * (L:ADFX2,number) + (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 65536 * (L:ADFX2,number) + (>L:ADFX2,number) } els{ (A:ADF1 Active Frequency, Kilohertz) 10 * 10005 - (>G:Var1) (G:Var1) 10 % flr (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 16 * (L:ADFX2,number) + (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 256 * (L:ADFX2,number) + (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 4096 * (L:ADFX2,number) + (>L:ADFX2,number) (G:Var1) 10 / (>G:Var1) (G:Var1) 10 % flr 65536 * (L:ADFX2,number) + (>L:ADFX2,number)Then there is the BFO toggle in the click parts:(L:ADF ON,bool) (A:Circuit Avionics On,bool) && if{ (P:Absolute Time,seconds) 25 + (>L:ADF Timer,seconds) (L:ADF UpDown,bool) ! (>L:ADF UpDown,bool) (L:ADF UpDown,bool) ! if{ (A:ADF1 Active Frequency, Kilohertz) 1000 > if{ (L:ADFX2,number) (>K:ADF_HIGHRANGE_SET) } els{ (L:ADFX2,number) (>K:ADF_LOWRANGE_SET) } } els{ (A:ADF1 Active Frequency, Kilohertz) 999.9 < if{ (L:ADFX1,number) (>K:ADF_LOWRANGE_SET) } els{ (L:ADFX1,number) (>K:ADF_HIGHRANGE_SET) } } }BFO not simulated, will use .5 frequency instead when active(L:ADF ON,bool) is something that describes the on/off state of thereciever, and can be omitted. The (L:ADF Timer,seconds) may not be needed, they only serve special purpose for ident stuff in other gauges.Again, it works for me, but I have NO idea why :) Thanks for this one Bill, I could not have done it myself.

Share this post


Link to post
Share on other sites

The idea behind it is to set the ADF frequency directly using the ADF_LOWRANGE_SET and ADF_HIGHRANGE_SET events. Unfortunately they need both bcd coded values, and you have to distinguish between high and low ADF frequencies, because the events set only the last four digits including .0 and .5.With the BCD<->decimal conversion scheme in http://ftp.avsim.com/cgi-bin/dcforum/dcboa...orum=DCForumID9 it should be possible to make an easier .5 .0 switching.Arne Bartels

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