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

Interface ICWFGM WindDirectionGrid. More...

import "WeatherCom.idl";

Collaboration diagram for ICWFGM_WindDirectionGrid:
Collaboration graph

Public Member Functions

HRESULT Clone ([out]ICWFGM_WindDirectionGrid **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)
 

Detailed Description

Interface ICWFGM WindDirectionGrid.

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

ICWFGM_WindDirectionGrid::AddSector ( [in] const BSTR  sector_name,
[in, out] double *  min_angle,
[in, out] double *  max_angle,
[out, retval] 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.
ICWFGM_WindDirectionGrid::Clone ( [out] ICWFGM_WindDirectionGrid **  newFilter)

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

Parameters
newFilterA wind direction grid object.
ICWFGM_WindDirectionGrid::Export ( [in] const unsigned short  sector,
[in] const double  speed,
[in] const BSTR  prj_file_name,
[in] const BSTR  grid_file_name 
)

Exports a Wind Direction Grid from a specific sector. Specification of the output projection file name is optional.

Parameters
sectorIndex of sector.
prj_file_nameProjection File name
grid_file_nameGrid File name
ICWFGM_WindDirectionGrid::GetAttribute ( [in] unsigned short  option,
[out, retval] 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.
ICWFGM_WindDirectionGrid::GetCount ( [in] const unsigned short  sector,
[out, retval] unsigned short *  count 
)

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

Parameters
sectorIndex of sector.
countNumber of wind speed ranges.
ICWFGM_WindDirectionGrid::GetFilenames ( [in] const unsigned short  sector,
[out] SAFEARRAY(BSTR)*  filenames 
)

Gets filename for the grid loaded into the specified wind direction sector.

Parameters
sectorIndex of sector.
filenamesArray of File names for given sector
ICWFGM_WindDirectionGrid::GetSector ( [in] unsigned short  option,
[in,out] double *  angle,
[in,out] unsigned short *  sector,
[out] BSTR *  sector_name 
)

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
ICWFGM_WindDirectionGrid::GetSectorAngles ( [in] const unsigned short  sector,
[out] double *  min_angle,
[out] 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
ICWFGM_WindDirectionGrid::GetSectorCount ( [out, retval] unsigned short *  count)

Gets the number of sectors in this grid object.

Parameters
countReturns the number of sectors for the filter
ICWFGM_WindDirectionGrid::GetWindSpeeds ( [in] const unsigned short  sector,
[out] unsigned short *  count,
[in,out] SAFEARRAY(double)*  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
ICWFGM_WindDirectionGrid::Import ( [in] const unsigned short  sector,
[in] const double  speed,
[in] const BSTR  prj_file_name,
[in] const BSTR  grid_file_name 
)

Imports a Wind Direction Grid to a specific sector. If the import projection file is unspecified, then it is assumed to match the projection for the associated main ICWFGM_GridEngine object.

Parameters
sectorSector value. If sector is (unsigned short) -1, then the file is loaded into the default sector.
speedWind speed value (kph) used to generate the grid
prj_file_nameProjection File name
grid_file_nameName of file to import.
ICWFGM_WindDirectionGrid::ImportFrom ( [in] 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
ICWFGM_WindDirectionGrid::ModifySectorSet ( [in] SAFEARRAY(WeatherGridSetModifier set_modifier)

Updates the wind direction ranges in the grid.

Parameters
set_modifierA list of grid values to modify.
ICWFGM_WindDirectionGrid::Remove ( [in] const unsigned short  sector,
[in] const double  speed 
)

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

Parameters
sectorIndex of sector.
speedSpeed value (kph)
ICWFGM_WindDirectionGrid::RemoveSector ( [in] const unsigned short  sector)

Removes sector from filter

Parameters
sectorIndex of sector.
ICWFGM_WindDirectionGrid::SetAttribute ( [in] unsigned short  option,
[in] 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.
valueThe value to set the option to.