Move navaids and fixes out of "global" name space into the FGGlobals
structure.
This commit is contained in:
parent
88f6b4e23b
commit
78e6d35998
19 changed files with 102 additions and 71 deletions
|
@ -677,7 +677,7 @@ int NewWaypoint( string Tgt_Alt )
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
} else if ( current_fixlist->query( TgtAptId, &f ) ) {
|
} else if ( globals->get_fixlist()->query( TgtAptId, &f ) ) {
|
||||||
SG_LOG( SG_GENERAL, SG_INFO,
|
SG_LOG( SG_GENERAL, SG_INFO,
|
||||||
"Adding waypoint (fix) = " << TgtAptId );
|
"Adding waypoint (fix) = " << TgtAptId );
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@ void FGDME::search()
|
||||||
FGILS *ils;
|
FGILS *ils;
|
||||||
FGNav *nav;
|
FGNav *nav;
|
||||||
|
|
||||||
if ( (ils = current_ilslist->findByFreq( freq, lon, lat, elev )) != NULL ) {
|
if ( (ils = globals->get_ilslist()->findByFreq( freq, lon, lat, elev )) != NULL ) {
|
||||||
if ( ils->get_has_dme() ) {
|
if ( ils->get_has_dme() ) {
|
||||||
valid = true;
|
valid = true;
|
||||||
lon = ils->get_loclon();
|
lon = ils->get_loclon();
|
||||||
|
@ -233,7 +233,7 @@ void FGDME::search()
|
||||||
y = ils->get_dme_y();
|
y = ils->get_dme_y();
|
||||||
z = ils->get_dme_z();
|
z = ils->get_dme_z();
|
||||||
}
|
}
|
||||||
} else if ( (nav = current_navlist->findByFreq(freq, lon, lat, elev)) != NULL ) {
|
} else if ( (nav = globals->get_navlist()->findByFreq(freq, lon, lat, elev)) != NULL ) {
|
||||||
if (nav->get_has_dme()) {
|
if (nav->get_has_dme()) {
|
||||||
valid = true;
|
valid = true;
|
||||||
lon = nav->get_lon();
|
lon = nav->get_lon();
|
||||||
|
|
|
@ -488,7 +488,7 @@ void FGKR_87::search() {
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
FGNav *nav
|
FGNav *nav
|
||||||
= current_navlist->findByFreq(freq, acft_lon, acft_lat, acft_elev);
|
= globals->get_navlist()->findByFreq(freq, acft_lon, acft_lat, acft_elev);
|
||||||
|
|
||||||
if ( nav != NULL ) {
|
if ( nav != NULL ) {
|
||||||
char sfreq[128];
|
char sfreq[128];
|
||||||
|
|
|
@ -174,8 +174,8 @@ void FGMarkerBeacon::search()
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
FGMkrBeacon::fgMkrBeacType beacon_type
|
FGMkrBeacon::fgMkrBeacType beacon_type
|
||||||
= current_beacons->query( lon * SGD_RADIANS_TO_DEGREES,
|
= globals->get_beacons()->query( lon * SGD_RADIANS_TO_DEGREES,
|
||||||
lat * SGD_RADIANS_TO_DEGREES, elev );
|
lat * SGD_RADIANS_TO_DEGREES, elev );
|
||||||
|
|
||||||
outer_marker = middle_marker = inner_marker = false;
|
outer_marker = middle_marker = inner_marker = false;
|
||||||
|
|
||||||
|
|
|
@ -604,7 +604,7 @@ void FGNavCom::search()
|
||||||
// Nav.
|
// Nav.
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
if ( (ils = current_ilslist->findByFreq(nav_freq, lon, lat, elev)) != NULL ) {
|
if ( (ils = globals->get_ilslist()->findByFreq(nav_freq, lon, lat, elev)) != NULL ) {
|
||||||
nav_id = ils->get_locident();
|
nav_id = ils->get_locident();
|
||||||
nav_valid = true;
|
nav_valid = true;
|
||||||
if ( last_nav_id != nav_id || last_nav_vor ) {
|
if ( last_nav_id != nav_id || last_nav_vor ) {
|
||||||
|
@ -678,7 +678,7 @@ void FGNavCom::search()
|
||||||
// cout << "Found an ils station in range" << endl;
|
// cout << "Found an ils station in range" << endl;
|
||||||
// cout << " id = " << ils->get_locident() << endl;
|
// cout << " id = " << ils->get_locident() << endl;
|
||||||
}
|
}
|
||||||
} else if ( (nav = current_navlist->findByFreq(nav_freq, lon, lat, elev)) != NULL ) {
|
} else if ( (nav = globals->get_navlist()->findByFreq(nav_freq, lon, lat, elev)) != NULL ) {
|
||||||
nav_id = nav->get_ident();
|
nav_id = nav->get_ident();
|
||||||
nav_valid = (nav->get_type() == 'V');
|
nav_valid = (nav->get_type() == 'V');
|
||||||
if ( last_nav_id != nav_id || !last_nav_vor ) {
|
if ( last_nav_id != nav_id || !last_nav_vor ) {
|
||||||
|
|
|
@ -163,9 +163,9 @@ ADF::search (double frequency_khz, double longitude_rad,
|
||||||
_time_before_search_sec = 1.0;
|
_time_before_search_sec = 1.0;
|
||||||
|
|
||||||
// try the ILS list first
|
// try the ILS list first
|
||||||
FGNav * nav =
|
FGNav *nav =
|
||||||
current_navlist->findByFreq(frequency_khz, longitude_rad,
|
globals->get_navlist()->findByFreq(frequency_khz, longitude_rad,
|
||||||
latitude_rad, altitude_m);
|
latitude_rad, altitude_m);
|
||||||
|
|
||||||
if (nav !=0) {
|
if (nav !=0) {
|
||||||
_transmitter_valid = true;
|
_transmitter_valid = true;
|
||||||
|
|
|
@ -149,10 +149,10 @@ DME::search (double frequency_mhz, double longitude_rad,
|
||||||
_time_before_search_sec = 1.0;
|
_time_before_search_sec = 1.0;
|
||||||
|
|
||||||
// try the ILS list first
|
// try the ILS list first
|
||||||
FGILS * ils = current_ilslist->findByFreq(frequency_mhz,
|
FGILS *ils = globals->get_ilslist()->findByFreq(frequency_mhz,
|
||||||
longitude_rad,
|
longitude_rad,
|
||||||
latitude_rad,
|
latitude_rad,
|
||||||
altitude_m);
|
altitude_m);
|
||||||
if (ils !=0 && ils->get_has_dme()) {
|
if (ils !=0 && ils->get_has_dme()) {
|
||||||
_transmitter_valid = true;
|
_transmitter_valid = true;
|
||||||
_transmitter = Point3D(ils->get_dme_x(),
|
_transmitter = Point3D(ils->get_dme_x(),
|
||||||
|
@ -164,10 +164,10 @@ DME::search (double frequency_mhz, double longitude_rad,
|
||||||
}
|
}
|
||||||
|
|
||||||
// try the VORs next
|
// try the VORs next
|
||||||
FGNav * nav = current_navlist->findByFreq(frequency_mhz,
|
FGNav *nav = globals->get_navlist()->findByFreq(frequency_mhz,
|
||||||
longitude_rad,
|
longitude_rad,
|
||||||
latitude_rad,
|
latitude_rad,
|
||||||
altitude_m);
|
altitude_m);
|
||||||
if (nav != 0 && nav->get_has_dme()) {
|
if (nav != 0 && nav->get_has_dme()) {
|
||||||
_transmitter_valid = true;
|
_transmitter_valid = true;
|
||||||
_transmitter = Point3D(nav->get_x(),
|
_transmitter = Point3D(nav->get_x(),
|
||||||
|
|
|
@ -326,10 +326,12 @@ GPS::update (double delta_time_sec)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (waypont_type == "nav") {
|
else if (waypont_type == "nav") {
|
||||||
FGNav * n;
|
FGNav *n;
|
||||||
if ( (n = current_navlist->findByIdent(wp0_ID.c_str(),
|
if ( (n = globals->get_navlist()->findByIdent(wp0_ID.c_str(),
|
||||||
longitude_deg,
|
longitude_deg,
|
||||||
latitude_deg)) != NULL) {
|
latitude_deg))
|
||||||
|
!= NULL)
|
||||||
|
{
|
||||||
//cout << "Nav found" << endl;
|
//cout << "Nav found" << endl;
|
||||||
wp0_longitude_deg = n->get_lon();
|
wp0_longitude_deg = n->get_lon();
|
||||||
wp0_latitude_deg = n->get_lat();
|
wp0_latitude_deg = n->get_lat();
|
||||||
|
@ -338,7 +340,7 @@ GPS::update (double delta_time_sec)
|
||||||
}
|
}
|
||||||
else if (waypont_type == "fix") {
|
else if (waypont_type == "fix") {
|
||||||
FGFix f;
|
FGFix f;
|
||||||
if ( current_fixlist->query(wp0_ID, &f) ) {
|
if ( globals->get_fixlist()->query(wp0_ID, &f) ) {
|
||||||
//cout << "Fix found" << endl;
|
//cout << "Fix found" << endl;
|
||||||
wp0_longitude_deg = f.get_lon();
|
wp0_longitude_deg = f.get_lon();
|
||||||
wp0_latitude_deg = f.get_lat();
|
wp0_latitude_deg = f.get_lat();
|
||||||
|
@ -365,9 +367,11 @@ GPS::update (double delta_time_sec)
|
||||||
}
|
}
|
||||||
else if (waypont_type == "nav") {
|
else if (waypont_type == "nav") {
|
||||||
FGNav * n;
|
FGNav * n;
|
||||||
if ( (n = current_navlist->findByIdent(wp1_ID.c_str(),
|
if ( (n = globals->get_navlist()->findByIdent(wp1_ID.c_str(),
|
||||||
longitude_deg,
|
longitude_deg,
|
||||||
latitude_deg)) != NULL) {
|
latitude_deg))
|
||||||
|
!= NULL)
|
||||||
|
{
|
||||||
//cout << "Nav found" << endl;
|
//cout << "Nav found" << endl;
|
||||||
wp1_longitude_deg = n->get_lon();
|
wp1_longitude_deg = n->get_lon();
|
||||||
wp1_latitude_deg = n->get_lat();
|
wp1_latitude_deg = n->get_lat();
|
||||||
|
@ -376,7 +380,7 @@ GPS::update (double delta_time_sec)
|
||||||
}
|
}
|
||||||
else if (waypont_type == "fix") {
|
else if (waypont_type == "fix") {
|
||||||
FGFix f;
|
FGFix f;
|
||||||
if ( current_fixlist->query(wp1_ID, &f) ) {
|
if ( globals->get_fixlist()->query(wp1_ID, &f) ) {
|
||||||
//cout << "Fix found" << endl;
|
//cout << "Fix found" << endl;
|
||||||
wp1_longitude_deg = f.get_lon();
|
wp1_longitude_deg = f.get_lon();
|
||||||
wp1_latitude_deg = f.get_lat();
|
wp1_latitude_deg = f.get_lat();
|
||||||
|
|
|
@ -906,7 +906,7 @@ static void fgSetDistOrAltFromGlideSlope() {
|
||||||
|
|
||||||
// Set current_options lon/lat given an airport id and heading (degrees)
|
// Set current_options lon/lat given an airport id and heading (degrees)
|
||||||
static bool fgSetPosFromNAV( const string& id, const double& freq ) {
|
static bool fgSetPosFromNAV( const string& id, const double& freq ) {
|
||||||
FGNav *nav = current_navlist->findByIdentAndFreq( id.c_str(), freq );
|
FGNav *nav = globals->get_navlist()->findByIdentAndFreq( id.c_str(), freq );
|
||||||
|
|
||||||
// set initial position from runway and heading
|
// set initial position from runway and heading
|
||||||
if ( nav != NULL ) {
|
if ( nav != NULL ) {
|
||||||
|
@ -958,7 +958,7 @@ static bool fgSetPosFromFix( const string& id ) {
|
||||||
FGFix fix;
|
FGFix fix;
|
||||||
|
|
||||||
// set initial position from runway and heading
|
// set initial position from runway and heading
|
||||||
if ( current_fixlist->query( id.c_str(), &fix ) ) {
|
if ( globals->get_fixlist()->query( id.c_str(), &fix ) ) {
|
||||||
SG_LOG( SG_GENERAL, SG_INFO, "Attempting to set starting position for "
|
SG_LOG( SG_GENERAL, SG_INFO, "Attempting to set starting position for "
|
||||||
<< id );
|
<< id );
|
||||||
|
|
||||||
|
@ -1049,24 +1049,28 @@ fgInitNav ()
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, "Loading Navaids");
|
SG_LOG(SG_GENERAL, SG_INFO, "Loading Navaids");
|
||||||
|
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, " VOR/NDB");
|
SG_LOG(SG_GENERAL, SG_INFO, " VOR/NDB");
|
||||||
current_navlist = new FGNavList;
|
FGNavList *navlist = new FGNavList;
|
||||||
SGPath p_nav( globals->get_fg_root() );
|
SGPath p_nav( globals->get_fg_root() );
|
||||||
p_nav.append( "Navaids/default.nav" );
|
p_nav.append( "Navaids/default.nav" );
|
||||||
current_navlist->init( p_nav );
|
navlist->init( p_nav );
|
||||||
|
globals->set_navlist( navlist );
|
||||||
|
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, " ILS and Marker Beacons");
|
SG_LOG(SG_GENERAL, SG_INFO, " ILS and Marker Beacons");
|
||||||
current_beacons = new FGMarkerBeacons;
|
FGMarkerBeacons *beacons = new FGMarkerBeacons;
|
||||||
current_beacons->init();
|
beacons->init();
|
||||||
current_ilslist = new FGILSList;
|
globals->set_beacons( beacons );
|
||||||
|
FGILSList *ilslist = new FGILSList;
|
||||||
SGPath p_ils( globals->get_fg_root() );
|
SGPath p_ils( globals->get_fg_root() );
|
||||||
p_ils.append( "Navaids/default.ils" );
|
p_ils.append( "Navaids/default.ils" );
|
||||||
current_ilslist->init( p_ils );
|
ilslist->init( p_ils );
|
||||||
|
globals->set_ilslist( ilslist );
|
||||||
|
|
||||||
SG_LOG(SG_GENERAL, SG_INFO, " Fixes");
|
SG_LOG(SG_GENERAL, SG_INFO, " Fixes");
|
||||||
current_fixlist = new FGFixList;
|
FGFixList *fixlist = new FGFixList;
|
||||||
SGPath p_fix( globals->get_fg_root() );
|
SGPath p_fix( globals->get_fg_root() );
|
||||||
p_fix.append( "Navaids/fix.dat" );
|
p_fix.append( "Navaids/fix.dat" );
|
||||||
current_fixlist->init( p_fix );
|
fixlist->init( p_fix );
|
||||||
|
globals->set_fixlist( fixlist );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,11 @@ FGGlobals::FGGlobals() :
|
||||||
initial_waypoints(0),
|
initial_waypoints(0),
|
||||||
scenery( NULL ),
|
scenery( NULL ),
|
||||||
tile_mgr( NULL ),
|
tile_mgr( NULL ),
|
||||||
io( new FGIO )
|
io( new FGIO ),
|
||||||
|
navlist( NULL ),
|
||||||
|
fixlist( NULL ),
|
||||||
|
ilslist( NULL ),
|
||||||
|
beacons( NULL )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,10 @@ class FGATCDisplay;
|
||||||
class FGAircraftModel;
|
class FGAircraftModel;
|
||||||
class FGControls;
|
class FGControls;
|
||||||
class FGIO;
|
class FGIO;
|
||||||
|
class FGNavList;
|
||||||
|
class FGFixList;
|
||||||
|
class FGILSList;
|
||||||
|
class FGMarkerBeacons;
|
||||||
class FGLight;
|
class FGLight;
|
||||||
class FGModelMgr;
|
class FGModelMgr;
|
||||||
class FGRouteMgr;
|
class FGRouteMgr;
|
||||||
|
@ -191,6 +195,12 @@ private:
|
||||||
// Input/Ouput subsystem
|
// Input/Ouput subsystem
|
||||||
FGIO *io;
|
FGIO *io;
|
||||||
|
|
||||||
|
// Navigational Aids
|
||||||
|
FGNavList *navlist;
|
||||||
|
FGFixList *fixlist;
|
||||||
|
FGILSList *ilslist;
|
||||||
|
FGMarkerBeacons *beacons;
|
||||||
|
|
||||||
#ifdef FG_MPLAYER_AS
|
#ifdef FG_MPLAYER_AS
|
||||||
//Mulitplayer managers
|
//Mulitplayer managers
|
||||||
FGMultiplayTxMgr *multiplayer_tx_mgr;
|
FGMultiplayTxMgr *multiplayer_tx_mgr;
|
||||||
|
@ -347,7 +357,20 @@ public:
|
||||||
|
|
||||||
inline FGIO* get_io() const { return io; }
|
inline FGIO* get_io() const { return io; }
|
||||||
|
|
||||||
/**
|
inline FGNavList *get_navlist() const { return navlist; }
|
||||||
|
inline void set_navlist( FGNavList *n ) { navlist = n; }
|
||||||
|
|
||||||
|
inline FGFixList *get_fixlist() const { return fixlist; }
|
||||||
|
inline void set_fixlist( FGFixList *f ) { fixlist = f; }
|
||||||
|
|
||||||
|
inline FGILSList *get_ilslist() const { return ilslist; }
|
||||||
|
inline void set_ilslist( FGILSList *i ) { ilslist = i; }
|
||||||
|
|
||||||
|
inline FGMarkerBeacons *get_beacons() const { return beacons; }
|
||||||
|
inline void set_beacons( FGMarkerBeacons *b ) { beacons = b; }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* Save the current state as the initial state.
|
* Save the current state as the initial state.
|
||||||
*/
|
*/
|
||||||
void saveInitialState ();
|
void saveInitialState ();
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
noinst_LIBRARIES = libNavaids.a
|
noinst_LIBRARIES = libNavaids.a
|
||||||
|
|
||||||
noinst_PROGRAMS = testnavs
|
# noinst_PROGRAMS = testnavs
|
||||||
|
|
||||||
libNavaids_a_SOURCES = \
|
libNavaids_a_SOURCES = \
|
||||||
fix.hxx fixlist.hxx fixlist.cxx \
|
fix.hxx fixlist.hxx fixlist.cxx \
|
||||||
ils.hxx ilslist.hxx ilslist.cxx \
|
ils.hxx ilslist.hxx ilslist.cxx \
|
||||||
mkrbeacons.hxx mkrbeacons.cxx \
|
mkrbeacons.hxx mkrbeacons.cxx \
|
||||||
nav.hxx navlist.hxx navlist.cxx
|
nav.hxx navlist.hxx navlist.cxx \
|
||||||
|
navrecord.hxx
|
||||||
|
|
||||||
testnavs_SOURCES = testnavs.cxx
|
# testnavs_SOURCES = testnavs.cxx
|
||||||
testnavs_LDADD = \
|
# testnavs_LDADD = \
|
||||||
libNavaids.a \
|
# libNavaids.a \
|
||||||
-lsgtiming -lsgmath -lsgmisc -lsgdebug -lsgmagvar -lsgxml \
|
# -lsgtiming -lsgmath -lsgmisc -lsgdebug -lsgmagvar -lsgxml \
|
||||||
$(base_LIBS) -lz
|
# $(base_LIBS) -lz
|
||||||
|
|
||||||
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
|
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src
|
||||||
|
|
|
@ -67,7 +67,4 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern FGFixList *current_fixlist;
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _FG_FIXLIST_HXX
|
#endif // _FG_FIXLIST_HXX
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#include <simgear/misc/sgstream.hxx>
|
#include <simgear/misc/sgstream.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
|
|
||||||
|
#include <Main/globals.hxx>
|
||||||
|
|
||||||
#include "mkrbeacons.hxx"
|
#include "mkrbeacons.hxx"
|
||||||
#include "ilslist.hxx"
|
#include "ilslist.hxx"
|
||||||
|
|
||||||
|
@ -98,18 +100,21 @@ bool FGILSList::init( SGPath path ) {
|
||||||
// update the marker beacon list
|
// update the marker beacon list
|
||||||
if ( fabs(ils->get_omlon()) > SG_EPSILON ||
|
if ( fabs(ils->get_omlon()) > SG_EPSILON ||
|
||||||
fabs(ils->get_omlat()) > SG_EPSILON ) {
|
fabs(ils->get_omlat()) > SG_EPSILON ) {
|
||||||
current_beacons->add( ils->get_omlon(), ils->get_omlat(),
|
globals->get_beacons()->add( ils->get_omlon(), ils->get_omlat(),
|
||||||
ils->get_gselev(), FGMkrBeacon::OUTER );
|
ils->get_gselev(),
|
||||||
|
FGMkrBeacon::OUTER );
|
||||||
}
|
}
|
||||||
if ( fabs(ils->get_mmlon()) > SG_EPSILON ||
|
if ( fabs(ils->get_mmlon()) > SG_EPSILON ||
|
||||||
fabs(ils->get_mmlat()) > SG_EPSILON ) {
|
fabs(ils->get_mmlat()) > SG_EPSILON ) {
|
||||||
current_beacons->add( ils->get_mmlon(), ils->get_mmlat(),
|
globals->get_beacons()->add( ils->get_mmlon(), ils->get_mmlat(),
|
||||||
ils->get_gselev(), FGMkrBeacon::MIDDLE );
|
ils->get_gselev(),
|
||||||
|
FGMkrBeacon::MIDDLE );
|
||||||
}
|
}
|
||||||
if ( fabs(ils->get_imlon()) > SG_EPSILON ||
|
if ( fabs(ils->get_imlon()) > SG_EPSILON ||
|
||||||
fabs(ils->get_imlat()) > SG_EPSILON ) {
|
fabs(ils->get_imlat()) > SG_EPSILON ) {
|
||||||
current_beacons->add( ils->get_imlon(), ils->get_imlat(),
|
globals->get_beacons()->add( ils->get_imlon(), ils->get_imlat(),
|
||||||
ils->get_gselev(), FGMkrBeacon::INNER );
|
ils->get_gselev(),
|
||||||
|
FGMkrBeacon::INNER );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,4 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern FGILSList *current_ilslist;
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _FG_ILSLIST_HXX
|
#endif // _FG_ILSLIST_HXX
|
||||||
|
|
|
@ -134,7 +134,8 @@ bool FGMarkerBeacons::add( double lon, double lat, double elev,
|
||||||
// returns marker beacon type if we are over a marker beacon, NOBEACON
|
// returns marker beacon type if we are over a marker beacon, NOBEACON
|
||||||
// otherwise
|
// otherwise
|
||||||
FGMkrBeacon::fgMkrBeacType FGMarkerBeacons::query( double lon, double lat,
|
FGMkrBeacon::fgMkrBeacType FGMarkerBeacons::query( double lon, double lat,
|
||||||
double elev ) {
|
double elev )
|
||||||
|
{
|
||||||
double diff;
|
double diff;
|
||||||
|
|
||||||
int lonidx = (int)lon;
|
int lonidx = (int)lon;
|
||||||
|
@ -160,7 +161,8 @@ FGMkrBeacon::fgMkrBeacType FGMarkerBeacons::query( double lon, double lat,
|
||||||
beacon_list_iterator current = beacons.begin();
|
beacon_list_iterator current = beacons.begin();
|
||||||
beacon_list_iterator last = beacons.end();
|
beacon_list_iterator last = beacons.end();
|
||||||
|
|
||||||
Point3D aircraft = sgGeodToCart(Point3D(lon*SGD_DEGREES_TO_RADIANS, lat*SGD_DEGREES_TO_RADIANS, 0));
|
Point3D aircraft = sgGeodToCart( Point3D(lon*SGD_DEGREES_TO_RADIANS,
|
||||||
|
lat*SGD_DEGREES_TO_RADIANS, 0) );
|
||||||
|
|
||||||
double min_dist = 999999999.0;
|
double min_dist = 999999999.0;
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,4 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern FGMarkerBeacons *current_beacons;
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _FG_MKRBEACON_HXX
|
#endif // _FG_MKRBEACON_HXX
|
||||||
|
|
|
@ -82,7 +82,4 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern FGNavList *current_navlist;
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _FG_NAVLIST_HXX
|
#endif // _FG_NAVLIST_HXX
|
||||||
|
|
|
@ -11,7 +11,7 @@ const string FG_DATA_DIR("/usr/local/lib/FlightGear");
|
||||||
int main() {
|
int main() {
|
||||||
double heading, dist;
|
double heading, dist;
|
||||||
|
|
||||||
current_navlist = new FGNavList;
|
FGNavList *current_navlist = new FGNavList;
|
||||||
SGPath p_nav( FG_DATA_DIR + "/Navaids/default.nav" );
|
SGPath p_nav( FG_DATA_DIR + "/Navaids/default.nav" );
|
||||||
|
|
||||||
current_navlist->init( p_nav );
|
current_navlist->init( p_nav );
|
||||||
|
@ -42,10 +42,10 @@ int main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// we have to init the marker beacon storage before we parse the ILS file
|
// we have to init the marker beacon storage before we parse the ILS file
|
||||||
current_beacons = new FGMarkerBeacons;
|
FGMarkerBeacons *current_beacons = new FGMarkerBeacons;
|
||||||
current_beacons->init();
|
current_beacons->init();
|
||||||
|
|
||||||
current_ilslist = new FGILSList;
|
FGILSList *current_ilslist = new FGILSList;
|
||||||
SGPath p_ils( FG_DATA_DIR + "/Navaids/default.ils" );
|
SGPath p_ils( FG_DATA_DIR + "/Navaids/default.ils" );
|
||||||
current_ilslist->init( p_ils );
|
current_ilslist->init( p_ils );
|
||||||
FGILS *i = current_ilslist->findByFreq( -93.1 * SG_DEGREES_TO_RADIANS,
|
FGILS *i = current_ilslist->findByFreq( -93.1 * SG_DEGREES_TO_RADIANS,
|
||||||
|
@ -59,7 +59,7 @@ int main() {
|
||||||
cout << "not picking up ils. :-(" << endl;
|
cout << "not picking up ils. :-(" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_fixlist = new FGFixList;
|
FGFixList *current_fixlist = new FGFixList;
|
||||||
SGPath p_fix( FG_DATA_DIR + "/Navaids/default.fix" );
|
SGPath p_fix( FG_DATA_DIR + "/Navaids/default.fix" );
|
||||||
current_fixlist->init( p_fix );
|
current_fixlist->init( p_fix );
|
||||||
FGFix fix;
|
FGFix fix;
|
||||||
|
|
Loading…
Add table
Reference in a new issue