X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAirports%2Fapt_loader.cxx;h=34cccff20cf7ce6f52618e2c3088215c4ded2fb3;hb=386aefe69358ce41a11c9afeb8f56e26758fe56b;hp=3dfcdf0591e0a658424214ebefb99fa51d5d0609;hpb=8114d1d8998f48e61e2bd4a73d8223961ad4dc17;p=flightgear.git diff --git a/src/Airports/apt_loader.cxx b/src/Airports/apt_loader.cxx index 3dfcdf059..34cccff20 100644 --- a/src/Airports/apt_loader.cxx +++ b/src/Airports/apt_loader.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -47,6 +48,8 @@ #include "pavement.hxx" #if ENABLE_ATCDCL # include +#else + #include #endif #include @@ -78,11 +81,8 @@ public: {} -#ifdef ENABLE_ATCDCL + void parseAPT(const string &aptdb_file, FGCommList *comm_list) -#else - void parseAPT(const string &aptdb_file) -#endif { sg_gzifstream in( aptdb_file ); @@ -162,7 +162,9 @@ public: } else if ( line_id == 0 ) { // ?? } else if ( line_id == 50 ) { + parseATISLine(comm_list, simgear::strutils::split(line)); + } else if ( line_id >= 51 && line_id <= 56 ) { // other frequency entries (ignore) } else if ( line_id == 110 ) { @@ -236,7 +238,6 @@ private: SGGeod pos(SGGeod::fromDegFt(lon, lat, last_apt_elev)); FGAirport* apt = new FGAirport(last_apt_id, pos, tower, last_apt_name, false, fptypeFromRobinType(atoi(last_apt_type.c_str()))); - apt->setRunwaysAndTaxiways(runways, taxiways, pavements); } @@ -468,7 +469,7 @@ private: pvt->addNode(pos, num == 113); } } -#if ENABLE_ATCDCL + void parseATISLine(FGCommList *comm_list, const vector& token) { if ( rwy_count <= 0 ) { @@ -485,6 +486,7 @@ private: // 50 11770 AWOS 3 // This code parallels code found in "operator>>" in ATC.hxx; // FIXME: unify the code. +#if ENABLE_ATCDCL ATCData a; a.geod = SGGeod::fromDegFt(rwy_lon_accum / (double)rwy_count, rwy_lat_accum / (double)rwy_count, last_apt_elev); @@ -503,6 +505,8 @@ private: SGBucket bucket(a.geod); int bucknum = bucket.gen_index(); comm_list->commlist_bck[bucknum].push_back(a); +#else +#endif #if 0 SG_LOG( SG_GENERAL, SG_ALERT, "Loaded ATIS/AWOS for airport: " << a.ident @@ -512,7 +516,7 @@ private: << " type: " << a.type ); #endif } -#endif + }; @@ -520,19 +524,11 @@ private: // metar file is used to mark the airports as having metar available // or not. bool fgAirportDBLoad( const string &aptdb_file, -#if ENABLE_ATCDCL FGCommList *comm_list, const std::string &metar_file ) -#else - const std::string &metar_file ) -#endif { APTLoader ld; -#if ENABLE_ATCDCL ld.parseAPT(aptdb_file, comm_list); -#else - ld.parseAPT(aptdb_file); -#endif // // Load the metar.dat file and update apt db with stations that // have metar data.