// add transmission button (modified copy of <button-template>)
SGPropertyNode *entry = button_group->getNode("button", n, true);
copyProperties(button_group->getNode("button-template", true), entry);
- entry->removeChildren("hide", false);
+ entry->removeChildren("enabled", true);
entry->setStringValue("property", buf);
entry->setIntValue("keynum", '1' + n);
if (n == 0)
//cout << "TOWER " << endl;
//cout << "ident is " << atcptr->get_ident() << endl;
atcmentry_vec_type atcmlist = (available_dialog[TOWER])[atcptr->get_ident()];
- unsigned int size = atcmlist.size();
+ int size = atcmlist.size();
if(size && num < size) {
//cout << "Doing callback...\n";
ATCMenuEntry a = atcmlist[num];
double lon = fgGetDouble("/position/longitude-deg");
double lat = fgGetDouble("/position/latitude-deg");
double elev = fgGetDouble("/position/altitude-ft");
- Point3D aircraft = sgGeodToCart(Point3D(lon * SGD_DEGREES_TO_RADIANS,
- lat * SGD_DEGREES_TO_RADIANS, elev));
+ SGVec3d aircraft = SGVec3d::fromGeod(SGGeod::fromDegM(lon, lat, elev));
// search stations in range
int num_stat = current_commlist->FindByPos(lon, lat, elev, 50.0, &atc_stations);
// fill map (sorts by distance and removes duplicates)
comm_list_iterator itr = atc_stations.begin();
for (; itr != atc_stations.end(); ++itr) {
- Point3D station = Point3D(itr->x, itr->y, itr->z);
- double distance = aircraft.distance3Dsquared(station);
+ SGVec3d station(itr->x, itr->y, itr->z);
+ double distance = distSqr(aircraft, station);
uniq[atcdata(itr->ident, itr->name, distance)] = true;
}
// create button per map entry (modified copy of <button-template>)
for (int n = 0; uit != uniq.end() && n < 6; ++uit, ++n) { // max 6 buttons
SGPropertyNode *entry = button_group->getNode("button", n, true);
copyProperties(button_group->getNode("button-template", true), entry);
- entry->removeChildren("hide", false);
+ entry->removeChildren("enabled", true);
entry->setStringValue("legend", uit->first.id.c_str());
entry->setStringValue("binding[0]/value", uit->first.id.c_str());
}
// (un)hide message saying no things in range
SGPropertyNode_ptr range_error = getNamedNode(dlg, "no-atc-in-range");
- range_error->setBoolValue("hide", num_stat);
+ range_error->setBoolValue("enabled", !num_stat);
_gui->showDialog(dialog_name);
}
// add frequency line (modified copy of <group-template>)
SGPropertyNode *entry = freq_group->getNode("group", n, true);
copyProperties(freq_group->getNode("group-template", true), entry);
- entry->removeChildren("hide", false);
+ entry->removeChildren("enabled", true);
ostr << itr->type;
entry->setStringValue("text[0]/label", ostr.str().c_str());