From: curt Date: Tue, 25 Apr 2000 17:33:13 +0000 (+0000) Subject: Tweaks to navaid database loading. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ff8e6b9e28ae044523b3988e29b58d5c1fc0e4f4;p=flightgear.git Tweaks to navaid database loading. --- diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 1cdbaa126..95176fce7 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -455,6 +455,8 @@ bool fgInitSubsystems( void ) { #endif // Initialize vor/ndb/ils/fix list management and query systems + FG_LOG(FG_GENERAL, FG_INFO, "Loading Navaids"); + current_navlist = new FGNavList; FGPath p_nav( current_options.get_fg_root() ); p_nav.append( "Navaids/default.nav" ); diff --git a/src/Navaids/ilslist.cxx b/src/Navaids/ilslist.cxx index 8c43d7c64..fa68f4f74 100644 --- a/src/Navaids/ilslist.cxx +++ b/src/Navaids/ilslist.cxx @@ -72,6 +72,9 @@ bool FGILSList::init( FGPath path ) { #else + double min = 1000000.0; + double max = 0.0; + while ( ! in.eof() && ils.get_ilstype() != '[' ) { in >> ils; /* cout << "id = " << n.get_ident() << endl; @@ -85,8 +88,18 @@ bool FGILSList::init( FGPath path ) { ilslist[ils.get_locfreq()].push_back(ils); } in >> skipcomment; + + if ( ils.get_locfreq() < min ) { + min = ils.get_locfreq(); + } + if ( ils.get_locfreq() > max ) { + max = ils.get_locfreq(); + } } + cout << "min freq = " << min << endl; + cout << "max freq = " << max << endl; + #endif return true; diff --git a/src/Navaids/navlist.cxx b/src/Navaids/navlist.cxx index f439044b5..55c788fe1 100644 --- a/src/Navaids/navlist.cxx +++ b/src/Navaids/navlist.cxx @@ -72,6 +72,9 @@ bool FGNavList::init( FGPath path ) { #else + double min = 100000; + double max = 0; + while ( ! in.eof() && n.get_type() != '[' ) { in >> n; /* cout << "id = " << n.get_ident() << endl; @@ -85,8 +88,20 @@ bool FGNavList::init( FGPath path ) { navaids[n.get_freq()].push_back(n); } in >> skipcomment; + + if ( n.get_type() != 'N' ) { + if ( n.get_freq() < min ) { + min = n.get_freq(); + } + if ( n.get_freq() > max ) { + max = n.get_freq(); + } + } } + cout << "min freq = " << min << endl; + cout << "max freq = " << max << endl; + #endif return true;