X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=src%2FATC%2Fatcdialog.cxx;h=eb9533fbb692726b6d5b6aba720e5b75cff56635;hb=038251e8af6ff9c24afcc08169c2bcca2c5a63c5;hp=a4c75a6113ebd89323af00ac7c7308447e6d84e7;hpb=e16f772e54216b0088ca9cb3f3b0fb062be8bfdb;p=flightgear.git diff --git a/src/ATC/atcdialog.cxx b/src/ATC/atcdialog.cxx index a4c75a611..eb9533fbb 100644 --- a/src/ATC/atcdialog.cxx +++ b/src/ATC/atcdialog.cxx @@ -36,14 +36,14 @@ FGATCDialogNew *currentATCDialog; static bool doATCDialog(const SGPropertyNode* arg) { - cerr << "Running doATCDialog" << endl; + //cerr << "Running doATCDialog" << endl; currentATCDialog->PopupDialog(); return(true); } FGATCDialogNew::FGATCDialogNew() { - dialogVisible = false; + dialogVisible = true; } FGATCDialogNew::~FGATCDialogNew() @@ -89,11 +89,22 @@ static SGPropertyNode *getNamedNode(SGPropertyNode *prop, const char *name) { void FGATCDialogNew::addEntry(int nr, string txt) { commands.clear(); commands.push_back(txt); + commands.push_back(string("Toggle ground network visibility")); } +void FGATCDialogNew::removeEntry(int nr) { + commands.clear(); +} + + void FGATCDialogNew::PopupDialog() { - double onBoardRadioFreq0 = + dialogVisible = !dialogVisible; + return; +} + +void FGATCDialogNew::update(double dt) { + double onBoardRadioFreq0 = fgGetDouble("/instrumentation/comm[0]/frequencies/selected-mhz"); double onBoardRadioFreq1 = fgGetDouble("/instrumentation/comm[1]/frequencies/selected-mhz"); @@ -136,11 +147,8 @@ void FGATCDialogNew::PopupDialog() { } else { _gui->showDialog(dialog_name); } - dialogVisible = !dialogVisible; + //dialogVisible = !dialogVisible; return; -} - -void FGATCDialogNew::update(double dt) { /* static SGPropertyNode_ptr trans_num = globals->get_props()->getNode("/sim/atc/transmission-num", true); int n = trans_num->getIntValue();