Fixed reporting of winds, cloudbase, and altimeter setting. The
temperature is still wrong.
This commit is contained in:
parent
0178c65981
commit
f8d4cb36b2
1 changed files with 12 additions and 6 deletions
|
@ -180,15 +180,12 @@ void FGATIS::UpdateTransmission() {
|
||||||
#ifdef FG_WEATHERCM
|
#ifdef FG_WEATHERCM
|
||||||
sprintf(buf, "%i", int(stationweather.Temperature - 273.15));
|
sprintf(buf, "%i", int(stationweather.Temperature - 273.15));
|
||||||
#else
|
#else
|
||||||
sprintf(buf, "%i", int(stationweather.get_temperature_degc()));
|
sprintf(buf, "%d", int(stationweather.get_temperature_degc()));
|
||||||
#endif
|
#endif
|
||||||
transmission += " Temperature ";
|
transmission += " Temperature ";
|
||||||
transmission += buf;
|
transmission += buf;
|
||||||
transmission += " degrees Celsius";
|
transmission += " degrees Celsius";
|
||||||
|
|
||||||
// Get the pressure / altimeter
|
|
||||||
// pressure is: stationweather.AirPressure in Pascal
|
|
||||||
|
|
||||||
// Get the visibility
|
// Get the visibility
|
||||||
#ifdef FG_WEATHERCM
|
#ifdef FG_WEATHERCM
|
||||||
visibility = fgGetDouble("/environment/visibility-m");
|
visibility = fgGetDouble("/environment/visibility-m");
|
||||||
|
@ -202,8 +199,7 @@ void FGATIS::UpdateTransmission() {
|
||||||
|
|
||||||
// Get the cloudbase
|
// Get the cloudbase
|
||||||
// FIXME: kludge for now
|
// FIXME: kludge for now
|
||||||
if (!strcmp(fgGetString("/environment/clouds/layer[0]/type"),
|
if (strcmp(fgGetString("/environment/clouds/layer[0]/type"), "clear")) {
|
||||||
"clear")) {
|
|
||||||
double cloudbase =
|
double cloudbase =
|
||||||
fgGetDouble("/environment/clouds/layer[0]/elevation-ft");
|
fgGetDouble("/environment/clouds/layer[0]/elevation-ft");
|
||||||
// For some reason the altitude returned doesn't seem to correspond to the actual cloud altitude.
|
// For some reason the altitude returned doesn't seem to correspond to the actual cloud altitude.
|
||||||
|
@ -213,6 +209,15 @@ void FGATIS::UpdateTransmission() {
|
||||||
transmission = transmission + " Cloudbase " + buf3 + " feet";
|
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
|
// Based on the airport-id and wind get the active runway
|
||||||
//FGRunway *r;
|
//FGRunway *r;
|
||||||
SGPath path( globals->get_fg_root() );
|
SGPath path( globals->get_fg_root() );
|
||||||
|
@ -255,6 +260,7 @@ void FGATIS::UpdateTransmission() {
|
||||||
char buf2[72];
|
char buf2[72];
|
||||||
sprintf(buf2, "%s %i %s %i %s", " Winds ", int(speed),
|
sprintf(buf2, "%s %i %s %i %s", " Winds ", int(speed),
|
||||||
" knots from ", int(hdg), " degrees");
|
" knots from ", int(hdg), " degrees");
|
||||||
|
transmission += buf2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue