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()
|
pure virtual |
§ AddNewCloudToTower()
|
pure virtual |
§ AddNewTempToTower()
|
pure virtual |
§ AddNewVisToTower()
|
pure virtual |
§ ClearAllCloudsAtTower()
|
pure virtual |
§ ClearAllTempLayersFromTower()
|
pure virtual |
§ ClearAllVisLayersFromTower()
|
pure virtual |
§ ClearAllWindLayersFromTower()
|
pure virtual |
§ GetAloftLayerAtIndex()
|
pure virtual |
§ GetAloftLayerCount()
|
pure virtual |
§ GetBaroPressure()
|
pure virtual |
§ GetCloudAtIndex()
|
pure virtual |
§ GetCloudLayerCount()
|
pure virtual |
§ GetSurfaceWind()
|
pure virtual |
§ GetTempLayerAtIndex()
|
pure virtual |
§ GetTempLayerCount()
|
pure virtual |
§ GetVisibilityLayerAtIndex()
|
pure virtual |
§ GetVisibilityLayerCount()
|
pure virtual |
§ IsValid()
|
pure virtual |
§ RemoveAloftLayerFromTower()
|
pure virtual |
§ RemoveCloudLayerFromTower()
|
pure virtual |
§ RemoveTempLayerFromTower()
|
pure virtual |
§ RemoveVisLayerFromTower()
|
pure virtual |
§ SetBaroPressure()
|
pure virtual |
§ SetSurfaceWind()
|
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()
|
pure virtual |
Creates a weather station at the given ICAO location
- Parameters
-
IN pszICAO The ICAO of the station to be created. IN pszName A descriptive name for the station. This name will appear on weather maps and within dialogs. IN dLatRadians The latitude of the station in radians. IN dLonRadians The longitude of the station in radians. IN dAltFeet The altitude of the station in feet. OUT ppStation The reference pointer to be used by RemoveStation().
§ CreateThermal()
|
pure virtual |
Creates a thermal at the given location
- Parameters
-
IN dLatRadians The latitude of the thermal in radians. IN dLonRadians The longitude of the thermal in radians. IN dAltFeet The altitude of the thermal in feet. IN fRadiusMeters Specifies the radius of the thermal, in meters. The maximum radius of a thermal is 100 km. IN fHeightMeters Specifies the height of the thermal, in meters. IN fCoreRateMps 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. IN fCoreTurbulenceMps 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. IN fSinkRateMps 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. IN fSinkTurbulenceMps 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. IN fCoreSizeMeters Specifies the radius in meters of the Core of the thermal. IN fCoreTransitionSizeMeters 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. IN fSinkLayerSizeMeters Specifies the radius in meters of the Sink of the thermal. IN fSinkTransitionSizeMeters 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. OUT ppThermal The reference pointer to be used by RemoveThermal().
§ GetCloudCoverageDensity()
|
pure virtual |
Get the current cloud coverage density.
§ GetCloudDrawDistance()
|
pure virtual |
Get the current cloud draw distance.
§ GetDetailedClouds()
|
pure virtual |
Get the detailed cloud setting.
§ GetGlobalBaroPressure()
|
pure virtual |
Get the global barometer pressure in millibars.
§ GetGlobalDewPoint()
|
pure virtual |
Get the global dew point.
§ GetGlobalHorizWindSpeed()
|
pure virtual |
Get the global horizontal wind speed in m/s.
§ GetGlobalTemp()
|
pure virtual |
Get the global temp in degrees C.
§ GetGlobalVisRange()
|
pure virtual |
Get the global visibility range in Meters.
§ GetGlobalWindDirection()
|
pure virtual |
Get the global wind direction in degrees.
§ GetInterpolatedMetarData()
|
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()
|
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()
|
pure virtual |
Get the current number of pressure points.
§ GetStationMetarData()
|
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()
|
pure virtual |
Gets the current weather theme file path.
- Parameters
-
pszThemePath OUT: The output string to store the theme file path. cchThemePath IN: The length of the pszThemePath parameter in characters.
- Remarks
- Succeeding and returning an empty string represents clear weather.
§ GetThermalVisualType()
|
pure virtual |
Get the current thermal visual type.
§ GetWeatherMode()
|
pure virtual |
Gets the current weather mode.
§ GetWeatherStation()
|
pure virtual |
§ ReloadWeather()
|
pure virtual |
§ RemoveStation()
|
pure virtual |
Removes the weather station with the given reference pointer.
- Parameters
-
IN pStation The reference pointer returned by CreateStation().
§ RemoveThermal()
|
pure virtual |
Removes a thermal with the given reference pointer.
- Parameters
-
pThermal The reference pointer returned by CreateThermal().
§ RequestCloudState()
|
pure virtual |
Returns the cloud state for the given area.
- Parameters
-
IN dLatRadiansMin Specifies the minimum latitude of the required area. This should simply be the lower of the two latitude numbers. IN dLonRadiansMin Specifies the minimum longitude of the required area. This should simply be the lower of the two longitude numbers. IN dAltFeetMin Specifies the minimum altitude of the required area, in feet. IN dLatRadiansMax Specifies the maximum latitude of the required area. IN dLonRadiansMax Specifies the maximum longitude of the required area. IN dAltFeetMax Specifies the maximum altitude of the required area, in feet. IN cbCloudState The size of the cloud state byte array. This value must be 64 * 64 (4096). OUT pCloudState 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()
|
pure virtual |
Set the current cloud coverage density. The effects of setting this value will not be immediately seen.
§ SetCloudDrawDistance()
|
pure virtual |
Set the current cloud draw distance.
§ SetDetailedClouds()
|
pure virtual |
Set the detailed cloud setting.
§ SetDynamicUpdateRate()
|
pure virtual |
Sets the rate at which cloud formations change.
- Parameters
-
Double word 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()
|
pure virtual |
Set the global barometer pressure in millibars.
§ SetGlobalDewPoint()
|
pure virtual |
Set the global dew point.
§ SetGlobalHorizWindSpeed()
|
pure virtual |
Set the global horizontal wind speed in knots.
§ SetGlobalTemp()
|
pure virtual |
Set the global temp using degrees C.
§ SetGlobalVisRange()
|
pure virtual |
Set the global visibility range in Meters.
§ SetGlobalWindDirection()
|
pure virtual |
Set the global wind direction in degrees.
§ SetMetarData()
|
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()
|
pure virtual |
Set the current thermal visual type.
§ SetWeatherMode()
|
pure virtual |
Sets the current weather mode.
- Parameters
-
eWeatherMode IN: The WEATHER_MODE to be set. pszThemePath IN: 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: - An absolute path (e.g. C:\Program Files\My Company\My Product\myweathertheme)
- A path relative to the Lockheed Martin\Prepar3D v4\ installation folder (e.g. weather\themes\grayrain)
- A path relative to any of the weather theme folders found in any of the weather.cfg configuration files (e.g. grayrain)
- 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.