Jump to content
Sign in to follow this  
Guest bartels

xml difficult(?) string questions

Recommended Posts

Hallo,1. Does anyone of you knows a "string", which gives the heading, bearing to a NAV-station?2. And is it possible to use this value, eg 312, in a SET command?Something like:1. ((A:NAV1 Radians, degrees))%!3d! or bearing etc.2. (A:.......) if{ (A:NAV1 Radians, degrees) >K:Heading Set } ?????????I am curious!Janhttp://community.webshots.com/sym/image4/2...75aouncN_ph.jpg

Share this post


Link to post
Share on other sites
Guest bartels

1.<String>%((A:NAV1 Radial, degrees) 180 + 360 % )%!.0f!</String>2.(>K:HEADING_BUG_SET)Arne Bartels

Share this post


Link to post
Share on other sites

Thanks Arne,To my surprise the next one will steer the plane to the facility.(A:NAV1 HAS NAV,bool) 1 == if{ (A:NAV1 radial, degrees) 180 + (>K:HEADING_BUG_SET) }Now looking for a way to automatically select the next frequency's after station passing, using my database with xml-navaids.Something with TOFROM etc.???????????(I try to make an XML-FMC)More questions will follow........Janhttp://community.webshots.com/sym/image4/2...75aouncN_ph.jpg

Share this post


Link to post
Share on other sites
Guest bartels

To-From has nothing to do with flying to and from a navaid, that is it is if you have also tuned the radial you are heading, and only for VORs, for ILSs it's useless. It might be possible somehow with calculating the distance and checking, if you approach or depart from a NAVAID or come near enough, DME is not sufficient for this purpose. Arne Bartels

Share this post


Link to post
Share on other sites

Need advice.This works! (L:test, bool) 1 == (A:HSI TF flags, enum) 1 == (A:NAV1 HAS NAV,bool) 1 == && && if{ (A:NAV1 radial, degrees) 180 + (>K:HEADING_BUG_SET) (A:NAV1 radial, degrees) 180 + (>K:VOR1_SET) }(L:test, bool) 1 == (A:HSI TF flags, enum) 2 == && if{ (>K:HEADING_BUG_SET) }(L:test, bool) 1 == (A:HSI TF flags, enum) 2 == && if{ 112.10 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:NAV1_RADIO_SET) }(L:test, bool) 1 == (A:HSI TF flags, enum) 2 == && if{ 114.20 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:NAV1_RADIO_SET) }etc etcIn other words: enroute, after station passage, frequency and obs change automatically and the plane heads to the next vor (112.10) or holds the last heading.Have been experimenting with more vor's but always the last frequency is chosen, in this case 114.20.Any ideas how to solve that problem, so there can be more stations in a row?Janhttp://community.webshots.com/sym/image4/2...75aouncN_ph.jpg

Share this post


Link to post
Share on other sites
Guest bartels

Of course last frequency is chosen. You can't distinguish with the toggling TF flag over which VOR you have flown. With your logic both frequencies are set to NAV1 at the same time, or better first 112.10, then almost immediately after theat 114.20, so 114.20 persists. You can different things, check also the ident to identify the sations, or place the frequencies in a row, use an index that increases and select per "case" in the value line.Something like <Value>... if{ (L:waypoint index,number) ++ (>L:waypoint index,number) 112.10 114.20 2 (L:waypoint index,number) case .... (>K:NAV1_RADIO_SET}...</Value>Arne Bartels

Share this post


Link to post
Share on other sites

Arne, you mean something like this:(A:HSI TF flags, enum) 2 == if{ (L:NAV,number) ++ (>L:NAV,number) 112.10 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + 114.20 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + 113.20 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + 109.90 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + etc. etc.117.80 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + 5 (L:NAV,number) case (>K:NAV1_RADIO_SET) }Doesn't work so properly.What is the first chosen frequency, the last in this stock i presume?Janhttp://community.webshots.com/sym/image4/2...75aouncN_ph.jpg

Share this post


Link to post
Share on other sites
Guest bartels

Sorry I only know that "case" works, not exactly how, I need to investigate this to be sure.I personally would shift the float BCD conversion to the end so you need it only once, e.g:<Value>(A:HSI TF flags, enum) 2 == if{ (L:NAV,number) ++ (>L:NAV,number)112.10 114.20113.20109.90117.805 (L:NAV,number) case 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:NAV1_RADIO_SET) }</Value<It is shorter and less error prone, you can even copy the part to a <String> element to check the frequencies that would be selected selected. It is not implemented how the first frequency is set in the first place.Arne Bartels

Share this post


Link to post
Share on other sites

Hallo,With the no problems, but the frequency's are a mess.Sometimes the next one is chosen, mostly the last.I cannot find the proper solution and am stuck with the FMC.This is what i have:%( 115.60 117.30 112.10 116.80 112.80 109.00 114.10 7 (L:NAV,number) case)%!6.2f! (A:HSI TF flags, enum) 2 == if{ (L:NAV,number) ++ (>L:NAV,number) 115.60 117.30 112.10 116.80 112.80 109.00 114.10 7 (L:NAV,,number) case 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:NAV1_RADIO_SET) 1(>K:TOGGLE_AFTERBURNER2) }Any ideas??Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest bartels

I tried a bit and it worked (mostly). One problem is that it is possible that frequencies are stepped over, since they might be FROM before the correct course is selected. As one solution (their might be others) I thought that waypoint switching should only be possible, if you aren't far from the VOR, instead of the real distance NAV1 SIGNAL is chosen.

<Element><Select><Value> (A:HSI TF flags, enum) 2 == (A:NAV1 SIGNAL,number) 40000 > && if{ (G:Var2) ++ (>G:Var2) 115.20 116.50 117.45 112.90 115.10 110.60 117.30 7 (G:Var2) case 100 * 10000 % int d 10 % r 10 / int d 10 % r 10 / int d 10 % r 10 / int 16 * + 16 * + 16 * + (>K:NAV1_RADIO_SET)  }</Value></Select></Element>

Don't forget the frequencies are run through from end to begin.BTW instead of using strings, you can also use the <Tooltip> for "debugging info", e.g.

<Tooltip>%((G:Var2))%!d! %((A:NAV1 SIGNAL,number))%!.1f!%</Tooltip>

See also the pic for a successful flown flightplan.Arne Bartels

Share this post


Link to post
Share on other sites

Arne,To my surprise the previous mentioned stuff works suddenly(?} reasonable.It seems that a good startup-situation, plane- and fmc setup is a must.Your code looks again better, so back to the drawing board.I use the string in a sort of "PROG-page" of the fmc.Next step ADF and ISECS if at all possible?????????????Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Found out that range of the VOR and flightlevel are important factors too (of course).Don't understand what(A:NAV1 SIGNAL,number) 40000 >really does.The whole thing remains pretty unstable still.What about setting and flying to an AIRPORT (or coordinate)? Making a rudimentary xml-gps.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest bartels

As I said, the signal strength is an indirect measure for the distance. To get the bearing to an airport (or any other waypoint), you have to calculate the distance from the coordinates.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  

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