Related Links
Weather System Service

Overview

This PDK service allows callers to manipulate the weather system during runtime. The interface gives the developer control over current weather settings as well as current weather station data.

Classes

class  IWeatherStationV430
 
class  IWeatherSystemV430
 

Class Documentation

§ P3D::IWeatherStationV430

class P3D::IWeatherStationV430

Inherits IUnknown.

Public Member Functions

virtual bool IsValid () const override
 
virtual float GetSurfaceWind () const override
 
virtual HRESULT SetSurfaceWind (float aVal) const override
 
virtual float GetBaroPressure () const override
 
virtual HRESULT SetBaroPressure (float aVal) const override
 
virtual int GetCloudLayerCount () const override
 
virtual HRESULT GetCloudAtIndex (__in UINT uIndex, P3D::CloudLayer &aLayer) const override
 
virtual HRESULT AddNewCloudToTower (__in CloudLayer &aLayer) const override
 
virtual HRESULT RemoveCloudLayerFromTower (int uIndex) const override
 
virtual HRESULT ClearAllCloudsAtTower () const override
 
virtual UINT GetTempLayerCount () const override
 
virtual HRESULT GetTempLayerAtIndex (__in UINT uIndex, __out P3D::TempLayer &aLayer) const override
 
virtual HRESULT AddNewTempToTower (__in TempLayer &aLayer) const override
 
virtual HRESULT RemoveTempLayerFromTower (int uIndex) const override
 
virtual HRESULT ClearAllTempLayersFromTower () const override
 
virtual UINT GetAloftLayerCount () const override
 
virtual HRESULT GetAloftLayerAtIndex (__in UINT uIndex, __out P3D::WindAloftLayer &aLayer) const override
 
virtual HRESULT AddNewAloftToTower (__in WindAloftLayer &aLayer) const override
 
virtual HRESULT RemoveAloftLayerFromTower (int uIndex) const override
 
virtual HRESULT ClearAllWindLayersFromTower () const override
 
virtual UINT GetVisibilityLayerCount () const override
 
virtual HRESULT GetVisibilityLayerAtIndex (__in UINT uIndex, __out P3D::VisibilityLayer &aLayer) const override
 
virtual HRESULT AddNewVisToTower (__in VisibilityLayer &aLayer) const override
 
virtual HRESULT RemoveVisLayerFromTower (int uIndex) const override
 
virtual HRESULT ClearAllVisLayersFromTower () const override
 

Member Function Documentation

§ AddNewAloftToTower()

virtual HRESULT AddNewAloftToTower ( __in WindAloftLayer aLayer) const
pure virtual

§ AddNewCloudToTower()

virtual HRESULT AddNewCloudToTower ( __in CloudLayer aLayer) const
pure virtual

§ AddNewTempToTower()

virtual HRESULT AddNewTempToTower ( __in TempLayer aLayer) const
pure virtual

§ AddNewVisToTower()

virtual HRESULT AddNewVisToTower ( __in VisibilityLayer aLayer) const
pure virtual

§ ClearAllCloudsAtTower()

virtual HRESULT ClearAllCloudsAtTower ( ) const
pure virtual

§ ClearAllTempLayersFromTower()

virtual HRESULT ClearAllTempLayersFromTower ( ) const
pure virtual

§ ClearAllVisLayersFromTower()

virtual HRESULT ClearAllVisLayersFromTower ( ) const
pure virtual

§ ClearAllWindLayersFromTower()

virtual HRESULT ClearAllWindLayersFromTower ( ) const
pure virtual

§ GetAloftLayerAtIndex()

virtual HRESULT GetAloftLayerAtIndex ( __in UINT  uIndex,
__out P3D::WindAloftLayer aLayer 
) const
pure virtual

§ GetAloftLayerCount()

virtual UINT GetAloftLayerCount ( ) const
pure virtual

§ GetBaroPressure()

virtual float GetBaroPressure ( ) const
pure virtual

§ GetCloudAtIndex()

virtual HRESULT GetCloudAtIndex ( __in UINT  uIndex,
P3D::CloudLayer aLayer 
) const
pure virtual

