]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/atis.cxx
Melchior FRANZ:
[flightgear.git] / src / ATC / atis.cxx
index 4ab783d8171c234657f2e785766d4cf018ca809a..c8f30ac0f4f61e3015d63793b24a38a677bcad6e 100644 (file)
@@ -56,8 +56,8 @@ FGATIS::FGATIS() :
        refname("atis")
        //type(ATIS)
 {
-       vPtr = globals->get_ATC_mgr()->GetVoicePointer(ATIS);
-       voiceOK = (vPtr == NULL ? false : true);
+       _vPtr = globals->get_ATC_mgr()->GetVoicePointer(ATIS);
+       _voiceOK = (_vPtr == NULL ? false : true);
        _type = ATIS;
 }
 
@@ -100,7 +100,7 @@ void FGATIS::UpdateTransmission() {
        
        FGEnvironment stationweather =
             ((FGEnvironmentMgr *)globals->get_subsystem("environment"))
-              ->getEnvironment(lat, lon, elev);
+              ->getEnvironment(lat, lon, 0.0);
        
        transmission = "";
        
@@ -180,10 +180,20 @@ void FGATIS::UpdateTransmission() {
        }
        
        // Get the pressure / altimeter
+       double P = fgGetDouble("/environment/pressure-sea-level-inhg");
+       if(ident.substr(0,2) == "EG" && fgGetBool("/sim/atc/use-millibars") == true) {
+               // Convert to millibars for the UK!
+               P *= 33.864;
+               sprintf(buf, "%.0f", P);
+       } else {
+               sprintf(buf, "%.2f", P);
+       }               
+       transmission += " / Altimeter ";
+       tempstr1 = buf;
+       transmission += ConvertNumToSpokenDigits(tempstr1);
        
        // Based on the airport-id and wind get the active runway
        //FGRunway *r;
-
        double speed = stationweather.get_wind_speed_kt();
        double hdg = stationweather.get_wind_from_heading_deg();
        if (speed == 0) {