1
0
Fork 0

Live weather: ensure valid flag is set correctly

This commit is contained in:
Torsten Dreyer 2015-03-09 12:24:36 +01:00
parent 585235ce01
commit 4564dbd95e
3 changed files with 6 additions and 0 deletions

View file

@ -190,6 +190,10 @@ MetarProperties::~MetarProperties()
delete _magneticVariation;
}
void MetarProperties::invalidate()
{
_metarValidNode->setBoolValue(false);
}
static const double thickness_value[] = { 0, 65, 600, 750, 1000 };

View file

@ -44,6 +44,7 @@ public:
virtual const std::string & getStationId() const { return _station_id; }
virtual void setStationId( const std::string & value );
virtual void setMetar(SGSharedPtr<FGMetar> m);
virtual void invalidate();
private:
const char * get_metar() const;

View file

@ -112,6 +112,7 @@ void LiveMetarProperties::update( double dt )
_pollingTimer -= dt;
if( _timeToLive <= 0.0 ) {
_timeToLive = 0.0;
invalidate();
std::string stationId = getStationId();
if( stationId.empty() ) return;
if( _pollingTimer > 0.0 ) return;