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

Class ICWFGM WindSpeedGrid. More...

#include <CWFGM_WindSpeedGrid.h>

Collaboration diagram for CCWFGM_WindSpeedGrid:
Collaboration graph

Public Member Functions

STDMETHOD() Clone (ICWFGM_WindSpeedGrid **newGrid)
 
STDMETHOD() Import (const unsigned short sector, const double speed, const BSTR prj_file_name, const BSTR grid_file_name)
 
STDMETHOD() Export (const unsigned short sector, const double speed, const BSTR prj_file_name, const BSTR grid_file_name)
 
STDMETHOD() Remove (const unsigned short sector, const double speed)
 
STDMETHOD() GetAttribute (USHORT option, VARIANT *value)
 
STDMETHOD() SetAttribute (unsigned short option, VARIANT value)
 
STDMETHOD() GetCount (const unsigned short sector, unsigned short *count)
 
STDMETHOD() GetWindSpeeds (const unsigned short sector, unsigned short *count, SAFEARRAY **speed_array)
 
STDMETHOD() GetFilenames (const unsigned short sector, SAFEARRAY **filenames)
 
STDMETHOD() GetSectorCount (unsigned short *count)
 
STDMETHOD() GetSectorAngles (const unsigned short sector, double *min_angle, double *max_angle)
 
STDMETHOD() AddSector (const BSTR sector_name, double *min_angle, double *max_angle, unsigned short *index)
 
STDMETHOD() RemoveSector (const unsigned short sector)
 
STDMETHOD() GetSector (USHORT option, double *angle, unsigned short *sector, BSTR *sector_name)
 
STDMETHOD() ImportFrom (ICWFGM_WeatherGridFilter *filter)
 
STDMETHOD() ModifySectorSet (SAFEARRAY *set_modifier)
 
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() 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() GetAttributeData (__int64 layerThread, USHORT _x, USHORT _y, ULONGLONG time, USHORT option, VARIANT *attribute)
 
STDMETHOD() GetWeatherData (__int64 layerThread, USHORT x, USHORT y, ULONGLONG time, ULONG interpolate_method, IWXData *wx, IFWIData *ifwi, DFWIData *dfwi)
 
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)
 
- Public Member Functions inherited from ICWFGM_WindSpeedGrid
HRESULT Clone ([out]ICWFGM_WindSpeedGrid **newGrid)
 
HRESULT Import ([in]const unsigned short sector, [in]const double speed, [in] const BSTR prj_file_name, [in]const BSTR grid_file_name)
 
HRESULT Export ([in]const unsigned short sector, [in]const double speed, [in] const BSTR prj_file_name, [in]const BSTR grid_file_name)
 
HRESULT Remove ([in]const unsigned short sector, [in]const double speed)
 
HRESULT GetAttribute ([in]unsigned short option, [out, retval]VARIANT *value)
 
HRESULT SetAttribute ([in]unsigned short option, [in]VARIANT value)
 
HRESULT GetCount ([in]const unsigned short sector, [out, retval]unsigned short *count)
 
HRESULT GetWindSpeeds ([in]const unsigned short sector, [out]unsigned short *count, [in, out]SAFEARRAY(double)*speed_array)
 
HRESULT GetFilenames ([in]const unsigned short sector, [out]SAFEARRAY(BSTR)*filenames)
 
HRESULT GetSectorCount ([out, retval]unsigned short *count)
 
HRESULT GetSectorAngles ([in]const unsigned short sector, [out]double *min_angle, [out]double *max_angle)
 
HRESULT AddSector ([in]const BSTR sector_name, [in, out]double *min_angle, [in, out]double *max_angle, [out, retval]unsigned short *index)
 
HRESULT RemoveSector ([in]const unsigned short sector)
 
HRESULT GetSector ([in]unsigned short option, [in, out]double *angle, [in, out]unsigned short *sector, [out]BSTR *sector_name)
 
HRESULT ImportFrom ([in]ICWFGM_WeatherGridFilter *filter)
 
HRESULT ModifySectorSet ([in]SAFEARRAY(WeatherGridSetModifier) set_modifier)
 
- 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_GridEngine
ICWFGM_LayerManager LayerManager [get, set]
 
