X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATC%2Fatcdialog.cxx;h=00c3e2c05e50354a4d44fc6aaadb724659b72de3;hb=831f75a0309fd8ef729f7f2407c17e13cccf0bd9;hp=ba7bc1791382e535b480b2356194de6065fc33d3;hpb=ebf3a0793dfe62f3be6295e03b9ab8afb5306cb3;p=flightgear.git diff --git a/src/ATC/atcdialog.cxx b/src/ATC/atcdialog.cxx index ba7bc1791..00c3e2c05 100644 --- a/src/ATC/atcdialog.cxx +++ b/src/ATC/atcdialog.cxx @@ -41,7 +41,7 @@ #include
#include // mkDialog #include -#include +#include #include using std::string; @@ -92,7 +92,7 @@ void FGATCDialogNew::frequencySearch() button_group->removeChildren("button", false); AirportsWithATC filt; - FGPositioned::List results = FGPositioned::findWithinRange(globals->get_aircraft_position(), 50.0, &filt); + FGPositionedList results = FGPositioned::findWithinRange(globals->get_aircraft_position(), 50.0, &filt); FGPositioned::sortByRange(results, globals->get_aircraft_position()); for (unsigned int r=0; (r) - SGPropertyNode *entry = freq_group->getNode("group", n, true); + SGPropertyNode *entry = freq_group->getNode("group", c, true); copyProperties(freq_group->getNode("group-template", true), entry); entry->removeChildren("enabled", true); entry->setStringValue("text[0]/label", comm->ident()); - + char buf[8]; snprintf(buf, 8, "%.2f", comm->freqMHz()); if(buf[5] == '3') buf[5] = '2'; @@ -163,7 +162,6 @@ void FGATCDialogNew::frequencyDisplay(const std::string& ident) buf[7] = '\0'; entry->setStringValue("text[1]/label", buf); - ++n; } _gui->showDialog(dialog_name); @@ -189,8 +187,9 @@ static bool doFrequencyDisplay( const SGPropertyNode* args ) FGATCDialogNew * FGATCDialogNew::_instance = NULL; FGATCDialogNew::FGATCDialogNew() +: _gui(NULL), + dialogVisible(true) { - dialogVisible = true; } FGATCDialogNew::~FGATCDialogNew() @@ -200,15 +199,15 @@ FGATCDialogNew::~FGATCDialogNew() void FGATCDialogNew::init() { - // Add ATC-dialog to the command list + // Add ATC-dialog to the command list globals->get_commands()->addCommand("ATC-dialog", FGATCDialogNew::popup ); - // Add ATC-freq-search to the command list - globals->get_commands()->addCommand("ATC-freq-search", doFrequencySearch); - globals->get_commands()->addCommand("ATC-freq-display", doFrequencyDisplay); + // Add ATC-freq-search to the command list + globals->get_commands()->addCommand("ATC-freq-search", doFrequencySearch); + globals->get_commands()->addCommand("ATC-freq-display", doFrequencyDisplay); - // initialize properties polled in Update() - //globals->get_props()->setStringValue("/sim/atc/freq-airport", ""); - globals->get_props()->setIntValue("/sim/atc/transmission-num", -1); + // initialize properties polled in Update() + //globals->get_props()->setStringValue("/sim/atc/freq-airport", ""); + globals->get_props()->setIntValue("/sim/atc/transmission-num", -1); } @@ -288,14 +287,4 @@ void FGATCDialogNew::update(double dt) { } else { _gui->showDialog(dialog_name); } - //dialogVisible = !dialogVisible; - return; - /* - static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true); - int n = trans_num->getIntValue(); - if (n >= 0) { - trans_num->setIntValue(-1); - // PopupCallback(n); - cerr << "Selected transmission message" << n << endl; - } */ }