§ GetCloudLayerCount()

virtual int GetCloudLayerCount ( ) const
pure virtual

§ GetSurfaceWind()

virtual float GetSurfaceWind ( ) const
pure virtual

§ GetTempLayerAtIndex()

virtual HRESULT GetTempLayerAtIndex ( __in UINT  uIndex,
__out P3D::TempLayer aLayer 
) const
pure virtual

§ GetTempLayerCount()

virtual UINT GetTempLayerCount ( ) const
pure virtual

§ GetVisibilityLayerAtIndex()

virtual HRESULT GetVisibilityLayerAtIndex ( __in UINT  uIndex,
__out P3D::VisibilityLayer aLayer 
) const
pure virtual

§ GetVisibilityLayerCount()

virtual UINT GetVisibilityLayerCount ( ) const
pure virtual

§ IsValid()

virtual bool IsValid ( ) const
pure virtual

§ RemoveAloftLayerFromTower()

virtual HRESULT RemoveAloftLayerFromTower ( int  uIndex) const
pure virtual

§ RemoveCloudLayerFromTower()

virtual HRESULT RemoveCloudLayerFromTower ( int  uIndex) const
pure virtual

§ RemoveTempLayerFromTower()

virtual HRESULT RemoveTempLayerFromTower ( int  uIndex) const
pure virtual

§ RemoveVisLayerFromTower()

virtual HRESULT RemoveVisLayerFromTower ( int  uIndex) const
pure virtual

§ SetBaroPressure()

virtual HRESULT SetBaroPressure ( float  aVal) const
pure virtual

§ SetSurfaceWind()

virtual HRESULT SetSurfaceWind ( float  aVal) const
pure virtual

§ P3D::IWeatherSystemV430

class P3D::IWeatherSystemV430

This is the interface to the core Prepar3D weather system. An example on how to query for the service can be found in the DLLStart() function of the Camera PDK Sample.

Remarks
This interface uses several enumerated weather types which are defined in WeatherSystemTypes.h. Several functions will also utilize the METAR Data Format.

Inherits IWeatherSystemV410.

Public Member Functions

virtual CLOUD_COVERAGE_DENSITY GetCloudCoverageDensity () const override
 Get the current cloud coverage density. More...
 
virtual HRESULT SetCloudCoverageDensity (__in CLOUD_COVERAGE_DENSITY eDensity) override
 
virtual CLOUD_DRAW_DISTANCE GetCloudDrawDistance () const override
 Get the current cloud draw distance. More...
 
virtual HRESULT SetCloudDrawDistance (__in CLOUD_DRAW_DISTANCE eDistance) override
 Set the current cloud draw distance. More...
 
virtual bool GetDetailedClouds () const override
 Get the detailed cloud setting. More...
 
virtual HRESULT SetDetailedClouds (__in bool bIsDetailed) override
 Set the detailed cloud setting. More...
 
virtual THERMAL_VISUAL_TYPE GetThermalVisualType () const override
 Get the current thermal visual type. More...
 
virtual HRESULT SetThermalVisualType (__in THERMAL_VISUAL_TYPE eThermalType) override
 Set the current thermal visual type. More...
 
virtual int GetNumberOfPressurePoints () const override
 Get the current number of pressure points. More...
 
virtual HRESULT GetStationMetarData (__in __notnull LPCSTR pszIcao, __out __notnull LPWSTR pszMetar, __in size_t cchMetar) const override
 
virtual HRESULT GetNearestStationMetarData (__in double dLatRadians, __in double dLonRadians, __in double dAltFeet, __out __notnull LPWSTR pszMetar, __in size_t cchMetar) const override
 
virtual HRESULT GetInterpolatedMetarData (__in double dLatRadians, __in double dLonRadians, __in double dAltFeet, __out __notnull LPWSTR pszMetar, __in size_t cchMetar) const override
 
virtual HRESULT SetMetarData (__in __notnull LPCWSTR pszMetar, __in int nSeconds) override
 