VARIANT UserData [get, set]
 

Detailed Description

Class ICWFGM WindSpeedGrid.

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 wind speed grids for use in a simulation. It can be configured to handle any number of different arcs (sectors) representing different wind directions that can be encountered. Then, any number of these sectors can have wind speed grid information loaded into it, to be applied when specific input wind speeds are encountered. This object is unconcerned about how other weather data has been provided: if times and other input data are valid, then this object will apply the updated wind speed data according to the defined rules.

This object will also update any FWI calculations required based on options and input values.

No weather streams or weather stations are associated with this object since it simply updates and replaces wind speed values based on the grid rules.

Member Function Documentation

CCWFGM_WindSpeedGrid::AddSector ( const BSTR  sector_name,
double *  min_angle,
double *  max_angle,
unsigned short *  index 
)

Adds a sector to filter. The logic applied for determining the correct sector is >= min_angle, and < max_angle. When max_angle < min_angle, it is assumed to cross 0 degrees (north) in compass rotation. A sector must be at least 1 degree wide.

Parameters
sector_nameSector Name value, only used by the client application.
min_angleMinimum sector angle value, compass degress
max_angleMaximum sector angle value, compass degrees
indexIndex of new sector.
See Also
ICWFGM_WindSpeedGrid::AddSector
Return values
S_OKSuccessful.
ERROR_DATA_NOT_UNIQUEData provided not unique
ERROR_SECTOR_TOO_SMALLSector value too small
ERROR_NAME_NOT_UNIQUEName provided not unique
E_POINTERInvalid pointer.
CCWFGM_WindSpeedGrid::Clone ( ICWFGM_WindSpeedGrid **  newGrid)

Creates a new wind speed grid with all the same properties and data of the object being called, returns a handle to the new object in 'newGrid'. No data is shared between these two objects, an exact copy (including of all loaded wind speed grid data) is created.

Parameters
newGridA wind speed grid object.
See Also
ICWFGM_WindSpeedGrid::Clone
Return values
E_POINTERThe address provided for "newFilter" is invalid.
S_OKSuccessful.
E_OUTOFMEMORYInsufficient memory.
ERROR_SEVERITY_WARNINGUnspecified failure.
E_NOINTERFACEInternal serialization issue.
CCWFGM_WindSpeedGrid::Export ( const unsigned short  sector,
const double  speed,
const BSTR  prj_file_name,
const BSTR  grid_file_name 
)

Exports a Wind Speed Grid from a specific sector, for a specific speed. Specification of the output projection file name is optional.

Parameters
sectorIndex of sector.
speedWind speed value (kph)
prj_file_nameProjection File name
grid_file_nameGrid File name
See Also
ICWFGM_WindSpeedGrid::Export
Return values
S_OKSuccessful.
ERROR_GRID_SIZE_INCORRECTIncorrect grid size.
E_POINTERError
ERROR_GRID_UNINITIALIZEDGrid uninitialized.
ERROR_SCENARIO_SIMULATION_RUNNINGScenario simulation running.
CCWFGM_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::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_START_TIME 64-bit unsigned integer. GMT time provided as seconds since Midnight January 1, 1600
  • CWFGM_WEATHER_OPTION_END_TIME 64-bit unsigned integer. GMT time provided as seconds since Midnight January 1, 1600
  • CWFGM_WEATHER_OPTION_START_TIMESPAN 64-bit signed integer. Units are in seconds. Specifies the start of the diurnal application period for this weather object.
  • CWFGM_WEATHER_OPTION_END_TIMESPAN 64-bit signed integer. Units are in seconds. Specifies the start of the diurnal application period for this weather object.
  • CWFGM_GRID_ATTRIBUTE_TIMEZONE 64-bit signed integer. Units are in seconds, relative to GMT. For example, MST (Mountain Standard Time) would be -6 * 60 * 60 seconds. Valid values are from -12 hours to +12 hours.
  • CWFGM_GRID_ATTRIBUTE_DAYLIGHT_SAVINGS 64-bit signed integer. Units are in seconds. Amount of correction to apply for daylight savings time.
  • CWFGM_GRID_ATTRIBUTE_DST_START 64-bit unsigned integer. Units are in seconds. Julian date determining when daylight savings starts within the calendar year.
  • CWFGM_GRID_ATTRIBUTE_DST_END 64-bit unsigned integer. Units are in seconds. Julian date determining when daylight savings ends within the calendar year.
  • CWFGM_WEATHER_GRID_APPLY_FILE_SECTORS Boolean. Determines whether to use per-sector data.
  • CWFGM_WEATHER_GRID_APPLY_FILE_DEFAULT Boolean. Determines whether to use default (shared among all data). If CWFGM_WEATHER_GRID_APPLY_FILE_SECTORS is true, then per-sector data will conditionally override this default data.
  • CWFGM_ATTRIBUTE_LOAD_WARNING BSTR. Any warnings generated by the COM object when deserializating.
