X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATCDCL%2FATCDialog.cxx;h=f5f5ec935d3f337e7b1efe4ad1cb7b2e613d503b;hb=8b57675aef4930245a964816469be922e3004287;hp=e356cee3f47aa10002c81747c563e582e10b4ee4;hpb=a6db6d89ff41a619569e6433409e8bf62ff98499;p=flightgear.git diff --git a/src/ATCDCL/ATCDialog.cxx b/src/ATCDCL/ATCDialog.cxx index e356cee3f..f5f5ec935 100644 --- a/src/ATCDCL/ATCDialog.cxx +++ b/src/ATCDCL/ATCDialog.cxx @@ -66,7 +66,7 @@ ATCMenuEntry::ATCMenuEntry() { ATCMenuEntry::~ATCMenuEntry() { } -static void atcUppercase(string &s) { +void atcUppercase(string &s) { for(unsigned int i=0; iFindByPos(lon, lat, elev, 50.0, &atc_stations); + int num_stat = current_commlist->FindByPos(geod, 50.0, &atc_stations); if (num_stat != 0) { map uniq; // fill map (sorts by distance and removes duplicates) comm_list_iterator itr = atc_stations.begin(); for (; itr != atc_stations.end(); ++itr) { - SGVec3d station(itr->x, itr->y, itr->z); - double distance = distSqr(aircraft, station); + double distance = distSqr(aircraft, itr->cart); uniq[atcdata(itr->ident, itr->name, distance)] = true; } // create button per map entry (modified copy of ) @@ -382,9 +380,8 @@ void FGATCDialog::FreqDisplay(string& ident) { int n = 0; // Number of ATC frequencies at this airport comm_list_type stations; - int found = current_commlist->FindByPos(a->getLongitude(), a->getLatitude(), a->getElevation(), 20.0, &stations); + int found = current_commlist->FindByPos(a->geod(), 20.0, &stations); if(found) { - ostringstream ostr; comm_list_iterator itr = stations.begin(); for (n = 0; itr != stations.end(); ++itr) { if(itr->ident != ident) @@ -398,8 +395,9 @@ void FGATCDialog::FreqDisplay(string& ident) { copyProperties(freq_group->getNode("group-template", true), entry); entry->removeChildren("enabled", true); + ostringstream ostr; ostr << itr->type; - entry->setStringValue("text[0]/label", ostr.str().c_str()); + entry->setStringValue("text[0]/label", ostr.str()); char buf[8]; snprintf(buf, 8, "%.2f", (itr->freq / 100.0)); // Convert from KHz to MHz @@ -408,8 +406,6 @@ void FGATCDialog::FreqDisplay(string& ident) { buf[7] = '\0'; entry->setStringValue("text[1]/label", buf); - - ostr.seekp(0); n++; } }