]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/approach.hxx
Catch sound exceptions at the earliest, report problem has an alert, and continue...
[flightgear.git] / src / ATC / approach.hxx
index debcd77d33eca318064f9e80f897edbb545c780d..9109e45210b6c5ecb4c1fccc4f699c0ea6ff27b2 100644 (file)
@@ -61,7 +61,7 @@ SG_USING_STD(string);
 const int    max_planes = 20;  // max number of planes on the stack
 const int    max_wp = 10;      // max number of waypoints for approach phase
 const double max_ta = 130;     // max turning angle for plane during approach
-const double tbm    = 20000.0; // min time (in ms) between two messages
+const double tbm    = 2.0;     // min time (in sec) between two messages
 const double lfl    = 10.0;    // length of final leg
 
 struct PlaneApp {
@@ -117,8 +117,6 @@ class FGApproach : public FGATC {
   double active_rw_lat;
   double active_rw_len;
 
-  bool     display;            // Flag to indicate whether we should be outputting to the display.
-  bool     displaying;         // Flag to indicate whether we are outputting to the display.
   int      num_planes;          // number of planes on the stack
   PlaneApp planes[max_planes];  // Array of planes
   string   transmission;
@@ -150,26 +148,19 @@ public:
 
   void Init();
 
-  void Update();
+  void Update(double dt);
 
   // Add new plane to stack if not already registered 
   // Input:  pid - id of plane (name) 
   // Output: "true" if added; "false" if already existend
-  void AddPlane(string pid);
+  void AddPlane(const string& pid);
 
   // Remove plane from stack if out of range
   int RemovePlane();
   
-  //Indicate that this instance should be outputting to the ATC display
-  inline void SetDisplay(void) {display = true;}
-  
-  //Indicate that this instance should not be outputting to the ATC display
-  inline void SetNoDisplay(void) {display = false;}
-  
   inline double get_bucket() const { return bucket; }
   inline int get_pnum() const { return num_planes; }
-  inline string get_trans_ident() { return trans_ident; }
-  inline atc_type GetType() { return APPROACH; }
+  inline const string& get_trans_ident() { return trans_ident; }
   
 private:
 
@@ -185,6 +176,8 @@ private:
 
   double angle_diff_deg( const double &a1, const double &a2);
 
+  void set_message(const string &s);
+
 // ========================================================================
 // get point2 given starting point1 and course and distance
 // input:  point1 = heading in degrees, distance