Hi All,

I've been working on a small patch to change the existing global Nasal
function airportinfo() to return more than one result.

With this patch, and optional argument allows the caller to specify
the number of nearest airports to return. E.g. airportinfo(10),
returns the nearest 10 airports, and airportinfo(55.5, -3, 10) returns
the 10 nearest airports to lat 55.5M, lon 3W.

This changes the return values of this function from a hash containing
a single airport to a vector of hashes, so requires a very
straightforward update to all
Nasal calls to airportinfo(). Previously one would call

var airport = airportinfo();

After this patch, this must be changed to

var airport = airportinfo()[0];

I'm happy to make this change to the dozen or so instances in fgdata
(I have commit permissions to fgdata but not the flightgear source),
assuming people approve of the change. I'm away on business this week,
so it would probably best wait until next weekend unless someone is
particularly keen to patch fgdata as well.

My original motivation for this change is to create a Nasal-driven
dialog displaying the local airport frequencies, something previously
provided by ATCDCL, and which hasn't yet been replaced. Unfortunately
I only noticed that frequency information isn't distributing through
the FGAirport object after writing the patch below!

The patch is available from http://www.nanjika.co.uk/flightgear/airport.patch

Comments etc. very welcome as always.

-Stuart

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to