Jump to content
The simFlight Network Forums

davidfournier1969

new Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Tucson, AZ

davidfournier1969's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks Pete, your calcs work great. Here's what I have for the longitutde: lon = ipc.readDBL(0x6018); londegs = math.floor(lon); lonmins = 60*(lon - londegs); lonminstr = string.format("&04f", lonmins); com.write(dev, lonminstr, 4); to format the minutes 4 digit field as a string, but I can't seem to get rid of the decimal. it's giving me 7.38 instead of the needed 0738.
  2. I have been working on a script to drive the latest in Garmin's portables, the area 796. I have the Garmin Interface Control Document and have about 90% of the moving map working. Note - The unit does seem to partially work with the FSUIPC AV400 format, but acts strange sometimes. I just decided to rewrite the entire interface using Lua and really haven't had much trouble until now. How would the latitude/longitude offsets be treated in Lua to convert them from decimal degrees, to degrees, minutes, and hundredths of minutes? The only thing I can think of is some kind of bit masking/logic routine to split apart the integer degree value from the decimal degree value. Then I could perform the necessary calculations, etc to take it down to ddd mmhh (2 or three digit degrees, two digit minutes, followed immediately by two digit hundredths of minutes). It seems like string handling in Lua isn't one of it's strong parts. I'm happy to share the full Interface control document with anyone that wants it. It's just part of a bigger document for an install of a real GNS 530. I'm not even sure why it's in there. Any thoughts? In a nutshell, ddd.ddddddd each from FSX latitude/longitude offsets to a format of ddd mmhh to be sent to the Garmin. I already have the N, S, E, W, signing figured out, along with everything else the unit needs to display own aircraft speed, altitude, track and flight plans. Thanks in advance. Dave
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.