valueLocation for the retrieved value to be placed.
See Also
ICWFGM_GridEngine::GetAttribute(unsigned short, VARIANT *)
Return values
E_POINTERvalue is NULL
E_INVALIDARGunknown requested option
S_OKSuccess
CCWFGM_WindSpeedGrid::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_START_TIME 64-bit unsigned integer. GMT time provided as seconds since Midnight January 1, 1600
  • CWFGM_WEATHER_OPTION_END_TIME 64-bit unsigned integer. GMT time provided as seconds since Midnight January 1, 1600
  • CWFGM_WEATHER_OPTION_START_TIMESPAN 64-bit signed integer. Units are in seconds. Specifies the start of the diurnal application period for this weather object.
  • CWFGM_WEATHER_OPTION_END_TIMESPAN 64-bit signed integer. Units are in seconds. Specifies the start of the diurnal application period for this weather object.
  • CWFGM_GRID_ATTRIBUTE_TIMEZONE 64-bit signed integer. Units are in seconds, relative to GMT. For example, MST (Mountain Standard Time) would be -6 * 60 * 60 seconds. Valid values are from -12 hours to +12 hours.
  • CWFGM_GRID_ATTRIBUTE_DAYLIGHT_SAVINGS 64-bit signed integer. Units are in seconds. Amount of correction to apply for daylight savings time.
  • CWFGM_GRID_ATTRIBUTE_DST_START 64-bit unsigned integer. Units are in seconds. Julian date determining when daylight savings starts within the calendar year.
  • CWFGM_GRID_ATTRIBUTE_DST_END 64-bit unsigned integer. Units are in seconds. Julian date determining when daylight savings ends within the calendar year.
  • CWFGM_WEATHER_GRID_APPLY_FILE_SECTORS Boolean. Determines whether to use per-sector data.
  • CWFGM_WEATHER_GRID_APPLY_FILE_DEFAULT Boolean. Determines whether to use default (shared among all data). If CWFGM_WEATHER_GRID_APPLY_FILE_SECTORS is true, then per-sector data will conditionally override this default data.
  • CWFGM_ATTRIBUTE_LOAD_WARNING BSTR. Any warnings generated by the COM object when deserializating.
valueLocation for the retrieved value to be placed.
See Also
ICWFGM_GridEngine::GetAttribute(__int64, unsigned short, VARIANT *)
Return values
E_POINTERvalue is NULL
ERROR_GRID_UNINITIALIZEDNo object in the grid layering to forward the request to.
S_OKSuccess
CCWFGM_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::GetCount ( const unsigned short  sector,
unsigned short *  count 
)

Returns the number of grid files loaded into the specified sector.

Parameters
sectorIndex of sector.
countNumber of wind speed ranges.
See Also
ICWFGM_WindSpeedGrid::GetCount
Return values
S_OKSuccessful.
ERROR_SECTION_INVALID_INDEXInvalid section value error
E_POINTERInvalid pointer
CCWFGM_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::GetEventTime ( __int64  layerThread,
ULONG  flags,
ULONGLONG  from_time,
ULONGLONG *  next_event 
)

This method will examine start and end dates and diurnal periods to determine the time at which the next event for known 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_WindSpeedGrid::GetFilenames ( const unsigned short  sector,
SAFEARRAY **  filenames 
)

Returns an array of filenames for specified wind speed sector

