]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/ATCmgr.hxx
new FSF address
[flightgear.git] / src / ATC / ATCmgr.hxx
index f4c363d0efa71cf5068f652bd0c96d77a68703a8..881abcf8fca5747849a0094181a724596f708943 100644 (file)
@@ -17,7 +17,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 #ifndef _FG_ATCMGR_HXX
 #define _FG_ATCMGR_HXX
@@ -70,7 +70,7 @@ 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
        unsigned int numAI;     // Ref count of the number of AI planes registered
-    bool set_by_comm[2];       // true when the relevant comm_freq has activated this station
+    bool set_by_comm[2][ATC_NUM_TYPES];        // true when the relevant comm_freq has activated this station and type
 };
 
 class FGATCMgr : public SGSubsystem
@@ -128,10 +128,9 @@ private:
 
     double comm_range[2], comm_effective_range[2];
     bool comm_valid[2]; 
-    const char* comm_ident[2];
-    const char* last_comm_ident[2];
-
-    const char* approach_ident;
+    string comm_ident[2];
+    //string last_comm_ident[2];
+    //string approach_ident;
     bool last_in_range;
 
     //FGATIS atis;
@@ -161,14 +160,11 @@ public:
     void update(double dt);
 
     // Returns true if the airport is found in the map
-    bool GetAirportATCDetails(string icao, AirportATC* a);
+    bool GetAirportATCDetails(const string& icao, AirportATC* a);
 
     // Return a pointer to a given sort of ATC at a given airport and activate if necessary
        // Returns NULL if service doesn't exist - calling function should check for this.
-    FGATC* GetATCPointer(string icao, atc_type type);
-       
-       // Display a dialog box with options relevant to the currently tuned ATC service.
-       void doPopupDialog();
+    FGATC* GetATCPointer(const string& icao, const atc_type& type);
        
        // Return a pointer to an appropriate voice for a given type of ATC
        // creating the voice if necessary - ie. make sure exactly one copy
@@ -177,7 +173,7 @@ public:
        // TODO - in the future this will get more complex and dole out country/airport
        // specific voices, and possible make sure that the same voice doesn't get used
        // at different airports in quick succession if a large enough selection are available.
-       FGATCVoice* GetVoicePointer(atc_type type);
+       FGATCVoice* GetVoicePointer(const atc_type& type);
        
        atc_type GetComm1ATCType() { return(comm_type[0]); }
        FGATC* GetComm1ATCPointer() { return(comm_atc_ptr[0]); }
@@ -186,29 +182,29 @@ public:
        
        // Get the frequency of a given service at a given airport
        // Returns zero if not found
-       unsigned short int GetFrequency(string ident, atc_type tp);
+       unsigned short int GetFrequency(const string& ident, const atc_type& tp);
        
        // Register the fact that the AI system wants to activate an airport
-       bool AIRegisterAirport(string ident);
+       bool AIRegisterAirport(const string& ident);
        
        // Register the fact that the comm radio is tuned to an airport
-       bool CommRegisterAirport(string ident, int chan);
+       bool CommRegisterAirport(const string& ident, int chan, const atc_type& tp);
        
 private:
 
     // Remove a class from the atc_list and delete it from memory
        // *if* no other comm channel or AI plane is using it.
-    void CommRemoveFromList(const char* id, atc_type tp, int chan);
+    void CommRemoveFromList(const string& id, const atc_type& tp, int chan);
 
     // Remove a class from the atc_list and delete it from memory
        // Should be called from the above - not directly!!
-    void RemoveFromList(const char* id, atc_type tp);
+    void RemoveFromList(const string& id, const atc_type& tp);
 
     // Return a pointer to a class in the list given ICAO code and type
        // (external interface to this is through GetATCPointer) 
        // Return NULL if the given service is not in the list
        // - *** THE CALLING FUNCTION MUST CHECK FOR THIS ***
-    FGATC* FindInList(const char* id, atc_type tp);
+    FGATC* FindInList(const string& id, const atc_type& tp);
 
     // Search the specified channel for stations on the same frequency and in range.
     void FreqSearch(int channel);