1 // navlist.hxx -- navaids management class
3 // Written by Curtis Olson, started April 2000.
5 // Copyright (C) 2000 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_NAVLIST_HXX
25 #define _FG_NAVLIST_HXX
28 #include <simgear/compiler.h>
30 #include <simgear/structure/SGSharedPtr.hxx>
36 #include "navrecord.hxx"
41 // FGNavList ------------------------------------------------------------------
43 typedef SGSharedPtr<FGNavRecord> nav_rec_ptr;
44 typedef std::vector < nav_rec_ptr > nav_list_type;
45 typedef nav_list_type::iterator nav_list_iterator;
46 typedef nav_list_type::const_iterator nav_list_const_iterator;
48 typedef std::map < int, nav_list_type > nav_map_type;
49 typedef nav_map_type::iterator nav_map_iterator;
50 typedef nav_map_type::const_iterator nav_map_const_iterator;
54 nav_list_type carrierlist;
57 // Given a point and a list of stations, return the closest one to
58 // the specified point.
59 FGNavRecord *findNavFromList( const SGGeod &aircraft,
60 const nav_list_type &stations );
67 // initialize the nav list
71 bool add( FGNavRecord *n );
73 /** Query the database for the specified station. It is assumed
74 * that there will be multiple stations with matching frequencies
75 * so a position must be specified.
77 FGNavRecord *findByFreq( double freq, const SGGeod& position);
79 // Given an Ident and optional freqency, return the first matching
81 FGNavRecord *findByIdentAndFreq( const std::string& ident,
82 const double freq = 0.0 );
84 // given a frequency returns the first matching entry
85 FGNavRecord *findStationByFreq( double frequency );
91 // FGTACANList ----------------------------------------------------------------
94 typedef SGSharedPtr<FGTACANRecord> tacan_rec_ptr;
95 typedef std::vector < tacan_rec_ptr > tacan_list_type;
96 typedef std::map < int, tacan_list_type > tacan_map_type;
97 typedef std::map < std::string, tacan_list_type > tacan_ident_map_type;
101 tacan_list_type channellist;
102 tacan_map_type channels;
103 tacan_ident_map_type ident_channels;
110 // initialize the TACAN list
114 bool add( FGTACANRecord *r );
116 // Given a TACAN Channel, return the appropriate frequency.
117 FGTACANRecord *findByChannel( const std::string& channel );
121 #endif // _FG_NAVLIST_HXX