All Classes Functions Variables Properties
List of all members | Public Member Functions
CCWFGM_WeatherGrid Class Reference

Class CCWFGM WeatherGrid. More...

#include <CWFGM_WeatherGrid.h>

Collaboration diagram for CCWFGM_WeatherGrid:
Collaboration graph

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]
 

Detailed Description

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.

Member Function Documentation

CCWFGM_WeatherGrid::AddStream ( ICWFGM_WeatherStream stream)

Adds a weather stream to this weather grid.

Parameters
streamWeather stream object.
See Also
ICWFGM_WeatherGrid::AddStream
Return values
E_POINTERThe address provided for stream is invalid, or the object trying to be added doesn't support the correct interfaces.
S_OKSuccessful.
ERROR_SCENARIO_SIMULATION_RUNNINGCannot add a stream if the simulation is running.
ERROR_WEATHER_STREAM_ALREADY_ADDEDThe stream being added is already associated with this WeatherGrid object.
ERROR_WEATHER_STREAM_NOT_ASSIGNEDThe 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_PRESENTThere is already a stream from the new stream's weather station attached to this weather grid.
E_OUTOFMEMORYInsufficient memory.
E_NOINTERFACEInterface 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.

Parameters
pValvalue 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.

Parameters
streamValue of PrimaryStream.
See Also
ICWFGM_WeatherGrid::PrimaryStream
Return values
E_POINTERThe address provided for pVal is invalid.
S_OKSuccessful.
ERROR_SCENARIO_SIMULATION_RUNNINGCannot 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.

Parameters
pValValue of UserData
See Also
ICWFGM_GridEngine::UserData
Return values
E_POINTERThe address provided for pVal is invalid
S_OKSuccessful
CCWFGM_WeatherGrid::GetAttribute ( USHORT  option,
VARIANT *  value 
)

Polymorphic. This routine retrieves an attribute/option value given the attribute/option index.

Parameters
optionThe attribute of interest. Valid attributes are:
  • CWFGM_WEATHER_OPTION_ADIABATIC_IDW_EXPONENT_TEMP 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL is set. IDW power for interpolating temperature and dew point values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_WS 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_WIND is set. IDW power for interpolating WS values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_PRECIP 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_PRECIP is set. IDW power for interpolating precip values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_FWI 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL is set. IDW power for interpolating FWI values.
  • CWFGM_WEATHER_OPTION_FFMC_VANWAGNER Boolean. Use the Van Wagner approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FFMC_LAWSON Boolean. Use the Lawson approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FFMC_HYBRID Boolean. Do not use, only for experimental purposes.
valueLocation for the retrieved value to be placed.
See Also
ICWFGM_GridEngine::GetAttribute
Return values
E_POINTERvalue is NULL
E_INVALIDARGunknown requested option
S_OKSuccess
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.

Parameters
layerThreadHandle 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.
optionThe attribute of interest. Valid attributes are:
  • CWFGM_WEATHER_OPTION_ADIABATIC_IDW_EXPONENT_TEMP 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL is set. IDW power for interpolating temperature and dew point values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_WS 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_WIND is set. IDW power for interpolating WS values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_PRECIP 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_PRECIP is set. IDW power for interpolating precip values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_FWI 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL is set. IDW power for interpolating FWI values.
  • CWFGM_WEATHER_OPTION_FFMC_VANWAGNER Boolean. Use the Van Wagner approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FFMC_LAWSON Boolean. Use the Lawson approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FFMC_HYBRID Boolean. Do not use, only for experimental purposes.
valueLocation for the retrieved value to be placed.
See Also
ICWFGM_GridEngine::GetAttribute
Return values
E_POINTERvalue is NULL
ERROR_GRID_UNINITIALIZEDNo object in the grid layering to forward the request to.
S_OKSuccess
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.

