2001-11-07 17:55:04 +00:00
|
|
|
// atis.hxx -- ATIS class
|
|
|
|
//
|
2002-03-01 17:39:52 +00:00
|
|
|
// Written by David Luff, started October 2001.
|
|
|
|
// Based on nav.hxx by Curtis Olson, started April 2000.
|
2001-11-07 17:55:04 +00:00
|
|
|
//
|
2002-03-01 17:39:52 +00:00
|
|
|
// Copyright (C) 2001 David C. Luff - david.luff@nottingham.ac.uk
|
2001-11-07 17:55:04 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
2006-02-21 01:16:04 +00:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2001-11-07 17:55:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef _FG_ATIS_HXX
|
|
|
|
#define _FG_ATIS_HXX
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2002-12-31 18:26:02 +00:00
|
|
|
#include <string>
|
2001-11-07 17:55:04 +00:00
|
|
|
|
|
|
|
#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>
|
2002-12-04 19:51:21 +00:00
|
|
|
# include <iomanip>
|
2002-05-10 23:35:06 +00:00
|
|
|
#elif defined( __BORLANDC__ ) || (__APPLE__)
|
2001-11-07 17:55:04 +00:00
|
|
|
# include <iostream>
|
|
|
|
#else
|
|
|
|
# include <istream.h>
|
2002-12-04 19:51:21 +00:00
|
|
|
# include <iomanip.h>
|
2001-11-07 17:55:04 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
SG_USING_STD(istream);
|
|
|
|
SG_USING_STD(string);
|
|
|
|
|
2002-03-01 17:39:52 +00:00
|
|
|
#include "ATC.hxx"
|
|
|
|
|
2001-11-07 17:55:04 +00:00
|
|
|
//DCL - a complete guess for now.
|
|
|
|
#define FG_ATIS_DEFAULT_RANGE 30
|
2003-02-06 10:42:43 +00:00
|
|
|
|
2002-03-01 17:39:52 +00:00
|
|
|
class FGATIS : public FGATC {
|
2002-12-04 19:51:21 +00:00
|
|
|
|
2003-02-06 10:42:43 +00:00
|
|
|
//atc_type type;
|
2002-12-04 19:51:21 +00:00
|
|
|
string transmission; // The actual ATIS transmission
|
|
|
|
// This is not stored in default.atis but is generated
|
|
|
|
// from the prevailing conditions when required.
|
|
|
|
|
|
|
|
// for failure modeling
|
|
|
|
string trans_ident; // transmitted ident
|
|
|
|
bool atis_failed; // atis failed?
|
|
|
|
|
|
|
|
// 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
|
|
|
|
// operation with the other ATC classes the ATIS class must calculate range to the aircraft in order
|
|
|
|
// to decide whether to render the transmission - hence the users plane details must be stored.
|
2006-06-11 10:21:10 +00:00
|
|
|
//SGPropertyNode_ptr airplane_lon_node;
|
|
|
|
//SGPropertyNode_ptr airplane_lat_node;
|
|
|
|
//SGPropertyNode_ptr airplane_elev_node;
|
2002-12-04 19:51:21 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
FGATIS(void);
|
|
|
|
~FGATIS(void);
|
|
|
|
|
|
|
|
//run the ATIS instance
|
2003-03-27 15:44:35 +00:00
|
|
|
void Update(double dt);
|
2002-12-04 19:51:21 +00:00
|
|
|
|
2003-02-06 10:42:43 +00:00
|
|
|
//inline void set_type(const atc_type tp) {type = tp;}
|
2005-10-25 13:49:55 +00:00
|
|
|
inline const string& get_trans_ident() { return trans_ident; }
|
|
|
|
inline void set_refname(const string& r) { refname = r; }
|
2002-12-04 19:51:21 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2003-01-07 13:11:00 +00:00
|
|
|
string refname; // Holds the refname of a transmission in progress
|
|
|
|
|
2002-12-04 19:51:21 +00:00
|
|
|
//Update the transmission string
|
|
|
|
void UpdateTransmission(void);
|
|
|
|
|
|
|
|
friend istream& operator>> ( istream&, FGATIS& );
|
2001-11-07 17:55:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _FG_ATIS_HXX
|