Durk's kindly committed my runway refactoring - just to say, this was  
a slightly far-reaching change, but a very beneficial one, I hope.

There's a few 'interesting' changes to come - I (or Durk) will be  
taking advantage of the new 'getActiveRunway' accessor on FGAirport,  
and Durk's runway preferences code, to bring all the places that  
request the active runway into sync, and much smarter. This means the  
HUD code, ATIS, ATC, local traffic and Durk's traffic manager should  
all agree about the appropriate landing and departing runways. As part  
of this, I replaced about six almost-identical copies of the 'get  
metar for airport, use wind direction to find the best runway for  
heading' logic with one. Yay.

One important thing is I've changed a 'return an empty runway if not  
found' logic to 'throw an sg_range_exception'. I've done (limited)  
testing (and so has Durk), and I've checked to identify the cases  
where we pass in an un-validated runway id to the lookup function, but  
I may have missed one. If code that previously worked now throws this  
exception (there's a log message as well), it's a one line fix, and it  
should be exceedingly obvious. Previous, lots of code used to call  
exit() if the returned runway was bogus, so I think this is a  
worthwhile change.

We can now almost get rid of the taxiway information - it's used for  
two things:

  - the groundradar instrument, to render a 'plan' of the airport
  - in ATCDCL/tower.cxx to do a really strange 'on ground' check.

The latter I reckon I can clean-up, and the former feels like a rather  
specialised use case, but I'm not going to worry about it in the short  
term. If someone could explain how I play with the groundradar, that'd  
be lovely.

Regards,
James


-------------------------------------------------------------------------
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