}
*/ //This wouldn't compile - including Time/event.hxx breaks it :-(
+AirportATC::AirportATC() :
+ lon(0.0),
+ lat(0.0),
+ elev(0.0),
+ atis_freq(0.0),
+ atis_active(false),
+ tower_freq(0.0),
+ tower_active(false),
+ ground_freq(0.0),
+ ground_active(false),
+ set_by_AI(false),
+ set_by_comm_search(false) {
+}
+
FGATCMgr::FGATCMgr() {
comm_ident[0] = "";
comm_ident[1] = "";
// DCL - testing
//current_atcdialog->add_entry( "EGNX", "Request vectoring for approach", "Request Vectors" );
//current_atcdialog->add_entry( "EGNX", "Mayday, Mayday", "Declare Emergency" );
+ /*
+ ATCData test;
+ bool ok = current_commlist->FindByCode("KEMT", test, TOWER);
+ if(ok) {
+ cout << "KEMT tower frequency from test was " << test.freq << endl;
+ } else {
+ cout << "KEMT tower frequency not found :-(" << endl;
+ }
+ exit(-1);
+ */
}
void FGATCMgr::update(double dt) {
SG_USING_STD(map);
// Structure for holding details of the ATC frequencies at a given airport, and whether they are in the active list or not.
-// These can then be cross referenced with the [atis][tower][etc]lists which are stored by frequency.
+// These can then be cross referenced with the commlists which are stored by frequency or bucket.
// Non-available services are denoted by a frequency of zero.
-// Eventually the whole ATC data structures may have to be rethought if we turn out to be massive memory hogs!!
+// These structures are only intended to be created for in-use airports, and removed when no longer needed.
struct AirportATC {
+ AirportATC();
+
float lon;
float lat;
float elev;
// Flags to ensure the stations don't get wrongly deactivated
bool set_by_AI; // true when the AI manager has activated this station
+ // Do we need to ref-count the number of AI planes setting this?
bool set_by_comm_search; // true when the comm_search has activated this station
+ // Do we need to distingiush comm1 and comm2?
};
class FGATCMgr : public FGSubsystem