Updated for revised SGMetar API
This commit is contained in:
parent
c92d1c01a7
commit
c136b31791
3 changed files with 7 additions and 6 deletions
|
@ -151,11 +151,11 @@ FGMetar::FGMetar(const string& icao) :
|
||||||
|
|
||||||
_time = sgTimeGetGMT(_year - 1900, _month - 1, _day, _hour, _minute, 0);
|
_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)
|
if (_x_proxy)
|
||||||
SG_LOG(SG_ENVIRONMENT, SG_INFO, "METAR from proxy");
|
SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "METAR from proxy");
|
||||||
else
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ static const double thickness_value[] = { 0, 65, 600, 750, 1000 };
|
||||||
const char* MetarProperties::get_metar() const
|
const char* MetarProperties::get_metar() const
|
||||||
{
|
{
|
||||||
if (!_metar) return "";
|
if (!_metar) return "";
|
||||||
return _metar->getData();
|
return _metar->getRawDataPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetarProperties::set_metar( const char * metarString )
|
void MetarProperties::set_metar( const char * metarString )
|
||||||
|
|
|
@ -128,8 +128,9 @@ void LiveMetarProperties::handleMetarData( const std::string & data )
|
||||||
try {
|
try {
|
||||||
m = new FGMetar(data.c_str());
|
m = new FGMetar(data.c_str());
|
||||||
}
|
}
|
||||||
catch( sg_io_exception &) {
|
catch( sg_io_exception &e) {
|
||||||
SG_LOG( SG_ENVIRONMENT, SG_WARN, "Can't parse metar: " << data );
|
SG_LOG( SG_ENVIRONMENT, SG_WARN, "Can't parse metar: " << data <<
|
||||||
|
" (" << e.getFormattedMessage() << ")");
|
||||||
|
|
||||||
// ensure we only report one METAR parse failure per session
|
// ensure we only report one METAR parse failure per session
|
||||||
if (!haveReportedMETARFailure) {
|
if (!haveReportedMETARFailure) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue