Jump to content
Sign in to follow this  

Recommended Posts

Guest ridgell

i would like to have a conditional string; N %((G:Var1))%!6.2f!where the (G:Var1) is a latitude coordinate.you will notice the "N" in the start of my string rather then have a negative number i would like to display a positive number with the "N" and "S" for a negative (G:Var1). i have seen and used conditions on the back side of the string, but i would like to know how to do it on the preface of the string.i could cheat and use 2 strings, 1 on top of the other, or 2 different string choices sorted by a but i would like to know the "right way".

Share this post


Link to post
Share on other sites

Ridgell,This is an easy one ;-)%((G:Var1) 0 >= if{ 'N' } els{ 'S' })%!s! %((G:Var1))%!6.2f!I would recommned to use LVars instead of GVars. GVars reset to zero whenever screen mode is changed, and don't support unit conversions.Tom

Share this post


Link to post
Share on other sites

Hi, Mustard after meal, dutch proverb..I achieve that while clicking with the mouse on W or S (irs keypad), which gives a negative value for (L:set coordinate lat,number) and (L:set coordinate lon,number).Then in a macro automatically the right coordinates are given:%((L:set coordinate lat,number) d 0 >=)%{if}N%{else}S%{end}%( abs d flr )%!02d!

Share this post


Link to post
Share on other sites
Guest ridgell

ah, i know how to change from degrees,to h,m,s and back again,(with code) i have had to deal with numbers on the right of the decimal before. the stuff you guys glean from... i guess the MS GPS gauge, cause i never saw it in the SDK, if i wasn't so excited about learning a new trick, i would lament all the holes i have dug by hand! G:Vars reset to zero when the screen mode changes? never knew that!oh yea....for some of us, there is nothing easy about strings!

Share this post


Link to post
Share on other sites
Guest ridgell

%((G:Var1) 0 >= if{ 'N' } els{ 'S' })%!s! %((G:Var1))%!6.2f!i need one more tweek... if G:Var1 is negative it needs -1 * if positive then leave it positive....plz

Share this post


Link to post
Share on other sites

Hi,Just curiosity, how do you guys put in the values for coordinates?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Guest ridgell

do you how are they physicaly imput? or how are they "put in" as in used?i am useing a set of dials, one for degrees,one for minutes.they are plugged in just as posted, with the exception of (@c:GeoCalcBearing,radians) (>L:FromToBearing,radians)where it was better for me to use radians.

Share this post


Link to post
Share on other sites

Jan,Do you mean which format I use for displaying coordinates? Because for any call to the gpsdll functions, degrees with fractions must be used.Tom

Share this post


Link to post
Share on other sites

Tom,I mean how do you get the dialed numbers transformed to coordinates.I use the mouse to click in the IRS keypad of the 767 for:1,2....0; N,S,E and W; ENT an CLR.Then via a complicated update section the numbers become 100% accurate coordinates.They are then visible in the irs window.If i want, i can store coordinates in L:Var's during the flight and let the plane automatically fly the route along them.(That is about what i did in fs2002, but since the new gps not anymore; was a lot of clicling to construct a SID or STAR!)Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan,I use a similar approach for an INS project I'm working on. Click on the keypad and transform that into a valid coordinate's value. With a bit of macros' help, it becomes an easy task. I also use arrays of LVars to store flightplan/user input coordinates and fly the route via LNAV. Tom

Share this post


Link to post
Share on other sites
Guest ridgell

yes i am basically storing the data as degrees with decimals.the input is degreed decimals but is displayd and appears to be entered as hours/minutes/seconds i originally was using the d/m/s data as the range of inputs lat/lon was limited. handling the roll overs from seconds to minutes and to degrees was a nightmare, and after writting a bunch of code i saw the folly...easier to keep it in base 100 and do the simple conversion for display. this allows for negative western and southern coordinates to be dealt with in a straight away fashion so... now the INS is global. i am displaying d/m/s because it seemed eaasier to obtain that kind of coordinates. tom..? i did not know that gpsdll was limited to degreed dcimals; i put in lat and lon in decimals but asked it to return radians for bearing .... and it does! (@c:GeoCalcBearing,radians) (>L:FromToBearing,radians)the thing is wicked acurate, you can hit a tower if you have the co-ords...i am working on dumbing it up some now...its to good! jan; not to be condisending...but you are often specific with your answers so...though the method is simple (and you forgot more about xml then i ever knew);@TDRS (L:latitude,enum) 1 + (>L:latitude,enum) (L:latitude,enum) 90 > if{ (L:latitude,enum) 180 - (>L:latitude,enum) } @BDRS 1 (>G:Var1) (G:Var1) 0.01 * (>G:Var1) (L:latitude,enum) (G:Var1) + (>L:latitude,enum) TDRS is a macro that handles the animation 'top dial right side'BDRS 'bottom dial right side'there is also a left side that subtracts the result is just like tuning a radio2 knobs 1 hi range 1 low range

Share this post


Link to post
Share on other sites

Hi,Also used that, but find the keyboard now more realistic.Jan"Beatus ille qui procul negotiis..."

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