Attached patch refactors the KLN89 code to use the same navaid / fix / airport storage as the rest of FG - instead of copying each (large) list when the instrument is initialised. This gets rids of the _waypoints member of DCLGPS - the waypoint class is still used in the internal flightplans, a job for another day is to change the code to use 'standard' flight plans, when they're better defined.

Some comments on the patch:
- it removes the hard-coded precision approaches Dave Luff put in for testing. If this troubles anyone, I can re-instate them, but my gut feeling is no one apart from Dave knew about them - it factors all the code that does 'order idents by the KLN89's ordering scheme' into one place - it extends some of the FGblahList search methods to take an FGIdentOrdering - which is essentially a wrapper to let me pass a string ordering object into the search methods without making everything 'templatey'. It's not massively elegant, but equally it's not hugely intrusive on the code.

The major improvement, however, is an internal one - this gets rid of the worst offender for the 'iterate over everything in list blah' - the MkVIII was another which I've fixed, and the remaining one is the airport list GUI widget, which I'm going to add a special accessor for, so the FGAirportList can returned a pu-compatible, filtered list itself.

Anyway, I'm not sure how widely used the KLN89 is - it's obviously got a huge amount of features, though equally the code I've changed isn't *that* widely used in it. The major one is adding waypoints in the FPL page. If there's anyone out there who uses the unit regularly, and could test the patch, that'd be great.

James

Attachment: kln89-waypoints-cleanup.patch
Description: Binary data


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to