#ifdef FG_WEATHERCM
sprintf(buf, "%i", int(stationweather.Temperature - 273.15));
#else
- sprintf(buf, "%i", int(stationweather.get_temperature_degc()));
+ sprintf(buf, "%d", int(stationweather.get_temperature_degc()));
#endif
transmission += " Temperature ";
transmission += buf;
transmission += " degrees Celsius";
- // Get the pressure / altimeter
- // pressure is: stationweather.AirPressure in Pascal
-
// Get the visibility
#ifdef FG_WEATHERCM
visibility = fgGetDouble("/environment/visibility-m");
transmission += " miles";
// Get the cloudbase
- if(fgGetBool("/environment/clouds/status")) {
- double cloudbase = fgGetDouble("/environment/clouds/altitude-ft");
+ // FIXME: kludge for now
+ if (strcmp(fgGetString("/environment/clouds/layer[0]/type"), "clear")) {
+ double cloudbase =
+ fgGetDouble("/environment/clouds/layer[0]/elevation-ft");
// For some reason the altitude returned doesn't seem to correspond to the actual cloud altitude.
char buf3[10];
// cout << "cloudbase = " << cloudbase << endl;
transmission = transmission + " Cloudbase " + buf3 + " feet";
}
+ // Get the pressure / altimeter
+
+#ifndef FG_WEATHERCM
+ double altimeter = stationweather.get_pressure_sea_level_inhg();
+ sprintf(buf, "%.2f", altimeter);
+ transmission += " Altimeter ";
+ transmission += buf;
+#endif
+
// Based on the airport-id and wind get the active runway
//FGRunway *r;
SGPath path( globals->get_fg_root() );
char buf2[72];
sprintf(buf2, "%s %i %s %i %s", " Winds ", int(speed),
" knots from ", int(hdg), " degrees");
+ transmission += buf2;
}
#endif