Hi James,
> Update of /var/cvs/FlightGear-0.9/source/src/Navaids
> In directory baron.flightgear.org:/tmp/cvs-serv9789/Navaids
>
> Modified Files:
> navdb.cxx navdb.hxx navlist.cxx navlist.hxx navrecord.cxx
> navrecord.hxx
> Log Message:
> James Turner:
> Convert FGNavRecord to inherit FGPositioned. This is much more self-contained
> than the FGRunway change, since FGNavRecord already had good encapsulation of
> its state. However, it's a large diff due to moving around two nasty pieces
> of code - the 'align navaid with extended runway centerline' logic and the
> 'penalise transmitters at the opposite runway end' logic.
>
> In general things are more readable because I've replaced the Navaid type
> enum, and the use of Robin's integer type codes, with switches on the
> FGPositioned::Type code - no more trying to recall that '6' is an outer
> marker in Robin's data. The creation code path is also pushed down from navdb
> into navrecord itself.
>
>
> Index: navlist.cxx
> ===================================================================
> RCS file: /var/cvs/FlightGear-0.9/source/src/Navaids/navlist.cxx,v
> retrieving revision 1.21
> retrieving revision 1.22
> diff -C 2 -r1.21 -r1.22
> *** navlist.cxx 20 Oct 2007 08:36:22 -0000 1.21
> --- navlist.cxx 12 Sep 2008 08:46:17 -0000 1.22
> ***************
> *** 262,265 ****
> --- 257,302 ----
> }
>
> + // LOC, ILS, GS, and DME antenna's could potentially be
> + // installed at the opposite end of the runway. So it's not
> + // enough to simply find the closest antenna with the right
> + // frequency. We need the closest antenna with the right
> + // frequency that is most oriented towards us. (We penalize
> + // stations that are facing away from us by adding 5000 meters
> + // which is further than matching stations would ever be
> + // placed from each other. (Do the expensive check only for
> + // directional atennas and only when there is a chance it is
> + // the closest station.)
> +
> + static bool penaltyForNav(FGNavRecord* aNav, const SGVec3d &aPos)
> + {
> + switch (aNav->type()) {
> + case FGPositioned::ILS:
> + case FGPositioned::LOC:
> + case FGPositioned::GS:
> + // FIXME
> + // case FGPositioned::DME: we can't get the heading for a DME transmitter,
> oops
> + break;
> + default:
> + return false;
> + }
> +
> + double hdg_deg = 0.0;
> + if (aNav->type() == FGPositioned::GS) {
> + int tmp = (int)(aNav->get_multiuse() / 1000.0);
> + hdg_deg = aNav->get_multiuse() - (tmp * 1000);
> + } else {
> + hdg_deg = aNav->get_multiuse();
> + }
> +
> + double az1 = 0.0, az2 = 0.0, s = 0.0;
> + SGGeod geod = SGGeod::fromCart(aPos);
> + geo_inverse_wgs_84( geod, aNav->geod(), &az1, &az2, &s);
> + az1 = az1 - hdg_deg;
> +
> + if ( az1 > 180.0) az1 -= 360.0;
> + if ( az1 < -180.0) az1 += 360.0;
> +
> + return fabs(az1 > 90.0);
> + }
>
> // Given a point and a list of stations, return the closest one to the
>
MSVC has a problem compiling this line :
return fabs(az1 > 90.0);
and I must admit I also have a problem understanding your intention. You
are trying to extract the absolute value of a boolean. Should it be
return fabs(az1) > 90.0;
instead ?
-Fred
--
Frédéric Bouvier
http://my.fotolia.com/frfoto/ Photo gallery
http://fgsd.sourceforge.net/ FlightGear Scenery Designer
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel