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