]> git.mxchange.org Git - flightgear.git/commitdiff
Added constructor to ATCData struct
authordaveluff <daveluff>
Thu, 6 Mar 2003 14:04:02 +0000 (14:04 +0000)
committerdaveluff <daveluff>
Thu, 6 Mar 2003 14:04:02 +0000 (14:04 +0000)
src/ATC/ATCmgr.cxx
src/ATC/ATCmgr.hxx

index 412664aee16a28d5facb830fb87c450e38c1d45e..f2de05d2343024ee049c1ab5026a9b4ae147f738 100644 (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) {
index 992e87f3c9e95dc0992e2ec0b601a296a11fb03c..483568f3a814b8f267118c2d90f0f93e54e70529 100644 (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