From d777d035a9a56f04e3956abb68930342b9a83a35 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 26 May 2004 16:40:27 +0000 Subject: [PATCH] Update fix management code to read Robin's native fix.dat format. --- src/Main/fg_init.cxx | 2 +- src/Navaids/fix.hxx | 11 +++++++---- src/Navaids/fixlist.cxx | 9 +++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 2cbb434d8..33a85f244 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -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; diff --git a/src/Navaids/fix.hxx b/src/Navaids/fix.hxx index f21dc1443..e50bc2761 100644 --- a/src/Navaids/fix.hxx +++ b/src/Navaids/fix.hxx @@ -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; diff --git a/src/Navaids/fixlist.cxx b/src/Navaids/fixlist.cxx index 31537e1d2..b4548a66d 100644 --- a/src/Navaids/fixlist.cxx +++ b/src/Navaids/fixlist.cxx @@ -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; }