1 // nav.hxx -- vor/dme/ndb class
3 // Written by Curtis Olson, started April 2000.
5 // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <simgear/compiler.h>
30 #include <simgear/math/sg_geodesy.hxx>
31 #include <simgear/misc/sgstream.hxx>
32 #include <simgear/magvar/magvar.hxx>
33 #include <simgear/timing/sg_time.hxx>
35 #ifdef SG_HAVE_STD_INCLUDES
37 #elif defined( __BORLANDC__ ) || (__APPLE__)
43 SG_USING_STD(istream);
54 double magvar; // magvar from true north (negative = W)
57 // for failure modeling
59 string trans_ident; // transmitted ident
64 inline FGNav( int _type, double _lat, double _lon, double _elev_ft,
65 int _freq, double _range, double _magvar,
66 string _ident, string _name,
70 inline int get_type() const { return type; }
71 inline double get_lon() const { return lon; }
72 inline double get_lat() const { return lat; }
73 inline double get_elev_ft() const { return elev_ft; }
74 inline double get_x() const { return x; }
75 inline double get_y() const { return y; }
76 inline double get_z() const { return z; }
77 inline int get_freq() const { return freq; }
78 inline double get_range() const { return range; }
79 // inline bool get_has_dme() const { return has_dme; }
80 inline const char *get_ident() { return ident.c_str(); }
81 inline string get_trans_ident() { return trans_ident; }
82 inline double get_magvar() const { return magvar; }
83 inline string get_name() { return name; }
92 x(0.0), y(0.0), z(0.0),
106 FGNav::FGNav( int _type, double _lat, double _lon, double _elev_ft,
107 int _freq, double _range, double _magvar,
108 string _ident, string _name,
109 bool _serviceable ) :
113 x(0.0), y(0.0), z(0.0),
132 trans_ident = _ident;
133 serviceable = _serviceable;
135 // generate cartesian coordinates
136 Point3D geod( lon * SGD_DEGREES_TO_RADIANS,
137 lat * SGD_DEGREES_TO_RADIANS,
138 elev_ft * SG_FEET_TO_METER );
139 Point3D cart = sgGeodToCart( geod );
146 #endif // _FG_NAV_HXX