#include <simgear/structure/subsystem_mgr.hxx>
-#include <Main/fg_props.hxx>
-#include <GUI/gui.h>
-
#include <string>
#include <list>
#include <map>
#include "ATC.hxx"
-using std::string;
-using std::list;
-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 commlists which are stored by frequency or bucket.
-// Non-available services are denoted by a frequency of zero.
-// These structures are only intended to be created for in-use airports, and removed when no longer needed.
-struct AirportATC {
- AirportATC();
-
- SGGeod geod;
- float atis_freq;
- bool atis_active;
-};
-
class FGATCMgr : public SGSubsystem
{
bool initDone; // Hack - guard against update getting called before init
- // A map of airport ID vs frequencies and ATC provision
- typedef map < string, AirportATC* > airport_atc_map_type;
- typedef airport_atc_map_type::iterator airport_atc_map_iterator;
- typedef airport_atc_map_type::const_iterator airport_atc_map_const_iterator;
-
- airport_atc_map_type airport_atc_map;
- airport_atc_map_iterator airport_atc_map_itr;
-
// A list of pointers to all currently active ATC classes
- typedef map<string,FGATC*> atc_list_type;
+ typedef std::map<std::string,FGATC*> atc_list_type;
typedef atc_list_type::iterator atc_list_iterator;
typedef atc_list_type::const_iterator atc_list_const_iterator;
void update(double dt);
- // Returns true if the airport is found in the map
- bool GetAirportATCDetails(const string& icao, AirportATC* a);
-
+
// Return a pointer to an appropriate voice for a given type of ATC
// creating the voice if necessary - ie. make sure exactly one copy
// of every voice in use exists in memory.
atc_type GetComm2ATCType() { return(INVALID); }
FGATC* GetComm2ATCPointer() { return(0/* kludge */); }
- // Get the frequency of a given service at a given airport
- // Returns zero if not found
- unsigned short int GetFrequency(const string& ident, const atc_type& tp);
-
- // Register the fact that the comm radio is tuned to an airport
- 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 ZapOtherService(const string ncunit, const string svc_name);
+ void ZapOtherService(const std::string ncunit, const std::string svc_name);
// Return a pointer to a class in the list given ICAO code and type
// Return NULL if the given service is not in the list
// - *** THE CALLING FUNCTION MUST CHECK FOR THIS ***
- FGATC* FindInList(const string& id, const atc_type& tp);
+ FGATC* FindInList(const std::string& id, const atc_type& tp);
// Search the specified radio for stations on the same frequency and in range.
- void FreqSearch(const string navcomm, const int unit);
+ void FreqSearch(const std::string navcomm, const int unit);
};
#endif // _FG_ATCMGR_HXX