virtual HRESULT SetWeatherMode (__in WEATHER_MODE eWeatherMode, __in_opt LPCWSTR pszThemePath=nullptr) override
 
virtual WEATHER_MODE GetWeatherMode () const override
 Gets the current weather mode. More...
 
virtual HRESULT GetThemePath (__out __notnull LPWSTR pszThemePath, __in size_t cchThemePath) const override
 
virtual HRESULT CreateStation (__in __notnull LPCWSTR pszICAO, __in __notnull LPCWSTR pszName, __in double dLatRadians, __in double dLonRadians, __in double dAltFeet, __out __notnull void **ppStation) override
 
virtual HRESULT RemoveStation (__in __notnull void *pStation) override
 
virtual HRESULT CreateThermal (__in double dLatRadians, __in double dLonRadians, __in double dAltFeet, __in float fRadiusMeters, __in float fHeightMeters, __in float fCoreRateMps, __in float fCoreTurbulenceMps, __in float fSinkRateMps, __in float fSinkTurbulenceMps, __in float fCoreSizeMeters, __in float fCoreTransitionSizeMeters, __in float fSinkLayerSizeMeters, __in float fSinkTransitionSizeMeters, __out __notnull void **ppThermal) override
 
virtual HRESULT RemoveThermal (__in __notnull void *pThermal) override
 
virtual HRESULT RequestCloudState (__in double dLatRadiansMin, __in double dLonRadiansMin, __in double dAltFeetMin, __in double dLatRadiansMax, __in double dLonRadiansMax, __in double dAltFeetMax, __in UINT cbCloudState, __out __notnull BYTE *pCloudState) const override
 
virtual HRESULT SetDynamicUpdateRate (__in DWORD dwRate) override
 
virtual float GetGlobalTemp () const override
 Get the global temp in degrees C. More...
 
virtual HRESULT SetGlobalTemp (__in float aVal) override
 Set the global temp using degrees C. More...
 
virtual float GetGlobalVisRange () const override
 Get the global visibility range in Meters. More...
 
virtual HRESULT SetGlobalVisRange (__in float aVal) override
 Set the global visibility range in Meters. More...
 
virtual float GetGlobalHorizWindSpeed () const override
 Get the global horizontal wind speed in m/s. More...
 
virtual HRESULT SetGlobalHorizWindSpeed (__in float aVal) override
 Set the global horizontal wind speed in knots. More...
 
virtual float GetGlobalWindDirection () const override
 Get the global wind direction in degrees. More...
 
virtual HRESULT SetGlobalWindDirection (__in float aVal) override
 Set the global wind direction in degrees. More...
 
virtual float GetGlobalBaroPressure () const override
 Get the global barometer pressure in millibars. More...
 
virtual HRESULT SetGlobalBaroPressure (__in float aVal) override
 Set the global barometer pressure in millibars. More...
 
virtual float GetGlobalDewPoint () const override
 Get the global dew point. More...
 
virtual HRESULT SetGlobalDewPoint (__in float aVal) override
 Set the global dew point. More...
 
virtual HRESULT GetWeatherStation (__in LPCSTR pszIcao, __out P3D::IWeatherStationV430 **ppStation) override
 
virtual HRESULT ReloadWeather () override
 

Member Function Documentation

§ CreateStation()

virtual HRESULT CreateStation ( __in __notnull LPCWSTR  pszICAO,
__in __notnull LPCWSTR  pszName,
__in double  dLatRadians,
__in double  dLonRadians,
__in double  dAltFeet,
__out __notnull void **  ppStation 
)
pure virtual

Creates a weather station at the given ICAO location

Parameters
INpszICAO The ICAO of the station to be created.
INpszName A descriptive name for the station. This name will appear on weather maps and within dialogs.
INdLatRadians The latitude of the station in radians.
INdLonRadians The longitude of the station in radians.
INdAltFeet The altitude of the station in feet.
OUTppStation The reference pointer to be used by RemoveStation().

§ CreateThermal()

