More name changing.
This commit is contained in:
parent
6b7353598b
commit
a759908c76
4 changed files with 26 additions and 26 deletions
|
@ -1,4 +1,4 @@
|
||||||
// navaid.hxx -- navaid class
|
// nav.hxx -- vor/dme/ndb class
|
||||||
//
|
//
|
||||||
// Written by Curtis Olson, started April 2000.
|
// Written by Curtis Olson, started April 2000.
|
||||||
//
|
//
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
||||||
#ifndef _FG_NAVAID_HXX
|
#ifndef _FG_NAV_HXX
|
||||||
#define _FG_NAVAID_HXX
|
#define _FG_NAV_HXX
|
||||||
|
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
|
@ -43,7 +43,7 @@ FG_USING_STD(istream);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
class FGNavaid {
|
class FGNav {
|
||||||
|
|
||||||
char type;
|
char type;
|
||||||
double lon, lat;
|
double lon, lat;
|
||||||
|
@ -55,8 +55,8 @@ class FGNavaid {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
inline FGNavaid(void) {}
|
inline FGNav(void) {}
|
||||||
inline ~FGNavaid(void) {}
|
inline ~FGNav(void) {}
|
||||||
|
|
||||||
inline char get_type() const { return type; }
|
inline char get_type() const { return type; }
|
||||||
inline double get_lon() const { return lon; }
|
inline double get_lon() const { return lon; }
|
||||||
|
@ -76,12 +76,12 @@ public:
|
||||||
inline void set_dme( bool b ) { dme = b; }
|
inline void set_dme( bool b ) { dme = b; }
|
||||||
inline void set_ident( char *i ) { strncpy( ident, i, 5 ); }
|
inline void set_ident( char *i ) { strncpy( ident, i, 5 ); }
|
||||||
|
|
||||||
friend istream& operator>> ( istream&, FGNavaid& );
|
friend istream& operator>> ( istream&, FGNav& );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline istream&
|
inline istream&
|
||||||
operator >> ( istream& in, FGNavaid& n )
|
operator >> ( istream& in, FGNav& n )
|
||||||
{
|
{
|
||||||
double f;
|
double f;
|
||||||
char c;
|
char c;
|
||||||
|
@ -99,4 +99,4 @@ operator >> ( istream& in, FGNavaid& n )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // _FG_NAVAID_HXX
|
#endif // _FG_NAV_HXX
|
||||||
|
|
|
@ -29,18 +29,18 @@
|
||||||
|
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
FGNavaids::FGNavaids( void ) {
|
FGNavList::FGNavList( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
FGNavaids::~FGNavaids( void ) {
|
FGNavList::~FGNavList( void ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// load the navaids and build the map
|
// load the navaids and build the map
|
||||||
bool FGNavaids::init( FGPath path ) {
|
bool FGNavList::init( FGPath path ) {
|
||||||
FGNavaid n;
|
FGNav n;
|
||||||
|
|
||||||
navaids.erase( navaids.begin(), navaids.end() );
|
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
|
// query the database for the specified frequency, lon and lat are in
|
||||||
// degrees, elev is in meters
|
// degrees, elev is in meters
|
||||||
bool FGNavaids::query( double lon, double lat, double elev, double freq,
|
bool FGNavList::query( double lon, double lat, double elev, double freq,
|
||||||
FGNavaid *n, double *heading, double *dist )
|
FGNav *n, double *heading, double *dist )
|
||||||
{
|
{
|
||||||
nav_list_type stations = navaids[(int)(freq*100.0)];
|
nav_list_type stations = navaids[(int)(freq*100.0)];
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// navaids.hxx -- navaids management class
|
// navlist.hxx -- navaids management class
|
||||||
//
|
//
|
||||||
// Written by Curtis Olson, started April 2000.
|
// Written by Curtis Olson, started April 2000.
|
||||||
//
|
//
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
||||||
#ifndef _FG_NAVAIDS_HXX
|
#ifndef _FG_NAVLIST_HXX
|
||||||
#define _FG_NAVAIDS_HXX
|
#define _FG_NAVLIST_HXX
|
||||||
|
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
|
@ -37,10 +37,10 @@ FG_USING_STD(map);
|
||||||
FG_USING_STD(vector);
|
FG_USING_STD(vector);
|
||||||
|
|
||||||
|
|
||||||
class FGNavaids {
|
class FGNavList {
|
||||||
|
|
||||||
// convenience types
|
// 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::iterator nav_list_iterator;
|
||||||
typedef nav_list_type::const_iterator nav_list_const_iterator;
|
typedef nav_list_type::const_iterator nav_list_const_iterator;
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ class FGNavaids {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
FGNavaids();
|
FGNavList();
|
||||||
~FGNavaids();
|
~FGNavList();
|
||||||
|
|
||||||
// load the navaids and build the map
|
// load the navaids and build the map
|
||||||
bool init( FGPath path );
|
bool init( FGPath path );
|
||||||
|
@ -61,8 +61,8 @@ public:
|
||||||
// query the database for the specified frequency, lon and lat are
|
// query the database for the specified frequency, lon and lat are
|
||||||
// in degrees, elev is in meters
|
// in degrees, elev is in meters
|
||||||
bool query( double lon, double lat, double elev, double freq,
|
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
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
#include "navlist.hxx"
|
#include "navlist.hxx"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
FGNavaids navs;
|
FGNavList navs;
|
||||||
|
|
||||||
FGPath p( "/export/data2/curt/FlightGear/Navaids/default.nav" );
|
FGPath p( "/export/data2/curt/FlightGear/Navaids/default.nav" );
|
||||||
|
|
||||||
navs.init( p );
|
navs.init( p );
|
||||||
|
|
||||||
FGNavaid n;
|
FGNav n;
|
||||||
double heading, dist;
|
double heading, dist;
|
||||||
if ( navs.query( -93.2, 45.14, 3000, 117.30,
|
if ( navs.query( -93.2, 45.14, 3000, 117.30,
|
||||||
&n, &heading, &dist) ) {
|
&n, &heading, &dist) ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue