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

Class CCWFGM WeatherStream. More...

#include <CWFGM_WeatherStream.h>

Collaboration diagram for CCWFGM_WeatherStream:
Collaboration graph

Public Member Functions

STDMETHOD() get_WeatherStation (ICWFGM_WeatherStation **pVal)
 
STDMETHOD() put_WeatherStation (long key, ICWFGM_WeatherStation *newVal)
 
STDMETHOD() MT_Lock (USHORT exclusive, USHORT obtain)
 
STDMETHOD() Clone (ICWFGM_WeatherStream **newWeatherStream)
 
STDMETHOD() GetAttribute (USHORT option, VARIANT *value)
 
STDMETHOD() SetAttribute (USHORT option, VARIANT value)
 
STDMETHOD() Import (const BSTR file_name, USHORT options)
 
STDMETHOD() ClearWeatherData ()
 
STDMETHOD() GetValidTimeRange (ULONGLONG *start, LONGLONG *duration)
 
STDMETHOD() GetEventTime (ULONG flags, ULONGLONG from_time, ULONGLONG *next_event)
 
STDMETHOD() MakeHourlyObservations (ULONGLONG time)
 
STDMETHOD() MakeDailyObservations (ULONGLONG time)
 
STDMETHOD() IsDailyObservations (ULONGLONG time)
 
STDMETHOD() GetDailyValues (ULONGLONG time, double *min_temp, double *max_temp, double *min_ws, double *max_ws, double *rh, double *precip, double *wd)
 
STDMETHOD() SetDailyValues (ULONGLONG time, double min_temp, double max_temp, double min_ws, double max_ws, double rh, double precip, double wd)
 
STDMETHOD() GetInstantaneousValues (ULONGLONG time, ULONG interpolation_method, IWXData *wx, IFWIData *ifwi, DFWIData *dfwi)
 
STDMETHOD() SetInstantaneousValues (ULONGLONG time, IWXData *wx)
 
STDMETHOD() get_UserData (VARIANT *pVal)
 
STDMETHOD() put_UserData (VARIANT newVal)
 
STDMETHOD() DailyStandardFFMC (ULONGLONG time, double *ffmc)
 
STDMETHOD() IsImportedFromFile (ULONGLONG time)
 
- Public Member Functions inherited from ICWFGM_WeatherStream
HRESULT put_WeatherStation ([in]long key, [in]ICWFGM_WeatherStation *newVal)
 
HRESULT MT_Lock ([in] unsigned short exclusive, [in] unsigned short obtain)
 
HRESULT Clone ([out]ICWFGM_WeatherStream **newWeatherStream)
 
HRESULT GetAttribute ([in]unsigned short option, [out, retval] VARIANT *value)
 
HRESULT SetAttribute ([in]unsigned short option, [in] VARIANT value)
 
HRESULT Import ([in]const BSTR file_name, [in]unsigned short options)
 
HRESULT GetValidTimeRange ([out]unsigned __int64 *start, [out]__int64 *duration)
 
HRESULT GetEventTime ([in] unsigned long flags, [in] unsigned __int64 from_time, [out, retval] unsigned __int64 *next_event)
 
HRESULT MakeHourlyObservations ([in]unsigned __int64 time)
 
HRESULT MakeDailyObservations ([in]unsigned __int64 time)
 
HRESULT IsDailyObservations ([in]unsigned __int64 time)
 
HRESULT GetDailyValues ([in]unsigned __int64 time, [out]double *min_temp, [out]double *max_temp, [out]double *min_ws, [out]double *max_ws, [out]double *rh, [out]double *precip, [out]double *wd)
 
HRESULT SetDailyValues ([in]unsigned __int64 time, [in]double min_temp, [in]double max_temp, [in]double min_ws, [in]double max_ws, [in]double rh, [in]double precip, [in]double wd)
 
HRESULT GetInstantaneousValues ([in]unsigned __int64 time, [in]unsigned long interpolation_method, [out]IWXData *wx, [out]IFWIData *ifwi, [out]DFWIData *dfwi)
 
HRESULT SetInstantaneousValues ([in]unsigned __int64 time, [in]IWXData *wx)
 
HRESULT IsImportedFromFile ([in] unsigned __int64 time)
 
HRESULT DailyStandardFFMC ([in]unsigned __int64 time, [out, retval]double *ffmc)
 
HRESULT ClearWeatherData ()
 

Additional Inherited Members

- Properties inherited from ICWFGM_WeatherStream
ICWFGM_WeatherStation WeatherStation [get]
 
VARIANT UserData [get, set]
 

Detailed Description

Class CCWFGM WeatherStream.

This object contains weather data for a series of consecutive days, so is such called a weather stream. It has a start time and duration, and the user can inspect and modify various daily or hourly values. Each day of weather data is complete unto itself. The user may also specify alpha, beta, and gamma for Judi Beck's diurnal weather calculations. It also supports the standard COM IPersistStream, IPersistStreamInit, and IPersistStorage interfaces. Any weather stream is automatically saved with the station in order to simplify serialization operations in the client application.

A weather stream must be associated with a weather station to be selected into a scenario.

Member Function Documentation

CCWFGM_WeatherStream::ClearWeatherData ( )

Deletes all hourly and daily weather data in the file. Does not reset start time, starting codes, etc.

See Also
ICWFGM_WeatherStream::ClearWeatherData
Return values
S_OKSuccessful
CCWFGM_WeatherStream::Clone ( ICWFGM_WeatherStream **  newWeatherStream)

Creates a new weather stream with all the same properties and data of the object being called, returns a handle to the new object in 'newWeatherStream'.

Parameters
newWeatherStreamA weather stream object.
See Also
ICWFGM_WeatherStream::Clone
Return values
E_POINTERThe address provided for "newWeatherStream" is invalid.
S_OKSuccessful.
E_OUTOFMEMORYInsufficient memory.
ERROR_SEVERITY_WARNINGUnspecified failure.
E_NOINTERFACEInternal serialization issue.
CCWFGM_WeatherStream::DailyStandardFFMC ( ULONGLONG  time,
double *  ffmc 
)

Retrieves the daily standard (Van Wagner) FFMC for the specified day. Note that other functions typically return the hourly FFMC value. Note that daily FFMC values change at noon LST, not at midnight.

Parameters
timeA GMT time provided as seconds since January 1st, 1600.
ffmcReturn value for daily FFMC.
See Also
ICWFGM_WeatherStream::DailyStandardFFMC
Return values
E_POINTERThe address provided for ffmc is invalid.
S_OKSuccessful.
ERROR_SEVERITY_WARNINGTime is invalid.
ERROR_INVALID_TIMEFFMC is invalid.
CCWFGM_WeatherStream::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_WeatherStream::UserData
Return values
E_POINTERThe address provided for pVal is invalid
S_OKSuccessful
CCWFGM_WeatherStream::get_WeatherStation ( ICWFGM_WeatherStation **  pVal)

This method is used to (only) retrieve which weather station a weather stream is associated with.

Parameters
pValA weather station object.
See Also
ICWFGM_WeatherStream::WeatherStation
Return values
E_POINTERThe address provided for pVal is invalid.
S_OKSuccessful.
ERROR_WEATHER_STREAM_NOT_ASSIGNEDThe stream is not associated with any station (pVal is set to NULL).
CCWFGM_WeatherStream::GetAttribute ( USHORT  option,
VARIANT *  value 
)

Gets the value of an "option" and saves it in the "value" variable provided.

