1
0
Fork 0

Update fix management code to read Robin's native fix.dat format.

This commit is contained in:
curt 2004-05-26 16:40:27 +00:00
parent 20e35b175e
commit d777d035a9
3 changed files with 13 additions and 9 deletions

View file

@ -1065,7 +1065,7 @@ fgInitNav ()
SG_LOG(SG_GENERAL, SG_INFO, " Fixes"); SG_LOG(SG_GENERAL, SG_INFO, " Fixes");
current_fixlist = new FGFixList; current_fixlist = new FGFixList;
SGPath p_fix( globals->get_fg_root() ); SGPath p_fix( globals->get_fg_root() );
p_fix.append( "Navaids/default.fix" ); p_fix.append( "Navaids/fix.dat" );
current_fixlist->init( p_fix ); current_fixlist->init( p_fix );
return true; return true;

View file

@ -45,6 +45,9 @@ SG_USING_STD(istream);
#include STL_STRING #include STL_STRING
SG_USING_STD(string); SG_USING_STD(string);
// SG_USING_STD(cout);
// SG_USING_STD(endl);
class FGFix { class FGFix {
@ -76,12 +79,12 @@ FGFix::FGFix()
inline istream& inline istream&
operator >> ( istream& in, FGFix& f ) operator >> ( istream& in, FGFix& f )
{ {
in >> f.ident; in >> f.lat;
if ( f.ident[0] == '[' ) if ( f.lat > 95.0 ) {
return in >> skipeol; return in >> skipeol;
}
in >> f.lat >> f.lon; in >> f.lon >> f.ident;
// cout << "id = " << f.ident << endl; // cout << "id = " << f.ident << endl;

View file

@ -56,10 +56,11 @@ bool FGFixList::init( SGPath path ) {
exit(-1); exit(-1);
} }
// read in each line of the file // toss the first two lines of the file
in >> skipeol; in >> skipeol;
in >> skipcomment; in >> skipeol;
// read in each remaining line of the file
#ifdef __MWERKS__ #ifdef __MWERKS__
char c = 0; char c = 0;
@ -71,7 +72,7 @@ bool FGFixList::init( SGPath path ) {
FGFix fix; FGFix fix;
in >> fix; in >> fix;
if ( fix.get_ident() == "[End]" ) { if ( fix.get_lat() > 95.0 ) {
break; break;
} }