virtual HRESULT CreateThermal ( __in double  dLatRadians,
__in double  dLonRadians,
__in double  dAltFeet,
__in float  fRadiusMeters,
__in float  fHeightMeters,
__in float  fCoreRateMps,
__in float  fCoreTurbulenceMps,
__in float  fSinkRateMps,
__in float  fSinkTurbulenceMps,
__in float  fCoreSizeMeters,
__in float  fCoreTransitionSizeMeters,
__in float  fSinkLayerSizeMeters,
__in float  fSinkTransitionSizeMeters,
__out __notnull void **  ppThermal 
)
pure virtual

Creates a thermal at the given location

Parameters
INdLatRadians The latitude of the thermal in radians.
INdLonRadians The longitude of the thermal in radians.
INdAltFeet The altitude of the thermal in feet.
INfRadiusMeters Specifies the radius of the thermal, in meters. The maximum radius of a thermal is 100 km.
INfHeightMeters Specifies the height of the thermal, in meters.
INfCoreRateMps Specifies the lift value, in meters per second, within the Core layer. A positive value will provide an updraft, a negative value a downdraft. The maximum rate is 1000 meters/second.
INfCoreTurbulenceMps Specifies a variation in meters per second that is applied to the coreRate. For example, if a value of 1.5 is entered, and the core rate is 5 m/s, the actual core rate applied will be randomly varying between 3.5 m/s and 6.5 m/s.
INfSinkRateMps Specifies the lift value, in meters per second, within the Sink layer. A positive value will provide an updraft, a negative value a downdraft. The maximum rate is 1000 meters/second.
INfSinkTurbulenceMps Specifies a variation in meters per second that is applied to the sinkRate. For example, if a value of 1.5 is entered, and the sink rate is 5 m/s, the actual sink rate applied will be randomly varying between 3.5 m/s and 6.5 m/s.
INfCoreSizeMeters Specifies the radius in meters of the Core of the thermal.
INfCoreTransitionSizeMeters Specifies the width in meters of the transition layer between the Core and the Sink of the thermal. Half of the width of this transition will be outside the Core, and half within.
INfSinkLayerSizeMeters Specifies the radius in meters of the Sink of the thermal.
INfSinkTransitionSizeMeters Specifies the width in meters of the transition layer between the Sink and the atmosphere outside of the thermal. Half of the width of this transition will be outside the radius of the Sink layer, and half within.
OUTppThermal The reference pointer to be used by RemoveThermal().

§ GetCloudCoverageDensity()

virtual CLOUD_COVERAGE_DENSITY GetCloudCoverageDensity ( ) const
pure virtual

Get the current cloud coverage density.

§ GetCloudDrawDistance()

virtual CLOUD_DRAW_DISTANCE GetCloudDrawDistance ( ) const
pure virtual

Get the current cloud draw distance.

§ GetDetailedClouds()

virtual bool GetDetailedClouds ( ) const
pure virtual

Get the detailed cloud setting.

§ GetGlobalBaroPressure()

virtual float GetGlobalBaroPressure ( ) const
pure virtual

Get the global barometer pressure in millibars.

§ GetGlobalDewPoint()

virtual float GetGlobalDewPoint ( ) const
pure virtual

Get the global dew point.

§ GetGlobalHorizWindSpeed()

virtual float GetGlobalHorizWindSpeed ( ) const
pure virtual

Get the global horizontal wind speed in m/s.

§ GetGlobalTemp()

virtual float GetGlobalTemp ( ) const
pure virtual

Get the global temp in degrees C.

§ GetGlobalVisRange()

virtual float GetGlobalVisRange ( ) const
pure virtual

Get the global visibility range in Meters.

§ GetGlobalWindDirection()

virtual float GetGlobalWindDirection ( ) const
pure virtual

Get the global wind direction in degrees.

§ GetInterpolatedMetarData()

virtual HRESULT GetInterpolatedMetarData ( __in double  dLatRadians,
__in double  dLonRadians,
__in double  dAltFeet,
__out __notnull LPWSTR  pszMetar,
__in size_t  cchMetar 
) const
pure virtual