Parameters
optionThe weather option of interest. Valid values are:
  • CWFGM_ATTRIBUTE_LOAD_WARNING BSTR. Any warnings generated by the COM object when deserializating.
  • CWFGM_WEATHER_OPTION_WARNONSUNRISE Boolean. TRUE if sunrise could not be calculated.
  • CWFGM_WEATHER_OPTION_WARNONSUNSET Boolean. TRUE if sunset could not be calculated.
  • CWFGM_WEATHER_OPTION_FFMC_VANWAGNER Boolean. Use the Van Wagner approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FFMC_HYBRID Boolean. Do not use, only for experimental purposes.
  • CWFGM_WEATHER_OPTION_FFMC_LAWSON Boolean. Use the Lawson approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FWI_USE_SPECIFIED Boolean. Use any/all FWI values provided in the input file
  • CWFGM_WEATHER_OPTION_ORIGIN_FILE Boolean. Indicates whether the weather stream data origininated from an imported file.
  • CWFGM_WEATHER_OPTION_FWI_ANY_SPECIFIED Boolean. Indicates whether at least one entry in the inputted weather file had any FWI codes specified.
  • CWFGM_WEATHER_OPTION_TEMP_ALPHA 64-bit floating point. The 'alpha' value for Beck et. al. diurnal equations for temperature.
  • CWFGM_WEATHER_OPTION_TEMP_BETA 64-bit floating point. The 'beta' value for Beck et. al. diurnal equations for temperature.
  • CWFGM_WEATHER_OPTION_TEMP_GAMMA 64-bit floating point. The 'gamma' value for Beck et. al. diurnal equations for temperature.
  • CWFGM_WEATHER_OPTION_WIND_ALPHA 64-bit floating point. The 'alpha' value for Beck et. al. diurnal equations for wind.
  • CWFGM_WEATHER_OPTION_WIND_BETA 64-bit floating point. The 'beta' value for Beck et. al. diurnal equations for wind.
  • CWFGM_WEATHER_OPTION_WIND_GAMMA 64-bit floating point. The 'gamma' value for Beck et. al. diurnal equations for wind.
  • CWFGM_WEATHER_OPTION_INITIAL_FFMC 64-bit floating point. Initial FFMC value for daily FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_HFFMC 64-bit floating point. Initial hourly FFMC value for hourly FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_DC 64-bit floating point. Initial DC value for daily FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_DMC 64-bit floating point. Initial DMC value for daily FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_BUI 64-bit floating point. Optional initial BUI value. If not provided, then BUI is calculated from the initial DC, DMC values. Use -99.0 to clear the specified value.
  • CWFGM_WEATHER_OPTION_INITIAL_RAIN 64-bit floating point. Initial rain for the prior 11/12 hours. Only needed for Van Wagner HFFMC calculations.
  • CWFGM_GRID_ATTRIBUTE_LATITUDE 64-bit floating point, radians.
  • CWFGM_GRID_ATTRIBUTE_LONGITUDE 64-bit floating point, radians.
  • CWFGM_WEATHER_OPTION_INITIAL_HFFMCTIME 64-bit signed integer. Units are in seconds. Hour at which the initial HFFMC value is observed. HFFMC values will be calculated forward and back in time from this value.
  • 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_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
valueThe value of the option.
Return values
E_POINTERThe address provided for value is invalid.
S_OKSuccessful.
ERROR_WEATHER_OPTION_INVALIDThe weather option referred to is unknown.
CCWFGM_WeatherStream::GetDailyValues ( ULONGLONG  time,
double *  min_temp,
double *  max_temp,
double *  min_ws,
double *  max_ws,
double *  rh,
double *  precip,
double *  wd 
)

Returns the daily observations for the specified day. If the day is represented as daily observations, this method returns these specified values. If the day is represented as hourly readings, then it returns values calculated from the hourly readings.

