From: Torsten Dreyer Date: Wed, 5 Mar 2014 12:52:43 +0000 (+0100) Subject: NewAtis: handle varying winds X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c068049d840c2f4567c7d07e7fb37247d8e23407;p=flightgear.git NewAtis: handle varying winds --- diff --git a/src/ATC/ATISEncoder.cxx b/src/ATC/ATISEncoder.cxx index 6b6259b21..436c6bb55 100644 --- a/src/ATC/ATISEncoder.cxx +++ b/src/ATC/ATISEncoder.cxx @@ -113,6 +113,8 @@ ATISEncoder::ATISEncoder() handlerMap.insert( std::make_pair( "rwy-to", &ATISEncoder::getTakeoffRunway )); handlerMap.insert( std::make_pair( "transition-level", &ATISEncoder::getTransitionLevel )); handlerMap.insert( std::make_pair( "wind-dir", &ATISEncoder::getWindDirection )); + handlerMap.insert( std::make_pair( "wind-from", &ATISEncoder::getWindMinDirection )); + handlerMap.insert( std::make_pair( "wind-to", &ATISEncoder::getWindMaxDirection )); handlerMap.insert( std::make_pair( "wind-speed-kn", &ATISEncoder::getWindspeedKnots )); handlerMap.insert( std::make_pair( "gusts", &ATISEncoder::getGustsKnots )); handlerMap.insert( std::make_pair( "visibility-metric", &ATISEncoder::getVisibilityMetric )); @@ -386,6 +388,16 @@ string ATISEncoder::getWindDirection( SGPropertyNode_ptr ) return getSpokenNumber( _atis->getWindDeg(), true, 3 ); } +string ATISEncoder::getWindMinDirection( SGPropertyNode_ptr ) +{ + return getSpokenNumber( _atis->getWindMinDeg(), true, 3 ); +} + +string ATISEncoder::getWindMaxDirection( SGPropertyNode_ptr ) +{ + return getSpokenNumber( _atis->getWindMaxDeg(), true, 3 ); +} + string ATISEncoder::getWindspeedKnots( SGPropertyNode_ptr ) { return getSpokenNumber( _atis->getWindSpeedKt() ); diff --git a/src/ATC/ATISEncoder.hxx b/src/ATC/ATISEncoder.hxx index 269692969..410eb842c 100644 --- a/src/ATC/ATISEncoder.hxx +++ b/src/ATC/ATISEncoder.hxx @@ -48,6 +48,8 @@ public: virtual long getTime() = 0; // see makeAtisTime virtual int getWindDeg() = 0; + virtual int getWindMinDeg() = 0; + virtual int getWindMaxDeg() = 0; virtual int getWindSpeedKt() = 0; virtual int getGustsKt() = 0; virtual int getQnh() = 0; @@ -77,6 +79,8 @@ protected: virtual std::string getTakeoffRunway( SGPropertyNode_ptr ); virtual std::string getTransitionLevel( SGPropertyNode_ptr ); virtual std::string getWindDirection( SGPropertyNode_ptr ); + virtual std::string getWindMinDirection( SGPropertyNode_ptr ); + virtual std::string getWindMaxDirection( SGPropertyNode_ptr ); virtual std::string getWindspeedKnots( SGPropertyNode_ptr ); virtual std::string getGustsKnots( SGPropertyNode_ptr ); virtual std::string getCavok( SGPropertyNode_ptr ); diff --git a/src/ATC/CurrentWeatherATISInformationProvider.hxx b/src/ATC/CurrentWeatherATISInformationProvider.hxx index f3d7fdbb9..1c96bacec 100644 --- a/src/ATC/CurrentWeatherATISInformationProvider.hxx +++ b/src/ATC/CurrentWeatherATISInformationProvider.hxx @@ -36,6 +36,8 @@ protected: virtual std::string airportId(); virtual long getTime(); virtual int getWindDeg(); + virtual int getWindMinDeg() { return getWindDeg(); } + virtual int getWindMaxDeg() { return getWindDeg(); } virtual int getWindSpeedKt(); virtual int getGustsKt(); virtual int getQnh(); diff --git a/src/ATC/MetarPropertiesATISInformationProvider.cxx b/src/ATC/MetarPropertiesATISInformationProvider.cxx index d32033a53..7380ca93e 100644 --- a/src/ATC/MetarPropertiesATISInformationProvider.cxx +++ b/src/ATC/MetarPropertiesATISInformationProvider.cxx @@ -54,6 +54,14 @@ int MetarPropertiesATISInformationProvider::getWindDeg() return _metar->getIntValue( "base-wind-dir-deg" ); } +int MetarPropertiesATISInformationProvider::getWindMinDeg() +{ + return _metar->getIntValue( "base-wind-range-from" ); +} +int MetarPropertiesATISInformationProvider::getWindMaxDeg() +{ + return _metar->getIntValue( "base-wind-range-to" ); +} int MetarPropertiesATISInformationProvider::getWindSpeedKt() { return _metar->getIntValue( "base-wind-speed-kt" ); diff --git a/src/ATC/MetarPropertiesATISInformationProvider.hxx b/src/ATC/MetarPropertiesATISInformationProvider.hxx index 2df6e6263..151ded475 100644 --- a/src/ATC/MetarPropertiesATISInformationProvider.hxx +++ b/src/ATC/MetarPropertiesATISInformationProvider.hxx @@ -38,6 +38,8 @@ protected: virtual std::string airportId(); virtual long getTime(); virtual int getWindDeg(); + virtual int getWindMinDeg(); + virtual int getWindMaxDeg(); virtual int getWindSpeedKt(); virtual int getGustsKt(); virtual int getQnh();