1
0
Fork 0

Updated for revised SGMetar API

This commit is contained in:
James Turner 2021-10-15 12:14:01 +01:00
parent c92d1c01a7
commit c136b31791
3 changed files with 7 additions and 6 deletions

View file

@ -151,11 +151,11 @@ FGMetar::FGMetar(const string& icao) :
_time = sgTimeGetGMT(_year - 1900, _month - 1, _day, _hour, _minute, 0);
SG_LOG(SG_ENVIRONMENT, SG_INFO, _data);
SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "FGMetar:" << getRawDataPtr());
if (_x_proxy)
SG_LOG(SG_ENVIRONMENT, SG_INFO, "METAR from proxy");
SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "METAR from proxy");
else
SG_LOG(SG_ENVIRONMENT, SG_INFO, "METAR from tgftp.nws.noaa.gov");
SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "METAR from tgftp.nws.noaa.gov");
}

View file

@ -205,7 +205,7 @@ static const double thickness_value[] = { 0, 65, 600, 750, 1000 };
const char* MetarProperties::get_metar() const
{
if (!_metar) return "";
return _metar->getData();
return _metar->getRawDataPtr();
}
void MetarProperties::set_metar( const char * metarString )

View file

@ -128,8 +128,9 @@ void LiveMetarProperties::handleMetarData( const std::string & data )
try {
m = new FGMetar(data.c_str());
}
catch( sg_io_exception &) {
SG_LOG( SG_ENVIRONMENT, SG_WARN, "Can't parse metar: " << data );
catch( sg_io_exception &e) {
SG_LOG( SG_ENVIRONMENT, SG_WARN, "Can't parse metar: " << data <<
" (" << e.getFormattedMessage() << ")");
// ensure we only report one METAR parse failure per session
if (!haveReportedMETARFailure) {