Parameters
timeTime identifying the day to inspect, provided as a count of seconds since Midnight January 1, 1600 GMT time.
min_tempReturned minimum temperature.
max_tempReturned maximum temperature.
min_wsReturned minimum windspeed.
max_wsReturned maximum windspeed.
rhReturned relative humidity.
precipReturned precipitation for the day.
wdReturned mean wind direction, provided in Cartesian radians.
See Also
ICWFGM_WeatherStream::GetDailyValues
Return values
E_POINTERThe address provided for min_temp, max_temp, min_ws, max_ws, rh, precip or wd is invalid.
S_OKSuccessful.
ERROR_SEVERITY_WARNINGThe day is not present on the weather stream.
CCWFGM_WeatherStream::GetEventTime ( ULONG  flags,
ULONGLONG  from_time,
ULONGLONG *  next_event 
)

Gets the time of the next event by searching forwards or backwards (depending on the value of "flags" parameter) and saves the value of the next event to the "next_time" variable.

Parameters
flagsTo search backwards or forwards. Valid bit-flag identifiers are:
  • CWFGM_GETEVENTTIME_FLAG_SEARCH_FORWARD search forward in time
  • CWFGM_GETEVENTTIME_FLAG_SEARCH_BACKWARD search backwards in time
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_WeatherStream::GetEventTime
Return values
ERROR_GRID_UNINITIALIZEDNo object in the grid layering to forward the request to.
S_OKSuccessful.
CCWFGM_WeatherStream::GetInstantaneousValues ( ULONGLONG  time,
ULONG  interpolation_method,
IWXData wx,
IFWIData ifwi,
DFWIData dfwi 
)

Gets the instantaneous values for Temperature, DewPointTemperature, RH, Precipitation, WindSpeed and WindDirection (and saves these values in the data structure wx). It also gets FFMC, ISI and FWI (and saves theses values in the data structure ifwi) and similarly gets the values for dFFMC, dDMC, dDC and dBUI (and saves them to the data structure dfwi).

Parameters
timeTime identifying the day and hour to inspect, provided as a count of seconds since Midnight January 1, 1600 GMT time.
interpolation_methodValid bit-flag values are:
  • 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.
wxThe data structure that stores the values for Temperature, Dew DewPointTemperature, RH, Precipitation, WindSpeed and WindDirection.
ifwiThe data structure that stores the values for FFMC, ISI and FWI.
dfwiThe data structure that stores the values for dFFMC, dDMC, dDC and dBUI.
See Also
ICWFGM_WeatherStream::GetInstantaneousValues
Return values
S_OKThis day's data was loaded from a file.
E_POINTERInvalid parameters.
ERROR_SEVERITY_WARNINGUnspecified error.
CCWFGM_WeatherStream::GetValidTimeRange ( ULONGLONG *  start,
LONGLONG *  duration 
)

Returns the start time and duration for the data stored in this weather stream object. These objects return this data in GMT, where local time is set by SetAttribute().

Parameters
startStart time for the weather stream, specified in GMT time zone, as count of seconds since Midnight January 1, 1600.
durationDuration of the weather stream, provided as a count of seconds.
See Also
ICWFGM_WeatherStream::GetValidTimeRange
Return values
E_POINTERThe address provided for start or duration is invalid.
S_OKSuccessful.
CCWFGM_WeatherStream::Import ( const BSTR  file_name,
USHORT  options 
)

Imports a weather stream with hourly data or daily data depending on the file. For importing a weather stream with hourly data the file must be of a specific format. The first line contains the header determining the file layout. Necessary columns will be identified as

  • "hour" (synonyms are "Time(CST)")
  • "temp" (synonyms are "temperature", "temp(celsius)")
  • "rh" (synonyms are "relative_humidity")
  • "wd" (synonyms are "dir(degrees)", "dir", "wind_direction")
  • "ws" (synonyms are "wspd", "wind_speed", "spd(kph)")
  • "precip" (synonyms are "rain", "precipitation", "raintot", "rn_1", "rn24").