Parameters
sectorIndex of sector.
filenamesFile names for sector
See Also
ICWFGM_WindSpeedGrid::GetFilenames
Return values
S_OKSuccessful.
ERROR_SECTOR_INVALID_INDEXInvalid sector index.
CCWFGM_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::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::GetFuelIndexData
Return values
ERROR_GRID_UNINITIALIZEDNo object in the grid layering to forward the request to.
CCWFGM_WindSpeedGrid::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_WindSpeedGrid::GetSector ( USHORT  option,
double *  angle,
unsigned short *  sector,
BSTR *  sector_name 
)

Gets the details of a sector of the grid. If option is CWFGM_WINDGRID_BYINDEX, this method populates angle[0], angle[1], and sector_name, with the minimum angle, maximum angle, and name assigned to this sector, respectively. If option is CWFGM_WINDGRID_BYANGLE, this method populates sector and sector_name with the index of, and name assigned, to sector. If option is any other value, no action is taken and the method return S_FALSE.

Gets the details of a sector of the grid. This function has two modes: If option is CWFGM_WINDGRID_BYINDEX, then this method keys off '*sector' and populates angle[0], angle[1], and sector_name, with the minimum angle, maximum angle, and name assigned to this sector, respectively.
If option is CWFGM_WINDGRID_BYANGLE, then this method keys off '*angle' and populates sector and sector_name with the index of, and name assigned, to sector.

Parameters
optionOption value
angleAngle value
sectorIndex of sector.
sector_nameSector name
See Also
ICWFGM_WindSpeedGrid::GetSector
Return values
S_OKSuccessful.
ERROR_INVALID_INDEXError invalid index in 'sector'.
ERROR_INVALID_DATAError invalid data in 'angle' - no sector exists which contains 'angle'.
E_INVALIDARGUnknown option.
CCWFGM_WindSpeedGrid::GetSectorAngles ( const unsigned short  sector,
double *  min_angle,
double *  max_angle 
)

Get the minimum and maximum sector angles for a specific sector. The logic applied for determining the correct sector is >= min_angle, and < max_angle. When max_angle < min_angle, it is assumed to cross 0 degrees.

Parameters
sectorIndex of sector.
min_angleMinimum sector angle value, compass degrees
max_angleMaximum sector angle value, compass degrees
See Also
ICWFGM_WindSpeedGrid::GetSectorAngles
Return values
S_OKSuccessful.
ERROR_SECTOR_INVALID_INDEXInvalid Sector Index.
CCWFGM_WindSpeedGrid::GetSectorCount ( unsigned short *  count)

Returns number of sectors which exist.

Parameters
countStores the number of sectors for the filter
See Also
ICWFGM_WindSpeedGrid::GetSectorCount
Return values
S_OKSuccessful.
CCWFGM_WindSpeedGrid::GetWeatherData ( __int64  layerThread,
USHORT  x,
USHORT  y,
ULONGLONG  time,
ULONG  interpolate_method,
IWXData wx,
IFWIData ifwi,
DFWIData dfwi 
)

This object conditionally updates weather at location (x, y) at time 'time'. 'interpolate_method' determines various rules for how FWI calculations take place: if FWI calculations are being recursively calculated back in time, 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_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
CCWFGM_WindSpeedGrid::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 conditionally updates weather at the specified location for storage in the provided array(s) at time 'time'. 'interpolate_method' determines various rules for how FWI calculations take place: if FWI calculations are being recursively calculated back in time, 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_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_WindSpeedGrid::GetWindSpeeds ( const unsigned short  sector,
unsigned short *  count,
SAFEARRAY **  speed_array 
)

Returns the wind speeds for all grid files loaded into the specified sector.

Parameters
sectorIndex of sector.
countReturns number of elements stored in speed_array
speed_array2D Speed data for sectors
See Also
ICWFGM_WindSpeedGrid::GetWindSpeeds
Return values
S_OKSuccessful.
E_POINTERInvalid pointer
E_INVALIDARGInvalid argument
ERROR_SECTION_INVALID_INDEXInvalid section index error
CCWFGM_WindSpeedGrid::Import ( const unsigned short  sector,
const double  speed,
const BSTR  prj_file_name,
const BSTR  grid_file_name 
)