Get the weather station interpolated METAR string at the given latitude, longitude, and altitude. The maximum supported length for a METAR string is 2000 characters. See also the METAR Data Format.

§ GetNearestStationMetarData()

virtual HRESULT GetNearestStationMetarData ( __in double  dLatRadians,
__in double  dLonRadians,
__in double  dAltFeet,
__out __notnull LPWSTR  pszMetar,
__in size_t  cchMetar 
) const
pure virtual

Get the METAR string from the nearest weather station at the given latitude, longitude, and altitude. The maximum supported length for a METAR string is 2000 characters. See also the METAR Data Format.

§ GetNumberOfPressurePoints()

virtual int GetNumberOfPressurePoints ( ) const
pure virtual

Get the current number of pressure points.

§ GetStationMetarData()

virtual HRESULT GetStationMetarData ( __in __notnull LPCSTR  pszIcao,
__out __notnull LPWSTR  pszMetar,
__in size_t  cchMetar 
) const
pure virtual

Get the METAR string from the weather station with the given ICAO. The maximum supported length for a METAR string is 2000 characters. See also the METAR Data Format.

§ GetThemePath()

virtual HRESULT GetThemePath ( __out __notnull LPWSTR  pszThemePath,
__in size_t  cchThemePath 
) const
pure virtual

Gets the current weather theme file path.

Parameters
pszThemePathOUT: The output string to store the theme file path.
cchThemePathIN: The length of the pszThemePath parameter in characters.
Remarks
Succeeding and returning an empty string represents clear weather.

§ GetThermalVisualType()

virtual THERMAL_VISUAL_TYPE GetThermalVisualType ( ) const
pure virtual

Get the current thermal visual type.

§ GetWeatherMode()

virtual WEATHER_MODE GetWeatherMode ( ) const
pure virtual

Gets the current weather mode.

§ GetWeatherStation()

virtual HRESULT GetWeatherStation ( __in LPCSTR  pszIcao,
__out P3D::IWeatherStationV430 **  ppStation 
)
pure virtual

§ ReloadWeather()

virtual HRESULT ReloadWeather ( )
pure virtual

§ RemoveStation()

virtual HRESULT RemoveStation ( __in __notnull void *  pStation)
pure virtual

Removes the weather station with the given reference pointer.

Parameters
INpStation The reference pointer returned by CreateStation().

§ RemoveThermal()

virtual HRESULT RemoveThermal ( __in __notnull void *  pThermal)
pure virtual

Removes a thermal with the given reference pointer.

Parameters
pThermalThe reference pointer returned by CreateThermal().

§ RequestCloudState()

virtual HRESULT RequestCloudState ( __in double  dLatRadiansMin,
__in double  dLonRadiansMin,
__in double  dAltFeetMin,
__in double  dLatRadiansMax,
__in double  dLonRadiansMax,
__in double  dAltFeetMax,
__in UINT  cbCloudState,
__out __notnull BYTE *  pCloudState 
) const
pure virtual

Returns the cloud state for the given area.

Parameters
INdLatRadiansMin Specifies the minimum latitude of the required area. This should simply be the lower of the two latitude numbers.
INdLonRadiansMin Specifies the minimum longitude of the required area. This should simply be the lower of the two longitude numbers.
INdAltFeetMin Specifies the minimum altitude of the required area, in feet.
INdLatRadiansMax Specifies the maximum latitude of the required area.
INdLonRadiansMax Specifies the maximum longitude of the required area.
INdAltFeetMax Specifies the maximum altitude of the required area, in feet.
INcbCloudState The size of the cloud state byte array. This value must be 64 * 64 (4096).
OUTpCloudState The byte array to receive the cloud state data. This buffer must be 64 * 64 (4096) bytes. Cell data within this array is structured as a 64 x 64 grid. A cell value of zero would mean no cloud layers, to a maximum of 255 layers.
Remarks
Note that the entire world's weather is not simulated all the time. Only a region around the user aircraft with a radius of approximately 128 kilometers is modeled at any one time. A request for cloud data outside this region will simply return zeros. The defined area can cross the Equator or the Greenwich Meridian, but it cannot cross the Poles or the International Date Line.