Optional columns will be identified as

  • "ffmc" (synonyms are "hffmc", "ffmc(h)")
  • "dmc"
  • "dc"
  • "bui"
  • "isi" (synonyms are "hisi", "isi(h)")
  • "fwi" (synonyms are "hfwi", "fwi(h)").

It is advised to contact the support team or visit the web site for an example file.

For importing a weather stream with daily data the file must be of a specific format. The first line contains the header determining the file layout. Column headers may be

  • "min_temp"
  • "max_temp"
  • "rh" (synonyms are "min_rh", "relative_humidity")
  • "wd" (synonyms are "dir(degrees)", "dir", "wind_direction")
  • "min_ws"
  • "max_ws"
  • "precip" (synonyms are "rain", "precipitation", "raintot", "rn_1", "rn24").

It is advised to contact the support team or visit the web site for an example file.

Parameters
file_namePath/file of weather stream data.
optionsDetermines rules for (re)importing data. Valid options are:
  • 0 Only valid for importing data into a weather stream with no data.
  • CWFGM_WEATHERSTREAM_IMPORT_PURGE When there is existing data in the weather stream, this option removes this data before performing the import.
  • CWFGM_WEATHERSTREAM_IMPORT_SUPPORT_APPEND When there is existing data in the weather stream, this option will append data to the existing data. Times must be valid.
  • CWFGM_WEATHERSTREAM_IMPORT_SUPPORT_OVERWRITE When there is existing data in the weather stream, this option will conditionally overwrite existing data, depending on times.
  • CWFGM_WEATHERSTREAM_IMPORT_PURGE is mutually exclusive to the other two options. No option supports prepending data. Options are ignored when the weather stream has no existing data in it.
See Also
ICWFGM_WeatherStream::Import
Return values
S_OKSuccessful.
E_INVALIDARGInvalid options.
ERROR_FILE_NOT_FOUNDFile cannot be found in the filesystem.
ERROR_READ_FAULTThe file format is unrecognized, or there is an error in the file format.
ERROR_ACCESS_DENIEDFile cannot be opened.
ERROR_SEVERITY_WARNINGFile cannot be found in the filesystem.
ERROR_READ_FAULT| ERROR_SEVERITY_WARNING Cannot read any data from the file.
ERROR_BAD_FILE_TYPE| ERROR_SEVERITY_WARNING The file format is unrecognized, or there is an error in the file format.
ERROR_INVALID_DATA| ERROR_SEVERITY_WARNING Data in the file is out of range.
ERROR_INVALID_TIME| ERROR_SEVERITY_WARNING Time sequence is invalid (out of order or missing entries, etc.).
ERROR_SEVERITY_WARNINGFile cannot be opened.
ERROR_SCENARIO_SIMULATION_RUNNINGThe weather stream data cannot be imported while a scenario simulation is still running.
ERROR_INVALID_HANDLEGeneric file I/O error.
ERROR_FILE_EXISTSThe file does not exist.
ERROR_INVALID_PARAMETER
ERROR_TOO_MANY_OPEN_FILESToo many files are open.
ERROR_HANDLE_DISK_FULLDisk full
CCWFGM_WeatherStream::IsDailyObservations ( ULONGLONG  time)

Returns the representation of a given day.

Parameters
timeTime identifying the day to inspect, provided as a count of seconds since Midnight January 1, 1600 GMT time.
See Also
ICWFGM_WeatherStream::IsDailyObservations
Return values
S_OKThe day is represented using daily observations.
ERROR_NOT_ENOUGH_MEMORYThe day is not present in the data stream.
ERROR_INVALID_TIMEThe day is not present in the data stream.
ERROR_SEVERITY_WARNINGThe day is represented using hourly readings.
CCWFGM_WeatherStream::IsImportedFromFile ( ULONGLONG  time)

Retrieves information regarding whether a particular day's data was loaded from a file.

