#include <Airports/simple.hxx>
#include <ATC/CommStation.hxx>
-
-FGATCDialogNew *currentATCDialog;
+using std::string;
static SGPropertyNode *getNamedNode(SGPropertyNode *prop, const char *name)
{
return;
}
- int n = 0;
for (unsigned int c=0; c < comms.size(); ++c) {
flightgear::CommStation* comm = comms[c];
// add frequency line (modified copy of <group-template>)
- 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';
buf[7] = '\0';
entry->setStringValue("text[1]/label", buf);
- ++n;
}
_gui->showDialog(dialog_name);
const char *dialog_name = "atc-dialog";
_gui = (NewGUI *)globals->get_subsystem("gui");
+ if (!_gui) {
+ return;
+ }
+
SGPropertyNode_ptr dlg = _gui->getDialogProperties(dialog_name);
if (!dlg)
return;