#ifndef _FG_ATIS_HXX
#define _FG_ATIS_HXX
-#include <stdio.h>
#include <string>
+#include <iosfwd>
#include <simgear/compiler.h>
-#include <simgear/math/sg_geodesy.hxx>
-#include <simgear/misc/sgstream.hxx>
-#include <simgear/magvar/magvar.hxx>
#include <simgear/timing/sg_time.hxx>
-#ifdef SG_HAVE_STD_INCLUDES
-# include <istream>
-# include <iomanip>
-#elif defined( __BORLANDC__ ) || (__APPLE__)
-# include <iostream>
-#else
-# include <istream.h>
-# include <iomanip.h>
-#endif
-
-SG_USING_STD(istream);
-SG_USING_STD(string);
-
#include "ATC.hxx"
//DCL - a complete guess for now.
#define FG_ATIS_DEFAULT_RANGE 30
+typedef std::map<std::string,std::string> MSS;
+
class FGATIS : public FGATC {
//atc_type type;
- string transmission; // The actual ATIS transmission
- // This is not stored in default.atis but is generated
- // from the prevailing conditions when required.
+
+ // The actual ATIS transmission
+ // This is generated from the prevailing conditions when required.
+ // This is the version with markup, suitable for voice synthesis:
+ std::string transmission;
+ // Same as above, but in a form more readable as text.
+ std::string transmission_readable;
+
// for failure modeling
- string trans_ident; // transmitted ident
+ std::string trans_ident; // transmitted ident
+ double old_volume;
bool atis_failed; // atis failed?
+ time_t msg_time; // for moderating error messages
+ time_t cur_time;
+ int msg_OK;
+ int attention;
+ bool _prev_display; // Previous value of _display flag
+ MSS _remap; // abbreviations to be expanded
+
// Aircraft position
// ATIS is actually a special case in that unlike other ATC eg.tower it doesn't actually know about
// or the whereabouts of the aircraft it is transmitting to. However, to ensure consistancy of
FGATIS(void);
~FGATIS(void);
-
+ virtual void Init();
+ void attend (int);
+
//run the ATIS instance
void Update(double dt);
//inline void set_type(const atc_type tp) {type = tp;}
- inline const string& get_trans_ident() { return trans_ident; }
- inline void set_refname(const string& r) { refname = r; }
+ inline const std::string& get_trans_ident() { return trans_ident; }
+ inline void set_refname(const std::string& r) { refname = r; }
private:
- string refname; // Holds the refname of a transmission in progress
+ std::string refname; // Holds the refname of a transmission in progress
- //Update the transmission string
- void UpdateTransmission(void);
+ // Generate the ATIS transmission text:
+ int GenTransmission(const int regen, const int special);
- friend istream& operator>> ( istream&, FGATIS& );
+ // Put the text into the property tree
+ // (and in debug mode, print it on the console):
+ void TreeOut(int msgOK);
+
+ friend std::istream& operator>> ( std::istream&, FGATIS& );
+
};
+typedef int (FGATIS::*int_getter)() const;
+
#endif // _FG_ATIS_HXX