Parameters
timeTime identifying the day and hour to inspect, provided as a count of seconds since Midnight January 1, 1600 GMT time.
See Also
ICWFGM_WeatherStream::IsImportedFromFile
Return values
S_OKThis day's data was loaded from a file.
ERROR_SEVERITY_WARNINGTime is invalid.
ERROR_INVALID_TIMETime is invalid.
CCWFGM_WeatherStream::MakeDailyObservations ( ULONGLONG  time)

There are two basic formats supported by this weather stream object: a day's values can be specified as hourly conditions or daily observations. If hourly conditions are provided, then daily observations are subsequently calculated. If the day's values are already specified as daily observations, then there is no change. This method may also append a preceding or following day to existing data.

Parameters
timeTime identifying the day to modify, provided as a count of seconds since Midnight January 1, 1600 GMT time.
See Also
ICWFGM_WeatherStream::MakeDailyObservations
Return values
S_OKSuccessful.
ERROR_SEVERITY_WARNINGThe operation failed (usually because the requested day is not present or adjacent to existing data).
ERROR_SCENARIO_SIMULATION_RUNNINGChanges cannot be made if the simulation is running.
CCWFGM_WeatherStream::MakeHourlyObservations ( ULONGLONG  time)

There are two basic formats supported by this weather stream object: a day's values can be specified as hourly conditions or daily observations. If daily observations are provided, then hourly conditions are subsequently calculated. If the day's values are already specified as hourly conditions, then there is no change. This method may also append a preceding or following day to existing data.

