Live weather: ensure valid flag is set correctly
This commit is contained in:
parent
585235ce01
commit
4564dbd95e
3 changed files with 6 additions and 0 deletions
|
@ -190,6 +190,10 @@ MetarProperties::~MetarProperties()
|
|||
delete _magneticVariation;
|
||||
}
|
||||
|
||||
void MetarProperties::invalidate()
|
||||
{
|
||||
_metarValidNode->setBoolValue(false);
|
||||
}
|
||||
|
||||
static const double thickness_value[] = { 0, 65, 600, 750, 1000 };
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue