]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/transmission.hxx
Daniyar ATADJANOV:
[flightgear.git] / src / ATC / transmission.hxx
index dbc0142010c63ea7b47533e92cfcf69530127eb7..c1881b3c62fe1c8afe7e8d4667a4568782529cef 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_TRANSMISSION_HXX
@@ -46,6 +46,8 @@
 #include <iomanip.h>
 #endif
 
+#include "ATC.hxx"
+
 #if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
 SG_USING_STD(istream);
 #endif
@@ -79,10 +81,11 @@ struct TransPar {
 // FGTransmission - a class to encapsulate a speech transmission
 class FGTransmission {
 
-  int       StationType;             // Type of ATC station: 1 Approach
-  TransCode Code;
-  string    TransText;
-  string    MenuText;
+  //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
 
 public:
 
@@ -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;