Parameters
layerThreadHandle 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.
_xValue on x-axis.
_yValue on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
optionData array option.
attributeReturn value for attribute.
See Also
ICWFGM_GridEngine::GetAttributeData
Return values
S_OKReturned attribute is valid.
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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_minMinimum value (inclusive) on x-axis.
_y_minMinimum value (inclusive) on y-axis.
_x_maxMaximum value (inclusive) on x-axis.
_y_maxMaximum value (inclusive) on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
optionData array option.
attributeData array attribute.
See Also
ICWFGM_GridEngine::GetAttributeDataArray
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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_dimx dimension of the grid.
y_dimy dimension of the grid.
See Also
ICWFGM_GridEngine::GetDimensions
CCWFGM_Grid::GetDimensions
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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.
xx grid location.
yy grid location.
allow_defaults_returnedFlag for allowing defaults to be returned
elevationElevation (m) of the requested location.
slope_factorPercentage ground slope specified as a decimal value (0 - 1)
slope_azimuthDirection of up-slope, Cartesian radians.
See Also
ICWFGM_GridEngine::GetElevationData
CCWFGM_Grid::GetElevationData
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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_minMinimum value (inclusive) on x-axis.
y_minMinimum value (inclusive) on y-axis.
x_maxMaximum value (inclusive) on x-axis.
y_maxMaximum value (inclusive) on y-axis.
allow_defaults_returnedFlag for allowing defaults to be returned
elevationArray of elevations for the defined bounding rectangle (to fill in).
slope_factorArray of slope factors for the defined bounding rectangle (to fill in).
slope_azimuthArray of slope azimuths for the defined bounding rectangle (to fill in).
See Also
ICWFGM_GridEngine::GetElevationDataArray
CCWFGM_Grid::GetElevationDataArray
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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.
flagsCalculation flags. Valid bit-flag identifiers are:
  • CWFGM_GETEVENTTIME_FLAG_SEARCH_FORWARD search forward in time
  • CWFGM_GETEVENTTIME_FLAG_SEARCH_BACKWARD search backwards in time
  • CWFGM_GETEVENTTIME_QUERY_PRIMARY_WX_STREAM only the primary weather stream may respond
  • CWFGM_GETEVENTTIME_QUERY_ANY_WX_STREAM only weather streams may respond
from_timeA GMT time provided as seconds since January 1st, 1600.
next_eventA GMT time provided as seconds since January 1st, 1600, representing the time for the next event, based on 'flags'.
See Also
ICWFGM_GridEngine::GetEventTime
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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.
_xValue on x-axis.
_yValue on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
fuelreturn value
See Also
ICWFGM_GridEngine::GetFuelData
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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_minMinimum value (inclusive) on x-axis.
_y_minMinimum value (inclusive) on y-axis.
_x_maxMaximum value (inclusive) on x-axis.
_y_maxMaximum value (inclusive) on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
fuelarray for return values
See Also
ICWFGM_GridEngine::GetFuelDataArray
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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.
xValue on x-axis.
yValue on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
fuel_indexreturn value
See Also
ICWFGM_GridEngine::GetFuelIndexData
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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_minMinimum value (inclusive) on x-axis.
_y_minMinimum value (inclusive) on y-axis.
_x_maxMaximum value (inclusive) on x-axis.
_y_maxMaximum value (inclusive) on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
fuelarray for return values
See Also
ICWFGM_GridEngine::GetFuelIndexDataArray
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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.
pValPointer to grid engine.
See Also
ICWFGM_GridEngine::GetGridEngine
Return values
S_OKSuccessful look-up
E_POINTERAddress provided for value is invalid.
CCWFGM_WeatherGrid::GetStreamCount ( ULONG *  count)

Returns the number of weather streams associated with this weather grid.

Parameters
countNumber of streams.
See Also
ICWFGM_WeatherGrid::GetStreamCount
Return values
E_POINTERThe address provided for count is invalid.
S_OKSuccessful.
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.