§ SetCloudCoverageDensity()

virtual HRESULT SetCloudCoverageDensity ( __in CLOUD_COVERAGE_DENSITY  eDensity)
pure virtual

Set the current cloud coverage density. The effects of setting this value will not be immediately seen.

§ SetCloudDrawDistance()

virtual HRESULT SetCloudDrawDistance ( __in CLOUD_DRAW_DISTANCE  eDistance)
pure virtual

Set the current cloud draw distance.

§ SetDetailedClouds()

virtual HRESULT SetDetailedClouds ( __in bool  bIsDetailed)
pure virtual

Set the detailed cloud setting.

§ SetDynamicUpdateRate()

virtual HRESULT SetDynamicUpdateRate ( __in DWORD  dwRate)
pure virtual

Sets the rate at which cloud formations change.

Parameters
Doubleword containing the rate. A value of zero indicates that cloud formations do not change at all. Values between 1 and 5 indicate that cloud formations should change from 1 (the slowest) to 5 (the fastest).

§ SetGlobalBaroPressure()

virtual HRESULT SetGlobalBaroPressure ( __in float  aVal)
pure virtual

Set the global barometer pressure in millibars.

§ SetGlobalDewPoint()

virtual HRESULT SetGlobalDewPoint ( __in float  aVal)
pure virtual

Set the global dew point.

§ SetGlobalHorizWindSpeed()

virtual HRESULT SetGlobalHorizWindSpeed ( __in float  aVal)
pure virtual

Set the global horizontal wind speed in knots.

§ SetGlobalTemp()

virtual HRESULT SetGlobalTemp ( __in float  aVal)
pure virtual

Set the global temp using degrees C.

§ SetGlobalVisRange()

virtual HRESULT SetGlobalVisRange ( __in float  aVal)
pure virtual

Set the global visibility range in Meters.

§ SetGlobalWindDirection()

virtual HRESULT SetGlobalWindDirection ( __in float  aVal)
pure virtual

Set the global wind direction in degrees.

§ SetMetarData()

virtual HRESULT SetMetarData ( __in __notnull LPCWSTR  pszMetar,
__in int  nSeconds 
)
pure virtual

Set the weather system METAR string. The maximum supported length for a METAR string is 2000 characters. See also the METAR Data Format.

§ SetThermalVisualType()

virtual HRESULT SetThermalVisualType ( __in THERMAL_VISUAL_TYPE  eThermalType)
pure virtual

Set the current thermal visual type.

§ SetWeatherMode()

virtual HRESULT SetWeatherMode ( __in WEATHER_MODE  eWeatherMode,
__in_opt LPCWSTR  pszThemePath = nullptr 
)
pure virtual

Sets the current weather mode.

Parameters
eWeatherModeIN: The WEATHER_MODE to be set.
pszThemePathIN: Null-terminated string containing the theme path and filename. The theme file path is only used by the WEATHER_MODE_THEME type. The path can be either:
  1. An absolute path (e.g. C:\Program Files\My Company\My Product\myweathertheme)
  2. A path relative to the Lockheed Martin\Prepar3D v4\ installation folder (e.g. weather\themes\grayrain)
  3. A path relative to any of the weather theme folders found in any of the weather.cfg configuration files (e.g. grayrain)
  4. Null or an empty string to set clear weather

Variables

GUID IID_IWeatherSystemV430
 WeatherSystemPdk interface ID. More...
 
GUID SID_WeatherSystem
 WeatherSystemPdk service ID. More...
 
GUID IID_IWeatherStationV430
 WeatherSystemPdk. More...
 

Variable Documentation

§ IID_IWeatherStationV430

GUID IID_IWeatherStationV430

WeatherSystemPdk.

§ IID_IWeatherSystemV430

GUID IID_IWeatherSystemV430

WeatherSystemPdk interface ID.

§ SID_WeatherSystem

GUID SID_WeatherSystem

WeatherSystemPdk service ID.