]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/atis.cxx
Roy Vegard Ovesen:
[flightgear.git] / src / ATC / atis.cxx
index ea897c18a9ae08416475b8852f57c808306f14e0..ff0da5767891b196127945c178c05e77cad32625 100644 (file)
@@ -34,8 +34,6 @@ SG_USING_STD(string);
 #include STL_IOSTREAM
 SG_USING_STD(cout);
 
-//#include <simgear/debug/logstream.hxx>
-//#include <simgear/misc/sgstream.hxx>
 #include <simgear/misc/sg_path.hxx>
 
 #ifdef FG_WEATHERCM
@@ -51,33 +49,29 @@ SG_USING_STD(cout);
 
 #include "atis.hxx"
 #include "commlist.hxx"
-//#include "atislist.hxx"
 #include "ATCdisplay.hxx"
 #include "ATCutils.hxx"
 #include "ATCmgr.hxx"
 
-// Constructor
 FGATIS::FGATIS() :
-display(false),
-displaying(false),
-transmission(""),
-trans_ident(""),
-atis_failed(false),
-refname("atis")
-//type(ATIS)
+       transmission(""),
+       trans_ident(""),
+       atis_failed(false),
+       refname("atis")
+       //type(ATIS)
 {
        vPtr = globals->get_ATC_mgr()->GetVoicePointer(ATIS);
        voiceOK = (vPtr == NULL ? false : true);
+       _type = ATIS;
 }
 
-// Destructor
 FGATIS::~FGATIS() {
 }
 
 // Main update function - checks whether we are displaying or not the correct message.
 void FGATIS::Update(double dt) {
-       if(display) {
-               if(displaying) {
+       if(_display) {
+               if(_displaying) {
                        // Check if we need to update the message
                        // - basically every hour and if the weather changes significantly at the station
                        //globals->get_ATC_display()->ChangeRepeatingMessage(transmission);
@@ -86,14 +80,14 @@ void FGATIS::Update(double dt) {
                        UpdateTransmission();
                        //cout << "ATIS.CXX - calling ATCMgr to render transmission..." << endl;
                        Render(transmission, refname, true);
-                       displaying = true;
+                       _displaying = true;
                }
        } else {
                // We shouldn't be displaying
-               if(displaying) {
+               if(_displaying) {
                        //cout << "ATIS.CXX - calling NoRender()..." << endl;
                        NoRender(refname);
-                       displaying = false;
+                       _displaying = false;
                }
        }
 }
@@ -214,11 +208,7 @@ void FGATIS::UpdateTransmission() {
        
        // Based on the airport-id and wind get the active runway
        //FGRunway *r;
-       SGPath path( globals->get_fg_root() );
-       path.append( "Airports" );
-       path.append( "runways.mk4" );
-       FGRunways runways( path.c_str() );
-       
+
        #ifdef FG_WEATHERCM
        //Set the heading to into the wind
        double wind_x = stationweather.Wind[0];
@@ -269,8 +259,8 @@ void FGATIS::UpdateTransmission() {
        }
        #endif
        
-       string rwy_no = runways.search(ident, int(hdg));
-       if(rwy_no != (string)"NN") {
+       string rwy_no = globals->get_runways()->search(ident, int(hdg));
+       if(rwy_no != "NN") {
                transmission += " / Landing_and_departing_runway ";
                transmission += ConvertRwyNumToSpokenString(atoi(rwy_no.c_str()));
                //cout << "in atis.cxx, r.rwy_no = " << rwy_no << " r.id = " << r->id << " r.heading = " << r->heading << endl;