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;
|
delete _magneticVariation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MetarProperties::invalidate()
|
||||||
|
{
|
||||||
|
_metarValidNode->setBoolValue(false);
|
||||||
|
}
|
||||||
|
|
||||||
static const double thickness_value[] = { 0, 65, 600, 750, 1000 };
|
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 const std::string & getStationId() const { return _station_id; }
|
||||||
virtual void setStationId( const std::string & value );
|
virtual void setStationId( const std::string & value );
|
||||||
virtual void setMetar(SGSharedPtr<FGMetar> m);
|
virtual void setMetar(SGSharedPtr<FGMetar> m);
|
||||||
|
virtual void invalidate();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const char * get_metar() const;
|
const char * get_metar() const;
|
||||||
|
|
|
@ -112,6 +112,7 @@ void LiveMetarProperties::update( double dt )
|
||||||
_pollingTimer -= dt;
|
_pollingTimer -= dt;
|
||||||
if( _timeToLive <= 0.0 ) {
|
if( _timeToLive <= 0.0 ) {
|
||||||
_timeToLive = 0.0;
|
_timeToLive = 0.0;
|
||||||
|
invalidate();
|
||||||
std::string stationId = getStationId();
|
std::string stationId = getStationId();
|
||||||
if( stationId.empty() ) return;
|
if( stationId.empty() ) return;
|
||||||
if( _pollingTimer > 0.0 ) return;
|
if( _pollingTimer > 0.0 ) return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue