1
0
Fork 0

More name changing.

This commit is contained in:
curt 2000-04-21 16:42:01 +00:00
parent 6b7353598b
commit a759908c76
4 changed files with 26 additions and 26 deletions

View file

@ -1,4 +1,4 @@
// navaid.hxx -- navaid class
// nav.hxx -- vor/dme/ndb class
//
// Written by Curtis Olson, started April 2000.
//
@ -21,8 +21,8 @@
// $Id$
#ifndef _FG_NAVAID_HXX
#define _FG_NAVAID_HXX
#ifndef _FG_NAV_HXX
#define _FG_NAV_HXX
#include <simgear/compiler.h>
@ -43,7 +43,7 @@ FG_USING_STD(istream);
#endif
class FGNavaid {
class FGNav {
char type;
double lon, lat;
@ -55,8 +55,8 @@ class FGNavaid {
public:
inline FGNavaid(void) {}
inline ~FGNavaid(void) {}
inline FGNav(void) {}
inline ~FGNav(void) {}
inline char get_type() const { return type; }
inline double get_lon() const { return lon; }
@ -76,12 +76,12 @@ public:
inline void set_dme( bool b ) { dme = b; }
inline void set_ident( char *i ) { strncpy( ident, i, 5 ); }
friend istream& operator>> ( istream&, FGNavaid& );
friend istream& operator>> ( istream&, FGNav& );
};
inline istream&
operator >> ( istream& in, FGNavaid& n )
operator >> ( istream& in, FGNav& n )
{
double f;
char c;
@ -99,4 +99,4 @@ operator >> ( istream& in, FGNavaid& n )
}
#endif // _FG_NAVAID_HXX
#endif // _FG_NAV_HXX

View file

@ -29,18 +29,18 @@
// Constructor
FGNavaids::FGNavaids( void ) {
FGNavList::FGNavList( void ) {
}
// Destructor
FGNavaids::~FGNavaids( void ) {
FGNavList::~FGNavList( void ) {
}
// load the navaids and build the map
bool FGNavaids::init( FGPath path ) {
FGNavaid n;
bool FGNavList::init( FGPath path ) {
FGNav n;
navaids.erase( navaids.begin(), navaids.end() );
@ -92,8 +92,8 @@ bool FGNavaids::init( FGPath path ) {
// query the database for the specified frequency, lon and lat are in
// degrees, elev is in meters
bool FGNavaids::query( double lon, double lat, double elev, double freq,
FGNavaid *n, double *heading, double *dist )
bool FGNavList::query( double lon, double lat, double elev, double freq,
FGNav *n, double *heading, double *dist )
{
nav_list_type stations = navaids[(int)(freq*100.0)];

View file

@ -1,4 +1,4 @@
// navaids.hxx -- navaids management class
// navlist.hxx -- navaids management class
//
// Written by Curtis Olson, started April 2000.
//
@ -21,8 +21,8 @@
// $Id$
#ifndef _FG_NAVAIDS_HXX
#define _FG_NAVAIDS_HXX
#ifndef _FG_NAVLIST_HXX
#define _FG_NAVLIST_HXX
#include <simgear/compiler.h>
@ -37,10 +37,10 @@ FG_USING_STD(map);
FG_USING_STD(vector);
class FGNavaids {
class FGNavList {
// convenience types
typedef vector < FGNavaid > nav_list_type;
typedef vector < FGNav > nav_list_type;
typedef nav_list_type::iterator nav_list_iterator;
typedef nav_list_type::const_iterator nav_list_const_iterator;
@ -52,8 +52,8 @@ class FGNavaids {
public:
FGNavaids();
~FGNavaids();
FGNavList();
~FGNavList();
// load the navaids and build the map
bool init( FGPath path );
@ -61,8 +61,8 @@ public:
// query the database for the specified frequency, lon and lat are
// in degrees, elev is in meters
bool query( double lon, double lat, double elev, double freq,
FGNavaid *n, double *heading, double *dist);
FGNav *n, double *heading, double *dist);
};
#endif // _FG_NAVAIDS_HXX
#endif // _FG_NAVLIST_HXX

View file

@ -3,13 +3,13 @@
#include "navlist.hxx"
int main() {
FGNavaids navs;
FGNavList navs;
FGPath p( "/export/data2/curt/FlightGear/Navaids/default.nav" );
navs.init( p );
FGNavaid n;
FGNav n;
double heading, dist;
if ( navs.query( -93.2, 45.14, 3000, 117.30,
&n, &heading, &dist) ) {