Update fix management code to read Robin's native fix.dat format.
This commit is contained in:
parent
20e35b175e
commit
d777d035a9
3 changed files with 13 additions and 9 deletions
|
@ -1065,7 +1065,7 @@ fgInitNav ()
|
|||
SG_LOG(SG_GENERAL, SG_INFO, " Fixes");
|
||||
current_fixlist = new FGFixList;
|
||||
SGPath p_fix( globals->get_fg_root() );
|
||||
p_fix.append( "Navaids/default.fix" );
|
||||
p_fix.append( "Navaids/fix.dat" );
|
||||
current_fixlist->init( p_fix );
|
||||
|
||||
return true;
|
||||
|
|
|
@ -45,6 +45,9 @@ SG_USING_STD(istream);
|
|||
#include STL_STRING
|
||||
SG_USING_STD(string);
|
||||
|
||||
// SG_USING_STD(cout);
|
||||
// SG_USING_STD(endl);
|
||||
|
||||
|
||||
class FGFix {
|
||||
|
||||
|
@ -76,12 +79,12 @@ FGFix::FGFix()
|
|||
inline istream&
|
||||
operator >> ( istream& in, FGFix& f )
|
||||
{
|
||||
in >> f.ident;
|
||||
in >> f.lat;
|
||||
|
||||
if ( f.ident[0] == '[' )
|
||||
if ( f.lat > 95.0 ) {
|
||||
return in >> skipeol;
|
||||
|
||||
in >> f.lat >> f.lon;
|
||||
}
|
||||
in >> f.lon >> f.ident;
|
||||
|
||||
// cout << "id = " << f.ident << endl;
|
||||
|
||||
|
|
|
@ -56,10 +56,11 @@ bool FGFixList::init( SGPath path ) {
|
|||
exit(-1);
|
||||
}
|
||||
|
||||
// read in each line of the file
|
||||
|
||||
// toss the first two lines of the file
|
||||
in >> skipeol;
|
||||
in >> skipcomment;
|
||||
in >> skipeol;
|
||||
|
||||
// read in each remaining line of the file
|
||||
|
||||
#ifdef __MWERKS__
|
||||
char c = 0;
|
||||
|
@ -71,7 +72,7 @@ bool FGFixList::init( SGPath path ) {
|
|||
|
||||
FGFix fix;
|
||||
in >> fix;
|
||||
if ( fix.get_ident() == "[End]" ) {
|
||||
if ( fix.get_lat() > 95.0 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue