X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Ftacan.cxx;h=59066c4539bf634910e3163c6f7e586a59480c91;hb=61812ef4b88f5aa74e9cc0630c84d6fc6b4a51cd;hp=a6781d7d3477ca1a93b1e0582b1556a5f9a42049;hpb=d90922fe1ed1064ea408255f50723454e00268b6;p=flightgear.git diff --git a/src/Instrumentation/tacan.cxx b/src/Instrumentation/tacan.cxx index a6781d7d3..59066c453 100755 --- a/src/Instrumentation/tacan.cxx +++ b/src/Instrumentation/tacan.cxx @@ -17,7 +17,7 @@ #include "tacan.hxx" -SG_USING_STD(vector); +using std::vector; /** @@ -58,6 +58,8 @@ TACAN::TACAN ( SGPropertyNode *node ) : _transmitter_pos(SGGeod::fromDeg(0, 0)), _transmitter_range_nm(0), _transmitter_bias(0.0), + _mobile_lat(0.0), + _mobile_lon(0.0), _listener_active(0) { } @@ -154,10 +156,10 @@ TACAN::update (double delta_time_sec) double mobile_bearing = 0; double mobile_distance = 0; - SG_LOG( SG_INSTR, SG_DEBUG, "carrier_lat " << _mobile_lat); - SG_LOG( SG_INSTR, SG_DEBUG, "carrier_lon " << _mobile_lon); - SG_LOG( SG_INSTR, SG_DEBUG, "carrier_name " << _mobile_name); - SG_LOG( SG_INSTR, SG_DEBUG, "carrier_valid " << _mobile_valid); + SG_LOG( SG_INSTR, SG_DEBUG, "mobile_lat " << _mobile_lat); + SG_LOG( SG_INSTR, SG_DEBUG, "mobile_lon " << _mobile_lon); + SG_LOG( SG_INSTR, SG_DEBUG, "mobile_name " << _mobile_name); + SG_LOG( SG_INSTR, SG_DEBUG, "mobile_valid " << _mobile_valid); geo_inverse_wgs_84(altitude_m, latitude_deg, longitude_deg, @@ -276,6 +278,7 @@ TACAN::search (double frequency_mhz, double longitude_rad, double latitude_rad, double altitude_m) { int number, i; + _mobile_valid = false; SG_LOG( SG_INSTR, SG_DEBUG, "tacan freq " << frequency_mhz ); @@ -324,17 +327,13 @@ TACAN::search (double frequency_mhz, double longitude_rad, } } - SG_LOG( SG_INSTR, SG_DEBUG, "name " << _mobile_name); - SG_LOG( SG_INSTR, SG_DEBUG, "lat " << _mobile_lat << "lon " << _mobile_lon); - SG_LOG( SG_INSTR, SG_DEBUG, "elev " << _mobile_elevation_ft); - //try any AI tankers second if ( !_mobile_valid) { SG_LOG( SG_INSTR, SG_DEBUG, "tanker transmitter valid start " << _mobile_valid ); SGPropertyNode * branch = fgGetNode("ai/models", true); - vector tanker = branch->getChildren("aircraft"); + vector tanker = branch->getChildren("tanker"); number = tanker.size(); @@ -365,11 +364,6 @@ TACAN::search (double frequency_mhz, double longitude_rad, } } } - - SG_LOG( SG_INSTR, SG_DEBUG, "tanker name " << _mobile_name); - SG_LOG( SG_INSTR, SG_DEBUG, "lat " << _mobile_lat << "lon " << _mobile_lon); - SG_LOG( SG_INSTR, SG_DEBUG, "elev " << _mobile_elevation_ft); - SG_LOG( SG_INSTR, SG_DEBUG, "range " << _mobile_range_nm); } //try any mp tankers third, if we haven't found the tanker in the ai aircraft