Imports a Wind Speed Grid to a specific sector and assigned applicable speed ranges. If the import projection file is unspecified, then it is assumed to match the projection for the associated main ICWFGM_GridEngine object.

Parameters
sectorIndex of sector.
speedWind speed value (kph)
prj_file_nameProjection File name
grid_file_nameGrid File name
See Also
ICWFGM_WindSpeedGrid::Import
Return values
S_OKSuccessful.
ERROR_GRID_SIZE_INCORRECTIncorrect grid size.
E_POINTERError
ERROR_GRID_UNINITIALIZEDGrid uninitialized.
ERROR_SCENARIO_SIMULATION_RUNNINGScenario simulation running.
ERROR_SEVERITY_WARNINGFailed initialization or a non-specific I/O error. Wind speed values are limited to 250kph.
CCWFGM_WindSpeedGrid::ImportFrom ( ICWFGM_WeatherGridFilter filter)

Imports from an existing filter. This function only exists to support legacy FGM files and should not be called directly by any client code.

Parameters
filterWeather grid filter to import from
Return values
S_OKSuccessful.
E_POINTERInvalid pointer.
CCWFGM_WindSpeedGrid::ModifySectorSet ( SAFEARRAY *  set_modifier)

Updates the wind direction ranges in the grid.

Parameters
set_modifierA list of grid values to modify.
CCWFGM_WindSpeedGrid::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 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_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::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_WindSpeedGrid::Remove ( const unsigned short  sector,
const double  speed 
)

Remove a loaded grid applicable to a given speed from the specified sector.

Parameters
sectorIndex of sector.
speedSpeed value (kph)
See Also
ICWFGM_WindSpeedGrid::Remove
Return values
S_OKSuccessful.
ERROR_SECTOR_INVALID_INDEXInvalid sector index error
ERROR_SPEED_OUT_OF_RANGESpeed out of range error
CCWFGM_WindSpeedGrid::RemoveSector ( const unsigned short  sector)

Removes sector from filter

Parameters
sectorIndex of sector.
See Also
ICWFGM_WindSpeedGrid::RemoveSector
Return values
S_OK
ERROR_SECTOR_INVALID_INDEXInvalid sector index.
CCWFGM_WindSpeedGrid::SetAttribute ( unsigned short  option,
VARIANT  value 
)

Sets the value of an "option" to the value of the "value" variable provided.

Parameters
optionThe weather option of interest. Valid options are:
  • CWFGM_WEATHER_OPTION_START_TIME 64-bit unsigned integer. GMT time provided as seconds since Midnight January 1, 1600
  • CWFGM_WEATHER_OPTION_END_TIME 64-bit unsigned integer. GMT time provided as seconds since Midnight January 1, 1600
  • CWFGM_WEATHER_OPTION_START_TIMESPAN 64-bit signed integer. Units are in seconds. Specifies the start of the diurnal application period for this weather object.
  • CWFGM_WEATHER_OPTION_END_TIMESPAN 64-bit signed integer. Units are in seconds. Specifies the start of the diurnal application period for this weather object.
  • CWFGM_WEATHER_GRID_APPLY_FILE_SECTORS Boolean. Determines whether to use per-sector data.
  • CWFGM_WEATHER_GRID_APPLY_FILE_DEFAULT Boolean. Determines whether to use default (shared among all data). If CWFGM_WEATHER_GRID_APPLY_FILE_SECTORS is true, then per-sector data will conditionally override this default data.
valueValue of attribute
See Also
ICWFGM_WindSpeedGrid::SetAttribute
Return values
S_OKSuccessful.
E_INVALIDARGInvalid argument
E_POINTERInvalid pointer
CCWFGM_WindSpeedGrid::Valid ( __int64  layerThread,
ULONGLONG  start_time,
LONGLONG  duration,
ULONG  option,
SAFEARRAY **  application_count 
)

This method validates weather grid based on its start time, duration, and other properties. It 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.
start_timeStart time of grid data
durationDuration of observational data in grid
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_SEVERITY_WARNINGGrid validation failed based on options provided.
ERROR_GRID_WEATHER_NOT_IMPLEMENTEDInvalid grid.