1 // navrecord.hxx -- generic vor/dme/ndb class
3 // Written by Curtis Olson, started May 2004.
5 // Copyright (C) 2004 Curtis L. Olson - http://www.flightgear.org/~curt
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef _FG_NAVRECORD_HXX
25 #define _FG_NAVRECORD_HXX
29 #include "positioned.hxx"
31 const double FG_NAV_DEFAULT_RANGE = 50; // nm
32 const double FG_LOC_DEFAULT_RANGE = 18; // nm
33 const double FG_DME_DEFAULT_RANGE = 50; // nm
34 const double FG_NAV_MAX_RANGE = 300; // nm
40 class FGNavRecord : public FGPositioned
45 double multiuse; // can be slaved variation of VOR
46 // (degrees) or localizer heading
47 // (degrees) or dme bias (nm)
49 std::string mName; // verbose name in nav database
50 PositionedID mRunway; // associated runway, if there is one
52 bool serviceable; // for failure modeling
54 void processSceneryILS(SGPropertyNode* aILSNode);
56 FGNavRecord(PositionedID aGuid, Type type, const std::string& ident,
57 const std::string& name,
59 int freq, int range, double multiuse,
60 PositionedID aRunway);
62 inline double get_lon() const { return longitude(); } // degrees
63 inline double get_lat() const { return latitude(); } // degrees
64 inline double get_elev_ft() const { return elevation(); }
66 inline int get_freq() const { return freq; }
67 inline int get_range() const { return range; }
68 inline double get_multiuse() const { return multiuse; }
69 inline void set_multiuse( double m ) { multiuse = m; }
70 inline const char *get_ident() const { return ident().c_str(); }
72 inline bool get_serviceable() const { return serviceable; }
73 inline const char *get_trans_ident() const { return get_ident(); }
75 virtual const std::string& name() const
79 * Retrieve the runway this navaid is associated with (for ILS/LOC/GS)
81 FGRunway* runway() const;
84 * return the localizer width, in degrees
85 * computation is based up ICAO stdandard width at the runway threshold
86 * see implementation for further details.
88 double localizerWidth() const;
90 void bindToNode(SGPropertyNode* nd) const;
91 void unbindFromNode(SGPropertyNode* nd) const;
94 class FGTACANRecord : public SGReferenced {
102 inline ~FGTACANRecord(void) {}
104 inline const std::string& get_channel() const { return channel; }
105 inline int get_freq() const { return freq; }
106 friend std::istream& operator>> ( std::istream&, FGTACANRecord& );
109 #endif // _FG_NAVRECORD_HXX