Parameters
timeTime identifying the day to modify, provided as a count of seconds since Midnight January 1, 1600 GMT time.
See Also
ICWFGM_WeatherStream::MakeHourlyObservations
Return values
S_OKSuccessful.
ERROR_SEVERITY_WARNINGThe operation failed (usually because the requested day is not present or adjacent to existing data).
ERROR_SCENARIO_SIMULATION_RUNNINGChanges cannot be made if the simulation is running.
CCWFGM_WeatherStream::MT_Lock ( 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.

Locking request is forwarded to the attached ICWFGM_WeatherStation object.

In the event of an error, then locking is undone to reflect an error state.

Parameters
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_WeatherStream::MT_Lock
ICWFGM_WeatherStation::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
CCWFGM_WeatherStream::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_WeatherStream::UserData
Return values
S_OKSuccessful
CCWFGM_WeatherStream::put_WeatherStation ( long  key,
ICWFGM_WeatherStation newVal 
)

This method is a private method to only be called by a weather station or a weather grid. It is used to build associations between these objects.

Parameters
keyInternal value.
newValInternal value.
See Also
ICWFGM_WeatherStream::WeatherStation
Return values
E_NOINTERFACEThis is returned if the 'put' method should not be called directly or if any of the parameters are invalid.
ERROR_SCENARIO_SIMULATION_RUNNINGAssociation could not be built as the simulation is currently running.
ERROR_WEATHER_STREAM_ALREADY_ASSIGNEDAssociation already exists.
S_OKSuccessful.
CCWFGM_WeatherStream::SetAttribute ( USHORT  option,
VARIANT  value 
)

Sets the value of an "option" to the value of the "value" variable provided. It is important to set the starting codes of the weather stream before importing the weather data. Changing the starting codes after importing mean Prometheus will recalculate everything.

Parameters
optionThe weather option of interest. Valid values are:
  • CWFGM_WEATHER_OPTION_FFMC_VANWAGNER Boolean. Use the Van Wagner approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FFMC_HYBRID Boolean. Do not use, only for experimental purposes.
  • CWFGM_WEATHER_OPTION_FFMC_LAWSON Boolean. Use the Lawson approach to calculating HFFMC values
  • CWFGM_WEATHER_OPTION_FWI_USE_SPECIFIED Boolean. Use any/all FWI values provided in the input file
  • CWFGM_WEATHER_OPTION_TEMP_ALPHA 64-bit floating point. The 'alpha' value for Beck et. al. diurnal equations for temperature.
  • CWFGM_WEATHER_OPTION_TEMP_BETA 64-bit floating point. The 'beta' value for Beck et. al. diurnal equations for temperature.
  • CWFGM_WEATHER_OPTION_TEMP_GAMMA 64-bit floating point. The 'gamma' value for Beck et. al. diurnal equations for temperature.
  • CWFGM_WEATHER_OPTION_WIND_ALPHA 64-bit floating point. The 'alpha' value for Beck et. al. diurnal equations for wind.
  • CWFGM_WEATHER_OPTION_WIND_BETA 64-bit floating point. The 'beta' value for Beck et. al. diurnal equations for wind.
  • CWFGM_WEATHER_OPTION_WIND_GAMMA 64-bit floating point. The 'gamma' value for Beck et. al. diurnal equations for wind.
  • CWFGM_WEATHER_OPTION_INITIAL_FFMC 64-bit floating point. Initial FFMC value for daily FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_HFFMC 64-bit floating point. Initial hourly FFMC value for hourly FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_DC 64-bit floating point. Initial DC value for daily FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_DMC 64-bit floating point. Initial DMC value for daily FWI calculations.
  • CWFGM_WEATHER_OPTION_INITIAL_BUI 64-bit floating point. Optional initial BUI value. If not provided, then BUI is calculated from the initial DC, DMC values. Use -99.0 to clear the specified value.
  • CWFGM_WEATHER_OPTION_INITIAL_RAIN 64-bit floating point. Initial rain for the prior 11/12 hours. Only needed for Van Wagner HFFMC calculations.
  • CWFGM_GRID_ATTRIBUTE_LATITUDE 64-bit floating point, radians.
  • CWFGM_GRID_ATTRIBUTE_LONGITUDE 64-bit floating point, radians.
  • CWFGM_WEATHER_OPTION_INITIAL_HFFMCTIME 64-bit signed integer. Units are in seconds. Hour at which the initial HFFMC value is observed. HFFMC values will be calculated forward and back in time from this value.
  • 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_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
valueThe value to set the option to.
See Also
ICWFGM_WeatherStream::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_WeatherStream::SetDailyValues ( ULONGLONG  time,
double  min_temp,
double  max_temp,
double  min_ws,
double  max_ws,
double  rh,
double  precip,
double  wd 
)

Sets the daily observations for the specified day. If the day is represented as hourly readings, then this method will fail.

Parameters
timeTime identifying the day to set, provided as a count of seconds since Midnight January 1, 1600 GMT time.
min_tempMinimum temperature.
max_tempMaximum temperature.
min_wsMinimum windspeed.
max_wsMaximum windspeed.
rhRelative humidity.
precipDaily precipitation.
wdMean wind direction.
See Also
ICWFGM_WeatherStream::SetDailyValues
Return values
S_OKSuccessful.
ERROR_SEVERITY_WARNINGThe day is not present in the weather stream, or the day is represented as hourly observations.
ERROR_SCENARIO_SIMULATION_RUNNINGCannot set daily values while the simulation is running.
CCWFGM_WeatherStream::SetInstantaneousValues ( ULONGLONG  time,
IWXData wx 
)

Sets the instantaneous values for Temperature, DewPointTemperature, RH, Precipitation, WindSpeed and WindDirection via the IWXData data structure.

Parameters
timeTime identifying the day and hour to inspect, provided as a count of seconds since Midnight January 1, 1600 GMT time.
wxThe data structure that stores the values for Temperature, Dew DewPointTemperature, RH, Precipitation, WindSpeed and WindDirection.
See Also
ICWFGM_WeatherStream::SetInstantaneousValues
Return values
S_OKThis day's data was has been stored.
E_POINTERInvalid parameters.
ERROR_SEVERITY_WARNINGThe day is not present in the weather stream, or the day is represented as daily observations.
ERROR_SCENARIO_SIMULATION_RUNNINGCannot set values if the scenario simulation is running.