current_commlist = new FGCommList;
SGPath p_comm( globals->get_fg_root() );
current_commlist->init( p_comm );
+
+ // Set the user callsign - bit of a hack at the moment - eventually should be read from aircraft file and user-over-rideable
+ fgSetString("/sim/user/callsign", "Golf Foxtrot Sierra"); // C-FGFS
#ifdef ENABLE_AUDIO_SUPPORT
// Load all available voices.
current_atcdialog = new FGATCDialog;
current_atcdialog->Init();
- ATCDialogInit();
-
- // DCL - testing
- //current_atcdialog->add_entry( "EGNX", "Request vectoring for approach", "Request Vectors" );
- //current_atcdialog->add_entry( "EGNX", "Mayday, Mayday", "Declare Emergency" );
-
initDone = true;
}
SG_LOG(SG_ATC, SG_WARN, "Warning - ATCMgr::update(...) called before ATCMgr::init()");
}
+ current_atcdialog->Update(dt);
+
//cout << "Entering update..." << endl;
//Traverse the list of active stations.
//Only update one class per update step to avoid the whole ATC system having to calculate between frames.
// Note that chan is zero based.
void FGATCMgr::CommRemoveFromList(const char* id, atc_type tp, int chan) {
SG_LOG(SG_ATC, SG_BULK, "CommRemoveFromList called for airport " << id << " " << tp << " by channel " << chan);
- if(airport_atc_map.find((string)id) != airport_atc_map.end()) {
- AirportATC* a = airport_atc_map[(string)id];
+ if(airport_atc_map.find(id) != airport_atc_map.end()) {
+ AirportATC* a = airport_atc_map[id];
//cout << "In CommRemoveFromList, a->ground_freq = " << a->ground_freq << endl;
if(a->set_by_AI && tp != ATIS) {
// Set by AI, so don't remove simply because user isn't tuned in any more - just stop displaying
SG_LOG(SG_ATC, SG_BULK, "In CommRemoveFromList, service was set by AI\n");
- FGATC* aptr = GetATCPointer((string)id, tp);
+ FGATC* aptr = GetATCPointer(id, tp);
switch(chan) {
case 0:
//cout << "chan 1\n";
}
break;
}
- airport_atc_map[(string)id] = a;
+ airport_atc_map[id] = a;
return;
} else {
switch(chan) {
}
}
-// Display a dialog box with options relevant to the currently tuned ATC service.
-void FGATCMgr::doPopupDialog() {
- ATCDoDialog(comm_type[0]); // FIXME - currently hardwired to comm1
-}
-
// Search for ATC stations by frequency
void FGATCMgr::FreqSearch(int channel) {
int chan = channel - 1; // Convert to zero-based for the arrays
FGATC* app = FindInList(comm_ident[chan], TOWER);
if(app != NULL) {
// The station is already in the ATC list
- //cout << "In list - flagging SetDisplay..." << endl;
+ SG_LOG(SG_GENERAL, SG_DEBUG, comm_ident[chan] << " is in list - flagging SetDisplay...");
app->SetDisplay();
} else {
// Generate the station and put in the ATC list
- //cout << "Not in list - generating..." << endl;
+ SG_LOG(SG_GENERAL, SG_DEBUG, comm_ident[chan] << " is not in list - generating...");
FGTower* t = new FGTower;
t->SetData(&data);
comm_atc_ptr[chan] = t;
- t->SetDisplay();
t->Init();
+ t->SetDisplay();
atc_list.push_back(t);
}
} else if (comm_type[chan] == GROUND) {
FGGround* g = new FGGround;
g->SetData(&data);
comm_atc_ptr[chan] = g;
- g->SetDisplay();
g->Init();
+ g->SetDisplay();
atc_list.push_back(g);
}
} else if (comm_type[chan] == APPROACH) {
FGApproach* a = new FGApproach;
a->SetData(&data);
comm_atc_ptr[chan] = a;
- a->SetDisplay();
a->Init();
+ a->SetDisplay();
a->AddPlane("Player");
atc_list.push_back(a);
}