Parameters
layerThreadHandle 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.
xValue on x-axis.
yValue on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
interpolate_methodInterpolation method identifier. Valid bit-flag identifiers are:
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL Boolean. When TRUE, spatial weather interpolation is turned on. This option applies to both WX and FWI values, and will work whether there is 1 or more weather stations assigned to the scenario. If FALSE, then there should only be one weather stream.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_PRECIP Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL. When TRUE, precipitation is spatially interpolated using IDW. When FALSE, precipitation from the primary weather stream is used.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_WIND Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL. When TRUE, wind is spatially interpolated (WS is defined using IDW, WD is chosen from the closest station); when FALSE, wind from the primary weather stream is used.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_TEMP_RH Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL. When TRUE, temperature, dew point temperature, and RH are calculated spatially from adiabatic lapse rates; when FALSE, values from the primary weather stream are used.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_CALCFWI Boolean. If FALSE, then the current FWI values are returned (possibly interpolated). If TRUE, then the current FWI values are calculated from the prior FWI values and the current weather values (likely spatially interpolated).
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_HISTORY Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL and CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_CALCFWI. If TRUE, then historical FWI values are calculated to try to attain equilibrium on FWI values.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_TEMPORAL Boolean. When TRUE, temporal weather interpolation is turned on, for all of the WX and hourly/instantantaneous FWI calculations.
wxWeather information.
ifwiIFWI Information.
dfwiDFWI Information.
See Also
ICWFGM_GridEngine::GetWeatherData
Return values
CWFGM_WEATHER_INITIAL_VALUES_ONLYGiven time, only initial weather values (used for starting FWI calculations) could be returned.
ERROR_INVALID_DATAInvalid latitude/longitude available for calculations.
E_INVALIDARGError in calculations (likely FWI calculations).
E_POINTERInvalid wx, ifwi, or dfwi pointers.
S_OKCalculations 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.

Parameters
layerThreadHandle 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_minMinimum value (inclusive) on x-axis.
y_minMinimum value (inclusive) on y-axis.
x_maxMaximum value (inclusive) on x-axis.
y_maxMaximum value (inclusive) on y-axis.
timeA GMT time provided as seconds since January 1st, 1600.
interpolate_methodInterpolation method identifier. Valid bit-flag identifiers are:
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL Boolean. When TRUE, spatial weather interpolation is turned on. This option applies to both WX and FWI values, and will work whether there is 1 or more weather stations assigned to the scenario. If FALSE, then there should only be one weather stream.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_PRECIP Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL. When TRUE, precipitation is spatially interpolated using IDW. When FALSE, precipitation from the primary weather stream is used.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_WIND Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL. When TRUE, wind is spatially interpolated (WS is defined using IDW, WD is chosen from the closest station); when FALSE, wind from the primary weather stream is used.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_TEMP_RH Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL. When TRUE, temperature, dew point temperature, and RH are calculated spatially from adiabatic lapse rates; when FALSE, values from the primary weather stream are used.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_CALCFWI Boolean. If FALSE, then the current FWI values are returned (possibly interpolated). If TRUE, then the current FWI values are calculated from the prior FWI values and the current weather values (likely spatially interpolated).
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_HISTORY Boolean. Conditional on CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL and CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_CALCFWI. If TRUE, then historical FWI values are calculated to try to attain equilibrium on FWI values.
  • CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_TEMPORAL Boolean. When TRUE, temporal weather interpolation is turned on, for all of the WX and hourly/instantantaneous FWI calculations.
wxArray of Weather information.
ifwiArray of Instantaneous FWI codes.
dfwiArray of Daily FWI codes.
See Also
ICWFGM_GridEngine::GetWeatherDataArray
Return values
ERROR_GRID_UNINITIALIZEDNo object in the grid layering to forward the request to.
E_INVALIDARGThe 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.

Parameters
streamWeather stream object.
indexIndex to the stream.
See Also
ICWFGM_WeatherGrid::IndexOfStream
Return values
E_POINTERThe address provided for stream or index is invalid.
S_OKSuccessful.
ERROR_WEATHER_STREAM_UNKNOWNThe 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.

Parameters
layerThreadHandle 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.
exclusiveTRUE if the requester wants a write lock, false for read/shared access
obtainTRUE 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.
See Also
ICWFGM_GridEngine::MT_Lock
Return values
SUCCESS_STATE_OBJECT_UNLOCKEDLock was released.
SUCCESS_STATE_OBJECT_LOCKED_WRITEExclusive/write lock obtained.
SUCCESS_STATE_OBJECT_LOCKED_SCENARIOA scenario successfully required a lock for purposes of simulating.
SUCCESS_STATE_OBJECT_LOCKED_READShared/read lock obtained.
S_OKSuccessful
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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.
timeA GMT time provided as seconds since January 1st, 1600.
modeCalculation mode.
See Also
ICWFGM_GridEngine::PostCalculationEvent
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
layerThreadHandle 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.
timeA GMT time provided as seconds since January 1st, 1600.
modeCalculation mode.
See Also
ICWFGM_GridEngine::PreCalculationEvent
Return values
ERROR_GRID_UNINITIALIZEDNo 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.

