]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/transmission.hxx
Alex Romosan:
[flightgear.git] / src / ATC / transmission.hxx
index 02c0c050bb9e85f1996f907d3d7f9121f7ad9dcc..fafc885b79e5f34f69ea429a18c237763f2933e3 100644 (file)
@@ -46,6 +46,8 @@
 #include <iomanip.h>
 #endif
 
+#include "ATC.hxx"
+
 #if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 SG_USING_STD(istream);
 #endif
@@ -79,7 +81,8 @@ struct TransPar {
 // FGTransmission - a class to encapsulate a speech transmission
 class FGTransmission {
 
-  int       StationType;    // Type of ATC station: 1 Approach
+  //int       StationType;    // Type of ATC station: 1 Approach
+  atc_type  StationType;
   TransCode Code;           // DCL - no idea what this is.
   string    TransText;      // The text of the spoken transmission
   string    MenuText;       // An abbreviated version of the text for the menu entry
@@ -91,10 +94,10 @@ public:
 
   void Init();
 
-  inline int       get_station()   const { return StationType; }
-  inline TransCode get_code()     { return Code; }
-  inline string    get_transtext() { return TransText; }
-  inline string    get_menutext()  { return MenuText; }
+  inline atc_type  get_station()   const { return StationType; }
+  inline const TransCode& get_code()      { return Code; }
+  inline const string&    get_transtext() { return TransText; }
+  inline const string&    get_menutext()  { return MenuText; }
 
   // Return the parsed logic of the transmission  
   TransPar Parse();
@@ -109,6 +112,7 @@ private:
 inline istream&
 operator >> ( istream& in, FGTransmission& a ) {
        char ch;
+       int tmp;
        
        static bool first_time = true;
        static double julian_date = 0;
@@ -117,7 +121,13 @@ operator >> ( istream& in, FGTransmission& a ) {
                julian_date = sgTimeCurrentMJD(0, 0) + MJD0;
                first_time = false;
        }
-       in >> a.StationType;
+       // Ugly hack alert - eventually we'll use xml format for the transmissions file
+       in >> tmp;
+       if(tmp == 1) {
+               a.StationType = APPROACH;
+       } else {
+               a.StationType = INVALID;
+       }
        in >> a.Code.c1;
        in >> a.Code.c2;
        in >> a.Code.c3;