WXP::ForeTime Class Reference

This class defines forecast time parameters. More...

#include "../include/ForeTime.h"

List of all members.

Public Member Functions

 ForeTime ()
 ForeTime (int t, int t1, int t2)
 ForeTime (int t)
 ForeTime (const char *str)
int init ()
bool isSet ()
int decode (const char *str)
int toString (String &str)
float getFore ()
float getHour ()
int getSecs ()
int toTimeLabelDay (String &str)
int toTimeLabel (String &str)
int toVarLabel (String &str)
int set (int t, float t1, float t2)
int set (int t, int u, float t1, float t2)
int set (int val)
int set (const char *str)
int setEnd (DateVal &dv)
int getType ()
float getTim1 ()
float getTim2 ()
DateVal getEnd ()
bool validEnd ()
bool valid ()
int toCode ()
int print ()

Static Public Attributes

static const int NONE = -9999
static const int FORE = 0
static const int ANAL = 1
static const int RNG = 2
static const int AVG = 3
static const int ACC = 4
static const int DIFF = 5
static const int MAX = 6
static const int MIN = 7
static const int MINUTE = 0
static const int HOUR = 1
static const int DAY = 2
static const int MONTH = 3
static const int YEAR = 4

Detailed Description

This class defines forecast time parameters.

Author:
Dan Vietor

Constructor & Destructor Documentation

ForeTime::ForeTime (  ) 

Constructor. Initializes values

References init().

ForeTime::ForeTime ( const char *  str  ) 

Constructor. Decode from string

Parameters:
str String to decode forecast time from

References init().


Member Function Documentation

int ForeTime::decode ( const char *  str  ) 

Decodes forecast time date from string

Parameters:
str String to decode

References ACC, ANAL, AVG, DIFF, FORE, WXP::StrLib::iequal(), init(), MAX, MIN, RNG, and WXP::StrLib::valid().

Referenced by set().

float ForeTime::getFore (  ) 

Return a single time value dependent on type of forecast time

Returns:
Time value

Referenced by WXP::DateTool::createLabel(), toTimeLabel(), and toTimeLabelDay().

float ForeTime::getHour (  ) 

Return a single time value in hours dependent on type of forecast time

Returns:
Time value in hours

Referenced by WXP::GribFile::makeDatim().

int ForeTime::getSecs (  ) 

Return a single time value in hours dependent on type of forecast time

Returns:
Time value in seconds
int ForeTime::init (  ) 

Initializes class data

References HOUR, and WXP::Const::MISS.

Referenced by decode(), ForeTime(), and WXP::VarSpec::init().

int ForeTime::print (  ) 

Prints class data to standard output

References ACC, AVG, DIFF, FORE, MAX, MIN, RNG, and toCode().

Referenced by WXP::VarSpec::printDetails().

int ForeTime::set ( const char *  str  ) 

Sets the forecast time parameters from string

Parameters:
str String to decode

References decode().

int ForeTime::set ( int  val  ) 

Sets the forecast time values from integer code

Parameters:
val Integer code

References DAY, and MONTH.

int ForeTime::set ( int  t,
int  u,
float  t1,
float  t2 
)

Sets the forecast time parameters individually

Parameters:
t Type of time
u Unit of time (HOUR, DAY, ...)
t1 First time value
t2 Second time value
int ForeTime::set ( int  t,
float  t1,
float  t2 
)

Sets the forecast time parameters individually

Parameters:
t Type of time
t1 First time value
t2 Second time value

Referenced by WXP::GribFile::makeDatim(), WXP::GribFile::readPDB(), WXP::GribFile::readPDS(), and WXP::Grid::setForeTime().

int ForeTime::toCode (  ) 

Encodes forecast time parameters to a single integer

Returns:
Output integer code

References ACC, AVG, DAY, DIFF, MAX, MIN, WXP::Const::MISS, MONTH, and RNG.

Referenced by print().

int ForeTime::toString ( String str  ) 

Converts forecast time parameters to a string

Return values:
str Output string

References ACC, WXP::String::append(), AVG, WXP::String::clear(), WXP::String::copy(), DIFF, MAX, MIN, WXP::Const::MISS, WXP::String::printf(), and RNG.

Referenced by WXP::VarSpec::print().

int ForeTime::toTimeLabel ( String str  ) 

Create a label string

Return values:
str Output string

References WXP::String::clear(), getFore(), WXP::Const::MISS, and WXP::String::printf().

Referenced by WXP::DateTool::createLabel(), and WXP::GribFile::makeDatim().

int ForeTime::toTimeLabelDay ( String str  ) 

Create a label string with time in days

Return values:
str Output string

References WXP::String::clear(), getFore(), WXP::Const::MISS, and WXP::String::printf().

int ForeTime::toVarLabel ( String str  ) 

Create a label string for combination with variable data

Return values:
str Output string

References ACC, WXP::String::append(), AVG, DIFF, MAX, MIN, WXP::String::printf(), and RNG.

Referenced by WXP::GribFile::makeInfo(), and WXP::VarSpec::toInfoLabel().


Member Data Documentation

const int WXP::ForeTime::ACC = 4 [static]
const int WXP::ForeTime::ANAL = 1 [static]
const int WXP::ForeTime::AVG = 3 [static]
const int WXP::ForeTime::DAY = 2 [static]

Time in Days

Referenced by WXP::GribFile::readPDB(), set(), and toCode().

const int WXP::ForeTime::DIFF = 5 [static]

Difference between two forecast times

Referenced by decode(), print(), WXP::GribFile::readPDB(), WXP::GribFile::readPDS(), toCode(), toString(), and toVarLabel().

const int WXP::ForeTime::FORE = 0 [static]
const int WXP::ForeTime::HOUR = 1 [static]

Time in Hours

Referenced by init(), and WXP::GribFile::readPDB().

const int WXP::ForeTime::MAX = 6 [static]

Maximum over a period

Referenced by decode(), print(), WXP::GribFile::readPDS(), toCode(), toString(), and toVarLabel().

const int WXP::ForeTime::MIN = 7 [static]

Minimum over a period

Referenced by decode(), print(), WXP::GribFile::readPDS(), toCode(), toString(), and toVarLabel().

const int WXP::ForeTime::MINUTE = 0 [static]

Time in Minutes

const int WXP::ForeTime::MONTH = 3 [static]

Time in Months

Referenced by WXP::GribFile::readPDB(), set(), and toCode().

const int WXP::ForeTime::RNG = 2 [static]
const int WXP::ForeTime::YEAR = 4 [static]

Time in Years


The documentation for this class was generated from the following files:

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1