Class CCWFGM WeatherGrid. More...
#include <CWFGM_WeatherGrid.h>
Public Member Functions | |
STDMETHOD() | GetStreamCount (ULONG *count) |
STDMETHOD() | AddStream (ICWFGM_WeatherStream *stream) |
STDMETHOD() | RemoveStream (ICWFGM_WeatherStream *stream) |
STDMETHOD() | StreamAtIndex (ULONG index, ICWFGM_WeatherStream **stream) |
STDMETHOD() | IndexOfStream (ICWFGM_WeatherStream *stream, ULONG *index) |
STDMETHOD() | GetAttribute (USHORT option, VARIANT *value) |
STDMETHOD() | MT_Lock (__int64 layerThread, USHORT exclusive, USHORT obtain) |
STDMETHOD() | Valid (__int64 layerThread, ULONGLONG start_time, LONGLONG duration, ULONG option, SAFEARRAY **application_count) |
STDMETHOD() | GetAttribute (__int64 layerThread, USHORT option, VARIANT *value) |
STDMETHOD() | SetAttribute (USHORT option, VARIANT value) |
STDMETHOD() | GetDimensions (__int64 layerThread, USHORT *x_dim, USHORT *y_dim) |
STDMETHOD() | GetFuelData (__int64 layerThread, USHORT _x, USHORT _y, ULONGLONG time, ICWFGM_Fuel **fuel) |
STDMETHOD() | GetFuelIndexData (__int64 layerThread, USHORT x, USHORT y, ULONGLONG time, UCHAR *fuel_index) |
STDMETHOD() | GetElevationData (__int64 layerThread, USHORT x, USHORT y, SHORT allow_defaults_returned, double *elevation, double *slope_factor, double *slope_azimuth) |
STDMETHOD() | GetWeatherData (__int64 layerThread, USHORT x, USHORT y, ULONGLONG time, ULONG interpolate_method, IWXData *wx, IFWIData *ifwi, DFWIData *dfwi) |
STDMETHOD() | GetAttributeData (__int64 layerThread, USHORT _x, USHORT _y, ULONGLONG time, USHORT option, VARIANT *attribute) |
STDMETHOD() | GetFuelDataArray (__int64 layerThread, USHORT _x_min, USHORT _y_min, USHORT _x_max, USHORT _y_max, ULONGLONG time, SAFEARRAY **fuel) |
STDMETHOD() | GetFuelIndexDataArray (__int64 layerThread, USHORT _x_min, USHORT _y_min, USHORT _x_max, USHORT _y_max, ULONGLONG time, SAFEARRAY **fuel) |
STDMETHOD() | GetElevationDataArray (__int64 layerThread, USHORT x_min, USHORT y_min, USHORT x_max, USHORT y_max, SHORT allow_defaults_returned, SAFEARRAY **elevation, SAFEARRAY **slope_factor, SAFEARRAY **slope_azimuth) |
STDMETHOD() | GetWeatherDataArray (__int64 layerThread, USHORT x_min, USHORT y_min, USHORT x_max, USHORT y_max, ULONGLONG time, ULONG interpolate_method, SAFEARRAY **wx, SAFEARRAY **ifwi, SAFEARRAY **dfwi) |
STDMETHOD() | GetAttributeDataArray (__int64 layerThread, USHORT _x_min, USHORT _y_min, USHORT _x_max, USHORT _y_max, ULONGLONG time, USHORT option, SAFEARRAY **attribute) |
STDMETHOD() | GetEventTime (__int64 layerThread, ULONG flags, ULONGLONG from_time, ULONGLONG *next_event) |
STDMETHOD() | PreCalculationEvent (__int64 layerThread, ULONGLONG time, ULONG mode) |
STDMETHOD() | PostCalculationEvent (__int64 layerThread, ULONGLONG time, ULONG mode) |
STDMETHOD() | GetGridEngine (__int64 layerThread, ICWFGM_GridEngine **pVal) |
STDMETHOD() | PutGridEngine (__int64 layerThread, ICWFGM_GridEngine *newVal) |
STDMETHOD() | get_LayerManager (ICWFGM_LayerManager **pVal) |
STDMETHOD() | put_LayerManager (ICWFGM_LayerManager *newVal) |
STDMETHOD() | get_UserData (VARIANT *pVal) |
STDMETHOD() | put_UserData (VARIANT newVal) |
STDMETHOD() | get_PrimaryStream (ICWFGM_WeatherStream **stream) |
STDMETHOD() | put_PrimaryStream (ICWFGM_WeatherStream *stream) |
Public Member Functions inherited from ICWFGM_WeatherGrid | |
HRESULT | GetStreamCount ([out, retval]unsigned long *count) |
HRESULT | AddStream ([in]ICWFGM_WeatherStream *stream) |
HRESULT | RemoveStream ([in]ICWFGM_WeatherStream *stream) |
HRESULT | StreamAtIndex ([in]unsigned long index, [out, retval]ICWFGM_WeatherStream **stream) |
HRESULT | IndexOfStream ([in]ICWFGM_WeatherStream *stream, [out, retval]unsigned long *index) |
HRESULT | GetAttribute ([in]unsigned short option, [out, retval]VARIANT *value) |
HRESULT | SetAttribute ([in]unsigned short option, [in]VARIANT value) |
Public Member Functions inherited from ICWFGM_GridEngine | |
HRESULT | MT_Lock ([in] __int64 layerThread, [in] unsigned short exclusive, [in] unsigned short obtain) |
HRESULT | Valid ([in] __int64 layerThread, [in] unsigned __int64 start_time, [in] __int64 duration, [in] unsigned long option, [in, out] SAFEARRAY(unsigned short)*application_count) |
HRESULT | GetAttribute ([in] __int64 layerThread, [in] unsigned short option, [out, retval]VARIANT *value) |
HRESULT | GetDimensions ([in] __int64 layerThread, [out] unsigned short *x_dim, [out]unsigned short *y_dim) |
HRESULT | GetFuelData ([in] __int64 layerThread, [in] unsigned short _x, [in] unsigned short _y, [in] unsigned __int64 time, [out, retval]ICWFGM_Fuel **fuel) |
HRESULT | GetFuelIndexData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] unsigned __int64 time, [out, retval]unsigned char *fuel_index) |
HRESULT | GetElevationData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] short allow_defaults_returned, [out]double *elevation, [out] double *slope_factor, [out] double *slope_azimuth) |
HRESULT | GetAttributeData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] unsigned __int64 time, [in] unsigned short option, [out, retval] VARIANT *attribute) |
HRESULT | GetWeatherData ([in] __int64 layerThread, [in] unsigned short x, [in] unsigned short y, [in] unsigned __int64 time, [in]unsigned long interpolate_method, [out]IWXData *wx, [out]IFWIData *ifwi, [out]DFWIData *dfwi) |
HRESULT | GetFuelDataArray ([in] __int64 layerThread, [in] unsigned short _x_min, [in] unsigned short _y_min, [in] unsigned short _x_max, [in]unsigned short _y_max,[in]unsigned __int64 time, [in, out] SAFEARRAY(ICWFGM_Fuel *)*fuel) |
HRESULT | GetFuelIndexDataArray ([in] __int64 layerThread, [in]unsigned short _x_min, [in]unsigned short _y_min, [in]unsigned short _x_max, [in]unsigned short _y_max, [in]unsigned __int64 time, [in, out] SAFEARRAY(unsigned char)*fuel_index) |
HRESULT | GetElevationDataArray ([in] __int64 layerThread, [in]unsigned short x_min, [in]unsigned short y_min, [in]unsigned short x_max, [in]unsigned short y_max, [in]short allow_defaults_returned, [in, out] SAFEARRAY(double)*elevation, [in, out] SAFEARRAY(double)*slope_factor, [in, out] SAFEARRAY(double)*slope_azimuth) |
HRESULT | GetWeatherDataArray ([in] __int64 layerThread, [in]unsigned short x_min, [in]unsigned short y_min, [in]unsigned short x_max, [in] unsigned short y_max, [in]unsigned __int64 time, [in]unsigned long interpolate_method, [in, out] SAFEARRAY(IWXData)*wx, [in, out] SAFEARRAY(IFWIData)*ifwi, [in, out] SAFEARRAY(DFWIData)*dfwi) |
HRESULT | GetAttributeDataArray ([in] __int64 layerThread, [in]unsigned short x_min, [in]unsigned short y_min, [in]unsigned short x_max, [in]unsigned short y_max, [in] unsigned __int64 time, [in] unsigned short option, [in, out] SAFEARRAY(VARIANT)*attribute) |
HRESULT | GetEventTime ([in] __int64 layerThread, [in] unsigned long flags, [in] unsigned __int64 from_time, [out, retval] unsigned __int64 *next_event) |
HRESULT | PreCalculationEvent ([in] __int64 layerThread, [in] unsigned __int64 time, [in] unsigned long mode) |
HRESULT | PostCalculationEvent ([in] __int64 layerThread, [in] unsigned __int64 time, [in] unsigned long mode) |
HRESULT | GetGridEngine ([in] __int64 layerThread, [out, retval] ICWFGM_GridEngine **pVal) |
HRESULT | PutGridEngine ([in] __int64 layerThread, [in] ICWFGM_GridEngine *newVal) |
Additional Inherited Members | |
Properties inherited from ICWFGM_WeatherGrid | |
ICWFGM_WeatherStream | PrimaryStream [get, set] |
Properties inherited from ICWFGM_GridEngine | |
ICWFGM_LayerManager | LayerManager [get, set] |
VARIANT | UserData [get, set] |
Class CCWFGM WeatherGrid.
This object manages a collection weather data for a simulation engine's scenario. It implements the GridEngine interface for communication with the simulation engine. Since it only handles weather data, its GridEngine property should refer to an object that can provide fuel type and elevation data, latitude, longitude, etc. In addition to the GridEngine interface, it also implements its own interface so that a client application may specify a collection of weather streams for use in a simulation. This object manages the spatial aspect of merging data together from multiple weather streams.
Only one weather stream from a weather station may be associated with a weather grid at a time when spatial weather interpolation is turned off. This rule is imposed to avoid confusing situations to merge data from multiple streams. A stream cannot be attached to a weather grid until it is associated with a weather station, to ensure that it has a location.
CCWFGM_WeatherGrid::AddStream | ( | ICWFGM_WeatherStream * | stream | ) |
Adds a weather stream to this weather grid.
stream | Weather stream object. |
E_POINTER | The address provided for stream is invalid, or the object trying to be added doesn't support the correct interfaces. |
S_OK | Successful. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot add a stream if the simulation is running. |
ERROR_WEATHER_STREAM_ALREADY_ADDED | The stream being added is already associated with this WeatherGrid object. |
ERROR_WEATHER_STREAM_NOT_ASSIGNED | The stream is not attached to a weather station (a stream must be associated with a station before it may be added to a weather grid). |
ERROR_WEATHER_STATION_ALREADY_PRESENT | There is already a stream from the new stream's weather station attached to this weather grid. |
E_OUTOFMEMORY | Insufficient memory. |
E_NOINTERFACE | Interface not supported. |
CCWFGM_WeatherGrid::get_LayerManager | ( | ICWFGM_LayerManager ** | pVal | ) |
This property is must be set before any calls to GetGridEngine or PutGridEngine. Additionally, this property should be considered write-once. This value should be set to the ICWFGM_LayerManager object which any layerThread assigned to this object will have been allocated from.
pVal | value of LayerManager |
CCWFGM_WeatherGrid::get_PrimaryStream | ( | ICWFGM_WeatherStream ** | stream | ) |
This property is very important for various aspects and options for spatial weather modelling. It must be specified any time more than one stream is associated with this grid (and thus, a scenario). Its affects will vary according to scenario options. If only one stream is attached, then this value will automatically be set to that scenario.
stream | Value of PrimaryStream. |
E_POINTER | The address provided for pVal is invalid. |
S_OK | Successful. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot change PrimarySyream while scenario is running. |
CCWFGM_WeatherGrid::get_UserData | ( | VARIANT * | pVal | ) |
This property is unused by this object, and is available for exclusive use by the client code. It is a VARIANT value to ensure that the client code can store a pointer value (if it chooses) for use in manual subclassing this object. This value is not loaded or saved during serialization operations, and it is the responsibility of the client code to manage any value or object stored here. Access to this property is not thread-safe.
pVal | Value of UserData |
E_POINTER | The address provided for pVal is invalid |
S_OK | Successful |
CCWFGM_WeatherGrid::GetAttribute | ( | USHORT | option, |
VARIANT * | value | ||
) |
Polymorphic. This routine retrieves an attribute/option value given the attribute/option index.
option | The attribute of interest. Valid attributes are:
|
value | Location for the retrieved value to be placed. |
E_POINTER | value is NULL |
E_INVALIDARG | unknown requested option |
S_OK | Success |
CCWFGM_WeatherGrid::GetAttribute | ( | __int64 | layerThread, |
USHORT | option, | ||
VARIANT * | value | ||
) |
Polymorphic. If layerThread is non-zero, then this filter object simply forwards the call to the next lower GIS layer determined by layerThread. If layerthread is zero, then this object will interpret the call.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
option | The attribute of interest. Valid attributes are:
|
value | Location for the retrieved value to be placed. |
E_POINTER | value is NULL |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
S_OK | Success |
CCWFGM_WeatherGrid::GetAttributeData | ( | __int64 | layerThread, |
USHORT | _x, | ||
USHORT | _y, | ||
ULONGLONG | time, | ||
USHORT | option, | ||
VARIANT * | attribute | ||
) |
Polymorphic. This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x | Value on x-axis. |
_y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
option | Data array option. |
attribute | Return value for attribute. |
S_OK | Returned attribute is valid. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetAttributeDataArray | ( | __int64 | layerThread, |
USHORT | _x_min, | ||
USHORT | _y_min, | ||
USHORT | _x_max, | ||
USHORT | _y_max, | ||
ULONGLONG | time, | ||
USHORT | option, | ||
SAFEARRAY ** | attribute | ||
) |
Polymorphic. This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x_min | Minimum value (inclusive) on x-axis. |
_y_min | Minimum value (inclusive) on y-axis. |
_x_max | Maximum value (inclusive) on x-axis. |
_y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
option | Data array option. |
attribute | Data array attribute. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetDimensions | ( | __int64 | layerThread, |
USHORT * | x_dim, | ||
USHORT * | y_dim | ||
) |
This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x_dim | x dimension of the grid. |
y_dim | y dimension of the grid. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetElevationData | ( | __int64 | layerThread, |
USHORT | x, | ||
USHORT | y, | ||
SHORT | allow_defaults_returned, | ||
double * | elevation, | ||
double * | slope_factor, | ||
double * | slope_azimuth | ||
) |
This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x | x grid location. |
y | y grid location. |
allow_defaults_returned | Flag for allowing defaults to be returned |
elevation | Elevation (m) of the requested location. |
slope_factor | Percentage ground slope specified as a decimal value (0 - 1) |
slope_azimuth | Direction of up-slope, Cartesian radians. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetElevationDataArray | ( | __int64 | layerThread, |
USHORT | x_min, | ||
USHORT | y_min, | ||
USHORT | x_max, | ||
USHORT | y_max, | ||
SHORT | allow_defaults_returned, | ||
SAFEARRAY ** | elevation, | ||
SAFEARRAY ** | slope_factor, | ||
SAFEARRAY ** | slope_azimuth | ||
) |
This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x_min | Minimum value (inclusive) on x-axis. |
y_min | Minimum value (inclusive) on y-axis. |
x_max | Maximum value (inclusive) on x-axis. |
y_max | Maximum value (inclusive) on y-axis. |
allow_defaults_returned | Flag for allowing defaults to be returned |
elevation | Array of elevations for the defined bounding rectangle (to fill in). |
slope_factor | Array of slope factors for the defined bounding rectangle (to fill in). |
slope_azimuth | Array of slope azimuths for the defined bounding rectangle (to fill in). |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetEventTime | ( | __int64 | layerThread, |
ULONG | flags, | ||
ULONGLONG | from_time, | ||
ULONGLONG * | next_event | ||
) |
This method will query all valid, associated weather streams for the next time at which a specified weather event (recorded change in weather data) occurs. This filter object it will then forward the call to the next lower GIS layer determined by layerThread and combine results.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
flags | Calculation flags. Valid bit-flag identifiers are:
|
from_time | A GMT time provided as seconds since January 1st, 1600. |
next_event | A GMT time provided as seconds since January 1st, 1600, representing the time for the next event, based on 'flags'. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetFuelData | ( | __int64 | layerThread, |
USHORT | _x, | ||
USHORT | _y, | ||
ULONGLONG | time, | ||
ICWFGM_Fuel ** | fuel | ||
) |
This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x | Value on x-axis. |
_y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel | return value |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetFuelDataArray | ( | __int64 | layerThread, |
USHORT | _x_min, | ||
USHORT | _y_min, | ||
USHORT | _x_max, | ||
USHORT | _y_max, | ||
ULONGLONG | time, | ||
SAFEARRAY ** | fuel | ||
) |
This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x_min | Minimum value (inclusive) on x-axis. |
_y_min | Minimum value (inclusive) on y-axis. |
_x_max | Maximum value (inclusive) on x-axis. |
_y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel | array for return values |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetFuelIndexData | ( | __int64 | layerThread, |
USHORT | x, | ||
USHORT | y, | ||
ULONGLONG | time, | ||
UCHAR * | fuel_index | ||
) |
This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x | Value on x-axis. |
y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel_index | return value |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetFuelIndexDataArray | ( | __int64 | layerThread, |
USHORT | _x_min, | ||
USHORT | _y_min, | ||
USHORT | _x_max, | ||
USHORT | _y_max, | ||
ULONGLONG | time, | ||
SAFEARRAY ** | fuel | ||
) |
This filter object simply forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
_x_min | Minimum value (inclusive) on x-axis. |
_y_min | Minimum value (inclusive) on y-axis. |
_x_max | Maximum value (inclusive) on x-axis. |
_y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
fuel | array for return values |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::GetGridEngine | ( | __int64 | layerThread, |
ICWFGM_GridEngine ** | pVal | ||
) |
This method retrieves the next lower GIS layer for layerThread, used to determine the stacking and order of objects associated to a scenario.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
pVal | Pointer to grid engine. |
S_OK | Successful look-up |
E_POINTER | Address provided for value is invalid. |
CCWFGM_WeatherGrid::GetStreamCount | ( | ULONG * | count | ) |
Returns the number of weather streams associated with this weather grid.
count | Number of streams. |
E_POINTER | The address provided for count is invalid. |
S_OK | Successful. |
CCWFGM_WeatherGrid::GetWeatherData | ( | __int64 | layerThread, |
USHORT | x, | ||
USHORT | y, | ||
ULONGLONG | time, | ||
ULONG | interpolate_method, | ||
IWXData * | wx, | ||
IFWIData * | ifwi, | ||
DFWIData * | dfwi | ||
) |
This object calculates weather at location (x, y) at time 'time'. 'interpolate_method' determines various rules for how these calculations take place: if weather is to be temporally interpolated, spatially interpolated (and how), etc. All weather and fwi calculations are performed (as requested and determined). Note that some modes require a potentially long- duration recursive calculation to take place, which may take some time (and stack space) to perform.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x | Value on x-axis. |
y | Value on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
interpolate_method | Interpolation method identifier. Valid bit-flag identifiers are:
|
wx | Weather information. |
ifwi | IFWI Information. |
dfwi | DFWI Information. |
CWFGM_WEATHER_INITIAL_VALUES_ONLY | Given time, only initial weather values (used for starting FWI calculations) could be returned. |
ERROR_INVALID_DATA | Invalid latitude/longitude available for calculations. |
E_INVALIDARG | Error in calculations (likely FWI calculations). |
E_POINTER | Invalid wx, ifwi, or dfwi pointers. |
S_OK | Calculations are successful |
(ERROR_INVALID_STATE | | ERROR_SEVERITY_WARNING) No weather streams available, or no primary weather stream set, for calculations. |
CCWFGM_WeatherGrid::GetWeatherDataArray | ( | __int64 | layerThread, |
USHORT | x_min, | ||
USHORT | y_min, | ||
USHORT | x_max, | ||
USHORT | y_max, | ||
ULONGLONG | time, | ||
ULONG | interpolate_method, | ||
SAFEARRAY ** | wx, | ||
SAFEARRAY ** | ifwi, | ||
SAFEARRAY ** | dfwi | ||
) |
This object calculates weather at the specified location for storage in the provided array(s) at time 'time'. 'interpolate_method' determines various rules for how these calculations take place: if weather is to be temporally interpolated, spatially interpolated (and how), etc. All weather and fwi calculations are performed (as requested and determined). Note that some modes require a potentially long- duration recursive calculation to take place, which may take some time (and stack space) to perform.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
x_min | Minimum value (inclusive) on x-axis. |
y_min | Minimum value (inclusive) on y-axis. |
x_max | Maximum value (inclusive) on x-axis. |
y_max | Maximum value (inclusive) on y-axis. |
time | A GMT time provided as seconds since January 1st, 1600. |
interpolate_method | Interpolation method identifier. Valid bit-flag identifiers are:
|
wx | Array of Weather information. |
ifwi | Array of Instantaneous FWI codes. |
dfwi | Array of Daily FWI codes. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
E_INVALIDARG | The array is not 2D, or is insufficient in size to contain the requested data |
CCWFGM_WeatherGrid::IndexOfStream | ( | ICWFGM_WeatherStream * | stream, |
ULONG * | index | ||
) |
Returns the index of ‘stream' in this grid's set of weather streams.
stream | Weather stream object. |
index | Index to the stream. |
E_POINTER | The address provided for stream or index is invalid. |
S_OK | Successful. |
ERROR_WEATHER_STREAM_UNKNOWN | The index is out of range. |
CCWFGM_WeatherGrid::MT_Lock | ( | __int64 | layerThread, |
USHORT | exclusive, | ||
USHORT | obtain | ||
) |
Changes the state of the object with respect to access rights. When the object is used by an active simulation, it must not be modified. When the object is somehow modified, it must be done so in an atomic action to prevent concerns with arising from multithreading. Note that these locks are primarily needed to ensure that data contributing during a simulation is not modified while the simulation is executing.
All routines in the ICWFGM_GridEngine interface are necessarily NOT multithreading safe (for performance) but other interfaces for a given COM object implementing this interface must be by specification. Locking request is forwarded to the next lower object in the 'layerThread' layering, in additional to all attached ICWFGM_WeatherStream objects.
In the event of an error, then locking is undone to reflect an error state.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
exclusive | TRUE if the requester wants a write lock, false for read/shared access |
obtain | TRUE to obtain the lock, FALSE to release the lock. If this is FALSE, then the 'exclusive' parameter must match the initial call used to obtain the lock. |
SUCCESS_STATE_OBJECT_UNLOCKED | Lock was released. |
SUCCESS_STATE_OBJECT_LOCKED_WRITE | Exclusive/write lock obtained. |
SUCCESS_STATE_OBJECT_LOCKED_SCENARIO | A scenario successfully required a lock for purposes of simulating. |
SUCCESS_STATE_OBJECT_LOCKED_READ | Shared/read lock obtained. |
S_OK | Successful |
ERROR_GRID_UNINITIALIZED | No path via layerThread can be determined to further determine successful locks. |
CCWFGM_WeatherGrid::PostCalculationEvent | ( | __int64 | layerThread, |
ULONGLONG | time, | ||
ULONG | mode | ||
) |
This filter object handles caching of spatial weather data, then forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
time | A GMT time provided as seconds since January 1st, 1600. |
mode | Calculation mode. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::PreCalculationEvent | ( | __int64 | layerThread, |
ULONGLONG | time, | ||
ULONG | mode | ||
) |
This filter object handles caching of spatial weather data, then forwards the call to the next lower GIS layer determined by layerThread.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
time | A GMT time provided as seconds since January 1st, 1600. |
mode | Calculation mode. |
ERROR_GRID_UNINITIALIZED | No object in the grid layering to forward the request to. |
CCWFGM_WeatherGrid::put_LayerManager | ( | ICWFGM_LayerManager * | newVal | ) |
This property is must be set before any calls to GetGridEngine or PutGridEngine. Additionally, this property should be considered write-once. This value should be set to the ICWFGM_LayerManager object which any layerThread assigned to this object will have been allocated from.
newVal | value for LayerManager |
CCWFGM_WeatherGrid::put_PrimaryStream | ( | ICWFGM_WeatherStream * | stream | ) |
This property is very important for various aspects and options for spatial weather modelling. It must be specified any time more than one stream is associated with this grid (and thus, a scenario). Its affects will vary according to scenario options. If only one stream is attached, then this value will automatically be set to that scenario.
stream | Replacement value for PrimaryStream. |
E_POINTER | The address provided for pVal is invalid. |
S_OK | Successful. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot change PrimarySyream while scenario is running. |
CCWFGM_WeatherGrid::put_UserData | ( | VARIANT | newVal | ) |
This property is unused by this object, and is available for exclusive use by the client code. It is a VARIANT value to ensure that the client code can store a pointer value (if it chooses) for use in manual subclassing this object. This value is not loaded or saved during serialization operations, and it is the responsibility of the client code to manage any value or object stored here. Access to this property is not thread-safe.
newVal | Replacement value for UserData |
S_OK | Successful |
CCWFGM_WeatherGrid::PutGridEngine | ( | __int64 | layerThread, |
ICWFGM_GridEngine * | newVal | ||
) |
This method sets the next lower GIS layer for layerThread, used to determine the stacking and order of objects associated to a scenario.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
newVal | Pointer to new grid engine. |
E_NOINTERFACE | Provided object (newVal) does not support the required ICWFGM_GridEngine interface (mis-cast) |
S_OK | Mapping assignment between layerThread and newval was successful. |
CCWFGM_WeatherGrid::RemoveStream | ( | ICWFGM_WeatherStream * | stream | ) |
Removes an association between a weather stream and this weather grid.
stream | Weather stream object. |
E_POINTER | The address provided for stream is invalid. |
S_OK | Successful. |
ERROR_WEATHER_STREAM_UNKNOWN | The client program tries to remove a fire object that is unknown to this scenario object. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot remove a stream if the scenario simulation is running. |
CCWFGM_WeatherGrid::SetAttribute | ( | USHORT | option, |
VARIANT | value | ||
) |
Sets the value of an "option" to the value of the "value" variable provided. Supported values for IDW exponents are from (0.0 to 10.0]. If 0.0 is provided for either wind or precipitation, then voronoi regions / theissen polygons are used instead of the IDW approach.
option | The weather option of interest. Valid options are:
|
value | The value to set the option to. |
S_OK | Successful. |
ERROR_WEATHER_OPTION_INVALID | The weather option referred to is unknown. |
E_INVALIDARG | If value's value is incorrect. |
ERROR_SCENARIO_SIMULATION_RUNNING | Cannot set an attribute if the simulation is running. |
E_FAIL | Failed. |
CCWFGM_WeatherGrid::StreamAtIndex | ( | ULONG | index, |
ICWFGM_WeatherStream ** | stream | ||
) |
Given an index value, returns a pointer to a stream associated with this grid. Note that this value is expected to be different from the stream's index for its station.
index | Index to a weather stream |
stream | Address to contain the specific requested weather stream. |
E_POINTER | The address provided for stream is invalid. |
S_OK | Successful. |
ERROR_WEATHER_STREAM_UNKNOWN | The index is out of range. |
CCWFGM_WeatherGrid::Valid | ( | __int64 | layerThread, |
ULONGLONG | start_time, | ||
LONGLONG | duration, | ||
ULONG | option, | ||
SAFEARRAY ** | application_count | ||
) |
This filter object validates all associated weather streams with this simulation, and if successful, forwards the call to the next lower GIS layer determined by layerThread. It also ensures that the selection of weather streams is valid (no 2 streams from the same weather station, weather stations are appropriately spaced from each other, etc.) and all information needed to correctly initialize weather streams (e.g. latitude, longitude, timezone) is available and has been set.
layerThread | Handle for scenario layering/stack access, allocated from an ICWFGM_LayerManager COM object. Needed. It is designed to allow nested layering analogous to the GIS layers. |
start_time | Start time of the simulation for which valid data must be available |
duration | Duration of the simulation time for which valid data must be available |
option | Determines type of Valid request. |
application_count | Optional (dependent on option). Array of counts for how often a particular type of grid occurs in the set of ICWFGM_GridEngine objects associated with a scenario. |
S_OK | Successful. |
ERROR_GRID_UNINITIALIZED | Grid not initialized. |
ERROR_SEVERITY_WARNING | Grid validation failed based on options provided. |
ERROR_GRID_WEATHER_INVALID_DATES | Invalid layerThread. |
ERROR_WEATHER_STREAM_NOT_ASSIGNED | No weather streams are assigned to this object. |
ERROR_GRID_PRIMARY_STREAM_UNSPECIFIED | Multiple weather streams exist, but none have been identified as the primary weather stream. |
ERROR_GRID_WEATHER_STATION_ALREADY_PRESENT | Muliple weather streams from the same weather station exists; invalid. |
ERROR_GRID_WEATHERSTATIONS_TOO_CLOSE | At least 2 weather stations are within 100m of each other |
ERROR_GRID_WEATHER_INVALID_DATES | At least one weather station cannot provide weather data for the time, duration specified |