1
0
Fork 0

ATIS upgrade

Add missing ATIS elements (transition level, expected approach,
precipitation, runway surface warnings).
Minor phraseology fixes for US/Europe.
Adds "/sim/atis/concise-report" option to use abbreviations (CAVOK etc),
and omit "obvious" units (depends on airport).
Trigger ATIS updates for significant pressure changes.
This commit is contained in:
ThorstenB 2012-10-13 16:48:56 +02:00
parent 3bf09215b0
commit 32b9c61528
4 changed files with 651 additions and 275 deletions

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,6 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef _FG_ATIS_HXX
#define _FG_ATIS_HXX
@ -32,6 +31,8 @@
#include "ATC.hxx"
class FGAirport;
typedef std::map<std::string,std::string> MSS;
class FGATIS : public FGATC {
@ -70,6 +71,7 @@ class FGATIS : public FGATC {
time_t cur_time;
int msg_OK;
bool _attention;
bool _check_transmission;
bool _prev_display; // Previous value of _display flag
MSS _remap; // abbreviations to be expanded
@ -78,11 +80,33 @@ class FGATIS : public FGATC {
double _time_before_search_sec;
int _last_frequency;
// temporary buffer for string conversions
char buf[100];
// data for the current ATIS report
struct
{
std::string phonetic_seq_string;
bool US_CA;
bool cavok;
bool concise;
bool ils;
int temp;
int dewpoint;
double psl;
double qnh;
double rain_norm, snow_norm;
int notam;
std::string hours,mins;
} _report;
public:
FGATIS(const std::string& name, int num);
virtual void init();
void init();
void reinit();
void attend(SGPropertyNode* node);
//run the ATIS instance
@ -96,27 +120,32 @@ protected:
private:
/** generate the ATIS transmission text */
int genTransmission (const int regen, const bool special);
void createReport (const FGAirport* apt);
/** generate the ATIS transmission text */
bool genTransmission (const int regen, bool forceUpdate);
void genTimeInfo (void);
void genFacilityInfo (void);
void genVisibilityInfo (void);
void genCloudInfo (void);
void genPrecipitationInfo(void);
bool genVisibilityInfo (std::string& vis_info);
bool genCloudInfo (std::string& cloud_info);
void genWindInfo (void);
void genTemperatureInfo (double& Tsl, bool US_CA);
void genPressureInfo (bool US_CA, double Tsl);
void genRunwayInfo (const std::string& phonetic_seq_string);
void genTemperatureInfo (void);
void genTransitionLevel (const FGAirport* apt);
void genPressureInfo (void);
void genRunwayInfo (const FGAirport* apt);
void genWarnings (int position);
void addTemperature (int Temp);
// Put the text into the property tree
// (and in debug mode, print it on the console):
void TreeOut(int msgOK);
void treeOut(int msgOK);
// Search the specified radio for stations on the same frequency and in range.
void search(void);
bool search(double dt);
friend std::istream& operator>> ( std::istream&, FGATIS& );
};
typedef int (FGATIS::*int_getter)() const;

View file

@ -15,11 +15,11 @@ Q(Airfield)
Q(Airbase)
Q(Junior)
Q(Celsius)
Q(wind)
Q(Wind)
Q(zulu)
Q(zulu_weather)
Q(Automated_weather_observation)
Q(weather)
Q(Weather)
Q(airport_information)
Q(International)
Q(Regional)
@ -45,9 +45,10 @@ Q(overcast)
Q(thin)
Q(Sky_condition)
Q(Sky)
Q(Clouds)
Q(Ceiling)
Q(minus)
Q(dewpoint)
Q(Dewpoint)
Q(Visibility)
Q(less_than_one_quarter)
Q(one_quarter)
@ -56,13 +57,66 @@ Q(three_quarters)
Q(one_and_one_half)
Q(Altimeter)
Q(QNH)
Q(millibars)
Q(Landing_and_departing_runway)
Q(On_initial_contact_advise_you_have_information)
Q(Advise_on_initial_contact_you_have_information)
Q(This_is)
Q(information)
Q(millibars)
Q(hectopascal)
Q(inches)
Q(I_L_S)
Q(visual)
Q(cav_ok)
Q(clouds_and_visibility_OK)
Q(out)
Q(equals)
Q(Expect_I_L_S_approach)
Q(Expect_visual_approach)
Q(Transition_level)
Q(No_sig)
Q(Time)
Q(kelometers)
Q(Attention)
Q(flock_of_birds)
Q(bird_activity)
Q(in_the_vicinity_of_the_airport)
Q(short_time__I_LS_interference_possible_by_taxiing_aircraft)
Q(reed_back_all_runway_hold_instructions)
Q(glider_operation_in_sector)
Q(airport)
Q(runway_wet)
Q(runway_in_use)
Q(arrivals)
Q(runway)
Q(runways)
Q(expect)
Q(approach)
Q(departures)
Q(wet)
Q(ice)
Q(closed)
Q(light)
Q(moderate)
Q(heavy)
Q(rain)
Q(drizzle)
Q(snow)
Q(fog)
Q(plus)
Q(hours)
Q(variable)
Q(from)
Q(Or)
Q(And)
Q(to)
Q(maximum)
Q(between)
Q(degrees)
Q(or_more)
Q(left)
Q(right)
Q(center)
Q(knots)
}
#undef Q

View file

@ -841,6 +841,8 @@ void fgReInitSubsystems()
globals->get_subsystem("systems")->reinit();
globals->get_subsystem("instrumentation")->reinit();
globals->get_subsystem("ATIS")->reinit();
// setup state to end re-init
fgSetBool("/sim/signals/reinit", false);
if ( !freeze ) {