From c70faa4c0de66e4d6cc23931ac7971f3a81b30f1 Mon Sep 17 00:00:00 2001 From: daveluff Date: Thu, 6 Mar 2003 14:04:02 +0000 Subject: [PATCH] Added constructor to ATCData struct --- src/ATC/ATCmgr.cxx | 24 ++++++++++++++++++++++++ src/ATC/ATCmgr.hxx | 8 ++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/ATC/ATCmgr.cxx b/src/ATC/ATCmgr.cxx index 412664aee..f2de05d23 100644 --- a/src/ATC/ATCmgr.cxx +++ b/src/ATC/ATCmgr.cxx @@ -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) { diff --git a/src/ATC/ATCmgr.hxx b/src/ATC/ATCmgr.hxx index 992e87f3c..483568f3a 100644 --- a/src/ATC/ATCmgr.hxx +++ b/src/ATC/ATCmgr.hxx @@ -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 -- 2.39.5