Parameters
newValvalue 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.

Parameters
streamReplacement value for PrimaryStream.
See Also
ICWFGM_WeatherGrid::PrimaryStream
Return values
E_POINTERThe address provided for pVal is invalid.
S_OKSuccessful.
ERROR_SCENARIO_SIMULATION_RUNNINGCannot 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.

Parameters
newValReplacement value for UserData
See Also
ICWFGM_GridEngine::UserData
Return values
S_OKSuccessful
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.

Parameters
layerThreadHandle 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.
newValPointer to new grid engine.
See Also
ICWFGM_GridEngine::PutGridEngine
Return values
E_NOINTERFACEProvided object (newVal) does not support the required ICWFGM_GridEngine interface (mis-cast)
S_OKMapping assignment between layerThread and newval was successful.
CCWFGM_WeatherGrid::RemoveStream ( ICWFGM_WeatherStream stream)

Removes an association between a weather stream and this weather grid.

Parameters
streamWeather stream object.
See Also
ICWFGM_WeatherGrid::RemoveStream
Return values
E_POINTERThe address provided for stream is invalid.
S_OKSuccessful.
ERROR_WEATHER_STREAM_UNKNOWNThe client program tries to remove a fire object that is unknown to this scenario object.
ERROR_SCENARIO_SIMULATION_RUNNINGCannot 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.

Parameters
optionThe weather option of interest. Valid options are:
  • CWFGM_WEATHER_OPTION_ADIABATIC_IDW_EXPONENT_TEMP 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL is set. IDW power for interpolating temperature and dew point values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_WS 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_WIND is set. IDW power for interpolating WS values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_PRECIP 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_PRECIP is set. IDW power for interpolating precip values.
  • CWFGM_WEATHER_OPTION_IDW_EXPONENT_FWI 64-bit floating point. Used when CWFGM_SCENARIO_OPTION_WEATHER_INTERPOLATE_SPATIAL is set. IDW power for interpolating FWI values.
valueThe value to set the option to.
See Also
ICWFGM_WeatherGrid::SetAttribute
Return values
S_OKSuccessful.
ERROR_WEATHER_OPTION_INVALIDThe weather option referred to is unknown.
E_INVALIDARGIf value's value is incorrect.
ERROR_SCENARIO_SIMULATION_RUNNINGCannot set an attribute if the simulation is running.
E_FAILFailed.
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.

Parameters
indexIndex to a weather stream
streamAddress to contain the specific requested weather stream.
See Also
ICWFGM_WeatherGrid::StreamAtIndex
Return values
E_POINTERThe address provided for stream is invalid.
S_OKSuccessful.
ERROR_WEATHER_STREAM_UNKNOWNThe 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.

Parameters
layerThreadHandle 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_timeStart time of the simulation for which valid data must be available
durationDuration of the simulation time for which valid data must be available
optionDetermines type of Valid request.
application_countOptional (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.
See Also
ICWFGM_GridEngine::Valid
Return values
S_OKSuccessful.
ERROR_GRID_UNINITIALIZEDGrid not initialized.
ERROR_SEVERITY_WARNINGGrid validation failed based on options provided.
ERROR_GRID_WEATHER_INVALID_DATESInvalid layerThread.
ERROR_WEATHER_STREAM_NOT_ASSIGNEDNo weather streams are assigned to this object.
ERROR_GRID_PRIMARY_STREAM_UNSPECIFIEDMultiple weather streams exist, but none have been identified as the primary weather stream.
ERROR_GRID_WEATHER_STATION_ALREADY_PRESENTMuliple weather streams from the same weather station exists; invalid.
ERROR_GRID_WEATHERSTATIONS_TOO_CLOSEAt least 2 weather stations are within 100m of each other
ERROR_GRID_WEATHER_INVALID_DATESAt least one weather station cannot provide weather data for the time, duration specified