On 14 Sep 2011, at 14:34, Scott wrote: > I'm playing around with extending the NasalSys.cxx navinfo() function that > torsten wrote. > >From what I can tell it calls navlist.cxx findByIdentAndFreq(position, > >ident, freq, type) > which then calls findByIdentAndFreq(ident, freq, type) and does a distance > filter on the result. > > The problem is the findByIdentAndFreq() methods require a partial Id, and > this isn't always the case. > I'd like to be able to call navinfo() with a position and radius distance, > and to get back a list of all navaids within the radius range. > > Is there another method that I haven't seen that would return the nearest > navaids items from the database?
There is, one of the FGPositioned spatial queries, which could be exposed via Nasal. However, I already exposed these via an alternate method - I didn't want to add lots of Nasal proxies for each item we have. You can issue a search via a regular flightgear command, and the resulting navaid(s) can be stored into an arbitrary property tree location. The command is called 'find-nearest', it takes a maximum search radius in NM, a search position, and list of types to search on (NDB, ILS, VOR, or anything else in the positioned DB). Eg, from Nasal: fgcommand("find-nearest", props.Node.new({type: "vor", max-results:10, results:"/some/node/path"})); Will load the ten closest VORs to the current aircraft lat/lon below /some/node/path (or as many as possible within the default search radius, 400 nm) James ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the latest advances in developing for the BlackBerry® mobile platform with sessions, labs & more. See new tools and technologies. Register for BlackBerry® DevCon today! http://p.sf.net/sfu/rim-devcon-copy1 _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel