1
0
Fork 0

Added constructor to ATCData struct

This commit is contained in:
daveluff 2003-03-06 14:04:02 +00:00
parent 3f15f38d8d
commit c70faa4c0d
2 changed files with 30 additions and 2 deletions

View file

@ -39,6 +39,20 @@ static void fgATCSearch( void ) {
}
*/ //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] = "";
@ -129,6 +143,16 @@ void FGATCMgr::init() {
// 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) {

View file

@ -43,10 +43,12 @@ SG_USING_STD(list);
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;
@ -63,7 +65,9 @@ struct AirportATC {
// 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